@lacneu/atrium 0.1.1 → 0.1.3
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/README.md +26 -0
- package/dist/assets/index-BzApILPs.js +164 -0
- package/dist/assets/index-CaUp5A1G.css +1 -0
- package/dist/index.html +11 -2
- package/package.json +9 -1
- package/dist/assets/index-alak9Rjf.js +0 -166
- package/dist/assets/index-ed3GjIVI.css +0 -1
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(e,t,n)=>(c(e,t,`default`),n&&c(n,t,`default`)),u=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();for(var d=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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(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 ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=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)},F={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),f=o(((e,t)=>{t.exports=d()})),p=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}}}})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=f();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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),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=m(),n=f(),r=g();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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,h=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},re=[],ie=-1;function ae(e){return{current:e}}function oe(e){0>ie||(e.current=re[ie],re[ie]=null,ie--)}function se(e,t){ie++,re[ie]=e.current,e.current=t}var ce=ae(null),le=ae(null),ue=ae(null),de=ae(null);function fe(e,t){switch(se(ue,t),se(le,e),se(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$d(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$d(t),e=ef(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}oe(ce),se(ce,e)}function pe(){oe(ce),oe(le),oe(ue)}function me(e){e.memoizedState!==null&&se(de,e);var t=ce.current,n=ef(t,e.type);t!==n&&(se(le,e),se(ce,n))}function he(e){le.current===e&&(oe(ce),oe(le)),de.current===e&&(oe(de),up._currentValue=ne)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+ge+e+_e}var ye=!1;function be(e,t){if(!e||ye)return``;ye=!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}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
-
`),l=s.split(`
|
|
5
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ve(n):``}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve(`Lazy`);case 13:return e.child!==t&&t!==null?ve(`Suspense Fallback`):ve(`Suspense`);case 19:return ve(`SuspenseList`);case 0:case 15:return be(e.type,!1);case 11:return be(e.type.render,!1);case 1:return be(e.type,!0);case 31:return ve(`Activity`);default:return``}}function Se(e){try{var t=``,n=null;do t+=xe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var Ce=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Ee=t.unstable_shouldYield,De=t.unstable_requestPaint,Oe=t.unstable_now,ke=t.unstable_getCurrentPriorityLevel,Ae=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(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&261888;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 Je(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=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(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 Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(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 Ze(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(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-Be(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&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(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 at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Ep(e.type)):e}function st(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct;function _t(e){delete e[lt],delete e[ut],delete e[ft],delete e[pt],delete e[mt]}function vt(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cf(e);e!==null;){if(n=e[lt])return n;e=Cf(e)}return t}e=n,n=e.parentNode}return null}function yt(e){if(e=e[lt]||e[dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function xt(e){var t=e[ht];return t||=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map},t}function St(e){e[gt]=!0}var Ct=new Set,wt={};function Tt(e,t){Et(e,t),Et(e+`Capture`,t)}function Et(e,t){for(wt[e]=t,e=0;e<t.length;e++)Ct.add(t[e])}var Dt=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]*$`),Ot={},kt={};function At(e){return Ce.call(kt,e)?!0:Ce.call(Ot,e)?!1:Dt.test(e)?kt[e]=!0:(Ot[e]=!0,!1)}function jt(e,t,n){if(At(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 Mt(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 Nt(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 Pt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ft(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function It(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 Lt(e){if(!e._valueTracker){var t=Ft(e)?`checked`:`value`;e._valueTracker=It(e,t,``+e[t])}}function Rt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ft(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function zt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Bt=/[\n"\\]/g;function Vt(e){return e.replace(Bt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ht(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=``+Pt(t)):e.value!==``+Pt(t)&&(e.value=``+Pt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Wt(e,o,Pt(n)):Wt(e,o,Pt(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=``+Pt(s):e.removeAttribute(`name`)}function Ut(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)){Lt(e);return}n=n==null?``:``+Pt(n),t=t==null?n:``+Pt(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),Lt(e)}function Wt(e,t,n){t===`number`&&zt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Gt(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=``+Pt(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 Kt(e,t,n){if(t!=null&&(t=``+Pt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Pt(n)}function qt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Pt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Lt(e)}function Jt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yt=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 Xt(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||Yt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Zt(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]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Xt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Xt(e,o,t[o])}function Qt(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 $t=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`],[`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`]]),en=/^[\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 tn(e){return en.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function nn(){}var rn=null;function an(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var on=null,sn=null;function cn(e){var t=yt(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ht(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="`+Vt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ut]||null;if(!a)throw Error(i(90));Ht(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&&Rt(r)}break a;case`textarea`:Kt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Gt(e,!!n.multiple,t,!1)}}}var ln=!1;function un(e,t,n){if(ln)return e(t,n);ln=!0;try{return e(t)}finally{if(ln=!1,(on!==null||sn!==null)&&(ku(),on&&(t=on,e=sn,sn=on=null,cn(t),e)))for(t=0;t<e.length;t++)cn(e[t])}}function dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ut]||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 fn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),pn=!1;if(fn)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){pn=!0}}),window.addEventListener(`test`,mn,mn),window.removeEventListener(`test`,mn,mn)}catch{pn=!1}var hn=null,gn=null,_n=null;function vn(){if(_n)return _n;var e,t=gn,n=t.length,r,i=`value`in hn?hn.value:hn.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 _n=i.slice(e,1<r?1-r:void 0)}function I(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 yn(){return!0}function bn(){return!1}function xn(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)?yn:bn,this.isPropagationStopped=bn,this}return p(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=yn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var Sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cn=xn(Sn),wn=p({},Sn,{view:0,detail:0}),Tn=xn(wn),En,Dn,On,kn=p({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,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!==On&&(On&&e.type===`mousemove`?(En=e.screenX-On.screenX,Dn=e.screenY-On.screenY):Dn=En=0,On=e),En)},movementY:function(e){return`movementY`in e?e.movementY:Dn}}),L=xn(kn),R=xn(p({},kn,{dataTransfer:0})),An=xn(p({},wn,{relatedTarget:0})),jn=xn(p({},Sn,{animationName:0,elapsedTime:0,pseudoElement:0})),Mn=xn(p({},Sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Nn=xn(p({},Sn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={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`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var zn=xn(p({},wn,{key:function(e){if(e.key){var t=Pn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=I(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,charCode:function(e){return e.type===`keypress`?I(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?I(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Bn=xn(p({},kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Vn=xn(p({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Hn=xn(p({},Sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=xn(p({},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})),Wn=xn(p({},Sn,{newState:0,oldState:0})),Gn=[9,13,27,32],Kn=fn&&`CompositionEvent`in window,qn=null;fn&&`documentMode`in document&&(qn=document.documentMode);var Jn=fn&&`TextEvent`in window&&!qn,z=fn&&(!Kn||qn&&8<qn&&11>=qn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Gn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Kn&&Zn(e,t)?(e=vn(),_n=gn=hn=null,$n=!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 z&&t.locale!==`ko`?null:t.data;default:return null}}var nr={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 rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!nr[e.type]:t===`textarea`}function ir(e,t,n,r){on?sn?sn.push(r):sn=[r]:on=r,t=Ld(t,`onChange`),0<t.length&&(n=new Cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ar=null,or=null;function sr(e){kd(e,0)}function cr(e){if(Rt(bt(e)))return e}function lr(e,t){if(e===`change`)return t}var ur=!1;if(fn){var dr;if(fn){var fr=`oninput`in document;if(!fr){var pr=document.createElement(`div`);pr.setAttribute(`oninput`,`return;`),fr=typeof pr.oninput==`function`}dr=fr}else dr=!1;ur=dr&&(!document.documentMode||9<document.documentMode)}function mr(){ar&&(ar.detachEvent(`onpropertychange`,hr),or=ar=null)}function hr(e){if(e.propertyName===`value`&&cr(or)){var t=[];ir(t,or,e,an(e)),un(sr,t)}}function gr(e,t,n){e===`focusin`?(mr(),ar=t,or=n,ar.attachEvent(`onpropertychange`,hr)):e===`focusout`&&mr()}function _r(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return cr(or)}function vr(e,t){if(e===`click`)return cr(t)}function yr(e,t){if(e===`input`||e===`change`)return cr(t)}function br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var xr=typeof Object.is==`function`?Object.is:br;function Sr(e,t){if(xr(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(!Ce.call(t,i)||!xr(e[i],t[i]))return!1}return!0}function Cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wr(e,t){var n=Cr(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=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zt(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=zt(e.document)}return t}function Dr(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 Or=fn&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==zt(r)||(r=kr,`selectionStart`in r&&Dr(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}),jr&&Sr(jr,r)||(jr=r,r=Ld(Ar,`onSelect`),0<r.length&&(t=new Cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Fr={animationend:Pr(`Animation`,`AnimationEnd`),animationiteration:Pr(`Animation`,`AnimationIteration`),animationstart:Pr(`Animation`,`AnimationStart`),transitionrun:Pr(`Transition`,`TransitionRun`),transitionstart:Pr(`Transition`,`TransitionStart`),transitioncancel:Pr(`Transition`,`TransitionCancel`),transitionend:Pr(`Transition`,`TransitionEnd`)},Ir={},Lr={};fn&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),`TransitionEvent`in window||delete Fr.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!Fr[e])return e;var t=Fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),Tt(t,[e])}var Yr=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)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[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&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(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-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<bu)throw bu=0,xu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(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 si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(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&65011712,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 ui(e,t){e.flags&=65011714;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 di(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=tp(e,n,ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=si(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return fi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=si(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=si(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=si(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:Se(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:Se(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-Be(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,Pi=!1,Fi=null,Ii=!1,Li=Error(i(519));function Ri(e){throw Wi(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[lt]=e,t[ut]=r,n){case`dialog`:Ad(`cancel`,t),Ad(`close`,t);break;case`iframe`:case`object`:case`embed`:Ad(`load`,t);break;case`video`:case`audio`:for(n=0;n<Dd.length;n++)Ad(Dd[n],t);break;case`source`:Ad(`error`,t);break;case`img`:case`image`:case`link`:Ad(`error`,t),Ad(`load`,t);break;case`details`:Ad(`toggle`,t);break;case`input`:Ad(`invalid`,t),Ut(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Ad(`invalid`,t);break;case`textarea`:Ad(`invalid`,t),qt(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||Ud(t.textContent,n)?(r.popover!=null&&(Ad(`beforetoggle`,t),Ad(`toggle`,t)),r.onScroll!=null&&Ad(`scroll`,t),r.onScrollEnd!=null&&Ad(`scrollend`,t),r.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Mi=Mi.return}}function Vi(e){if(e!==Mi)return!1;if(!Pi)return Bi(e),Pi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||tf(e.type,e.memoizedProps)),n=!n),n&&Ni&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=Sf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=Sf(e)}else t===27?(t=Ni,uf(e.type)?(e=xf,xf=null,Ni=e):Ni=t):Ni=Mi?bf(e.stateNode.nextSibling):null;return!0}function Hi(){Ni=Mi=null,Pi=!1}function Ui(){var e=Fi;return e!==null&&(ou===null?ou=e:ou.push.apply(ou,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=ae(null),Ki=null,qi=null;function Ji(e,t,n){se(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,oe(Gi)}function Xi(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 Zi(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),Xi(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),Xi(s,n,e),s=null}else 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 Qi(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;xr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===de.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[up]:e.push(up))}a=a.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=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,oa=t.unstable_NormalPriority,sa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=xd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var _a=P.S;P.S=function(e,t){lu=Oe(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=ae(null);function ya(){var e=va.current;return e===null?Wl.pooledCache:e}function ba(e,t){t===null?se(va,va.current):se(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nn,nn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(nn,nn);else{if(e=Wl,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,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(i(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(e,t){throw t.$$typeof===h?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function La(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=li(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Oa(i)===t.type)?(t=a(t,n.props),Fa(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Fa(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=hi(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=fi(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=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=di(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case O:return t=Oa(t),f(e,t,n)}if(te(t)||M(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===C)return f(e,na(e,t),n);Ia(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 _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Oa(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===C)return p(e,t,na(e,n),r);Ia(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 _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Oa(r),m(e,t,n,r,i)}if(te(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Pa(r),i);if(r.$$typeof===C)return m(e,t,n,na(t,r),i);Ia(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),Pi&&Di(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 Pi&&Di(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(g.key===null?h:g.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)}),Pi&&Di(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),Pi&&Di(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 Pi&&Di(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(v.key===null?g:v.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)}),Pi&&Di(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case v: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}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Oa(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Pa(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Ia(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=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(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 Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ul&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Ga(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,nt(e,n)}}function Ka(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 qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!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,m=f!==s.lane;if(m?(Kl&f)===f:(r&f)===f){f!==0&&f===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ba=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),eu|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=ae(null),$a=ae(0);function eo(e,t){e=Ql,se($a,e),se(Qa,t),Ql=e|t.baseLanes}function to(){se($a,Ql),se(Qa,Qa.current)}function no(){Ql=$a.current,oe(Qa),oe($a)}var ro=ae(null),io=null;function ao(e){var t=e.alternate;se(uo,uo.current&1),se(ro,e),io===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){se(uo,uo.current),se(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(se(uo,uo.current),se(ro,e),io===null&&(io=e)):co(e)}function co(){se(uo,uo.current),se(ro,ro.current)}function lo(e){oe(ro),io===e&&(io=null),oe(uo)}var uo=ae(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_f(n)||vf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var po=0,mo=null,ho=null,go=null,_o=!1,vo=!1,yo=!1,bo=0,xo=0,So=null,Co=0;function wo(){throw Error(i(321))}function To(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function Eo(e,t,n,r,i,a){return po=a,mo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Hs:Us,yo=!1,a=n(r,i),yo=!1,vo&&(a=Oo(t,n,r,i)),Do(e),a}function Do(e){P.H=Vs;var t=ho!==null&&ho.next!==null;if(po=0,go=ho=mo=null,_o=!1,xo=0,So=null,t)throw Error(i(300));e===null||ac||(e=e.dependencies,e!==null&&$i(e)&&(ac=!0))}function Oo(e,t,n,r){mo=e;var a=0;do{if(vo&&(So=null),xo=0,vo=!1,25<=a)throw Error(i(301));if(a+=1,go=ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Ws,o=t(n,r)}while(vo);return o}function ko(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?Io(t):t,e=e.useState()[0],(ho===null?null:ho.memoizedState)!==e&&(mo.flags|=1024),t}function Ao(){var e=bo!==0;return bo=0,e}function jo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Mo(e){if(_o){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_o=!1}po=0,go=ho=mo=null,vo=!1,xo=bo=0,So=null}function No(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return go===null?mo.memoizedState=go=e:go=go.next=e,go}function Po(){if(ho===null){var e=mo.alternate;e=e===null?null:e.memoizedState}else e=ho.next;var t=go===null?mo.memoizedState:go.next;if(t!==null)go=t,ho=e;else{if(e===null)throw mo.alternate===null?Error(i(467)):Error(i(310));ho=e,e={memoizedState:ho.memoizedState,baseState:ho.baseState,baseQueue:ho.baseQueue,queue:ho.queue,next:null},go===null?mo.memoizedState=go=e:go=go.next=e}return go}function Fo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Io(e){var t=xo;return xo+=1,So===null&&(So=[]),e=Da(So,e,t),t=mo,(go===null?t.memoizedState:go.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Hs:Us),e}function Lo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Io(e);if(e.$$typeof===C)return ta(e)}throw Error(i(438,String(e)))}function Ro(e){var t=null,n=mo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=mo.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=Fo(),mo.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]=A;return t.index++,n}function zo(e,t){return typeof t==`function`?t(e):t}function Bo(e){return Vo(Po(),ho,e)}function Vo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(po&f)===f:(Kl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===fa&&(d=!0);else if((po&p)===p){u=u.next,p===fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,mo.lanes|=p,eu|=p;f=u.action,yo&&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,mo.lanes|=f,eu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!xr(o,e.memoizedState)&&(ac=!0,d&&(n=pa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ho(e){var t=Po(),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);xr(o,t.memoizedState)||(ac=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Uo(e,t,n){var r=mo,a=Po(),o=Pi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!xr((ho||a).memoizedState,n);if(s&&(a.memoizedState=n,ac=!0),a=a.queue,ms(Ko.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||go!==null&&go.memoizedState.tag&1){if(r.flags|=2048,ls(9,{destroy:void 0},Go.bind(null,r,a,n,t),null),Wl===null)throw Error(i(349));o||po&127||Wo(r,t,n)}return n}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=mo.updateQueue,t===null?(t=Fo(),mo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function Jo(e){var t=ni(e,2);t!==null&&wu(t,e,2)}function Yo(e){var t=No();if(typeof e==`function`){var n=e;if(e=n(),yo){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t}function Xo(e,t,n,r){return e.baseState=n,Vo(e,ho,typeof r==`function`?r:zo)}function Zo(e,t,n,r,a){if(Rs(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)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),$o(e,t,s)}catch(n){ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),$o(e,t,a)}catch(n){ts(e,t,n)}}function $o(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){es(e,t,n)},function(n){return ts(e,t,n)}):es(e,t,n)}function es(e,t,n){t.status=`fulfilled`,t.value=n,ns(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Qo(e,n)))}function ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ns(t),t=t.next;while(t!==r)}e.action=null}function ns(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rs(e,t){return t}function is(e,t){if(Pi){var n=Wl.formState;if(n!==null){a:{var r=mo;if(Pi){if(Ni){b:{for(var i=Ni,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=bf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=bf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=No(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:t},n.queue=r,n=Fs.bind(null,mo,r),r.dispatch=n,r=Yo(!1),a=Ls.bind(null,mo,!1,r.queue),r=No(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Zo.bind(null,mo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function as(e){return os(Po(),ho,e)}function os(e,t,n){if(t=Vo(e,t,rs)[0],e=Bo(zo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Io(t)}catch(e){throw e===Sa?wa:e}else r=t;t=Po();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(mo.flags|=2048,ls(9,{destroy:void 0},ss.bind(null,i,n),null)),[r,a,e]}function ss(e,t){e.action=t}function cs(e){var t=Po(),n=ho;if(n!==null)return os(t,n,e);Po(),t=t.memoizedState,n=Po();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=mo.updateQueue,t===null&&(t=Fo(),mo.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 us(){return Po().memoizedState}function ds(e,t,n,r){var i=No();mo.flags|=e,i.memoizedState=ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function fs(e,t,n,r){var i=Po();r=r===void 0?null:r;var a=i.memoizedState.inst;ho!==null&&r!==null&&To(r,ho.memoizedState.deps)?i.memoizedState=ls(t,a,n,r):(mo.flags|=e,i.memoizedState=ls(1|t,a,n,r))}function ps(e,t){ds(8390656,8,e,t)}function ms(e,t){fs(2048,8,e,t)}function hs(e){mo.flags|=4;var t=mo.updateQueue;if(t===null)t=Fo(),mo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function gs(e){var t=Po().memoizedState;return hs({ref:t,nextImpl:e}),function(){if(Ul&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function _s(e,t){return fs(4,2,e,t)}function vs(e,t){return fs(4,4,e,t)}function ys(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 bs(e,t,n){n=n==null?null:n.concat([e]),fs(4,4,ys.bind(null,t,e),n)}function xs(){}function Ss(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&To(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Cs(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&To(t,r[1]))return r[0];if(r=e(),yo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function B(e,t,n){return n===void 0||po&1073741824&&!(Kl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Cu(),mo.lanes|=e,eu|=e,n)}function ws(e,t,n,r){return xr(n,t)?n:Qa.current===null?!(po&42)||po&1073741824&&!(Kl&261930)?(ac=!0,e.memoizedState=n):(e=Cu(),mo.lanes|=e,eu|=e,t):(e=B(e,n,r),xr(e,t)||(ac=!0),e)}function Ts(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Ls(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,ga(c,r),Su(e)):Is(e,t,r,Su(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},Su())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Os(e).queue;Ts(e,a,t,ne,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},Su())}function As(){return ta(up)}function js(){return Po().memoizedState}function Ms(){return Po().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Su();e=Ua(n);var r=Wa(t,e,n);r!==null&&(wu(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=Su();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=ti(e,t,n,r),n!==null&&(wu(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,Su())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(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,xr(s,o))return ei(e,t,i,0),Wl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return wu(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:xd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(i(479))}else t=ti(e,n,r,2),t!==null&&wu(t,e,2)}function Rs(e){var t=e.alternate;return e===mo||t!==null&&t===mo}function zs(e,t){vo=_o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}var Vs={readContext:ta,use:Lo,useCallback:wo,useContext:wo,useEffect:wo,useImperativeHandle:wo,useLayoutEffect:wo,useInsertionEffect:wo,useMemo:wo,useReducer:wo,useRef:wo,useState:wo,useDebugValue:wo,useDeferredValue:wo,useTransition:wo,useSyncExternalStore:wo,useId:wo,useHostTransitionStatus:wo,useFormState:wo,useActionState:wo,useOptimistic:wo,useMemoCache:wo,useCacheRefresh:wo};Vs.useEffectEvent=wo;var Hs={readContext:ta,use:Lo,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:ps,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ds(4194308,4,ys.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ds(4194308,4,e,t)},useInsertionEffect:function(e,t){ds(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var r=e();if(yo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=No();if(n!==void 0){var i=n(t);if(yo){ze(!0);try{n(t)}finally{ze(!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=Ps.bind(null,mo,e),[r.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=Yo(e);var t=e.queue,n=Fs.bind(null,mo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:xs,useDeferredValue:function(e,t){return B(No(),e,t)},useTransition:function(){var e=Yo(!1);return e=Ts.bind(null,mo,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=mo,a=No();if(Pi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Wl===null)throw Error(i(349));Kl&127||Wo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ps(Ko.bind(null,r,o,e),[e]),r.flags|=2048,ls(9,{destroy:void 0},Go.bind(null,r,o,n,t),null),n},useId:function(){var e=No(),t=Wl.identifierPrefix;if(Pi){var n=Ei,r=Ti;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:As,useFormState:is,useActionState:is,useOptimistic:function(e){var t=No();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ls.bind(null,mo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ro,useCacheRefresh:function(){return No().memoizedState=Ns.bind(null,mo)},useEffectEvent:function(e){var t=No(),n={impl:e};return t.memoizedState=n,function(){if(Ul&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Us={readContext:ta,use:Lo,useCallback:Ss,useContext:ta,useEffect:ms,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:Bo,useRef:us,useState:function(){return Bo(zo)},useDebugValue:xs,useDeferredValue:function(e,t){return ws(Po(),ho.memoizedState,e,t)},useTransition:function(){var e=Bo(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:js,useHostTransitionStatus:As,useFormState:as,useActionState:as,useOptimistic:function(e,t){return Xo(Po(),ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ms};Us.useEffectEvent=gs;var Ws={readContext:ta,use:Lo,useCallback:Ss,useContext:ta,useEffect:ms,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:Ho,useRef:us,useState:function(){return Ho(zo)},useDebugValue:xs,useDeferredValue:function(e,t){var n=Po();return ho===null?B(n,e,t):ws(n,ho.memoizedState,e,t)},useTransition:function(){var e=Ho(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:js,useHostTransitionStatus:As,useFormState:cs,useActionState:cs,useOptimistic:function(e,t){var n=Po();return ho===null?(n.baseState=e,[e,n.queue.dispatch]):Xo(n,ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ms};Ws.useEffectEvent=gs;function Gs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ks={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(wu(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(wu(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Su(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(wu(t,e,n),Ga(t,e,n))}};function qs(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?!Sr(n,r)||!Sr(i,a):!0}function V(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&&Ks.enqueueReplaceState(t,t.state,null)}function Js(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=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ys(e){Yr(e)}function Xs(e){console.error(e)}function Zs(e){Yr(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function $s(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=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function tc(e){return e=Ua(e),e.tag=3,e}function nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){$s(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){$s(t,n,r),typeof i!=`function`&&(fu===null?fu=new Set([this]):fu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function rc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,a,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?Iu():n.alternate===null&&$l===0&&($l=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),td(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?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)),td(e,r,a)),!1}throw Error(i(435,n.tag))}return td(e,r,a),Iu(),!1}if(Pi)return t=ro.current,t===null?(r!==Li&&(t=Error(i(423),{cause:r}),Wi(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=ec(e.stateNode,r,a),Ka(e,a),$l!==4&&($l=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Li&&(e=Error(i(422),{cause:r}),Wi(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),au===null?au=[o]:au.push(o),$l!==4&&($l=2),t===null)return!0;r=_i(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),Ka(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`&&(fu===null||!fu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=tc(a),nc(a,e,n,r),Ka(n,a),!1}n=n.return}while(n!==null);return!1}var ic=Error(i(461)),ac=!1;function oc(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function sc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=Eo(e,t,n,o,a,i),s=Ao(),e!==null&&!ac?(jo(e,t,i),jc(e,t,i)):(Pi&&s&&ki(t),t.flags|=1,oc(e,t,r,i),t.child)}function cc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,lc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Mc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Sr:n,n(o,r)&&e.ref===t.ref)return jc(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sr(a,r)&&e.ref===t.ref)if(ac=!1,t.pendingProps=r=a,Mc(e,i))e.flags&131072&&(ac=!0);else return t.lanes=e.lanes,jc(e,t,i)}return _c(e,t,n,r,i)}function uc(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 fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),to(),co(t)):(ba(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return oc(e,t,i,n),t.child}function dc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),to(),so(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function pc(e,t){return t=Ec({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mc(e,t,n){return Ra(t,e.child,null,n),e=pc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function hc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Pi){if(r.mode===`hidden`)return e=pc(t,r),t.lanes=536870912,dc(null,e);if(oo(t),(e=Ni)?(e=gf(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(oo(t),a)if(t.flags&256)t.flags&=-257,t=mc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ac||Qi(e,t,n,!1),a=(n&e.childLanes)!==0,ac||a){if(r=Wl,r!==null&&(s=rt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),wu(r,e,s),ic;Iu(),t=mc(e,t,n)}else e=o.treeContext,Ni=bf(s.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=pc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function gc(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 _c(e,t,n,r,i){return ea(t),n=Eo(e,t,n,r,void 0,i),r=Ao(),e!==null&&!ac?(jo(e,t,i),jc(e,t,i)):(Pi&&r&&ki(t),t.flags|=1,oc(e,t,n,i),t.child)}function vc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=Oo(t,r,n,i),Do(e),r=Ao(),e!==null&&!ac?(jo(e,t,a),jc(e,t,a)):(Pi&&r&&ki(t),t.flags|=1,oc(e,t,n,a),t.child)}function yc(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ks,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Gs(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&&Ks.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),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=Js(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=ta(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)&&V(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Gs(t,n,d,r),l=t.memoizedState),(c=Ba||qs(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,Ha(e,t),o=t.memoizedProps,u=Js(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=ta(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)&&V(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Gs(t,n,s,r),p=t.memoizedState),(u=Ba||qs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(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,gc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=jc(e,t,i),e}function bc(e,t,n,r){return Hi(),t.flags|=256,oc(e,t,n,r),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sc(e){return{baseLanes:e,cachePool:xa()}}function Cc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ru),e}function wc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(uo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Pi){if(a?ao(t):co(t),(e=Ni)?(e=gf(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return vf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(co(t),a=t.mode,c=Ec({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(null,r)):(ao(t),Tc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ao(t),t.flags&=-257,t=Dc(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,a=t.mode,r=Ec({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,t=dc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),vf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Dc(e,t,n)}else if(ac||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,ac||s){if(s=Wl,s!==null&&(r=rt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),wu(s,e,r),ic;_f(c)||Iu(),t=Dc(e,t,n)}else _f(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=bf(c.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=Tc(t,r.children),t.flags|=4096);return t}return a?(co(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,dc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Sc(n):(a=c.cachePool,a===null?a=xa():(l=sa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Tc(e,t){return t=Ec({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ec(e,t){return e=si(22,e,null,t),e.lanes=0,e}function Dc(e,t,n){return Ra(t,e.child,null,n),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Oc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function kc(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 Ac(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=uo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,se(uo,o),oc(e,t,r,n),r=Pi?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oc(e,n,t);else if(e.tag===19)Oc(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`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kc(t,!0,n,null,a,r);break;case`together`:kc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function jc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),eu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Qi(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=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Mc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&$i(e))):!0}function Nc(e,t,n){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:me(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=jc(e,t,n),e===null?null:e.sibling):wc(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ac(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),se(uo,uo.current),r)break;return null;case 22:return t.lanes=0,uc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return jc(e,t,n)}function Pc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ac=!0;else{if(!Mc(e,n)&&!(t.flags&128))return ac=!1,Nc(e,t,n);ac=!!(e.flags&131072)}else ac=!1,Pi&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=Js(e,r),t.tag=1,t=yc(null,t,e,r,n)):(t.tag=0,t=_c(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=sc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=cc(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return _c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Js(r,t.pendingProps),yc(e,t,r,a,n);case 3:a:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==o.cache&&Zi(t,[sa],n,!0),Ja(),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=bc(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Wi(a),t=bc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ni=bf(e.firstChild),Mi=t,Pi=!0,Fi=null,Ii=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=jc(e,t,n);break a}oc(e,t,r,n)}t=t.child}return t;case 26:return gc(e,t),e===null?(n=Vf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Pi||(n=t.type,e=t.pendingProps,r=Qd(ue.current).createElement(n),r[lt]=t,r[ut]=e,Kd(r,n,e),St(r),t.stateNode=r):t.memoizedState=Vf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&Pi&&(r=t.stateNode=wf(t.type,t.pendingProps,ue.current),Mi=t,Ii=!0,a=Ni,uf(t.type)?(xf=a,Ni=bf(r.firstChild)):Ni=a),oc(e,t,t.pendingProps.children,n),gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pi&&((a=r=Ni)&&(r=mf(r,t.type,t.pendingProps,Ii),r===null?a=!1:(t.stateNode=r,Mi=t,Ni=bf(r.firstChild),Ii=!1,a=!0)),a||Ri(t)),me(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,tf(a,o)?r=null:s!==null&&tf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Eo(e,t,ko,null,null,n),up._currentValue=a),gc(e,t),oc(e,t,r,n),t.child;case 6:return e===null&&Pi&&((e=n=Ni)&&(n=hf(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Ri(t)),null;case 13:return wc(e,t,n);case 4:return fe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):oc(e,t,r,n),t.child;case 11:return sc(e,t,t.type,t.pendingProps,n);case 7:return oc(e,t,t.pendingProps,n),t.child;case 8:return oc(e,t,t.pendingProps.children,n),t.child;case 12:return oc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),oc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ea(t),a=ta(a),r=r(a),t.flags|=1,oc(e,t,r,n),t.child;case 14:return cc(e,t,t.type,t.pendingProps,n);case 15:return lc(e,t,t.type,t.pendingProps,n);case 19:return Ac(e,t,n);case 31:return hc(e,t,n);case 22:return uc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(a=ya(),a===null&&(a=Wl,o=ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Va(t),Ji(t,sa,a)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ji(t,sa,r),r!==a.cache&&Zi(t,[sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ji(t,sa,r))),oc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Fc(e){e.flags|=4}function Ic(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Nu())e.flags|=8192;else throw ka=Ta,Ca}else e.flags&=-16777217}function Lc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!np(t))if(Nu())e.flags|=8192;else throw ka=Ta,Ca}function Rc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ze(),e.lanes|=t,iu|=t)}function zc(e,t){if(!Pi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var 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}}function Bc(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&65011712,r|=i.flags&65011712,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 Vc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bc(t),null;case 1:return Bc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),pe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Fc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Bc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Fc(t),o===null?(Bc(t),Ic(t,a,null,r,n)):(Bc(t),Lc(t,o))):o?o===e.memoizedState?(Bc(t),t.flags&=-16777217):(Fc(t),Bc(t),Lc(t,o)):(e=e.memoizedProps,e!==r&&Fc(t),Bc(t),Ic(t,a,e,r,n)),null;case 27:if(he(t),n=ue.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}e=ce.current,Vi(t)?zi(t,e):(e=wf(a,r,n),t.stateNode=e,Fc(t))}return Bc(t),null;case 5:if(he(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}if(o=ce.current,Vi(t))zi(t,o);else{var s=Qd(ue.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[lt]=t,o[ut]=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(Kd(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&&Fc(t)}}return Bc(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ue.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ud(e.nodeValue,n)),e||Ri(t,!0)}else e=Qd(e).createTextNode(r),e[lt]=t,t.stateNode=e}return Bc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(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[lt]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return Bc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(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[lt]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(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),Rc(t,t.updateQueue),Bc(t),null);case 4:return pe(),e===null&&Nd(t.stateNode.containerInfo),Bc(t),null;case 10:return Yi(t.type),Bc(t),null;case 19:if(oe(uo),r=t.memoizedState,r===null)return Bc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)zc(r,!1);else{if($l!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,zc(r,!1),e=o.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return se(uo,uo.current&1|2),Pi&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Oe()>uu&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),zc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Pi)return Bc(t),null}else 2*Oe()-r.renderingStartTime>uu&&n!==536870912&&(t.flags|=128,a=!0,zc(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)}return r.tail===null?(Bc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Oe(),e.sibling=null,n=uo.current,se(uo,a?n&1|2:n&1),Pi&&Di(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Bc(t),t.subtreeFlags&6&&(t.flags|=8192)):Bc(t),n=t.updateQueue,n!==null&&Rc(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&&oe(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Bc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),pe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(uo),null;case 4:return pe(),null;case 10:return Yi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&oe(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Uc(e,t){switch(Ai(t),t.tag){case 3:Yi(sa),pe();break;case 26:case 27:case 5:he(t);break;case 4:pe();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:oe(uo);break;case 10:Yi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&oe(va);break;case 24:Yi(sa)}}function Wc(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){ed(t,t.return,e)}}function Gc(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){ed(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ed(t,t.return,e)}}function Kc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){ed(e,e.return,t)}}}function qc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ed(e,t,n)}}function Jc(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ed(e,t,n)}}function Yc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){ed(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){ed(e,t,n)}else n.current=null}function Xc(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){ed(e,e.return,t)}}function Zc(e,t,n){try{var r=e.stateNode;qd(r,e.type,n,t),r[ut]=t}catch(t){ed(e,e.return,t)}}function Qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&uf(e.type)||e.tag===4}function $c(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Qc(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&&uf(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 el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nn));else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Kd(t,r,n),t[lt]=e,t[ut]=n}catch(t){ed(e,e.return,t)}}var rl=!1,il=!1,al=!1,ol=typeof WeakSet==`function`?WeakSet:Set,sl=null;function cl(e,t){if(e=e.containerInfo,Xd=yp,e=Er(e),Dr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Zd={focusedElem:e,selectionRange:n},yp=!1,sl=t;sl!==null;)if(t=sl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,sl=e;else for(;sl!==null;){switch(t=sl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Js(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){ed(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)pf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:pf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,sl=e;break}sl=t.return}}function ll(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:wl(e,n),r&4&&Wc(5,n);break;case 1:if(wl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ed(n,n.return,e)}else{var i=Js(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ed(n,n.return,e)}}r&64&&Kc(n),r&512&&Jc(n,n.return);break;case 3:if(wl(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{Za(e,t)}catch(e){ed(n,n.return,e)}}break;case 27:t===null&&r&4&&nl(n);case 26:case 5:wl(e,n),t===null&&r&4&&Xc(n),r&512&&Jc(n,n.return);break;case 12:wl(e,n);break;case 31:wl(e,n),r&4&&hl(e,n);break;case 13:wl(e,n),r&4&&gl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=id.bind(null,n),yf(e,n))));break;case 22:if(r=n.memoizedState!==null||rl,!r){t=t!==null&&t.memoizedState!==null||il,i=rl;var a=il;rl=r,(il=t)&&!a?El(e,n,(n.subtreeFlags&8772)!=0):wl(e,n),rl=i,il=a}break;case 30:break;default:wl(e,n)}}function ul(e){var t=e.alternate;t!==null&&(e.alternate=null,ul(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_t(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 dl=null,fl=!1;function pl(e,t,n){for(n=n.child;n!==null;)ml(e,t,n),n=n.sibling}function ml(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:il||Yc(n,t),pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:il||Yc(n,t);var r=dl,i=fl;uf(n.type)&&(dl=n.stateNode,fl=!1),pl(e,t,n),Tf(n.stateNode),dl=r,fl=i;break;case 5:il||Yc(n,t);case 6:if(r=dl,i=fl,dl=null,pl(e,t,n),dl=r,fl=i,dl!==null)if(fl)try{(dl.nodeType===9?dl.body:dl.nodeName===`HTML`?dl.ownerDocument.body:dl).removeChild(n.stateNode)}catch(e){ed(n,t,e)}else try{dl.removeChild(n.stateNode)}catch(e){ed(n,t,e)}break;case 18:dl!==null&&(fl?(e=dl,df(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Gp(e)):df(dl,n.stateNode));break;case 4:r=dl,i=fl,dl=n.stateNode.containerInfo,fl=!0,pl(e,t,n),dl=r,fl=i;break;case 0:case 11:case 14:case 15:Gc(2,n,t),il||Gc(4,n,t),pl(e,t,n);break;case 1:il||(Yc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&qc(n,t,r)),pl(e,t,n);break;case 21:pl(e,t,n);break;case 22:il=(r=il)||n.memoizedState!==null,pl(e,t,n),il=r;break;default:pl(e,t,n)}}function hl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gp(e)}catch(e){ed(t,t.return,e)}}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gp(e)}catch(e){ed(t,t.return,e)}}function _l(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ol),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ol),t;default:throw Error(i(435,e.tag))}}function vl(e,t){var n=_l(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ad.bind(null,e,t);t.then(r,r)}})}function yl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(uf(c.type)){dl=c.stateNode,fl=!1;break a}break;case 5:dl=c.stateNode,fl=!1;break a;case 3:case 4:dl=c.stateNode.containerInfo,fl=!0;break a}c=c.return}if(dl===null)throw Error(i(160));ml(o,s,a),dl=null,fl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xl(t,e),t=t.sibling}var bl=null;function xl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:yl(t,e),Sl(e),r&4&&(Gc(3,e,e.return),Wc(3,e),Gc(5,e,e.return));break;case 1:yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),r&64&&rl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=bl;if(yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[gt]||o[lt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Kd(o,r,n),o[lt]=e,St(o),r=o;break a;case`link`:var s=$f(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Kd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=$f(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Kd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[lt]=e,St(o),r=o}e.stateNode=r}else ep(a,e.type,e.stateNode);else e.stateNode=Jf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?ep(a,e.type,e.stateNode):Jf(a,r,e.memoizedProps))}break;case 27:yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),n!==null&&r&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),e.flags&32){a=e.stateNode;try{Jt(a,``)}catch(t){ed(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Zc(e,a,n===null?a:n.memoizedProps)),r&1024&&(al=!0);break;case 6:if(yl(t,e),Sl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){ed(e,e.return,t)}}break;case 3:if(Qf=null,a=bl,bl=Of(t.containerInfo),yl(t,e),bl=a,Sl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gp(t.containerInfo)}catch(t){ed(e,e.return,t)}al&&(al=!1,Cl(e));break;case 4:r=bl,bl=Of(e.stateNode.containerInfo),yl(t,e),Sl(e),bl=r;break;case 12:yl(t,e),Sl(e);break;case 31:yl(t,e),Sl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 13:yl(t,e),Sl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(cu=Oe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=rl,d=il;if(rl=u||a,il=d||l,yl(t,e),il=d,rl=u,Sl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||rl||il||Tl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){ed(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){ed(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ff(m,!0):ff(l.stateNode,!1)}catch(e){ed(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,vl(e,n))));break;case 19:yl(t,e),Sl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 30:break;case 21:break;default:yl(t,e),Sl(e)}}function Sl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;tl(e,$c(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Jt(o,``),n.flags&=-33),tl(e,$c(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;el(e,$c(e),s);break;default:throw Error(i(161))}}catch(t){ed(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ll(e,t.alternate,t),t=t.sibling}function Tl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gc(4,t,t.return),Tl(t);break;case 1:Yc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&qc(t,t.return,n),Tl(t);break;case 27:Tf(t.stateNode);case 26:case 5:Yc(t,t.return),Tl(t);break;case 22:t.memoizedState===null&&Tl(t);break;case 30:Tl(t);break;default:Tl(t)}e=e.sibling}}function El(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:El(i,a,n),Wc(4,a);break;case 1:if(El(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ed(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Xa(c[i],s)}catch(e){ed(r,r.return,e)}}n&&o&64&&Kc(a),Jc(a,a.return);break;case 27:nl(a);case 26:case 5:El(i,a,n),n&&r===null&&o&4&&Xc(a),Jc(a,a.return);break;case 12:El(i,a,n);break;case 31:El(i,a,n),n&&o&4&&hl(i,a);break;case 13:El(i,a,n),n&&o&4&&gl(i,a);break;case 22:a.memoizedState===null&&El(i,a,n),Jc(a,a.return);break;case 30:break;default:El(i,a,n)}t=t.sibling}}function Dl(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&&la(n))}function Ol(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function kl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Al(e,t,n,r),t=t.sibling}function Al(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:kl(e,t,n,r),i&2048&&Wc(9,t);break;case 1:kl(e,t,n,r);break;case 3:kl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){kl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){ed(t,t.return,e)}}else kl(e,t,n,r);break;case 31:kl(e,t,n,r);break;case 13:kl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?kl(e,t,n,r):(a._visibility|=2,jl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?kl(e,t,n,r):Ml(e,t),i&2048&&Dl(o,t);break;case 24:kl(e,t,n,r),i&2048&&Ol(t.alternate,t);break;default:kl(e,t,n,r)}}function jl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:jl(a,o,s,c,i),Wc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,jl(a,o,s,c,i)):u._visibility&2?jl(a,o,s,c,i):Ml(a,o),i&&l&2048&&Dl(o.alternate,o);break;case 24:jl(a,o,s,c,i),i&&l&2048&&Ol(o.alternate,o);break;default:jl(a,o,s,c,i)}t=t.sibling}}function Ml(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:Ml(n,r),i&2048&&Dl(r.alternate,r);break;case 24:Ml(n,r),i&2048&&Ol(r.alternate,r);break;default:Ml(n,r)}t=t.sibling}}var Nl=8192;function Pl(e,t,n){if(e.subtreeFlags&Nl)for(e=e.child;e!==null;)Fl(e,t,n),e=e.sibling}function Fl(e,t,n){switch(e.tag){case 26:Pl(e,t,n),e.flags&Nl&&e.memoizedState!==null&&rp(n,bl,e.memoizedState,e.memoizedProps);break;case 5:Pl(e,t,n);break;case 3:case 4:var r=bl;bl=Of(e.stateNode.containerInfo),Pl(e,t,n),bl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Nl,Nl=16777216,Pl(e,t,n),Nl=r):Pl(e,t,n));break;default:Pl(e,t,n)}}function Il(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 Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Bl(r,e)}Il(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rl(e),e=e.sibling}function Rl(e){switch(e.tag){case 0:case 11:case 15:Ll(e),e.flags&2048&&Gc(9,e,e.return);break;case 3:Ll(e);break;case 12:Ll(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zl(e)):Ll(e);break;default:Ll(e)}}function zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Bl(r,e)}Il(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gc(8,t,t.return),zl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,zl(t));break;default:zl(t)}e=e.sibling}}function Bl(e,t){for(;sl!==null;){var n=sl;switch(n.tag){case 0:case 11:case 15:Gc(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:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,sl=r;else a:for(n=e;sl!==null;){r=sl;var i=r.sibling,a=r.return;if(ul(r),r===n){sl=null;break a}if(i!==null){i.return=a,sl=i;break a}sl=a}}}var Vl={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Hl=typeof WeakMap==`function`?WeakMap:Map,Ul=0,Wl=null,Gl=null,Kl=0,ql=0,Jl=null,Yl=!1,Xl=!1,Zl=!1,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=null,ou=null,su=!1,cu=0,lu=0,uu=1/0,du=null,fu=null,pu=0,mu=null,hu=null,gu=0,_u=0,vu=null,yu=null,bu=0,xu=null;function Su(){return Ul&2&&Kl!==0?Kl&-Kl:P.T===null?ot():xd()}function Cu(){if(ru===0)if(!(Kl&536870912)||Pi){var e=Ge;Ge<<=1,!(Ge&3932160)&&(Ge=262144),ru=e}else ru=536870912;return e=ro.current,e!==null&&(e.flags|=32),ru}function wu(e,t,n){(e===Wl&&(ql===2||ql===9)||e.cancelPendingCommit!==null)&&(ju(e,0),Ou(e,Kl,ru,!1)),$e(e,n),(!(Ul&2)||e!==Wl)&&(e===Wl&&(!(Ul&2)&&(tu|=n),$l===4&&Ou(e,Kl,ru,!1)),pd(e))}function Tu(e,t,n){if(Ul&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ye(e,t),a=r?zu(e,t):Lu(e,t,!0),o=r;do{if(a===0){Xl&&!r&&Ou(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Du(n)){a=Lu(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=au;var l=c.current.memoizedState.isDehydrated;if(l&&(ju(c,s).flags|=256),s=Lu(c,s,!1),s!==2){if(Zl&&!l){c.errorRecoveryDisabledLanes|=o,tu|=o,a=4;break a}o=ou,ou=a,o!==null&&(ou===null?ou=o:ou.push.apply(ou,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){ju(e,0),Ou(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)break;case 6:Ou(r,t,ru,!Yl);break a;case 2:ou=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=cu+300-Oe(),10<a)){if(Ou(r,t,ru,!Yl),Je(r,0,!0)!==0)break a;gu=t,r.timeoutHandle=af(Eu.bind(null,r,n,ou,du,su,t,ru,tu,iu,Yl,o,`Throttled`,-0,0),a);break a}Eu(r,n,ou,du,su,t,ru,tu,iu,Yl,o,null,-0,0)}}break}while(1);pd(e)}function Eu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},Fl(t,a,d);var m=(a&62914560)===a?cu-Oe():(a&4194048)===a?lu-Oe():0;if(m=ap(d,m),m!==null){gu=a,e.cancelPendingCommit=m(Ku.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Ou(e,a,o,!l);return}}Ku(e,t,a,n,r,i,o,s,c)}function Du(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(!xr(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 Ou(e,t,n,r){t&=~nu,t&=~tu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&tt(e,n,t)}function ku(){return Ul&6?!0:(md(0,!1),!1)}function Au(){if(Gl!==null){if(ql===0)var e=Gl.return;else e=Gl,qi=Ki=null,Mo(e),Ma=null,Na=0,e=Gl;for(;e!==null;)Uc(e.alternate,e),e=e.return;Gl=null}}function ju(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,of(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),gu=0,Au(),Wl=e,Gl=n=li(e.current,null),Kl=t,ql=0,Jl=null,Yl=!1,Xl=Ye(e,t),Zl=!1,iu=ru=nu=tu=eu=$l=0,ou=au=null,su=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Be(r),a=1<<i;t|=e[i],r&=~a}return Ql=t,$r(),n}function Mu(e,t){mo=null,P.H=Vs,t===Sa||t===wa?(t=Aa(),ql=3):t===Ca?(t=Aa(),ql=4):ql=t===ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Jl=t,Gl===null&&($l=1,Qs(e,_i(t,e.current)))}function Nu(){var e=ro.current;return e===null?!0:(Kl&4194048)===Kl?io===null:(Kl&62914560)===Kl||Kl&536870912?e===io:!1}function Pu(){var e=P.H;return P.H=Vs,e===null?Vs:e}function Fu(){var e=P.A;return P.A=Vl,e}function Iu(){$l=4,Yl||(Kl&4194048)!==Kl&&ro.current!==null||(Xl=!0),!(eu&134217727)&&!(tu&134217727)||Wl===null||Ou(Wl,Kl,ru,!1)}function Lu(e,t,n){var r=Ul;Ul|=2;var i=Pu(),a=Fu();(Wl!==e||Kl!==t)&&(du=null,ju(e,t)),t=!1;var o=$l;a:do try{if(ql!==0&&Gl!==null){var s=Gl,c=Jl;switch(ql){case 8:Au(),o=6;break a;case 3:case 2:case 9:case 6:ro.current===null&&(t=!0);var l=ql;if(ql=0,Jl=null,Uu(e,s,c,l),n&&Xl){o=0;break a}break;default:l=ql,ql=0,Jl=null,Uu(e,s,c,l)}}Ru(),o=$l;break}catch(t){Mu(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,Ul=r,P.H=i,P.A=a,Gl===null&&(Wl=null,Kl=0,$r()),o}function Ru(){for(;Gl!==null;)Vu(Gl)}function zu(e,t){var n=Ul;Ul|=2;var r=Pu(),a=Fu();Wl!==e||Kl!==t?(du=null,uu=Oe()+500,ju(e,t)):Xl=Ye(e,t);a:do try{if(ql!==0&&Gl!==null){t=Gl;var o=Jl;b:switch(ql){case 1:ql=0,Jl=null,Uu(e,t,o,1);break;case 2:case 9:if(Ea(o)){ql=0,Jl=null,Hu(t);break}t=function(){ql!==2&&ql!==9||Wl!==e||(ql=7),pd(e)},o.then(t,t);break a;case 3:ql=7;break a;case 4:ql=5;break a;case 7:Ea(o)?(ql=0,Jl=null,Hu(t)):(ql=0,Jl=null,Uu(e,t,o,7));break;case 5:var s=null;switch(Gl.tag){case 26:s=Gl.memoizedState;case 5:case 27:var c=Gl;if(s?np(s):c.stateNode.complete){ql=0,Jl=null;var l=c.sibling;if(l!==null)Gl=l;else{var u=c.return;u===null?Gl=null:(Gl=u,Wu(u))}break b}}ql=0,Jl=null,Uu(e,t,o,5);break;case 6:ql=0,Jl=null,Uu(e,t,o,6);break;case 8:Au(),$l=6;break a;default:throw Error(i(462))}}Bu();break}catch(t){Mu(e,t)}while(1);return qi=Ki=null,P.H=r,P.A=a,Ul=n,Gl===null?(Wl=null,Kl=0,$r(),$l):0}function Bu(){for(;Gl!==null&&!Ee();)Vu(Gl)}function Vu(e){var t=Pc(e.alternate,e,Ql);e.memoizedProps=e.pendingProps,t===null?Wu(e):Gl=t}function Hu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=vc(n,t,t.pendingProps,t.type,void 0,Kl);break;case 11:t=vc(n,t,t.pendingProps,t.type.render,t.ref,Kl);break;case 5:Mo(t);default:Uc(n,t),t=Gl=ui(t,Ql),t=Pc(n,t,Ql)}e.memoizedProps=e.pendingProps,t===null?Wu(e):Gl=t}function Uu(e,t,n,r){qi=Ki=null,Mo(t),Ma=null,Na=0;var i=t.return;try{if(rc(e,i,t,n,Kl)){$l=1,Qs(e,_i(n,e.current)),Gl=null;return}}catch(t){if(i!==null)throw Gl=i,t;$l=1,Qs(e,_i(n,e.current)),Gl=null;return}t.flags&32768?(Pi||r===1?e=!0:Xl||Kl&536870912?e=!1:(Yl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gu(t,e)):Wu(t)}function Wu(e){var t=e;do{if(t.flags&32768){Gu(t,Yl);return}e=t.return;var n=Vc(t.alternate,t,Ql);if(n!==null){Gl=n;return}if(t=t.sibling,t!==null){Gl=t;return}Gl=t=e}while(t!==null);$l===0&&($l=5)}function Gu(e,t){do{var n=Hc(e.alternate,e);if(n!==null){n.flags&=32767,Gl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Gl=e;return}Gl=e=n}while(e!==null);$l=6,Gl=null}function Ku(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Zu();while(pu!==0);if(Ul&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Qr,et(e,n,o,s,c,l),e===Wl&&(Gl=Wl=null,Kl=0),hu=t,mu=e,gu=n,_u=o,vu=a,yu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,od(Me,function(){return Qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Ul,Ul|=4;try{cl(e,t,n)}finally{Ul=s,F.p=a,P.T=r}}pu=1,qu(),Ju(),Yu()}}function qu(){if(pu===1){pu=0;var e=mu,t=hu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Ul;Ul|=4;try{xl(t,e);var a=Zd,o=Er(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Tr(s.ownerDocument.documentElement,s)){if(c!==null&&Dr(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 _=wr(s,h),v=wr(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}}yp=!!Xd,Zd=Xd=null}finally{Ul=i,F.p=r,P.T=n}}e.current=t,pu=2}}function Ju(){if(pu===2){pu=0;var e=mu,t=hu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Ul;Ul|=4;try{ll(e,t.alternate,t)}finally{Ul=i,F.p=r,P.T=n}}pu=3}}function Yu(){if(pu===4||pu===3){pu=0,De();var e=mu,t=hu,n=gu,r=yu;t.subtreeFlags&10256||t.flags&10256?pu=5:(pu=0,hu=mu=null,Xu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(fu=null),at(n),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}gu&3&&Zu(),pd(e),i=e.pendingLanes,n&261930&&i&42?e===xu?bu++:(bu=0,xu=e):bu=0,md(0,!1)}}function Xu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Zu(){return qu(),Ju(),Yu(),Qu()}function Qu(){if(pu!==5)return!1;var e=mu,t=_u;_u=0;var n=at(gu),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=vu,vu=null;var o=mu,s=gu;if(pu=0,hu=mu=null,gu=0,Ul&6)throw Error(i(331));var c=Ul;if(Ul|=4,Rl(o.current),Al(o,o.current,s,n),Ul=c,md(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,o)}catch{}return!0}finally{F.p=a,P.T=r,Xu(e,t)}}function $u(e,t,n){t=_i(n,t),t=ec(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&($e(e,2),pd(e))}function ed(e,t,n){if(e.tag===3)$u(e,e,n);else for(;t!==null;){if(t.tag===3){$u(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(fu===null||!fu.has(r))){e=_i(n,e),n=tc(2),r=Wa(t,n,2),r!==null&&(nc(n,r,t,e),$e(r,2),pd(r));break}}t=t.return}}function td(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Hl;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)||(Zl=!0,i.add(n),e=nd.bind(null,e,t,n),t.then(e,e))}function nd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Wl===e&&(Kl&n)===n&&($l===4||$l===3&&(Kl&62914560)===Kl&&300>Oe()-cu?!(Ul&2)&&ju(e,0):nu|=n,iu===Kl&&(iu=0)),pd(e)}function rd(e,t){t===0&&(t=Ze()),e=ni(e,t),e!==null&&($e(e,t),pd(e))}function id(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rd(e,n)}function ad(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),rd(e,n)}function od(e,t){return we(e,t)}var sd=null,cd=null,ld=!1,ud=!1,dd=!1,fd=0;function pd(e){e!==cd&&e.next===null&&(cd===null?sd=cd=e:cd=cd.next=e),ud=!0,ld||(ld=!0,bd())}function md(e,t){if(!dd&&ud){dd=!0;do for(var n=!1,r=sd;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-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,yd(r,a))}else a=Kl,a=Je(r,r===Wl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,yd(r,a));r=r.next}while(n);dd=!1}}function hd(){gd()}function gd(){ud=ld=!1;var e=0;fd!==0&&rf()&&(e=fd);for(var t=Oe(),n=null,r=sd;r!==null;){var i=r.next,a=_d(r,t);a===0?(r.next=null,n===null?sd=i:n.next=i,i===null&&(cd=n)):(n=r,(e!==0||a&3)&&(ud=!0)),r=i}pu!==0&&pu!==5||md(e,!1),fd!==0&&(fd=0)}function _d(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Xe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Wl,n=Kl,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ql===2||ql===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Te(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Te(r),at(n)){case 2:case 8:n=je;break;case 32:n=Me;break;case 268435456:n=Pe;break;default:n=Me}return r=vd.bind(null,e),n=we(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Te(r),e.callbackPriority=2,e.callbackNode=null,2}function vd(e,t){if(pu!==0&&pu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zu()&&e.callbackNode!==n)return null;var r=Kl;return r=Je(e,e===Wl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Tu(e,r,t),_d(e,Oe()),e.callbackNode!=null&&e.callbackNode===n?vd.bind(null,e):null)}function yd(e,t){if(Zu())return null;Tu(e,t,!0)}function bd(){cf(function(){Ul&6?we(Ae,hd):gd()})}function xd(){if(fd===0){var e=fa;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),fd=e}return fd}function Sd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:tn(``+e)}function Cd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function wd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Sd((i[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||null)?Sd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(fd!==0){var e=o?Cd(i,o):new FormData(i);Ds(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Cd(i,o):new FormData(i),Ds(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Td=0;Td<qr.length;Td++){var Ed=qr[Td];Jr(Ed.toLowerCase(),`on`+(Ed[0].toUpperCase()+Ed.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),Et(`onMouseEnter`,[`mouseout`,`mouseover`]),Et(`onMouseLeave`,[`mouseout`,`mouseover`]),Et(`onPointerEnter`,[`pointerout`,`pointerover`]),Et(`onPointerLeave`,[`pointerout`,`pointerover`]),Tt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Tt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Tt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Tt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Dd=`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(` `),Od=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Dd));function kd(e,t){t=(t&4)!=0;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){Yr(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){Yr(e)}i.currentTarget=null,a=c}}}}function Ad(e,t){var n=t[ft];n===void 0&&(n=t[ft]=new Set);var r=e+`__bubble`;n.has(r)||(Pd(t,e,2,!1),n.add(r))}function jd(e,t,n){var r=0;t&&(r|=4),Pd(n,e,r,t)}var Md=`_reactListening`+Math.random().toString(36).slice(2);function Nd(e){if(!e[Md]){e[Md]=!0,Ct.forEach(function(t){t!==`selectionchange`&&(Od.has(t)||jd(t,!1,e),jd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Md]||(t[Md]=!0,jd(`selectionchange`,!1,t))}}function Pd(e,t,n,r){switch(Ep(t)){case 2:var i=bp;break;case 8:i=xp;break;default:i=Sp}n=i.bind(null,t,n,e),i=void 0,!pn||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 Fd(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=vt(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}un(function(){var r=a,i=an(n),s=[];a:{var c=Kr.get(e);if(c!==void 0){var l=Cn,u=e;switch(e){case`keypress`:if(I(n)===0)break a;case`keydown`:case`keyup`:l=zn;break;case`focusin`:u=`focus`,l=An;break;case`focusout`:u=`blur`,l=An;break;case`beforeblur`:case`afterblur`:l=An;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=L;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=R;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Vn;break;case zr:case Br:case Vr:l=jn;break;case Gr:l=Hn;break;case`scroll`:case`scrollend`:l=Tn;break;case`wheel`:l=Un;break;case`copy`:case`cut`:case`paste`:l=Mn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Bn;break;case`toggle`:case`beforetoggle`:l=Wn}var d=(t&4)!=0,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(Id(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(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==rn&&(u=n.relatedTarget||n.fromElement)&&(vt(u)||u[dt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?vt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=L,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:bt(l),h=u==null?c:bt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,vt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Rd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&zd(s,c,l,d,!1),u!==null&&f!==null&&zd(s,f,u,d,!0)}}a:{if(c=r?bt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=lr;else if(rr(c))if(ur)v=yr;else{v=_r;var y=gr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Qt(r.elementType)&&(v=lr):v=vr;if(v&&=v(e,r)){ir(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Wt(c,`number`,c.value)}switch(y=r?bt(r):window,e){case`focusin`:(rr(y)||y.contentEditable===`true`)&&(kr=y,Ar=r,jr=null);break;case`focusout`:jr=Ar=kr=null;break;case`mousedown`:Mr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Mr=!1,Nr(s,n,i);break;case`selectionchange`:if(Or)break;case`keydown`:case`keyup`:Nr(s,n,i)}var b;if(Kn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else $n?Zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(z&&n.locale!==`ko`&&($n||x!==`onCompositionStart`?x===`onCompositionEnd`&&$n&&(b=vn()):(hn=i,gn=`value`in hn?hn.value:hn.textContent,$n=!0)),y=Ld(r,x),0<y.length&&(x=new Nn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Qn(n),b!==null&&(x.data=b)))),(b=Jn?er(e,n):tr(e,n))&&(x=Ld(r,`onBeforeInput`),0<x.length&&(y=new Nn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),wd(s,e,r,n,i)}kd(s,t)})}function Id(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ld(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(Id(e,i,a)),i=dn(e,t),i!=null&&r.push(Id(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Rd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zd(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(Id(n,l,c))):i||(l=dn(n,a),l!=null&&o.push(Id(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Bd=/\r\n?/g,Vd=/\u0000|\uFFFD/g;function Hd(e){return(typeof e==`string`?e:``+e).replace(Bd,`
|
|
9
|
-
`).replace(Vd,``)}function Ud(e,t){return t=Hd(t),Hd(e)===t}function Wd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Mt(e,`class`,r);break;case`tabIndex`:Mt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Mt(e,n,r);break;case`style`:Zt(e,r,o);break;case`data`:if(t!==`object`){Mt(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=tn(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Wd(e,t,`name`,a.name,a,null),Wd(e,t,`formEncType`,a.formEncType,a,null),Wd(e,t,`formMethod`,a.formMethod,a,null),Wd(e,t,`formTarget`,a.formTarget,a,null)):(Wd(e,t,`encType`,a.encType,a,null),Wd(e,t,`method`,a.method,a,null),Wd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`onScroll`:r!=null&&Ad(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ad(`scrollend`,e);break;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));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=tn(``+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`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`:Ad(`beforetoggle`,e),Ad(`toggle`,e),jt(e,`popover`,r);break;case`xlinkActuate`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:jt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=$t.get(n)||n,jt(e,n,r))}}function Gd(e,t,n,r,a,o){switch(n){case`style`:Zt(e,r,o);break;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));e.innerHTML=n}}break;case`children`:typeof r==`string`?Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Jt(e,``+r);break;case`onScroll`:r!=null&&Ad(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ad(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!wt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ut]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):jt(e,n,r)}}}function Kd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Ad(`error`,e),Ad(`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:Wd(e,t,o,s,n,null)}}a&&Wd(e,t,`srcSet`,n.srcSet,n,null),r&&Wd(e,t,`src`,n.src,n,null);return;case`input`:Ad(`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:Wd(e,t,r,d,n,null)}}Ut(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Ad(`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:Wd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Gt(e,!!r,n,!0):Gt(e,!!r,t,!1);return;case`textarea`:for(s in Ad(`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:Wd(e,t,s,c,n,null)}qt(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:Wd(e,t,l,r,n,null)}return;case`dialog`:Ad(`beforetoggle`,e),Ad(`toggle`,e),Ad(`cancel`,e),Ad(`close`,e);break;case`iframe`:case`object`:Ad(`load`,e);break;case`video`:case`audio`:for(r=0;r<Dd.length;r++)Ad(Dd[r],e);break;case`image`:Ad(`error`,e),Ad(`load`,e);break;case`details`:Ad(`toggle`,e);break;case`embed`:case`source`:case`link`:Ad(`error`,e),Ad(`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:Wd(e,t,u,r,n,null)}return;default:if(Qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Gd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Wd(e,t,c,r,n,null))}function qd(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)||Wd(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Wd(e,t,p,m,r,f)}}Ht(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)||Wd(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`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Wd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Gt(e,!!n,n?[]:``,!1):Gt(e,!!n,t,!0)):Gt(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:Wd(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`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Wd(e,t,s,a,r,o)}Kt(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:Wd(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Wd(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)&&Wd(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:Wd(e,t,u,p,r,m)}return;default:if(Qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Gd(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||Gd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Wd(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||Wd(e,t,f,p,r,m)}function Jd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Yd(){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&&Jd(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&&Jd(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 Xd=null,Zd=null;function Qd(e){return e.nodeType===9?e:e.ownerDocument}function $d(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 ef(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 tf(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 nf=null;function rf(){var e=window.event;return e&&e.type===`popstate`?e===nf?!1:(nf=e,!0):(nf=null,!1)}var af=typeof setTimeout==`function`?setTimeout:void 0,of=typeof clearTimeout==`function`?clearTimeout:void 0,sf=typeof Promise==`function`?Promise:void 0,cf=typeof queueMicrotask==`function`?queueMicrotask:sf===void 0?af:function(e){return sf.resolve(null).then(e).catch(lf)};function lf(e){setTimeout(function(){throw e})}function uf(e){return e===`head`}function df(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),Gp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[gt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tf(e.ownerDocument.body);n=i}while(n);Gp(t)}function ff(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 pf(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`:pf(n),_t(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mf(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[gt])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=bf(e.nextSibling),e===null)break}return null}function hf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bf(e.nextSibling),e===null))return null;return e}function gf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bf(e.nextSibling),e===null))return null;return e}function _f(e){return e.data===`$?`||e.data===`$~`}function vf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function yf(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 bf(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 xf=null;function Sf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cf(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 wf(e,t,n){switch(t=Qd(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 Tf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_t(e)}var Ef=new Map,Df=new Set;function Of(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var kf=F.d;F.d={f:Af,r:jf,D:Pf,C:Ff,L:If,m:Lf,X:zf,S:Rf,M:Bf};function Af(){var e=kf.f(),t=ku();return e||t}function jf(e){var t=yt(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):kf.r(e)}var Mf=typeof document>`u`?null:document;function Nf(e,t,n){var r=Mf;if(r&&typeof t==`string`&&t){var i=Vt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Df.has(i)||(Df.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Kd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Pf(e){kf.D(e),Nf(`dns-prefetch`,e,null)}function Ff(e,t){kf.C(e,t),Nf(`preconnect`,e,t)}function If(e,t,n){kf.L(e,t,n);var r=Mf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Vt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Vt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Vt(n.imageSizes)+`"]`)):i+=`[href="`+Vt(e)+`"]`;var a=i;switch(t){case`style`:a=Hf(e);break;case`script`:a=Kf(e)}Ef.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Ef.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Uf(a))||t===`script`&&r.querySelector(qf(a))||(t=r.createElement(`link`),Kd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Lf(e,t){kf.m(e,t);var n=Mf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Vt(r)+`"][href="`+Vt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Kf(e)}if(!Ef.has(a)&&(e=p({rel:`modulepreload`,href:e},t),Ef.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qf(a)))return}r=n.createElement(`link`),Kd(r,`link`,e),St(r),n.head.appendChild(r)}}}function Rf(e,t,n){kf.S(e,t,n);var r=Mf;if(r&&e){var i=xt(r).hoistableStyles,a=Hf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Uf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Ef.get(a))&&Xf(e,n);var c=o=r.createElement(`link`);St(c),Kd(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,Yf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zf(e,t){kf.X(e,t);var n=Mf;if(n&&e){var r=xt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=p({src:e,async:!0},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),St(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t){kf.M(e,t);var n=Mf;if(n&&e){var r=xt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),St(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t,n,r){var a=(a=ue.current)?Of(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`?(t=Hf(n.href),n=xt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Hf(n.href);var o=xt(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(Uf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Ef.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ef.set(e,n),o||Gf(a,e,n,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`?(t=Kf(n),n=xt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hf(e){return`href="`+Vt(e)+`"`}function Uf(e){return`link[rel="stylesheet"][`+e+`]`}function Wf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Gf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Kd(t,`link`,n),St(t),e.head.appendChild(t))}function Kf(e){return`[src="`+Vt(e)+`"]`}function qf(e){return`script[async]`+e}function Jf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Vt(n.href)+`"]`);if(r)return t.instance=r,St(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),St(r),Kd(r,`style`,a),Yf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hf(n.href);var o=e.querySelector(Uf(a));if(o)return t.state.loading|=4,t.instance=o,St(o),o;r=Wf(n),(a=Ef.get(a))&&Xf(r,a),o=(e.ownerDocument||e).createElement(`link`),St(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Kd(o,`link`,r),t.state.loading|=4,Yf(o,n.precedence,e),t.instance=o;case`script`:return o=Kf(n.src),(a=e.querySelector(qf(o)))?(t.instance=a,St(a),a):(r=n,(a=Ef.get(o))&&(r=p({},n),Zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),St(a),Kd(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,Yf(r,n.precedence,e));return t.instance}function Yf(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 Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qf=null;function $f(e,t,n){if(Qf===null){var r=new Map,i=Qf=new Map;i.set(n,r)}else i=Qf,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[gt]||a[lt]||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 ep(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function tp(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 np(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rp(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=Hf(r.href),a=t.querySelector(Uf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=op.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,St(a);return}a=t.ownerDocument||t,r=Wf(r),(i=Ef.get(i))&&Xf(r,i),a=a.createElement(`link`),St(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Kd(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=op.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ip=0;function ap(e,t){return e.stylesheets&&e.count===0&&cp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ip===0&&(ip=62500*Yd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ip?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sp=null;function cp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sp=new Map,t.forEach(lp,e),sp=null,op.call(e))}function lp(e,t){if(!(t.state.loading&4)){var n=sp.get(e);if(n)var r=n.get(null);else{n=new Map,sp.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=op.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 up={$$typeof:C,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function dp(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=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function fp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new dp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function pp(e){return e?(e=ai,e):ai}function mp(e,t,n,r,i,a){i=pp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(wu(n,e,t),Ga(n,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gp(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function _p(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&wu(t,e,67108864),gp(e,67108864)}}function vp(e){if(e.tag===13||e.tag===31){var t=Su();t=it(t);var n=ni(e,t);n!==null&&wu(n,e,t),gp(e,t)}}var yp=!0;function bp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,Sp(e,t,n,r)}finally{F.p=a,P.T=i}}function xp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,Sp(e,t,n,r)}finally{F.p=a,P.T=i}}function Sp(e,t,n,r){if(yp){var i=Cp(r);if(i===null)Fd(e,t,r,wp,n),Fp(e,r);else if(Lp(i,e,t,n,r))r.stopPropagation();else if(Fp(e,r),t&4&&-1<Pp.indexOf(e)){for(;i!==null;){var a=yt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}pd(a),!(Ul&6)&&(uu=Oe()+500,md(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&wu(s,a,2),ku(),gp(a,2)}if(a=Cp(r),a===null&&Fd(e,t,r,wp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Fd(e,t,r,null,n)}}function Cp(e){return e=an(e),Tp(e)}var wp=null;function Tp(e){if(wp=null,e=vt(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 wp=e,null}function Ep(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`resize`: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`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`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(ke()){case Ae:return 2;case je:return 8;case Me:case Ne:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var Dp=!1,Op=null,kp=null,Ap=null,jp=new Map,Mp=new Map,Np=[],Pp=`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 Fp(e,t){switch(e){case`focusin`:case`focusout`:Op=null;break;case`dragenter`:case`dragleave`:kp=null;break;case`mouseover`:case`mouseout`:Ap=null;break;case`pointerover`:case`pointerout`:jp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mp.delete(t.pointerId)}}function Ip(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=yt(t),t!==null&&_p(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lp(e,t,n,r,i){switch(t){case`focusin`:return Op=Ip(Op,e,t,n,r,i),!0;case`dragenter`:return kp=Ip(kp,e,t,n,r,i),!0;case`mouseover`:return Ap=Ip(Ap,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jp.set(a,Ip(jp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mp.set(a,Ip(Mp.get(a)||null,e,t,n,r,i)),!0}return!1}function Rp(e){var t=vt(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,st(e.priority,function(){vp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,st(e.priority,function(){vp(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 zp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);rn=r,n.target.dispatchEvent(r),rn=null}else return t=yt(n),t!==null&&_p(t),e.blockedOn=n,!1;t.shift()}return!0}function Bp(e,t,n){zp(e)&&n.delete(t)}function Vp(){Dp=!1,Op!==null&&zp(Op)&&(Op=null),kp!==null&&zp(kp)&&(kp=null),Ap!==null&&zp(Ap)&&(Ap=null),jp.forEach(Bp),Mp.forEach(Bp)}function Hp(e,n){e.blockedOn===n&&(e.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vp)))}var Up=null;function Wp(e){Up!==e&&(Up=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Up===e&&(Up=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(Tp(r||n)===null)continue;break}var a=yt(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gp(e){function t(t){return Hp(t,e)}Op!==null&&Hp(Op,e),kp!==null&&Hp(kp,e),Ap!==null&&Hp(Ap,e),jp.forEach(t),Mp.forEach(t);for(var n=0;n<Np.length;n++){var r=Np[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Np.length&&(n=Np[0],n.blockedOn===null);)Rp(n),n.blockedOn===null&&Np.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[ut]||null;if(typeof a==`function`)o||Wp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(Tp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wp(n)}}}function Kp(){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 qp(e){this._internalRoot=e}Jp.prototype.render=qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;mp(n,Su(),e,t,null,null)},Jp.prototype.unmount=qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),ku(),t[dt]=null}};function Jp(e){this._internalRoot=e}Jp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Np.length&&t!==0&&t<Np[n].priority;n++);Np.splice(n,0,e),n===0&&Rp(e)}};var Yp=n.version;if(Yp!==`19.2.7`)throw Error(i(527,Yp,`19.2.7`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Xp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zp.isDisabled&&Zp.supportsFiber)try{Le=Zp.inject(Xp),Re=Zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ys,s=Xs,c=Zs;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=fp(e,1,!1,null,null,n,r,null,o,s,c,Kp),e[dt]=t.current,Nd(e),new qp(t)}})),v=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=_()})),y=[],b=[],x=Uint8Array,S=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,C=0,w=S.length;C<w;++C)y[C]=S[C],b[S.charCodeAt(C)]=C;b[45]=62,b[95]=63;function T(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function E(e,t,n){return(t+n)*3/4-n}function D(e){var t,n=T(e),r=n[0],i=n[1],a=new x(E(e,r,i)),o=0,s=i>0?r-4:r,c;for(c=0;c<s;c+=4)t=b[e.charCodeAt(c)]<<18|b[e.charCodeAt(c+1)]<<12|b[e.charCodeAt(c+2)]<<6|b[e.charCodeAt(c+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=b[e.charCodeAt(c)]<<2|b[e.charCodeAt(c+1)]>>4,a[o++]=t&255),i===1&&(t=b[e.charCodeAt(c)]<<10|b[e.charCodeAt(c+1)]<<4|b[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function O(e){return y[e>>18&63]+y[e>>12&63]+y[e>>6&63]+y[e&63]}function k(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(O(r));return i.join(``)}function A(e){for(var t,n=e.length,r=n%3,i=[],a=16383,o=0,s=n-r;o<s;o+=a)i.push(k(e,o,o+a>s?s:o+a));return r===1?(t=e[n-1],i.push(y[t>>2]+y[t<<4&63]+`==`)):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(y[t>>10]+y[t>>4&63]+y[t<<2&63]+`=`)),i.join(``)}function j(e){if(e===void 0)return{};if(!N(e))throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function M(e){if(e===void 0)throw Error(`Client created with undefined deployment address. If you used an environment variable, check that it's set.`);if(typeof e!=`string`)throw Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith(`http:`)||e.startsWith(`https:`)))throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(`.convex.site`))throw Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function N(e){let t=typeof e==`object`,n=Object.getPrototypeOf(e),r=n===null||n===Object.prototype||n?.constructor?.name===`Object`;return t&&r}var ee=!0,te=BigInt(`-9223372036854775808`),P=BigInt(`9223372036854775807`),F=BigInt(`0`),ne=BigInt(`8`),re=BigInt(`256`);function ie(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function ae(e){e<F&&(e-=te+te);let t=e.toString(16);t.length%2==1&&(t=`0`+t);let n=new Uint8Array(new ArrayBuffer(8)),r=0;for(let i of t.match(/.{2}/g).reverse())n.set([parseInt(i,16)],r++),e>>=ne;return A(n)}function oe(e){let t=D(e);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let n=F,r=F;for(let e of t)n+=BigInt(e)*re**r,r++;return n>P&&(n+=te+te),n}function se(e){if(e<te||P<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);let t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),A(new Uint8Array(t))}function ce(e){let t=D(e);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}var le=DataView.prototype.setBigInt64?se:ae,ue=DataView.prototype.getBigInt64?ce:oe,de=1024;function fe(e){if(e.length>de)throw Error(`Field name ${e} exceeds maximum field name length ${de}.`);if(e.startsWith(`$`))throw Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n<32||n>=127)throw Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function pe(e){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return e;if(Array.isArray(e))return e.map(e=>pe(e));if(typeof e!=`object`)throw Error(`Unexpected type of ${e}`);let t=Object.entries(e);if(t.length===1){let n=t[0][0];if(n===`$bytes`){if(typeof e.$bytes!=`string`)throw Error(`Malformed $bytes field on ${e}`);return D(e.$bytes).buffer}if(n===`$integer`){if(typeof e.$integer!=`string`)throw Error(`Malformed $integer field on ${e}`);return ue(e.$integer)}if(n===`$float`){if(typeof e.$float!=`string`)throw Error(`Malformed $float field on ${e}`);let t=D(e.$float);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $float`);let n=new DataView(t.buffer).getFloat64(0,ee);if(!ie(n))throw Error(`Float ${n} should be encoded as a number`);return n}if(n===`$set`)throw Error(`Received a Set which is no longer supported as a Convex type.`);if(n===`$map`)throw Error(`Received a Map which is no longer supported as a Convex type.`)}let n={};for(let[t,r]of Object.entries(e))fe(t),n[t]=pe(r);return n}var me=16384;function he(e){let t=JSON.stringify(e,(e,t)=>t===void 0?`undefined`:typeof t==`bigint`?`${t.toString()}n`:t);if(t.length>me){let e=me-14,n=t.codePointAt(e-1);return n!==void 0&&n>65535&&--e,t.substring(0,e)+`[...truncated]`}return t}function ge(e,t,n,r){if(e===void 0){let e=n&&` (present at path ${n} in original object ${he(t)})`;throw Error(`undefined is not a valid Convex value${e}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e==`bigint`){if(e<te||P<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:le(e)}}if(typeof e==`number`)if(ie(e)){let t=new ArrayBuffer(8);return new DataView(t).setFloat64(0,e,ee),{$float:A(new Uint8Array(t))}}else return e;if(typeof e==`boolean`||typeof e==`string`)return e;if(e instanceof ArrayBuffer)return{$bytes:A(new Uint8Array(e))};if(Array.isArray(e))return e.map((e,r)=>ge(e,t,n+`[${r}]`,!1));if(e instanceof Set)throw Error(_e(n,`Set`,[...e],t));if(e instanceof Map)throw Error(_e(n,`Map`,[...e],t));if(!N(e)){let r=e?.constructor?.name,i=r?`${r} `:``;throw Error(_e(n,i,e,t))}let i={},a=Object.entries(e);a.sort(([e,t],[n,r])=>e===n?0:e<n?-1:1);for(let[e,o]of a)o===void 0?r&&(fe(e),i[e]=ve(o,t,n+`.${e}`)):(fe(e),i[e]=ge(o,t,n+`.${e}`,!1));return i}function _e(e,t,n,r){return e?`${t}${he(n)} is not a supported Convex type (present at path ${e} in original object ${he(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${he(n)} is not a supported Convex type.`}function ve(e,t,n){if(e===void 0)return{$undefined:null};if(t===void 0)throw Error(`Programming error. Current value is ${he(e)} but original value is undefined`);return ge(e,t,n,!1)}function ye(e){return ge(e,e,``,!1)}var be=Object.defineProperty,xe=(e,t,n)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se=(e,t,n)=>xe(e,typeof t==`symbol`?t:t+``,n),Ce,we,Te=Symbol.for(`ConvexError`),Ee=class extends (we=Error,Ce=Te,we){constructor(e){super(typeof e==`string`?e:he(e)),Se(this,`name`,`ConvexError`),Se(this,`data`),Se(this,Ce,!0),this.data=e}},De=`1.41.0`,Oe=Object.defineProperty,ke=(e,t,n)=>t in e?Oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ae=(e,t,n)=>ke(e,typeof t==`symbol`?t:t+``,n),je=`color:rgb(0, 145, 255)`;function Me(e){switch(e){case`query`:return`Q`;case`mutation`:return`M`;case`action`:return`A`;case`any`:return`?`}}var Ne=class{constructor(e){Ae(this,`_onLogLineFuncs`),Ae(this,`_verbose`),this._onLogLineFuncs={},this._verbose=e.verbose}addLogLineListener(e){let t=Math.random().toString(36).substring(2,15);for(let e=0;e<10&&this._onLogLineFuncs[t]!==void 0;e++)t=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[t]=e,()=>{delete this._onLogLineFuncs[t]}}logVerbose(...e){if(this._verbose)for(let t of Object.values(this._onLogLineFuncs))t(`debug`,`${new Date().toISOString()}`,...e)}log(...e){for(let t of Object.values(this._onLogLineFuncs))t(`info`,...e)}warn(...e){for(let t of Object.values(this._onLogLineFuncs))t(`warn`,...e)}error(...e){for(let t of Object.values(this._onLogLineFuncs))t(`error`,...e)}};function Pe(e){let t=new Ne(e);return t.addLogLineListener((e,...t)=>{switch(e){case`debug`:console.debug(...t);break;case`info`:console.log(...t);break;case`warn`:console.warn(...t);break;case`error`:console.error(...t);break;default:console.log(...t)}}),t}function Fe(e){return new Ne(e)}function Ie(e,t,n,r,i){let a=Me(n);if(typeof i==`object`&&(i=`ConvexError ${JSON.stringify(i.errorData,null,2)}`),t===`info`){let t=i.match(/^\[.*?\] /);if(t===null){e.error(`[CONVEX ${a}(${r})] Could not parse console.log`);return}let n=i.slice(1,t[0].length-2),o=i.slice(t[0].length);e.log(`%c[CONVEX ${a}(${r})] [${n}]`,je,o)}else e.error(`[CONVEX ${a}(${r})] ${i}`)}function Le(e,t){let n=`[CONVEX FATAL ERROR] ${t}`;return e.error(n),Error(n)}function Re(e,t,n){return`[CONVEX ${Me(e)}(${t})] ${n.errorMessage}
|
|
10
|
-
Called by client`}function ze(e,t){return t.data=e.errorData,t}function Be(e){let t=e.split(`:`),n,r;return t.length===1?(n=t[0],r=`default`):(n=t.slice(0,t.length-1).join(`:`),r=t[t.length-1]),n.endsWith(`.js`)&&(n=n.slice(0,-3)),`${n}:${r}`}function Ve(e,t){return JSON.stringify({udfPath:Be(e),args:ye(t)})}function He(e,t,n){let{initialNumItems:r,id:i}=n;return JSON.stringify({type:`paginated`,udfPath:Be(e),args:ye(t),options:ye({initialNumItems:r,id:i})})}var Ue=Object.defineProperty,We=(e,t,n)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ge=(e,t,n)=>We(e,typeof t==`symbol`?t:t+``,n),Ke=class{constructor(){Ge(this,`nextQueryId`),Ge(this,`querySetVersion`),Ge(this,`querySet`),Ge(this,`queryIdToToken`),Ge(this,`identityVersion`),Ge(this,`auth`),Ge(this,`outstandingQueriesOlderThanRestart`),Ge(this,`outstandingAuthOlderThanRestart`),Ge(this,`paused`),Ge(this,`pendingQuerySetModifications`),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(e,t,n,r){let i=Be(e),a=Ve(i,t),o=this.querySet.get(a);if(o!==void 0)return o.numSubscribers+=1,{queryToken:a,modification:null,unsubscribe:()=>this.removeSubscriber(a)};{let e=this.nextQueryId++,o={id:e,canonicalizedUdfPath:i,args:t,numSubscribers:1,journal:n,componentPath:r};this.querySet.set(a,o),this.queryIdToToken.set(e,a);let s=this.querySetVersion,c=this.querySetVersion+1,l={type:`Add`,queryId:e,udfPath:i,args:[ye(t)],journal:n,componentPath:r};return this.paused?this.pendingQuerySetModifications.set(e,l):this.querySetVersion=c,{queryToken:a,modification:{type:`ModifyQuerySet`,baseVersion:s,newVersion:c,modifications:[l]},unsubscribe:()=>this.removeSubscriber(a)}}}transition(e){for(let t of e.modifications)switch(t.type){case`QueryUpdated`:case`QueryFailed`:{this.outstandingQueriesOlderThanRestart.delete(t.queryId);let e=t.journal;if(e!==void 0){let n=this.queryIdToToken.get(t.queryId);n!==void 0&&(this.querySet.get(n).journal=e)}break}case`QueryRemoved`:this.outstandingQueriesOlderThanRestart.delete(t.queryId);break;default:throw Error(`Invalid modification ${t.type}`)}}queryId(e,t){let n=Ve(Be(e),t),r=this.querySet.get(n);return r===void 0?null:r.id}isCurrentOrNewerAuthVersion(e){return e>=this.identityVersion}getAuth(){return this.auth}setAuth(e){this.auth={tokenType:`User`,value:e};let t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:`Authenticate`,baseVersion:t,...this.auth}}setAdminAuth(e,t){let n={tokenType:`Admin`,value:e,impersonating:t};this.auth=n;let r=this.identityVersion;return this.paused||(this.identityVersion=r+1),{type:`Authenticate`,baseVersion:r,...n}}clearAuth(){this.auth=void 0,this.markAuthCompletion();let e=this.identityVersion;return this.paused||(this.identityVersion=e+1),{type:`Authenticate`,tokenType:`None`,baseVersion:e}}hasAuth(){return!!this.auth}isNewAuth(e){return this.auth?.value!==e}queryPath(e){let t=this.queryIdToToken.get(e);return t?this.querySet.get(t).canonicalizedUdfPath:null}queryArgs(e){let t=this.queryIdToToken.get(e);return t?this.querySet.get(t).args:null}queryToken(e){return this.queryIdToToken.get(e)??null}queryJournal(e){return this.querySet.get(e)?.journal}restart(){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();let e=[];for(let t of this.querySet.values()){let n={type:`Add`,queryId:t.id,udfPath:t.canonicalizedUdfPath,args:[ye(t.args)],journal:t.journal,componentPath:t.componentPath};e.push(n),this.outstandingQueriesOlderThanRestart.add(t.id)}this.querySetVersion=1;let t={type:`ModifyQuerySet`,baseVersion:0,newVersion:1,modifications:e};if(!this.auth)return this.identityVersion=0,[t,void 0];this.outstandingAuthOlderThanRestart=!0;let n={type:`Authenticate`,baseVersion:0,...this.auth};return this.identityVersion=1,[t,n]}pause(){this.paused=!0}resume(){let e=this.pendingQuerySetModifications.size>0?{type:`ModifyQuerySet`,baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,t=this.auth===void 0?void 0:{type:`Authenticate`,baseVersion:this.identityVersion++,...this.auth};return this.unpause(),[e,t]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(e){let t=this.querySet.get(e);if(t.numSubscribers>1)return--t.numSubscribers,null;{this.querySet.delete(e),this.queryIdToToken.delete(t.id),this.outstandingQueriesOlderThanRestart.delete(t.id);let n=this.querySetVersion,r=this.querySetVersion+1,i={type:`Remove`,queryId:t.id};return this.paused?this.pendingQuerySetModifications.has(t.id)?this.pendingQuerySetModifications.delete(t.id):this.pendingQuerySetModifications.set(t.id,i):this.querySetVersion=r,{type:`ModifyQuerySet`,baseVersion:n,newVersion:r,modifications:[i]}}}},qe=Object.defineProperty,Je=(e,t,n)=>t in e?qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ye=(e,t,n)=>Je(e,typeof t==`symbol`?t:t+``,n),Xe=class{constructor(e,t){this.logger=e,this.markConnectionStateDirty=t,Ye(this,`inflightRequests`),Ye(this,`requestsOlderThanRestart`),Ye(this,`inflightMutationsCount`,0),Ye(this,`inflightActionsCount`,0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(e,t){let n=new Promise(n=>{let r=t?`Requested`:`NotSent`;this.inflightRequests.set(e.requestId,{message:e,status:{status:r,requestedAt:new Date,onResult:n}}),e.type===`Mutation`?this.inflightMutationsCount++:e.type===`Action`&&this.inflightActionsCount++});return this.markConnectionStateDirty(),n}onResponse(e){let t=this.inflightRequests.get(e.requestId);if(t===void 0||t.status.status===`Completed`)return null;let n=t.message.type===`Mutation`?`mutation`:`action`,r=t.message.udfPath;for(let t of e.logLines)Ie(this.logger,`info`,n,r,t);let i=t.status,a,o;if(e.success)a={success:!0,logLines:e.logLines,value:pe(e.result)},o=()=>i.onResult(a);else{let t=e.result,{errorData:s}=e;Ie(this.logger,`error`,n,r,t),a={success:!1,errorMessage:t,errorData:s===void 0?void 0:pe(s),logLines:e.logLines},o=()=>i.onResult(a)}return e.type===`ActionResponse`||!e.success?(o(),this.inflightRequests.delete(e.requestId),this.requestsOlderThanRestart.delete(e.requestId),t.message.type===`Action`?this.inflightActionsCount--:t.message.type===`Mutation`&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:e.requestId,result:a}):(t.status={status:`Completed`,result:a,ts:e.ts,onResolve:o},null)}removeCompleted(e){let t=new Map;for(let[n,r]of this.inflightRequests.entries()){let i=r.status;i.status===`Completed`&&i.ts.lessThanOrEqual(e)&&(i.onResolve(),t.set(n,i.result),r.message.type===`Mutation`?this.inflightMutationsCount--:r.message.type===`Action`&&this.inflightActionsCount--,this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n))}return t.size>0&&this.markConnectionStateDirty(),t}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());let e=[];for(let[t,n]of this.inflightRequests){if(n.status.status===`NotSent`){n.status.status=`Requested`,e.push(n.message);continue}if(n.message.type===`Mutation`)e.push(n.message);else if(n.message.type===`Action`){if(this.inflightRequests.delete(t),this.requestsOlderThanRestart.delete(t),this.inflightActionsCount--,n.status.status===`Completed`)throw Error(`Action should never be in 'Completed' state`);n.status.onResult({success:!1,errorMessage:`Connection lost while action was in flight`,logLines:[]})}}return this.markConnectionStateDirty(),e}resume(){let e=[];for(let[,t]of this.inflightRequests)if(t.status.status===`NotSent`){t.status.status=`Requested`,e.push(t.message);continue}return e}hasIncompleteRequests(){for(let e of this.inflightRequests.values())if(e.status.status===`Requested`)return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let e=Date.now();for(let t of this.inflightRequests.values())t.status.status!==`Completed`&&t.status.requestedAt.getTime()<e&&(e=t.status.requestedAt.getTime());return new Date(e)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}},Ze=Symbol.for(`functionName`),Qe=Symbol.for(`toReferencePath`);function $e(e){return e[Qe]??null}function et(e){return e.startsWith(`function://`)}function tt(e){let t;if(typeof e==`string`)t=et(e)?{functionHandle:e}:{name:e};else if(e[Ze])t={name:e[Ze]};else{let n=$e(e);if(!n)throw Error(`${e} is not a functionReference`);t={reference:n}}return t}function nt(e){let t=tt(e);if(t.name===void 0)throw t.functionHandle===void 0?t.reference===void 0?Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`):Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`);if(typeof e==`string`)return e;let n=e[Ze];if(!n)throw Error(`${e} is not a functionReference`);return n}function rt(e){return{[Ze]:e}}function it(e=[]){return new Proxy({},{get(t,n){if(typeof n==`string`)return it([...e,n]);if(n===Ze){if(e.length<2){let t=[`api`,...e].join(`.`);throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${t}\``)}let t=e.slice(0,-1).join(`/`),n=e[e.length-1];return n==="default"?t:t+`:`+n}else if(n===Symbol.toStringTag)return`FunctionReference`;else return}})}var at=it(),ot=Object.defineProperty,st=(e,t,n)=>t in e?ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ct=(e,t,n)=>st(e,typeof t==`symbol`?t:t+``,n),lt=class e{constructor(e){ct(this,`queryResults`),ct(this,`modifiedQueries`),this.queryResults=e,this.modifiedQueries=[]}getQuery(t,...n){let r=j(n[0]),i=nt(t),a=this.queryResults.get(Ve(i,r));if(a!==void 0)return e.queryValue(a.result)}getAllQueries(t){let n=[],r=nt(t);for(let t of this.queryResults.values())t.udfPath===Be(r)&&n.push({args:t.args,value:e.queryValue(t.result)});return n}setQuery(e,t,n){let r=j(t),i=nt(e),a=Ve(i,r),o;o=n===void 0?void 0:{success:!0,value:n,logLines:[]};let s={udfPath:i,args:r,result:o};this.queryResults.set(a,s),this.modifiedQueries.push(a)}static queryValue(e){if(e!==void 0&&e.success)return e.value}},ut=class{constructor(){ct(this,`queryResults`),ct(this,`optimisticUpdates`),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(e,t){this.optimisticUpdates=this.optimisticUpdates.filter(e=>!t.has(e.mutationId));let n=this.queryResults;this.queryResults=new Map(e);let r=new lt(this.queryResults);for(let e of this.optimisticUpdates)e.update(r);let i=[];for(let[e,t]of this.queryResults){let r=n.get(e);(r===void 0||r.result!==t.result)&&i.push(e)}return i}applyOptimisticUpdate(e,t){this.optimisticUpdates.push({update:e,mutationId:t});let n=new lt(this.queryResults);return e(n),n.modifiedQueries}rawQueryResult(e){let t=this.queryResults.get(e);if(t!==void 0)return t.result}queryResult(e){let t=this.queryResults.get(e);if(t===void 0)return;let n=t.result;if(n!==void 0){if(n.success)return n.value;throw n.errorData===void 0?Error(Re(`query`,t.udfPath,n)):ze(n,new Ee(Re(`query`,t.udfPath,n)))}}hasQueryResult(e){return this.queryResults.get(e)!==void 0}queryLogs(e){return this.queryResults.get(e)?.result?.logLines}},dt=Object.defineProperty,ft=(e,t,n)=>t in e?dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pt=(e,t,n)=>ft(e,typeof t==`symbol`?t:t+``,n),mt=class e{constructor(e,t){pt(this,`low`),pt(this,`high`),pt(this,`__isUnsignedLong__`),this.low=e|0,this.high=t|0,this.__isUnsignedLong__=!0}static isLong(e){return(e&&e.__isUnsignedLong__)===!0}static fromBytesLE(t){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){let e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]}static fromNumber(t){return isNaN(t)||t<0?ht:t>=vt?yt:new e(t%_t|0,t/_t|0)}toString(){return(BigInt(this.high)*BigInt(_t)+BigInt(this.low)).toString()}equals(t){return e.isLong(t)||(t=e.fromValue(t)),this.high>>>31==1&&t.high>>>31==1?!1:this.high===t.high&&this.low===t.low}notEquals(e){return!this.equals(e)}comp(t){return e.isLong(t)||(t=e.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(e){return this.comp(e)<=0}static fromValue(t){return typeof t==`number`?e.fromNumber(t):new e(t.low,t.high)}},ht=new mt(0,0),gt=65536,_t=gt*gt,vt=_t*_t,yt=new mt(-1,-1),bt=Object.defineProperty,xt=(e,t,n)=>t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,St=(e,t,n)=>xt(e,typeof t==`symbol`?t:t+``,n),Ct=class{constructor(e,t){St(this,`version`),St(this,`remoteQuerySet`),St(this,`queryPath`),St(this,`logger`),this.version={querySet:0,ts:mt.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=e,this.logger=t}transition(e){let t=e.startVersion;if(this.version.querySet!==t.querySet||this.version.ts.notEquals(t.ts)||this.version.identity!==t.identity)throw Error(`Invalid start version: ${t.ts.toString()}:${t.querySet}:${t.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(let t of e.modifications)switch(t.type){case`QueryUpdated`:{let e=this.queryPath(t.queryId);if(e)for(let n of t.logLines)Ie(this.logger,`info`,`query`,e,n);let n=pe(t.value??null);this.remoteQuerySet.set(t.queryId,{success:!0,value:n,logLines:t.logLines});break}case`QueryFailed`:{let e=this.queryPath(t.queryId);if(e)for(let n of t.logLines)Ie(this.logger,`info`,`query`,e,n);let{errorData:n}=t;this.remoteQuerySet.set(t.queryId,{success:!1,errorMessage:t.errorMessage,errorData:n===void 0?void 0:pe(n),logLines:t.logLines});break}case`QueryRemoved`:this.remoteQuerySet.delete(t.queryId);break;default:throw Error(`Invalid modification ${t.type}`)}this.version=e.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}};function wt(e){let t=D(e);return mt.fromBytesLE(Array.from(t))}function Tt(e){return A(new Uint8Array(e.toBytesLE()))}function Et(e){switch(e.type){case`FatalError`:case`AuthError`:case`ActionResponse`:case`TransitionChunk`:case`Ping`:return{...e};case`MutationResponse`:return e.success?{...e,ts:wt(e.ts)}:{...e};case`Transition`:return{...e,startVersion:{...e.startVersion,ts:wt(e.startVersion.ts)},endVersion:{...e.endVersion,ts:wt(e.endVersion.ts)}};default:}}function Dt(e){switch(e.type){case`Authenticate`:case`ModifyQuerySet`:case`Mutation`:case`Action`:case`Event`:return{...e};case`Connect`:return e.maxObservedTimestamp===void 0?{...e,maxObservedTimestamp:void 0}:{...e,maxObservedTimestamp:Tt(e.maxObservedTimestamp)};default:}}var Ot=Object.defineProperty,kt=(e,t,n)=>t in e?Ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,At=(e,t,n)=>kt(e,typeof t==`symbol`?t:t+``,n),jt=1e3,Mt=1001,Nt=1005,Pt=4040,Ft;function It(){return Ft===void 0&&(Ft=Date.now()),typeof performance>`u`||!performance.now?Date.now():Math.round(Ft+performance.now())}function Lt(){return`t=${Math.round((It()-Ft)/100)/10}s`}var Rt={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function zt(e){if(e===void 0)return`Unknown`;for(let t of Object.keys(Rt))if(e.startsWith(t))return t;return`Unknown`}var Bt=class{constructor(e,t,n,r,i,a){this.markConnectionStateDirty=i,this.debug=a,At(this,`socket`),At(this,`connectionCount`),At(this,`_hasEverConnected`,!1),At(this,`lastCloseReason`),At(this,`transitionChunkBuffer`,null),At(this,`defaultInitialBackoff`),At(this,`maxBackoff`),At(this,`retries`),At(this,`serverInactivityThreshold`),At(this,`reconnectDueToServerInactivityTimeout`),At(this,`scheduledReconnect`,null),At(this,`networkOnlineHandler`,null),At(this,`pendingNetworkRecoveryInfo`,null),At(this,`uri`),At(this,`onOpen`),At(this,`onResume`),At(this,`onMessage`),At(this,`webSocketConstructor`),At(this,`logger`),At(this,`onServerDisconnectError`),this.webSocketConstructor=n,this.socket={state:`disconnected`},this.connectionCount=0,this.lastCloseReason=`InitialConnect`,this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=e,this.onOpen=t.onOpen,this.onResume=t.onResume,this.onMessage=t.onMessage,this.onServerDisconnectError=t.onServerDisconnectError,this.logger=r,this.setupNetworkListener(),this.connect()}setSocketState(e){this.socket=e,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${`paused`in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>`u`||typeof window.addEventListener!=`function`||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose(`network online event detected`),this.tryReconnectImmediately()},window.addEventListener(`online`,this.networkOnlineHandler),this._logVerbose(`network online event listener registered`))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<`u`&&typeof window.removeEventListener==`function`&&(window.removeEventListener(`online`,this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose(`network online event listener removed`))}assembleTransition(e){if(e.partNumber<0||e.partNumber>=e.totalParts||e.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==e.totalParts||this.transitionChunkBuffer.transitionId!==e.transitionId))throw this.transitionChunkBuffer=null,Error(`Invalid TransitionChunk`);if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:e.totalParts,transitionId:e.transitionId}),e.partNumber!==this.transitionChunkBuffer.chunks.length){let t=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,Error(`TransitionChunk received out of order: expected part ${t}, got ${e.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(e.chunk),this.transitionChunkBuffer.chunks.length===e.totalParts){let e=this.transitionChunkBuffer.chunks.join(``);this.transitionChunkBuffer=null;let t=Et(JSON.parse(e));if(t.type!==`Transition`)throw Error(`Expected Transition, got ${t.type} after assembling chunks`);return t}return null}connect(){if(this.socket.state===`terminated`)return;if(this.socket.state!==`disconnected`&&this.socket.state!==`stopped`)throw Error(`Didn't start connection from disconnected state: `+this.socket.state);let e=new this.webSocketConstructor(this.uri);this._logVerbose(`constructed WebSocket`),this.setSocketState({state:`connecting`,ws:e,paused:`no`}),this.resetServerInactivityTimeout(),e.onopen=()=>{if(this.logger.logVerbose(`begin ws.onopen`),this.socket.state!==`connecting`)throw Error(`onopen called with socket not in connecting state`);if(this.setSocketState({state:`ready`,ws:e,paused:this.socket.paused===`yes`?`uninitialized`:`no`}),this.resetServerInactivityTimeout(),this.socket.paused===`no`&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:It()})),this.lastCloseReason!==`InitialConnect`&&(this.lastCloseReason?this.logger.log(`WebSocket reconnected at`,Lt(),`after disconnect due to`,this.lastCloseReason):this.logger.log(`WebSocket reconnected at`,Lt())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){let{timeSavedMs:e}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:`Event`,eventType:`NetworkRecoveryReconnect`,event:{timeSavedMs:e}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(e/1e3)}s of waiting`)}},e.onerror=e=>{this.transitionChunkBuffer=null;let t=e.message;t&&this.logger.log(`WebSocket error message: ${t}`)},e.onmessage=e=>{this.resetServerInactivityTimeout();let t=e.data.length,n=Et(JSON.parse(e.data));if(this._logVerbose(`received ws message with type ${n.type}`),n.type!==`Ping`){if(n.type===`TransitionChunk`){let e=this.assembleTransition(n);if(!e)return;n=e,this._logVerbose(`assembled full ws message of type ${n.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${n.type} while buffering TransitionChunks`)),n.type===`Transition`&&this.reportLargeTransition({messageLength:t,transition:n}),this.onMessage(n).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())}},e.onclose=e=>{if(this._logVerbose(`begin ws.onclose`),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=e.reason||`closed with code ${e.code}`),e.code!==jt&&e.code!==Mt&&e.code!==Nt&&e.code!==Pt){let t=`WebSocket closed with code ${e.code}`;e.reason&&(t+=`: ${e.reason}`),this.logger.log(t),this.onServerDisconnectError&&e.reason&&this.onServerDisconnectError(t)}let t=zt(e.reason);this.scheduleReconnect(t)}}socketState(){return this.socket.state}sendMessage(e){let t={type:e.type,...e.type===`Authenticate`&&e.tokenType===`User`?{value:`...${e.value.slice(-7)}`}:{}};if(this.socket.state===`ready`&&this.socket.paused===`no`){let n=Dt(e),r=JSON.stringify(n),i=!1;try{this.socket.ws.send(r),i=!0}catch(e){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${e}`),this.closeAndReconnect(`FailedToSendMessage`)}return this._logVerbose(`${i?`sent`:`failed to send`} message with type ${e.type}: ${JSON.stringify(t)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${`paused`in this.socket?this.socket.paused:void 0}): ${JSON.stringify(t)}`),!1}resetServerInactivityTimeout(){this.socket.state!==`terminated`&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect(`InactiveServer`)},this.serverInactivityThreshold))}scheduleReconnect(e){this.scheduledReconnect&&=(clearTimeout(this.scheduledReconnect.timeout),null),this.socket={state:`disconnected`};let t=this.nextBackoff(e);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);let n=It(),r=setTimeout(()=>{this.scheduledReconnect?.timeout===r&&(this.scheduledReconnect=null,this.connect())},t);this.scheduledReconnect={timeout:r,scheduledAt:n,backoffMs:t}}closeAndReconnect(e){switch(this._logVerbose(`begin closeAndReconnect with reason ${e}`),this.socket.state){case`disconnected`:case`terminated`:case`stopped`:return;case`connecting`:case`ready`:this.lastCloseReason=e,this.close(),this.scheduleReconnect(`client`);return;default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case`disconnected`:case`terminated`:case`stopped`:return Promise.resolve();case`connecting`:{let e=this.socket.ws;return e.onmessage=e=>{this._logVerbose(`Ignoring message received after close`)},new Promise(t=>{e.onclose=()=>{this._logVerbose(`Closed after connecting`),t()},e.onopen=()=>{this._logVerbose(`Opened after connecting`),e.close()}})}case`ready`:{this._logVerbose(`ws.close called`);let e=this.socket.ws;e.onmessage=e=>{this._logVerbose(`Ignoring message received after close`)};let t=new Promise(t=>{e.onclose=()=>{t()}});return e.close(),t}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&=(clearTimeout(this.scheduledReconnect.timeout),null),this.cleanupNetworkListener(),this.socket.state){case`terminated`:case`stopped`:case`disconnected`:case`connecting`:case`ready`:{let e=this.close();return this.setSocketState({state:`terminated`}),e}default:throw this.socket,Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case`terminated`:return Promise.resolve();case`connecting`:case`stopped`:case`disconnected`:case`ready`:{this.cleanupNetworkListener();let e=this.close();return this.socket={state:`stopped`},e}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case`stopped`:break;case`terminated`:case`connecting`:case`ready`:case`disconnected`:this.logger.logVerbose(`Restart called without stopping first`);return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case`disconnected`:case`stopped`:case`terminated`:return;case`connecting`:case`ready`:this.socket={...this.socket,paused:`yes`};return;default:this.socket;return}}tryReconnectImmediately(){if(this._logVerbose(`tryReconnectImmediately called`),this.socket.state!==`disconnected`){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let e=null;if(this.scheduledReconnect){let t=It()-this.scheduledReconnect.scheduledAt;e=Math.max(0,this.scheduledReconnect.backoffMs-t),this._logVerbose(`would have waited ${Math.round(e)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(t)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose(`canceled scheduled reconnect`)}this.logger.log(`Network recovery detected, reconnecting immediately`),this.pendingNetworkRecoveryInfo=e===null?null:{timeSavedMs:e},this.connect()}resume(){switch(this.socket.state){case`connecting`:this.socket={...this.socket,paused:`no`};return;case`ready`:this.socket.paused===`uninitialized`?(this.socket={...this.socket,paused:`no`},this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:It()})):this.socket.paused===`yes`&&(this.socket={...this.socket,paused:`no`},this.onResume());return;case`terminated`:case`stopped`:case`disconnected`:return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state===`ready`,hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(e){this.logger.logVerbose(e)}nextBackoff(e){let t=(e===`client`?100:e===`Unknown`?this.defaultInitialBackoff:Rt[e].timeout)*2**this.retries;this.retries+=1;let n=Math.min(t,this.maxBackoff);return n+n*(Math.random()-.5)}reportLargeTransition({transition:e,messageLength:t}){if(e.clientClockSkew===void 0||e.serverTs===void 0)return;let n=It()-e.clientClockSkew-e.serverTs/1e6,r=`${Math.round(n)}ms`,i=`${Math.round(t/1e4)/100}MB`,a=t/(n/1e3),o=`${Math.round(a/1e4)/100}MB per second`;this._logVerbose(`received ${i} transition in ${r} at ${o}`),t>2e7?this.logger.log(`received query results totaling more that 20MB (${i}) which will take a long time to download on slower connections`):n>2e4&&this.logger.log(`received query results totaling ${i} which took more than 20s to arrive (${r})`),this.debug&&this.sendMessage({type:`Event`,eventType:`ClientReceivedTransition`,event:{transitionTransitTime:n,messageLength:t}})}};function Vt(){return Ht()}function Ht(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var Ut=class extends Error{};Ut.prototype.name=`InvalidTokenError`;function Wt(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n=`0`+n),`%`+n}))}function Gt(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);switch(t.length%4){case 0:break;case 2:t+=`==`;break;case 3:t+=`=`;break;default:throw Error(`base64 string is not of the correct length`)}try{return Wt(t)}catch{return atob(t)}}function Kt(e,t){if(typeof e!=`string`)throw new Ut(`Invalid token specified: must be a string`);t||={};let n=t.header===!0?0:1,r=e.split(`.`)[n];if(typeof r!=`string`)throw new Ut(`Invalid token specified: missing part #${n+1}`);let i;try{i=Gt(r)}catch(e){throw new Ut(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new Ut(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}var qt=Object.defineProperty,Jt=(e,t,n)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yt=(e,t,n)=>Jt(e,typeof t==`symbol`?t:t+``,n),Xt=480*60*60*1e3,Zt=2,Qt=class{constructor(e,t,n){Yt(this,`authState`,{state:`noAuth`}),Yt(this,`configVersion`,0),Yt(this,`syncState`),Yt(this,`authenticate`),Yt(this,`stopSocket`),Yt(this,`tryRestartSocket`),Yt(this,`pauseSocket`),Yt(this,`resumeSocket`),Yt(this,`clearAuth`),Yt(this,`logger`),Yt(this,`refreshTokenLeewaySeconds`),Yt(this,`lastRefreshChange`),Yt(this,`tokenConfirmationAttempts`,0),this.syncState=e,this.authenticate=t.authenticate,this.stopSocket=t.stopSocket,this.tryRestartSocket=t.tryRestartSocket,this.pauseSocket=t.pauseSocket,this.resumeSocket=t.resumeSocket,this.clearAuth=t.clearAuth,this.logger=n.logger,this.refreshTokenLeewaySeconds=n.refreshTokenLeewaySeconds,this.lastRefreshChange=!1}notifyRefreshChange(e){this.authState.state!==`noAuth`&&this.authState.state!==`initialRefetch`&&this.authState.config.onRefreshChange&&this.lastRefreshChange!==e&&(this.lastRefreshChange=e,this.authState.config.onRefreshChange(e))}async setConfig(e,t,n){this.resetAuthState(),this._logVerbose(`pausing WS for auth token fetch`),this.pauseSocket();let r=await this.fetchTokenAndGuardAgainstRace(e,{forceRefreshToken:!1});if(r.isFromOutdatedConfig)return;let i={fetchToken:e,onAuthChange:t,onRefreshChange:n};r.value?(this.setAuthState({state:`waitingForServerConfirmationOfCachedToken`,config:i,hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:`initialRefetch`,config:i}),await this.refetchToken()),this._logVerbose(`resuming WS after auth token fetch`),this.resumeSocket()}onTransition(e){if(this.syncState.isCurrentOrNewerAuthVersion(e.endVersion.identity)&&!(e.endVersion.identity<=e.startVersion.identity)){if(this._logVerbose(`auth state is ${this.authState.state} when handling transition`),this.syncState.markAuthCompletion(),this.authState.state===`waitingForServerConfirmationOfCachedToken`){this._logVerbose(`server confirmed auth token is valid`),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state===`waitingForServerConfirmationOfFreshToken`&&(this._logVerbose(`server confirmed new auth token is valid`),this.notifyRefreshChange(!1),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(e){if(e.authUpdateAttempted===!1&&(this.authState.state===`waitingForServerConfirmationOfFreshToken`||this.authState.state===`waitingForServerConfirmationOfCachedToken`)){this._logVerbose(`ignoring non-auth token expired error`);return}let{baseVersion:t}=e;if(!this.syncState.isCurrentOrNewerAuthVersion(t+1)){this._logVerbose(`ignoring auth error for previous auth attempt`);return}this.tryToReauthenticate(e)}async tryToReauthenticate(e){if(this._logVerbose(`attempting to reauthenticate: ${e.error}`),this.authState.state===`noAuth`||this.authState.state===`waitingForServerConfirmationOfFreshToken`&&this.tokenConfirmationAttempts>=Zt){this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!==`noAuth`&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}if(this.authState.state===`waitingForServerConfirmationOfFreshToken`&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${Zt-this.tokenConfirmationAttempts} attempts remaining`)),this.notifyRefreshChange(!0),await this.stopSocket(),this.authState.state===`noAuth`)return;let t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value&&this.syncState.isNewAuth(t.value)?(this.authenticate(t.value),this.setAuthState({state:`waitingForServerConfirmationOfFreshToken`,config:this.authState.config,token:t.value,hadAuth:this.authState.state===`notRefetching`||this.authState.state===`waitingForScheduledRefetch`})):(this._logVerbose(`reauthentication failed, could not fetch a new token`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state===`noAuth`)return;this._logVerbose(`refetching auth token`);let e=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});e.isFromOutdatedConfig||(e.value?this.syncState.isNewAuth(e.value)?(this.setAuthState({state:`waitingForServerConfirmationOfFreshToken`,hadAuth:this.syncState.hasAuth(),token:e.value,config:this.authState.config}),this.authenticate(e.value)):this.setAuthState({state:`notRefetching`,config:this.authState.config}):(this._logVerbose(`refetching token failed`),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose(`restarting WS after auth token fetch (if currently stopped)`),this.tryRestartSocket())}scheduleTokenRefetch(e){if(this.authState.state===`noAuth`)return;let t=this.decodeToken(e);if(!t){this.logger.error(`Auth token is not a valid JWT, cannot refetch the token`);return}let{iat:n,exp:r}=t;if(!n||!r){this.logger.error(`Auth token does not have required fields, cannot refetch the token`);return}let i=r-n;if(i<=2){this.logger.error(`Auth token does not live long enough, cannot refetch the token`);return}let a=Math.min(Xt,(i-this.refreshTokenLeewaySeconds)*1e3);a<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${i}s`),a=0);let o=setTimeout(()=>{this._logVerbose(`running scheduled token refetch`),this.refetchToken()},a);this.setAuthState({state:`waitingForScheduledRefetch`,refetchTokenTimeoutId:o,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${a}ms`)}async fetchTokenAndGuardAgainstRace(e,t){let n=++this.configVersion;this._logVerbose(`fetching token with config version ${n}`);let r=await e(t);return this.configVersion===n?{isFromOutdatedConfig:!1,value:r}:(this._logVerbose(`stale config version, expected ${n}, got ${this.configVersion}`),{isFromOutdatedConfig:!0})}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(e){e(!1),this.resetAuthState()}resetAuthState(){this.notifyRefreshChange(!1),this.setAuthState({state:`noAuth`})}setAuthState(e){let t=e.state===`waitingForServerConfirmationOfFreshToken`?{hadAuth:e.hadAuth,state:e.state,token:`...${e.token.slice(-7)}`}:{state:e.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(t)}`),e.state){case`waitingForScheduledRefetch`:case`notRefetching`:case`noAuth`:this.tokenConfirmationAttempts=0;break;case`waitingForServerConfirmationOfFreshToken`:case`waitingForServerConfirmationOfCachedToken`:case`initialRefetch`:break;default:}this.authState.state===`waitingForScheduledRefetch`&&clearTimeout(this.authState.refetchTokenTimeoutId),this.authState=e}decodeToken(e){try{return Kt(e)}catch(e){return this._logVerbose(`Error decoding token: ${e instanceof Error?e.message:`Unknown error`}`),null}}_logVerbose(e){this.logger.logVerbose(`${e} [v${this.configVersion}]`)}},$t=[`convexClientConstructed`,`convexWebSocketOpen`,`convexFirstMessageReceived`];function en(e,t){let n={sessionId:t};typeof performance>`u`||!performance.mark||performance.mark(e,{detail:n})}function tn(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function nn(e){if(typeof performance>`u`||!performance.getEntriesByName)return[];let t=[];for(let n of $t){let r=performance.getEntriesByName(n).filter(e=>e.entryType===`mark`).filter(t=>t.detail.sessionId===e);t.push(...r)}return t.map(tn)}var rn=Object.defineProperty,an=(e,t,n)=>t in e?rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,on=(e,t,n)=>an(e,typeof t==`symbol`?t:t+``,n),sn=class{constructor(e,t,n){if(on(this,`address`),on(this,`state`),on(this,`requestManager`),on(this,`webSocketManager`),on(this,`authenticationManager`),on(this,`remoteQuerySet`),on(this,`optimisticQueryResults`),on(this,`_transitionHandlerCounter`,0),on(this,`_nextRequestId`),on(this,`_onTransitionFns`,new Map),on(this,`_sessionId`),on(this,`firstMessageReceived`,!1),on(this,`debug`),on(this,`logger`),on(this,`maxObservedTimestamp`),on(this,`connectionStateSubscribers`,new Map),on(this,`nextConnectionStateSubscriberId`,0),on(this,`_lastPublishedConnectionState`),on(this,`markConnectionStateDirty`,()=>{Promise.resolve().then(()=>{let e=this.connectionState();if(JSON.stringify(e)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=e;for(let t of this.connectionStateSubscribers.values())t(e)}})}),on(this,`mark`,e=>{this.debug&&en(e,this.sessionId)}),typeof e==`object`)throw Error(`Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.`);n?.skipConvexDeploymentUrlCheck!==!0&&M(e),n={...n};let r=n.authRefreshTokenLeewaySeconds??10,i=n.webSocketConstructor;if(!i&&typeof WebSocket>`u`)throw Error(`No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient`);i||=WebSocket,this.debug=n.reportDebugInfoToConvex??!1,this.address=e,this.logger=n.logger===!1?Fe({verbose:n.verbose??!1}):n.logger!==!0&&n.logger?n.logger:Pe({verbose:n.verbose??!1});let a=e.search(`://`);if(a===-1)throw Error(`Provided address was not an absolute URL.`);let o=e.substring(a+3),s=e.substring(0,a),c;if(s===`http`)c=`ws`;else if(s===`https`)c=`wss`;else throw Error(`Unknown parent protocol ${s}`);let l=`${c}://${o}/api/${De}/sync`;this.state=new Ke,this.remoteQuerySet=new Ct(e=>this.state.queryPath(e),this.logger),this.requestManager=new Xe(this.logger,this.markConnectionStateDirty);let u=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new Qt(this.state,{authenticate:e=>{let t=this.state.setAuth(e);return this.webSocketManager.sendMessage(t),t.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:u,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:r}),this.optimisticQueryResults=new ut,this.addOnTransitionHandler(e=>{t(e.queries.map(e=>e.token))}),this._nextRequestId=0,this._sessionId=Vt();let{unsavedChangesWarning:d}=n;if(typeof window>`u`||window.addEventListener===void 0){if(d===!0)throw Error(`unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.`)}else d!==!1&&window.addEventListener(`beforeunload`,e=>{if(this.requestManager.hasIncompleteRequests()){e.preventDefault();let t=`Are you sure you want to leave? Your changes may not be saved.`;return(e||window.event).returnValue=t,t}});this.webSocketManager=new Bt(l,{onOpen:e=>{this.mark(`convexWebSocketOpen`),this.webSocketManager.sendMessage({...e,type:`Connect`,sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp}),this.remoteQuerySet=new Ct(e=>this.state.queryPath(e),this.logger);let[t,n]=this.state.restart();n&&this.webSocketManager.sendMessage(n),this.webSocketManager.sendMessage(t);for(let e of this.requestManager.restart())this.webSocketManager.sendMessage(e)},onResume:()=>{let[e,t]=this.state.resume();t&&this.webSocketManager.sendMessage(t),e&&this.webSocketManager.sendMessage(e);for(let e of this.requestManager.resume())this.webSocketManager.sendMessage(e)},onMessage:e=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark(`convexFirstMessageReceived`),this.reportMarks()),e.type){case`Transition`:{this.observedTimestamp(e.endVersion.ts),this.authenticationManager.onTransition(e),this.remoteQuerySet.transition(e),this.state.transition(e);let t=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(t);break}case`MutationResponse`:{e.success&&this.observedTimestamp(e.ts);let t=this.requestManager.onResponse(e);t!==null&&this.notifyOnQueryResultChanges(new Map([[t.requestId,t.result]]));break}case`ActionResponse`:this.requestManager.onResponse(e);break;case`AuthError`:this.authenticationManager.onAuthError(e);break;case`FatalError`:{let t=Le(this.logger,e.error);throw this.webSocketManager.terminate(),t}default:}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:n.onServerDisconnectError},i,this.logger,this.markConnectionStateDirty,this.debug),this.mark(`convexClientConstructed`),n.expectAuth&&u()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()&&this.state.hasSyncedPastLastReconnect()}observedTimestamp(e){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(e))&&(this.maxObservedTimestamp=e)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(e){let t=this.remoteQuerySet.remoteQueryResults(),n=new Map;for(let[e,r]of t){let t=this.state.queryToken(e);if(t!==null){let i={result:r,udfPath:this.state.queryPath(e),args:this.state.queryArgs(e)};n.set(t,i)}}let r=this.optimisticQueryResults.ingestQueryResultsFromServer(n,new Set(e.keys()));this.handleTransition({queries:r.map(e=>({token:e,modification:{kind:`Updated`,result:this.optimisticQueryResults.rawQueryResult(e)}})),reflectedMutations:Array.from(e).map(([e,t])=>({requestId:e,result:t})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(e){for(let t of this._onTransitionFns.values())t(e)}addOnTransitionHandler(e){let t=this._transitionHandlerCounter++;return this._onTransitionFns.set(t,e),()=>this._onTransitionFns.delete(t)}getCurrentAuthClaims(){let e=this.state.getAuth(),t={};if(e&&e.tokenType===`User`)try{t=e?Kt(e.value):{}}catch{t={}}else return;return{token:e.value,decoded:t}}setAuth(e,t,n){this.authenticationManager.setConfig(e,t,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(e,t){let n=this.state.setAdminAuth(e,t);this.webSocketManager.sendMessage(n)}clearAuth(){let e=this.state.clearAuth();this.webSocketManager.sendMessage(e)}subscribe(e,t,n){let r=j(t),{modification:i,queryToken:a,unsubscribe:o}=this.state.subscribe(e,r,n?.journal,n?.componentPath);return i!==null&&this.webSocketManager.sendMessage(i),{queryToken:a,unsubscribe:()=>{let e=o();e&&this.webSocketManager.sendMessage(e)}}}localQueryResult(e,t){let n=Ve(e,j(t));return this.optimisticQueryResults.queryResult(n)}localQueryResultByToken(e){return this.optimisticQueryResults.queryResult(e)}hasLocalQueryResultByToken(e){return this.optimisticQueryResults.hasQueryResult(e)}localQueryLogs(e,t){let n=Ve(e,j(t));return this.optimisticQueryResults.queryLogs(n)}queryJournal(e,t){let n=Ve(e,j(t));return this.state.queryJournal(n)}connectionState(){let e=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:e.isConnected,hasEverConnected:e.hasEverConnected,connectionCount:e.connectionCount,connectionRetries:e.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(e){let t=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(t,e),()=>{this.connectionStateSubscribers.delete(t)}}async mutation(e,t,n){let r=await this.mutationInternal(e,t,n);if(!r.success)throw r.errorData===void 0?Error(Re(`mutation`,e,r)):ze(r,new Ee(Re(`mutation`,e,r)));return r.value}async mutationInternal(e,t,n,r){let{mutationPromise:i}=this.enqueueMutation(e,t,n,r);return i}enqueueMutation(e,t,n,r){let i=j(t);this.tryReportLongDisconnect();let a=this.nextRequestId;if(this._nextRequestId++,n!==void 0){let e=n.optimisticUpdate;if(e!==void 0){let t=this.optimisticQueryResults.applyOptimisticUpdate(t=>{e(t,i)instanceof Promise&&this.logger.warn(`Optimistic update handler returned a Promise. Optimistic updates should be synchronous.`)},a).map(e=>{let t=this.localQueryResultByToken(e);return{token:e,modification:{kind:`Updated`,result:t===void 0?void 0:{success:!0,value:t,logLines:[]}}}});this.handleTransition({queries:t,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}let o={type:`Mutation`,requestId:a,udfPath:e,componentPath:r,args:[ye(i)]},s=this.webSocketManager.sendMessage(o);return{requestId:a,mutationPromise:this.requestManager.request(o,s)}}async action(e,t){let n=await this.actionInternal(e,t);if(!n.success)throw n.errorData===void 0?Error(Re(`action`,e,n)):ze(n,new Ee(Re(`action`,e,n)));return n.value}async actionInternal(e,t,n){let r=j(t),i=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();let a={type:`Action`,requestId:i,udfPath:e,componentPath:n,args:[ye(r)]},o=this.webSocketManager.sendMessage(a);return this.requestManager.request(a,o)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){let e=nn(this.sessionId);this.webSocketManager.sendMessage({type:`Event`,eventType:`ClientConnect`,event:e})}}tryReportLongDisconnect(){if(!this.debug)return;let e=this.connectionState().timeOfOldestInflightRequest;if(e===null||Date.now()-e.getTime()<=60*1e3)return;let t=`${this.address}/api/debug_event`;fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`,"Convex-Client":`npm-${De}`},body:JSON.stringify({event:`LongWebsocketDisconnect`})}).then(e=>{e.ok||this.logger.warn(`Analytics request failed with response:`,e.body)}).catch(e=>{this.logger.warn(`Analytics response failed with error:`,e)})}};function cn(e){if(typeof e!=`object`||!e||!Array.isArray(e.page)||typeof e.isDone!=`boolean`||typeof e.continueCursor!=`string`)throw Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var ln=Object.defineProperty,un=(e,t,n)=>t in e?ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dn=(e,t,n)=>un(e,typeof t==`symbol`?t:t+``,n),fn=class{constructor(e,t){this.client=e,this.onTransition=t,dn(this,`paginatedQuerySet`,new Map),dn(this,`lastTransitionTs`),this.lastTransitionTs=mt.fromNumber(0),this.client.addOnTransitionHandler(e=>this.onBaseTransition(e))}subscribe(e,t,n){let r=Be(e),i=He(r,t,n),a=()=>this.removePaginatedQuerySubscriber(i),o=this.paginatedQuerySet.get(i);return o?(o.numSubscribers+=1,{paginatedQueryToken:i,unsubscribe:a}):(this.paginatedQuerySet.set(i,{token:i,canonicalizedUdfPath:r,args:t,numSubscribers:1,options:{initialNumItems:n.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:n.id}),this.addPageToPaginatedQuery(i,null,n.initialNumItems),{paginatedQueryToken:i,unsubscribe:a})}localQueryResult(e,t,n){let r=He(Be(e),t,n);return this.localQueryResultByToken(r)}localQueryResultByToken(e){let t=this.paginatedQuerySet.get(e);if(!t)return;let n=this.activePageQueryTokens(t);if(n.length===0)return{results:[],status:`LoadingFirstPage`,loadMore:t=>this.loadMoreOfPaginatedQuery(e,t)};let r=[],i=!1,a=!1;for(let e of n){let t=this.client.localQueryResultByToken(e);if(t===void 0){i=!0,a=!1;continue}let n=cn(t);r=r.concat(n.page),a=!!n.isDone}let o;return o=i?r.length===0?`LoadingFirstPage`:`LoadingMore`:a?`Exhausted`:`CanLoadMore`,{results:r,status:o,loadMore:t=>this.loadMoreOfPaginatedQuery(e,t)}}onBaseTransition(e){let t=e.queries.map(e=>e.token),n=this.queriesContainingTokens(t),r=[];n.length>0&&(this.processPaginatedQuerySplits(n,e=>this.client.localQueryResultByToken(e)),r=n.map(e=>({token:e,modification:{kind:`Updated`,result:this.localQueryResultByToken(e)}})));let i={...e,paginatedQueries:r};this.onTransition(i)}loadMoreOfPaginatedQuery(e,t){this.mustGetPaginatedQuery(e);let n=this.queryTokenForLastPageOfPaginatedQuery(e),r=this.client.localQueryResultByToken(n);if(!r)return!1;let i=cn(r);if(i.isDone)return!1;this.addPageToPaginatedQuery(e,i.continueCursor,t);let a={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:e,modification:{kind:`Updated`,result:this.localQueryResultByToken(e)}}]};return this.onTransition(a),!0}queriesContainingTokens(e){if(e.length===0)return[];let t=[],n=new Set(e);for(let[e,r]of this.paginatedQuerySet)for(let i of this.allQueryTokens(r))if(n.has(i)){t.push(e);break}return t}processPaginatedQuerySplits(e,t){for(let n of e){let e=this.mustGetPaginatedQuery(n),{ongoingSplits:r,pageKeyToQuery:i,pageKeys:a}=e;for(let[n,[a,o]]of r)t(i.get(a).queryToken)!==void 0&&t(i.get(o).queryToken)!==void 0&&this.completePaginatedQuerySplit(e,n,a,o);for(let n of a){if(r.has(n))continue;let a=i.get(n).queryToken,o=t(a);if(!o)continue;let s=cn(o);s.splitCursor&&(s.pageStatus===`SplitRecommended`||s.pageStatus===`SplitRequired`||s.page.length>e.options.initialNumItems*2)&&this.splitPaginatedQueryPage(e,n,s.splitCursor,s.continueCursor)}}}splitPaginatedQueryPage(e,t,n,r){let i=e.nextPageKey++,a=e.nextPageKey++,o={cursor:r,numItems:e.options.initialNumItems,id:e.id},s=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...o,cursor:null,endCursor:n}});e.pageKeyToQuery.set(i,s);let c=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...o,cursor:n,endCursor:r}});e.pageKeyToQuery.set(a,c),e.ongoingSplits.set(t,[i,a])}addPageToPaginatedQuery(e,t,n){let r=this.mustGetPaginatedQuery(e),i=r.nextPageKey++,a={cursor:t,numItems:n,id:r.id},o={...r.args,paginationOpts:a},s=this.client.subscribe(r.canonicalizedUdfPath,o);return r.pageKeys.push(i),r.pageKeyToQuery.set(i,s),s}removePaginatedQuerySubscriber(e){let t=this.paginatedQuerySet.get(e);if(t&&(--t.numSubscribers,!(t.numSubscribers>0))){for(let e of t.pageKeyToQuery.values())e.unsubscribe();this.paginatedQuerySet.delete(e)}}completePaginatedQuerySplit(e,t,n,r){let i=e.pageKeyToQuery.get(t);e.pageKeyToQuery.delete(t);let a=e.pageKeys.indexOf(t);e.pageKeys.splice(a,1,n,r),e.ongoingSplits.delete(t),i.unsubscribe()}activePageQueryTokens(e){return e.pageKeys.map(t=>e.pageKeyToQuery.get(t).queryToken)}allQueryTokens(e){return Array.from(e.pageKeyToQuery.values()).map(e=>e.queryToken)}queryTokenForLastPageOfPaginatedQuery(e){let t=this.mustGetPaginatedQuery(e),n=t.pageKeys[t.pageKeys.length-1];if(n===void 0)throw Error(`No pages for paginated query ${e}`);return t.pageKeyToQuery.get(n).queryToken}mustGetPaginatedQuery(e){let t=this.paginatedQuerySet.get(e);if(!t)throw Error(`paginated query no longer exists for token `+e);return t}},pn=Object.defineProperty,mn=(e,t,n)=>t in e?pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hn=(e,t,n)=>mn(e,typeof t==`symbol`?t:t+``,n),gn=void 0,_n=class{constructor(e,t){if(hn(this,`address`),hn(this,`auth`),hn(this,`adminAuth`),hn(this,`encodedTsPromise`),hn(this,`debug`),hn(this,`fetchOptions`),hn(this,`fetch`),hn(this,`logger`),hn(this,`mutationQueue`,[]),hn(this,`isProcessingQueue`,!1),typeof t==`boolean`)throw Error("skipConvexDeploymentUrlCheck as the second argument is no longer supported. Please pass an options object, `{ skipConvexDeploymentUrlCheck: true }`.");(t??{}).skipConvexDeploymentUrlCheck!==!0&&M(e),this.logger=t?.logger===!1?Fe({verbose:!1}):t?.logger!==!0&&t?.logger?t.logger:Pe({verbose:!1}),this.address=e,this.debug=!0,this.auth=void 0,this.adminAuth=void 0,this.fetch=t?.fetch,t?.auth&&this.setAuth(t.auth)}backendUrl(){return`${this.address}/api`}get url(){return this.address}setAuth(e){this.clearAuth(),this.auth=e}setAdminAuth(e,t){if(this.clearAuth(),t!==void 0){let n=new TextEncoder().encode(JSON.stringify(t)),r=btoa(String.fromCodePoint(...n));this.adminAuth=`${e}:${r}`}else this.adminAuth=e}clearAuth(){this.auth=void 0,this.adminAuth=void 0}setDebug(e){this.debug=e}setFetchOptions(e){this.fetchOptions=e}async consistentQuery(e,...t){let n=j(t[0]),r=this.getTimestamp();return await this.queryInner(e,n,{timestampPromise:r})}async getTimestamp(){return this.encodedTsPromise?this.encodedTsPromise:this.encodedTsPromise=this.getTimestampInner()}async getTimestampInner(){let e=this.fetch||gn||fetch,t={"Content-Type":`application/json`,"Convex-Client":`npm-${De}`},n=await e(`${this.address}/api/query_ts`,{...this.fetchOptions,method:`POST`,headers:t});if(!n.ok)throw Error(await n.text());let{ts:r}=await n.json();return r}async query(e,...t){let n=j(t[0]);return await this.queryInner(e,n,{})}async queryInner(e,t,n){let r=nt(e),i=[ye(t)],a={"Content-Type":`application/json`,"Convex-Client":`npm-${De}`};this.adminAuth?a.Authorization=`Convex ${this.adminAuth}`:this.auth&&(a.Authorization=`Bearer ${this.auth}`);let o=this.fetch||gn||fetch,s=n.timestampPromise?await n.timestampPromise:void 0,c=JSON.stringify({path:r,format:`convex_encoded_json`,args:i,...s?{ts:s}:{}}),l=await o(s?`${this.address}/api/query_at_ts`:`${this.address}/api/query`,{...this.fetchOptions,body:c,method:`POST`,headers:a});if(!l.ok&&l.status!==560)throw Error(await l.text());let u=await l.json();if(this.debug)for(let e of u.logLines??[])Ie(this.logger,`info`,`query`,r,e);switch(u.status){case`success`:return pe(u.value);case`error`:throw u.errorData===void 0?Error(u.errorMessage):vn(u.errorData,new Ee(u.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(u)}`)}}async mutationInner(e,t){let n=nt(e),r=JSON.stringify({path:n,format:`convex_encoded_json`,args:[ye(t)]}),i={"Content-Type":`application/json`,"Convex-Client":`npm-${De}`};this.adminAuth?i.Authorization=`Convex ${this.adminAuth}`:this.auth&&(i.Authorization=`Bearer ${this.auth}`);let a=await(this.fetch||gn||fetch)(`${this.address}/api/mutation`,{...this.fetchOptions,body:r,method:`POST`,headers:i});if(!a.ok&&a.status!==560)throw Error(await a.text());let o=await a.json();if(this.debug)for(let e of o.logLines??[])Ie(this.logger,`info`,`mutation`,n,e);switch(o.status){case`success`:return pe(o.value);case`error`:throw o.errorData===void 0?Error(o.errorMessage):vn(o.errorData,new Ee(o.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(o)}`)}}async processMutationQueue(){if(!this.isProcessingQueue){for(this.isProcessingQueue=!0;this.mutationQueue.length>0;){let{mutation:e,args:t,resolve:n,reject:r}=this.mutationQueue.shift();try{n(await this.mutationInner(e,t))}catch(e){r(e)}}this.isProcessingQueue=!1}}enqueueMutation(e,t){return new Promise((n,r)=>{this.mutationQueue.push({mutation:e,args:t,resolve:n,reject:r}),this.processMutationQueue()})}async mutation(e,...t){let[n,r]=t,i=j(n);return r?.skipQueue?await this.mutationInner(e,i):await this.enqueueMutation(e,i)}async action(e,...t){let n=j(t[0]),r=nt(e),i=JSON.stringify({path:r,format:`convex_encoded_json`,args:[ye(n)]}),a={"Content-Type":`application/json`,"Convex-Client":`npm-${De}`};this.adminAuth?a.Authorization=`Convex ${this.adminAuth}`:this.auth&&(a.Authorization=`Bearer ${this.auth}`);let o=await(this.fetch||gn||fetch)(`${this.address}/api/action`,{...this.fetchOptions,body:i,method:`POST`,headers:a});if(!o.ok&&o.status!==560)throw Error(await o.text());let s=await o.json();if(this.debug)for(let e of s.logLines??[])Ie(this.logger,`info`,`action`,r,e);switch(s.status){case`success`:return pe(s.value);case`error`:throw s.errorData===void 0?Error(s.errorMessage):vn(s.errorData,new Ee(s.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(s)}`)}}async function(e,t,...n){let r=j(n[0]),i=typeof e==`string`?e:nt(e),a=JSON.stringify({componentPath:t,path:i,format:`convex_encoded_json`,args:ye(r)}),o={"Content-Type":`application/json`,"Convex-Client":`npm-${De}`};this.adminAuth?o.Authorization=`Convex ${this.adminAuth}`:this.auth&&(o.Authorization=`Bearer ${this.auth}`);let s=await(this.fetch||gn||fetch)(`${this.address}/api/function`,{...this.fetchOptions,body:a,method:`POST`,headers:o});if(!s.ok&&s.status!==560)throw Error(await s.text());let c=await s.json();if(this.debug)for(let e of c.logLines??[])Ie(this.logger,`info`,`any`,i,e);switch(c.status){case`success`:return pe(c.value);case`error`:throw c.errorData===void 0?Error(c.errorMessage):vn(c.errorData,new Ee(c.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(c)}`)}}};function vn(e,t){return t.data=pe(e),t}var I=u(f(),1);function yn({getCurrentValue:e,subscribe:t}){let[n,r]=(0,I.useState)(()=>({getCurrentValue:e,subscribe:t,value:e()})),i=n.value;return(n.getCurrentValue!==e||n.subscribe!==t)&&(i=e(),r({getCurrentValue:e,subscribe:t,value:i})),(0,I.useEffect)(()=>{let n=!1,i=()=>{n||r(n=>{if(n.getCurrentValue!==e||n.subscribe!==t)return n;let r=e();return n.value===r?n:{...n,value:r}})},a=t(i);return i(),()=>{n=!0,a()}},[e,t]),i}var bn=Object.defineProperty,xn=(e,t,n)=>t in e?bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sn=(e,t,n)=>xn(e,typeof t==`symbol`?t:t+``,n),Cn=5e3;if(I.default===void 0)throw Error(`Required dependency 'react' not found`);function wn(e,t,n){function r(r){return jn(r),t.mutation(e,r,{optimisticUpdate:n})}return r.withOptimisticUpdate=function(r){if(n!==void 0)throw Error(`Already specified optimistic update for mutation ${nt(e)}`);return wn(e,t,r)},r}function Tn(e,t){return function(n){return t.action(e,n)}}var En=class{constructor(e,t){if(Sn(this,`address`),Sn(this,`cachedSync`),Sn(this,`cachedPaginatedQueryClient`),Sn(this,`listeners`),Sn(this,`options`),Sn(this,`closed`,!1),Sn(this,`_logger`),Sn(this,`adminAuth`),Sn(this,`fakeUserIdentity`),e===void 0)throw Error(`No address provided to ConvexReactClient.
|
|
11
|
-
If trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/
|
|
12
|
-
If running locally, make sure to run \`convex dev\` and ensure the .env.local file is populated.`);if(typeof e!=`string`)throw Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof e} instead.`);if(!e.includes(`://`))throw Error(`Provided address was not an absolute URL.`);this.address=e,this.listeners=new Map,this._logger=t?.logger===!1?Fe({verbose:t?.verbose??!1}):t?.logger!==!0&&t?.logger?t.logger:Pe({verbose:t?.verbose??!1}),this.options={...t,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw Error(`ConvexReactClient has already been closed.`);return this.cachedSync?this.cachedSync:(this.cachedSync=new sn(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new fn(this.cachedSync,e=>this.handleTransition(e)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw Error(`Should already be instantiated`)}setAuth(e,t,n){if(typeof e==`string`)throw Error(`Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.`);this.sync.setAuth(e,t??(()=>{}),n)}clearAuth(){this.sync.clearAuth()}setAdminAuth(e,t){if(this.adminAuth=e,this.fakeUserIdentity=t,this.closed)throw Error(`ConvexReactClient has already been closed.`);this.cachedSync&&this.sync.setAdminAuth(e,t)}watchQuery(e,...t){let[n,r]=t,i=nt(e);return{onUpdate:e=>{let{queryToken:t,unsubscribe:a}=this.sync.subscribe(i,n,r),o=this.listeners.get(t);return o===void 0?this.listeners.set(t,new Set([e])):o.add(e),()=>{if(this.closed)return;let n=this.listeners.get(t);n.delete(e),n.size===0&&this.listeners.delete(t),a()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(i,n)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(i,n)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(i,n)}}}prewarmQuery(e){let t=e.extendSubscriptionFor??Cn,n=this.watchQuery(e.query,e.args||{}).onUpdate(()=>{});setTimeout(n,t)}watchPaginatedQuery(e,t,n){let r=nt(e);return{onUpdate:e=>{let{paginatedQueryToken:i,unsubscribe:a}=this.paginatedQueryClient.subscribe(r,t||{},n),o=this.listeners.get(i);return o===void 0?this.listeners.set(i,new Set([e])):o.add(e),()=>{if(this.closed)return;let t=this.listeners.get(i);t.delete(e),t.size===0&&this.listeners.delete(i),a()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(r,t,n)}}mutation(e,...t){let[n,r]=t,i=nt(e);return this.sync.mutation(i,n,r)}action(e,...t){let n=nt(e);return this.sync.action(n,...t)}query(e,...t){let n=this.watchQuery(e,...t),r=n.localQueryResult();return r===void 0?new Promise((e,t)=>{let r=n.onUpdate(()=>{r();try{e(n.localQueryResult())}catch(e){t(e)}})}):Promise.resolve(r)}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(e){return this.sync.subscribeToConnectionState(e)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&=void 0,this.cachedSync){let e=this.cachedSync;this.cachedSync=void 0,await e.close()}}handleTransition(e){let t=e.queries.map(e=>e.token),n=e.paginatedQueries.map(e=>e.token);this.transition([...t,...n])}transition(e){for(let t of e){let e=this.listeners.get(t);if(e)for(let t of e)t()}}},Dn=I.createContext(void 0);function On(){return(0,I.useContext)(Dn)}var kn=({client:e,children:t})=>I.createElement(Dn.Provider,{value:e},t);function L(e,...t){let n=t[0]===`skip`,r=t[0]===`skip`?{}:j(t[0]),i=typeof e==`string`?rt(e):e,a=nt(i),o=In((0,I.useMemo)(()=>n?{}:{query:{query:i,args:r}},[JSON.stringify(ye(r)),a,n])).query;if(o instanceof Error)throw o;return o}function R(e){let t=typeof e==`string`?rt(e):e,n=(0,I.useContext)(Dn);if(n===void 0)throw Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return(0,I.useMemo)(()=>wn(t,n),[n,nt(t)])}function An(e){let t=(0,I.useContext)(Dn),n=typeof e==`string`?rt(e):e;if(t===void 0)throw Error("Could not find Convex client! `useAction` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return(0,I.useMemo)(()=>Tn(n,t),[t,nt(n)])}function jn(e){if(typeof e==`object`&&e&&`bubbles`in e&&`persist`in e&&`isDefaultPrevented`in e)throw Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var Mn=Object.defineProperty,Nn=(e,t,n)=>t in e?Mn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pn=(e,t,n)=>Nn(e,typeof t==`symbol`?t:t+``,n),Fn=class{constructor(e){Pn(this,`createWatch`),Pn(this,`queries`),Pn(this,`listeners`),this.createWatch=e,this.queries={},this.listeners=new Set}setQueries(e){for(let t of Object.keys(e)){let{query:n,args:r,paginationOptions:i}=e[t];if(nt(n),this.queries[t]===void 0)this.addQuery(t,n,r,i?{paginationOptions:i}:{});else{let e=this.queries[t];(nt(n)!==nt(e.query)||JSON.stringify(ye(r))!==JSON.stringify(ye(e.args))||JSON.stringify(i)!==JSON.stringify(e.paginationOptions))&&(this.removeQuery(t),this.addQuery(t,n,r,i?{paginationOptions:i}:{}))}}for(let t of Object.keys(this.queries))e[t]===void 0&&this.removeQuery(t)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getLocalResults(e){let t={};for(let n of Object.keys(e)){let{query:r,args:i}=e[n],a=e[n].paginationOptions;nt(r);let o=this.createWatch(r,i,a?{paginationOptions:a}:{}),s;try{s=o.localQueryResult()}catch(e){if(e instanceof Error)s=e;else throw e}t[n]=s}return t}setCreateWatch(e){this.createWatch=e;for(let e of Object.keys(this.queries)){let{query:t,args:n,watch:r,paginationOptions:i}=this.queries[e],a=`journal`in r?r.journal():void 0;this.removeQuery(e),this.addQuery(e,t,n,{...a?{journal:a}:[],...i?{paginationOptions:i}:{}})}}destroy(){for(let e of Object.keys(this.queries))this.removeQuery(e);this.listeners=new Set}addQuery(e,t,n,{paginationOptions:r,journal:i}){if(this.queries[e]!==void 0)throw Error(`Tried to add a new query with identifier ${e} when it already exists.`);let a=this.createWatch(t,n,{...i?{journal:i}:[],...r?{paginationOptions:r}:{}}),o=a.onUpdate(()=>this.notifyListeners());this.queries[e]={query:t,args:n,watch:a,unsubscribe:o,...r?{paginationOptions:r}:{}}}removeQuery(e){let t=this.queries[e];if(t===void 0)throw Error(`No query found with identifier ${e}.`);t.unsubscribe(),delete this.queries[e]}notifyListeners(){for(let e of this.listeners)e()}};function In(e){let t=On();if(t===void 0)throw Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return Ln(e,(0,I.useMemo)(()=>(e,n,{journal:r,paginationOptions:i})=>i?t.watchPaginatedQuery(e,n,i):t.watchQuery(e,n,r?{journal:r}:{}),[t]))}function Ln(e,t){let[n]=(0,I.useState)(()=>new Fn(t));return n.createWatch!==t&&n.setCreateWatch(t),(0,I.useEffect)(()=>()=>n.destroy(),[n]),yn((0,I.useMemo)(()=>({getCurrentValue:()=>n.getLocalResults(e),subscribe:t=>(n.setQueries(e),n.subscribe(t))}),[n,e]))}var Rn=(0,I.createContext)(void 0);function zn(){let e=(0,I.useContext)(Rn);if(e===void 0)throw Error("Could not find `ConvexProviderWithAuth` (or `ConvexProviderWithClerk` or `ConvexProviderWithAuth0`) as an ancestor component. This component may be missing, or you might have two instances of the `convex/react` module loaded in your project.");return e}function Bn({children:e,client:t,useAuth:n}){let{isLoading:r,isAuthenticated:i,fetchAccessToken:a}=n(),[o,s]=(0,I.useState)(null),[c,l]=(0,I.useState)(!1);r&&o!==null&&(s(null),l(!1)),!r&&!i&&o!==!1&&(s(!1),l(!1));let u=i&&(o??!1);return I.createElement(Rn.Provider,{value:{isLoading:o===null,isAuthenticated:u,isRefreshing:c&&u}},I.createElement(Vn,{authProviderAuthenticated:i,fetchAccessToken:a,authProviderLoading:r,client:t,setIsConvexAuthenticated:s,setIsRefreshing:l}),I.createElement(kn,{client:t},e),I.createElement(Hn,{authProviderAuthenticated:i,fetchAccessToken:a,authProviderLoading:r,client:t,setIsConvexAuthenticated:s,setIsRefreshing:l}))}function Vn({authProviderAuthenticated:e,fetchAccessToken:t,authProviderLoading:n,client:r,setIsConvexAuthenticated:i,setIsRefreshing:a}){return(0,I.useEffect)(()=>{let n=!0;if(e)return r.setAuth(t,e=>{n&&i(()=>e)},e=>{n&&a(e)}),()=>{n=!1,i(e=>e?!1:null),a(!1)}},[e,t,n,r,i,a]),null}function Hn({authProviderAuthenticated:e,fetchAccessToken:t,authProviderLoading:n,client:r,setIsConvexAuthenticated:i,setIsRefreshing:a}){return(0,I.useEffect)(()=>{if(e)return()=>{r.clearAuth(),i(()=>null),a(!1)}},[e,t,n,r,i,a]),null}function Un({children:e}){let{isLoading:t,isAuthenticated:n}=zn();return t||!n?null:I.createElement(I.Fragment,null,e)}function Wn({children:e}){let{isLoading:t,isAuthenticated:n}=zn();return t||n?null:I.createElement(I.Fragment,null,e)}function Gn({children:e}){let{isLoading:t}=zn();return t?I.createElement(I.Fragment,null,e):null}var Kn=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})),qn=o(((e,t)=>{t.exports=Kn()})),Jn=u(v(),1),z=qn(),Yn=(0,I.createContext)(void 0),Xn=(0,I.createContext)(void 0);function Zn(){return(0,I.useContext)(Xn)}var Qn=(0,I.createContext)(null),$n=`__convexAuthOAuthVerifier`,er=`__convexAuthJWT`,tr=`__convexAuthRefreshToken`,nr=`__convexAuthServerStateFetchTime`;function rr({client:e,serverState:t,onChange:n,storage:r,storageNamespace:i,replaceURL:a,children:o}){let s=(0,I.useRef)(t?._state.token??null),[c,l]=(0,I.useState)(s.current===null),[u,d]=(0,I.useState)(s.current),f=e.verbose??!1,p=(0,I.useCallback)(e=>{f&&console.debug(`${new Date().toISOString()} ${e}`)},[f]),{storageSet:m,storageGet:h,storageRemove:g,storageKey:_}=ir(r,i),[v,y]=(0,I.useState)(!1),b=(0,I.useCallback)(async e=>{let t=s.current!==null,r;if(e.tokens===null)s.current=null,e.shouldStore&&(await g(er),await g(tr)),r=null;else{let{token:t}=e.tokens;if(s.current=t,e.shouldStore){let{refreshToken:n}=e.tokens;await m(er,t),await m(tr,n)}r=t}t!==(r!==null)&&await n?.(),d(r),l(!1)},[m,g]);(0,I.useEffect)(()=>{let e=async e=>{if(v)return e.preventDefault(),e.returnValue=!0,`Are you sure you want to leave? Your changes may not be saved.`};return dr(`beforeunload`,e),()=>{fr(`beforeunload`,e)}}),(0,I.useEffect)(()=>{let e=e=>{(async()=>{if(e.storageArea===r&&e.key===_(er)){let t=e.newValue;p(`synced access token, is null: ${t===null}`),await b({shouldStore:!1,tokens:t===null?null:{token:t}})}})()};return dr(`storage`,e),()=>fr(`storage`,e)},[b]);let x=(0,I.useCallback)(async t=>{let{tokens:n}=await e.unauthenticatedCall(`auth:signIn`,`code`in t?{params:{code:t.code},verifier:t.verifier}:t);return p(`retrieved tokens, is null: ${n===null}`),await b({shouldStore:!0,tokens:n??null}),n!==null},[e,b]),S=(0,I.useCallback)(async(t,n)=>{let r=n instanceof FormData?Array.from(n.entries()).reduce((e,[t,n])=>(e[t]=n,e),{}):n??{},i=await h($n)??void 0;await g($n);let a=await e.authenticatedCall(`auth:signIn`,{provider:t,params:r,verifier:i});if(a.redirect!==void 0){let e=new URL(a.redirect);return await m($n,a.verifier),window.location!==void 0&&(window.location.href=e.toString()),{signingIn:!1,redirect:e}}else if(a.tokens!==void 0){let{tokens:e}=a;return p(`signed in and got tokens, is null: ${e===null}`),await b({shouldStore:!0,tokens:e}),{signingIn:a.tokens!==null}}return{signingIn:!1}},[e,b,h]),C=(0,I.useCallback)(async()=>{try{await e.authenticatedCall(`auth:signOut`)}catch{}p(`signed out, erasing tokens`),await b({shouldStore:!0,tokens:null})},[b,e]),w=(0,I.useCallback)(async({forceRefreshToken:e})=>{if(e){let e=s.current;return await or(tr,async()=>{let t=s.current;if(t!==e)return p(`returning synced token, is null: ${t===null}`),t;let n=await h(tr)??null;return n===null?(y(!1),p(`returning null, there is no refresh token`),null):(y(!0),await x({refreshToken:n}).finally(()=>{y(!1)}),p(`returning retrieved token, is null: ${t===null}`),s.current)})}return s.current},[x,C,h]),T=(0,I.useRef)(!1);(0,I.useEffect)(()=>{if(r===void 0)throw Error("`localStorage` is not available in this environment, set the `storage` prop on `ConvexAuthProvider`!");let e=async()=>{let e=await h(er)??null;p(`retrieved token from storage, is null: ${e===null}`),await b({shouldStore:!1,tokens:e===null?null:{token:e}})};if(t!==void 0){let n=h(nr),r=n=>{if(!n||t._timeFetched>+n){let{token:e,refreshToken:n}=t._state,r=e===null||n===null?null:{token:e,refreshToken:n};m(nr,t._timeFetched.toString()),b({tokens:r,shouldStore:!0})}else e()};n instanceof Promise?n.then(r):r(n);return}let n=window?.location===void 0?null:new URLSearchParams(window.location.search).get(`code`);if(T.current||n){if(n&&!T.current){T.current=!0;let e=new URL(window.location.href);e.searchParams.delete(`code`),(async()=>{await a(e.pathname+e.search+e.hash),await S(void 0,{code:n}),T.current=!1})()}}else e()},[e,h]);let E=(0,I.useMemo)(()=>({signIn:S,signOut:C}),[S,C]),D=u!==null,O=(0,I.useMemo)(()=>({isLoading:c,isAuthenticated:D,fetchAccessToken:w}),[w,c,D]);return(0,z.jsx)(Xn.Provider,{value:O,children:(0,z.jsx)(Yn.Provider,{value:E,children:(0,z.jsx)(Qn.Provider,{value:u,children:o})})})}function ir(e,t){let n=ar(),r=(0,I.useMemo)(()=>e??n(),[e]),i=t.replace(/[^a-zA-Z0-9]/g,``),a=(0,I.useCallback)(e=>`${e}_${i}`,[t]);return{storageSet:(0,I.useCallback)((e,t)=>r.setItem(a(e),t),[r,a]),storageGet:(0,I.useCallback)(e=>r.getItem(a(e)),[r,a]),storageRemove:(0,I.useCallback)(e=>r.removeItem(a(e)),[r,a]),storageKey:a}}function ar(){let[e,t]=(0,I.useState)({});return()=>({getItem:t=>e[t],setItem:(e,n)=>{t(t=>({...t,[e]:n}))},removeItem:e=>{t(t=>{let{[e]:n,...r}=t;return r})}})}async function or(e,t){let n=window?.navigator?.locks;return n===void 0?await ur(e,t):await n.request(e,t)}function sr(e){globalThis.__convexAuthMutexes===void 0&&(globalThis.__convexAuthMutexes={});let t=globalThis.__convexAuthMutexes[e];return t===void 0&&(globalThis.__convexAuthMutexes[e]={currentlyRunning:null,waiting:[]}),t=globalThis.__convexAuthMutexes[e],t}function cr(e,t){globalThis.__convexAuthMutexes[e]=t}async function lr(e,t){let n=sr(e);n.currentlyRunning===null?cr(e,{currentlyRunning:t().finally(()=>{let t=sr(e).waiting.shift();sr(e).currentlyRunning=null,cr(e,{...sr(e),currentlyRunning:t===void 0?null:lr(e,t)})}),waiting:[]}):cr(e,{...n,waiting:[...n.waiting,t]})}async function ur(e,t){return new Promise((n,r)=>{lr(e,()=>t().then(e=>n(e)).catch(e=>r(e)))})}function dr(e,t,n){window.addEventListener?.(e,t,n)}function fr(e,t,n){window.removeEventListener?.(e,t,n)}function pr(){return(0,I.useContext)(Yn)}function mr(e){let{client:t,storage:n,storageNamespace:r,replaceURL:i,children:a}=e;return(0,z.jsx)(rr,{client:(0,I.useMemo)(()=>({authenticatedCall(e,n){return t.action(e,n)},unauthenticatedCall(e,n){return new _n(t.address).action(e,n)},verbose:t.options?.verbose}),[t]),storage:n??(typeof window>`u`?void 0:window?.localStorage),storageNamespace:r??t.address,replaceURL:i??(e=>{window.history.replaceState({},``,e)}),children:(0,z.jsx)(Bn,{client:t,useAuth:Zn,children:a})})}var hr=typeof window<`u`?I.useLayoutEffect:I.useEffect;function gr(e){let t=I.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function _r(e,t,n={},r={}){I.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function vr(e){let t=I.useRef(null);return I.useImperativeHandle(e,()=>t.current,[]),t}function yr(e){return e[e.length-1]}function br(e){return typeof e==`function`}function xr(e,t){return br(e)?e(t):e}var Sr=Object.prototype.hasOwnProperty,Cr=Object.prototype.propertyIsEnumerable;function wr(e){for(let t in e)if(Sr.call(e,t))return!0;return!1}var Tr=()=>Object.create(null),Er=(e,t)=>Dr(e,t,Tr);function Dr(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=jr(e)&&jr(i);if(!a&&!(kr(e)&&kr(i)))return i;let o=a?e:Or(e);if(!o)return i;let s=a?i:Or(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:Sr.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=Dr(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function Or(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!Cr.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!Cr.call(e,t))return!1;r.push(t)}return r}function kr(e){if(!Ar(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ar(n)||!n.hasOwnProperty(`isPrototypeOf`))}function Ar(e){return Object.prototype.toString.call(e)===`[object Object]`}function jr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Mr(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Mr(e[r],t[r],n))return!1;return!0}if(kr(e)&&kr(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!Mr(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Mr(e[o],t[o],n)))return!1;return i===a}return!1}function Nr(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function Pr(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Fr(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function Ir(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Fr(t)}var Lr=[`http:`,`https:`,`mailto:`,`tel:`];function Rr(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function zr(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Ir(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Ir(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Br(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Vr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Hr(){throw Error(`Invariant failed`)}function Ur(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Wr=4,Gr=5;function Kr(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function qr(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=Kr(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Jr(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=qr(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=Zr(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=Zr(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Qr(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Qr(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Qr(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Zr(n.fullPath??n.from);e.kind=Gr,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=Zr(n.fullPath??n.from);e.kind=Wr,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Jr(e,t,r,s,i,a,o)}function Yr(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Xr(e){if(e.pathless)for(let t of e.pathless)Xr(t);if(e.static)for(let t of e.static.values())Xr(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Xr(t);if(e.dynamic?.length){e.dynamic.sort(Yr);for(let t of e.dynamic)Xr(t)}if(e.optional?.length){e.optional.sort(Yr);for(let t of e.optional)Xr(t)}if(e.wildcard?.length){e.wildcard.sort(Yr);for(let t of e.wildcard)Xr(t)}}function Zr(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function Qr(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function $r(e,t){let n=Zr(`/`),r=new Uint16Array(6);for(let t of e)Jr(!1,r,t,1,n,0);Xr(n),t.masksTree=n,t.flatCache=Ur(1e3)}function ei(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=ai(e,t.masksTree);return t.flatCache.set(e,r),r}function ti(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Zr(`/`),Jr(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),ai(r,o,n)}function ni(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=ai(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=si(a.route)),t.matchCache.set(r,a),a}function ri(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function ii(e,t=!1,n){let r=Zr(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Jr(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&Hr(),a[e.id]=e,s!==0&&e.path){let t=ri(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Xr(r),{processedTree:{segmentTree:r,singleCache:Ur(1e3),matchCache:Ur(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function ai(e,t,n=!1){let r=e.split(`/`),i=li(e,r,t,n);if(!i)return null;let[a]=oi(e,r,i);return{route:i.node.route,rawParams:a}}function oi(e,t,n){let r=ci(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Wr)break;if(u.kind===Gr){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function si(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ci(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function li(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!yr(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!pi(l,n))continue;if(i.parse){if(!fi(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==Wr&&pi(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===Wr||i.kind===2)&&pi(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(fi(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&di(p,o))return n;pi(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+ui(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+ui(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+ui(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+ui(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function ui(e,t){return 2**(e-t-1)}function di(e,t){return e===2**(t-1)-1}function fi(e,t,n){let r,i;try{[r,i]=oi(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function pi(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Wr)>(e.node.kind===Wr)||t.node.kind===Wr==(e.node.kind===Wr)&&t.depth>e.depth))):!0}function mi(e){return hi(e.filter(e=>e!==void 0).join(`/`))}function hi(e){return e.replace(/\/{2,}/g,`/`)}function gi(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function _i(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function vi(e){return _i(gi(e))}function yi(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function bi(e,t,n){return yi(e,n)===yi(t,n)}function xi({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&yr(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(yr(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=hi(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Si(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Ci(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ti(e,n)).join(`/`):Ti(r,n):r}function wi({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=qr(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Ci(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ci(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ci(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ti(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Ei(e){return e?.isNotFound===!0}function Di(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Oi(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function ki(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Oi(r):Array.isArray(t)?t.push(Oi(r)):n[e]=[t,Oi(r)]}return n}var Ai=Mi(JSON.parse),ji=Ni(JSON.stringify,JSON.parse);function Mi(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=ki(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ni(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Di(e,r);return t?`?${t}`:``}}var Pi=`__root__`;function Fi(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Ii(e){return e instanceof Response&&!!e.options}var Li=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ri=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),zi=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Bi=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Vi=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Hi=(e,t,n)=>{if(!(!Ii(n)&&!Ei(n)))throw Ii(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Ii(n)?`redirected`:Ei(n)?`notFound`:r.status===`pending`?`success`:r.status,context:Bi(e,t.index),isFetching:!1,error:n})),Ei(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Ii(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Ui=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Wi=(e,t,n)=>{let r=Bi(e,n);e.updateMatch(t,e=>({...e,context:r}))},Gi=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,Hi(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,Hi(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Ii(n)&&!Ei(n)&&(e.serialError??=n)},Ki=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!zi(e,t)&&(n.options.loader||n.options.beforeLoad||ra(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Li(e)},i);r._nonReactive.pendingTimeout=t}},qi=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Ki(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Hi(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Ji=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Nr(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Gi(e,n,o),s&&Gi(e,n,s),Ki(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=Nr();let f={...Bi(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=zi(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Ii(r)||Ei(r))&&(u(),Gi(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),Pr(y))return u(),y.catch(t=>{Gi(e,n,t)}).then(v)}catch(t){u(),Gi(e,n,t)}v(y)},Yi=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Ji(e,n,t,i),s=()=>{if(Ui(e,n))return;let t=qi(e,n,i);return Pr(t)?t.then(o):o()};return a()},Xi=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Zi=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Bi(e,r),d=zi(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Qi=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{na(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Zi(e,t,n,r,i)),l=!!s&&Pr(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Hi(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Bi(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Bi(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,Ei(t)&&await i.options.notFoundComponent?.preload?.(),Hi(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Hi(e,e.router.getMatch(n),t)}!Ii(o)&&!Ei(o)&&await na(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Bi(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Hi(e,r,t)}},$i=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Zi(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Qi(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){Ii(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Qi(e,t,i,n,d):Wi(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Ui(e,i)){if(!e.router.getMatch(i))return e.matches[n];Wi(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=zi(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Hi(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=Nr(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function ea(e){let t=e,n=[];Ri(t.router)&&Li(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Yi(t,e);Pr(n)&&await n}catch(e){if(Ii(e))throw e;if(Ei(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Vi(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push($i(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(Ii(e))throw e;Ei(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Vi(t,l);e===void 0&&Hr();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await na(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await na(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Xi(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Li(t);if(Pr(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function ta(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function na(e,t=ia){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===ia?(()=>{if(e._componentsPromise===void 0){let t=ta(e,ia);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():ta(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function ra(e){for(let t of ia)if(e.options[t]?.preload)return!0;return!1}var ia=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function aa(e){return{input:({url:t})=>{for(let n of e)t=sa(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ca(e[n],t);return t}}}function oa(e){let t=vi(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=mi([`/`,t,e.pathname]),e)}}function sa(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ca(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function la(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>ua(o,_.get())),x=r(()=>ua(s,v.get())),S=r(()=>ua(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=Ur(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:j,setCached:M};A(e.matches),a?.(k);function A(e){da(e,o,_,n,i)}function j(e){da(e,s,v,n,i)}function M(e){da(e,c,y,n,i)}return k}function ua(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function da(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}Vr(n.get(),a)||n.set(a)})}var fa=`__TSR_index`,pa=`popstate`,ma=`beforeunload`;function ha(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=ya(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[fa];i=ga(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[fa];i=ga(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[fa]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function ga(e,t){t||={};let n=ba();return{...t,key:n,__TSR_key:n,[fa]:e}}function _a(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>ya(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=ba();t.history.replaceState({[fa]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=ya(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[fa]-l.state[fa],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=ha({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(ma,S,{capture:!0}),t.removeEventListener(pa,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(ma,S,{capture:!0}),t.addEventListener(pa,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function va(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function ya(e,t){let n=va(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=ba();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[fa]:0,key:a,__TSR_key:a}}}function ba(){return(Math.random()+1).toString(36).substring(7)}function xa(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Sa=new WeakMap,Ca=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Si(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=_a()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Ur(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=la(Ea(this.latestLocation),e),Ka(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=vi(o);t&&t!==`/`&&e.push(oa({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:aa(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ii(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&$r(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:zr(e).path,external:!1,searchStr:o,search:Er(t?.search,i),hash:zr(r.slice(1)).path,state:Dr(t?.state,a)}}let o=new URL(i,this.origin),s=sa(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:zr(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:Er(t?.search,c),hash:zr(s.hash.slice(1)).path,state:Dr(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>xi({base:e,to:t.includes(`//`)?hi(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Oa({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,xr(t.params,s)),d=this.routesByPath[_i(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&wr(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:zr(wi({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Da(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=ka({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=Er(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?xr(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?xr(t.state,n.state):{};v=Dr(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=ca(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=Br(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=ei(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,xr(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=Mr(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=_i(this.latestLocation.href)===_i(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=Nr(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=ya(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=sa(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(Rr(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?Sa.set(this.latestLocation,t):Sa.delete(this.latestLocation);let n=this.latestLocation,r=xa(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await ea({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){Ii(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Ei(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(xa(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&Rr(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=na,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await ea({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(Ii(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});Ei(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=ti(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!Mr(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?Mr(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??ji,parseSearch:e.parseSearch??Ai,protocolAllowlist:e.protocolAllowlist??Lr}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=si(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:_i(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?ja(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Da(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof wa||(r=new wa(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=wi({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,x;if(!v)try{Ma(r,b)}catch(e){if(x=Ei(e)||Ii(e)?e:new Ta(e.message,{cause:e}),t?.throwOnError)throw x}Object.assign(i,b);let S=y?`stay`:`enter`,C;if(v)C={...v,cause:S,params:y?.params??i,_strictParams:b,search:Er(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||ra(r)?`pending`:`success`;C={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?Er(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:Nr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?Dr(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(C.globalNotFound=s===r.id),C.searchError=f;let w=this.getParentContext(o);C.context={...w,...C.__routeContext,...C.__beforeLoadContext},c[n]=C}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?Er(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=yr(t),i={...e.search};for(let e of t)try{Object.assign(i,Da(e.options.validateSearch,i))}catch{}let a=yr(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{Ma(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},wa=class extends Error{},Ta=class extends Error{};function Ea(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Da(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new wa(`Async validation not supported`);if(n.issues)throw new wa(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Oa({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=_i(e),a,o=ni(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function ka({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Aa(n)(e,t,r??!1)}function Aa(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=Da(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=xr(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function ja(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Pi}function Ma(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}function Na(){try{return sessionStorage}catch{return}}var Pa=`tsr-scroll-restoration-v1_3`,Fa=Na();function Ia(){try{return JSON.parse(Fa?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function La(){try{Fa?.setItem(Pa,JSON.stringify(Ra))}catch{}}var Ra=Ia(),za=`data-scroll-restoration-id`,Ba=e=>e.state.__TSR_key||e.href;function Va(e){let t=e.getAttribute(za);if(t)return`[${za}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Ha=!1,Ua=`window`;function Wa(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ga(e){let t=[];for(let n of e){if(n===Ua)continue;let e=Wa(n);e&&t.push(e)}return t}function Ka(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Ba,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(Ha||!r.restoring))if(e.target===document)o(Ua,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=Ra[e]||={};for(let[e,n]of a)e===Ua?t[Ua]=n:e.isConnected&&(t[Va(e)]=n)};n&&!r.restoration&&(r.restoration=!0,Ha=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),La()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=Ra[u];if(e){let t=Ra[l];for(let n in e){if(n===Ua){if(s)continue}else{let e=Wa(n);if(!e||s&&o&&(c??=Ga(o),c.includes(e)))continue}t||=Ra[l]={},t[n]??=e[n]}}}Ha=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=Sa.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?Ra[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===Ua){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=Wa(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=Ga(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Ha=!1}}))}var qa=`Error preloading route! ☝️`,Ja=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Pi:this.parentRoute||Hr();let r=n?Pi:t?.path;r&&r!==`/`&&(r=gi(r));let i=t?.id||r,a=n?Pi:mi([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=mi([`/`,a]));let o=a===`__root__`?`/`:mi([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=_i(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Fi({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Ya=class extends Ja{constructor(e){super(e)}};function Xa(e){let t=e.errorComponent??Qa;return(0,z.jsx)(Za,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?I.createElement(t,{error:n,reset:r}):e.children})}var Za=class extends I.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Qa({error:e}){let[t,n]=I.useState(!1);return(0,z.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,z.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,z.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,z.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,z.jsx)(`div`,{children:(0,z.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,z.jsx)(`code`,{children:e.message}):null})}):null]})}function $a({children:e,fallback:t=null}){return eo()?(0,z.jsx)(I.Fragment,{children:e}):(0,z.jsx)(I.Fragment,{children:t})}function eo(){return I.useSyncExternalStore(to,()=>!0,()=>!1)}function to(){return()=>{}}var no=I.createContext(null);function ro(e){return I.useContext(no)}var io=I.createContext(void 0),ao=I.createContext(void 0),oo=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(oo||{});function so({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function co(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var lo=[],uo=0,{link:fo,unlink:po,propagate:mo,checkDirty:ho,shallowPropagate:go}=so({update(e){return e._update()},notify(e){lo[vo++]=e,e.flags&=~oo.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=oo.Mutable|oo.Dirty,So(e))}}),_o=0,vo=0,yo,bo=0;function xo(e){try{++bo,e()}finally{--bo||Co()}}function So(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=po(n,e)}function Co(){if(!(bo>0)){for(;_o<vo;){let e=lo[_o];lo[_o++]=void 0,e.notify()}_o=0,vo=0}}function wo(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?oo.None:oo.Mutable,get(){return yo!==void 0&&fo(i,yo,uo),i._snapshot},subscribe(e){let t=co(e),n={current:!1},r=To(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=yo,o=t?.compare??Object.is;if(n)yo=i,++uo,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=oo.Mutable|oo.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{yo=a,n&&(i.flags&=~oo.RecursedCheck),So(i)}}};return n?(i.flags=oo.Mutable|oo.Dirty,i.get=function(){let e=i.flags;if(e&oo.Dirty||e&oo.Pending&&ho(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&go(e)}}else e&oo.Pending&&(i.flags=e&~oo.Pending);return yo!==void 0&&fo(i,yo,uo),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(mo(e),go(e),Co())}},i}function To(e){let t=()=>{let t=yo;yo=n,++uo,n.depsTail=void 0,n.flags=oo.Watching|oo.RecursedCheck;try{return e()}finally{yo=t,n.flags&=~oo.RecursedCheck,So(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:oo.Watching|oo.RecursedCheck,notify(){let e=this.flags;e&oo.Dirty||e&oo.Pending&&ho(this.deps,this)?t():this.flags=oo.Watching},stop(){this.flags=oo.None,this.depsTail=void 0,So(this)}};return t(),n}var Eo=o((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Do=o(((e,t)=>{t.exports=Eo()})),Oo=o((e=>{var t=f(),n=Do();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ko=o(((e,t)=>{t.exports=Oo()}))();function Ao(e,t){return e===t}function jo(e,t,n=Ao){let r=(0,I.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,I.useCallback)(()=>e?.get(),[e]);return(0,ko.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Mo={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function No(e){let t=ro(),n=I.useContext(e.from?ao:io),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=I.useRef(void 0);return jo(i??Mo,n=>{if((e.shouldThrow??!0)&&!n&&Hr(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=Dr(a.current,r);return a.current=e,e}return r})}function Po(e){return No({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Fo(e){let{select:t,...n}=e;return No({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Io(e){return No({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Lo(e){return No({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ro(e){let t=ro();return I.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function zo(e){return No({...e,select:t=>e.select?e.select(t.context):t.context})}var Bo=u(g(),1);function Vo(e,t){let n=ro(),r=vr(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:k,hash:A,state:j,mask:M,reloadDocument:N,unsafeRelative:ee,from:te,_fromLocation:P,...F}=e,ne=eo(),re=I.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ie=jo(n.stores.location,e=>e,(e,t)=>e.href===t.href),ae=I.useMemo(()=>{let e={_fromLocation:ie,...re};return n.buildLocation(e)},[n,ie,re]),oe=ae.maskedLocation?ae.maskedLocation.publicHref:ae.publicHref,se=ae.maskedLocation?ae.maskedLocation.external:ae.external,ce=I.useMemo(()=>Xo(oe,se,n.history,v),[v,se,oe,n.history]),le=I.useMemo(()=>{if(ce?.external)return Rr(ce.href,n.protocolAllowlist)?void 0:ce.href;if(!Zo(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),Rr(s,n.protocolAllowlist)?void 0:s}catch{}},[s,ce,n.protocolAllowlist]),ue=I.useMemo(()=>{if(le)return!1;if(o?.exact){if(!bi(ie.pathname,ae.pathname,n.basepath))return!1}else{let e=yi(ie.pathname,n.basepath),t=yi(ae.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!Mr(ie.search,ae.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ne&&ie.hash===ae.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,ie,le,ne,ae.hash,ae.pathname,ae.search,n.basepath]),de=ue?xr(i,{})??Uo:Ho,fe=ue?Ho:xr(a,{})??Ho,pe=[b,de.className,fe.className].filter(Boolean).join(` `),me=(y||de.style||fe.style)&&{...y,...de.style,...fe.style},[he,ge]=I.useState(!1),_e=I.useRef(!1),ve=e.reloadDocument||le?!1:c??n.options.defaultPreload,ye=l??n.options.defaultPreloadDelay??0,be=I.useCallback(()=>{n.preloadRoute({...re,_builtLocation:ae}).catch(e=>{console.warn(e),console.warn(qa)})},[n,re,ae]);_r(r,I.useCallback(e=>{e?.isIntersecting&&be()},[be]),Jo,{disabled:!!v||ve!==`viewport`}),I.useEffect(()=>{_e.current||!v&&ve===`render`&&(be(),_e.current=!0)},[v,be,ve]);let xe=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!$o(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Bo.flushSync)(()=>{ge(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ge(!1)});n.navigate({...re,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(le)return{...F,ref:r,href:le,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let Se=e=>{if(v||ve!==`intent`)return;if(!ye){be();return}let t=e.currentTarget;if(qo.has(t))return;let n=setTimeout(()=>{qo.delete(t),be()},ye);qo.set(t,n)},Ce=e=>{v||ve!==`intent`||be()},we=e=>{if(v||!ve||!ye)return;let t=e.currentTarget,n=qo.get(t);n&&(clearTimeout(n),qo.delete(t))};return{...F,...de,...fe,href:ce?.href,ref:r,onClick:Yo([x,xe]),onBlur:Yo([S,we]),onFocus:Yo([C,Se]),onMouseEnter:Yo([w,Se]),onMouseLeave:Yo([T,we]),onTouchStart:Yo([E,Ce]),disabled:!!v,target:_,...me&&{style:me},...pe&&{className:pe},...v&&Wo,...ue&&Go,...ne&&he&&Ko}}var Ho={},Uo={className:`active`},Wo={role:`link`,"aria-disabled":!0},Go={"data-status":`active`,"aria-current":`page`},Ko={"data-transitioning":`transitioning`},qo=new WeakMap,Jo={rootMargin:`100px`},Yo=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Xo(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Zo(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Qo=I.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Vo(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return I.createElement(`a`,t,o)}return I.createElement(n,a,o)});function $o(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var es=class extends Ja{constructor(e){super(e),this.useMatch=e=>No({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>zo({...e,from:this.id}),this.useSearch=e=>Lo({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Io({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Fo({...e,from:this.id}),this.useLoaderData=e=>Po({...e,from:this.id}),this.useNavigate=()=>Ro({from:this.fullPath}),this.Link=I.forwardRef((e,t)=>(0,z.jsx)(Qo,{ref:t,from:this.fullPath,...e}))}};function ts(e){return new es(e)}var ns=class extends Ya{constructor(e){super(e),this.useMatch=e=>No({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>zo({...e,from:this.id}),this.useSearch=e=>Lo({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Io({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Fo({...e,from:this.id}),this.useLoaderData=e=>Po({...e,from:this.id}),this.useNavigate=()=>Ro({from:this.fullPath}),this.Link=I.forwardRef((e,t)=>(0,z.jsx)(Qo,{ref:t,from:this.fullPath,...e}))}};function rs(e){return new ns(e)}function is(e){let t=ro(),n=`not-found-${jo(t.stores.location,e=>e.pathname)}-${jo(t.stores.status,e=>e)}`;return(0,z.jsx)(Xa,{getResetKey:()=>n,onCatch:(t,n)=>{if(Ei(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Ei(t))return e.fallback?.(t);throw t},children:e.children})}function as(){return(0,z.jsx)(`p`,{children:`Not Found`})}function os(e){return(0,z.jsx)(z.Fragment,{children:e.children})}function ss(e,t,n){return t.options.notFoundComponent?(0,z.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,z.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,z.jsx)(as,{})}var cs=I.memo(function({matchId:e}){let t=ro(),n=t.stores.matchStores.get(e);n||Hr();let r=jo(t.stores.loadedAt,e=>e),i=jo(n,e=>e);return(0,z.jsx)(ls,{router:t,matchId:e,resetKey:r,matchState:I.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function ls({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,z.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?I.Suspense:os,f=s?Xa:os,p=l?is:os;return(0,z.jsxs)(i.isRoot?i.options.shellComponent??os:os,{children:[(0,z.jsx)(io.Provider,{value:t,children:(0,z.jsx)(d,{fallback:o,children:(0,z.jsx)(f,{getResetKey:()=>n,errorComponent:s||Qa,onCatch:(e,t)=>{if(Ei(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,z.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return I.createElement(l,e)},children:u||r._displayPending?(0,z.jsx)($a,{fallback:o,children:(0,z.jsx)(ds,{matchId:t})}):(0,z.jsx)(ds,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(us,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function us({resetKey:e}){let t=ro(),n=I.useRef(void 0);return hr(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...xa(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var ds=I.memo(function({matchId:e}){let t=ro(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||Hr();let i=jo(r,e=>e),a=i.routeId,o=t.routesById[a],s=I.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=I.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,z.jsx)(e,{},s):(0,z.jsx)(fs,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=Nr();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return Ei(i.error)||Hr(),ss(t,o,i.error);if(i.status===`redirected`)throw Ii(i.error)||Hr(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),fs=I.memo(function(){let e=ro(),t=I.useContext(io),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=jo(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=jo(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,z.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||Hr(),ss(e,a,void 0);if(!i)return null;let s=(0,z.jsx)(cs,{matchId:i});return n===`__root__`?(0,z.jsx)(I.Suspense,{fallback:o,children:s}):s});function ps(){let e=ro(),t=I.useRef({router:e,mounted:!1}),[n,r]=I.useState(!1),i=jo(e.stores.isLoading,e=>e),a=jo(e.stores.hasPending,e=>e),o=gr(i),s=i||n||a,c=gr(s),l=i||a,u=gr(l);return e.startTransition=e=>{r(!0),I.startTransition(()=>{e(),r(!1)})},I.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return _i(e.latestLocation.publicHref)!==_i(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),hr(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),hr(()=>{o&&!i&&e.emit({type:`onLoad`,...xa(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),hr(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...xa(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),hr(()=>{if(c&&!s){let t=xa(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),xo(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function ms(){let e=ro(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,z.jsx)(t,{}):null,r=(0,z.jsxs)(typeof document<`u`&&e.ssr?os:I.Suspense,{fallback:n,children:[(0,z.jsx)(ps,{}),(0,z.jsx)(hs,{})]});return e.options.InnerWrap?(0,z.jsx)(e.options.InnerWrap,{children:r}):r}function hs(){let e=ro(),t=jo(e.stores.firstId,e=>e),n=jo(e.stores.loadedAt,e=>e),r=t?(0,z.jsx)(cs,{matchId:t}):null;return(0,z.jsx)(io.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,z.jsx)(Xa,{getResetKey:()=>n,errorComponent:Qa,onCatch:void 0,children:r})})}function gs(){let e=ro();return jo(e.stores.matchRouteDeps,e=>e),I.useCallback(t=>{let{pending:n,caseSensitive:r,fuzzy:i,includeSearch:a,...o}=t;return e.matchRoute(o,{pending:n,caseSensitive:r,fuzzy:i,includeSearch:a})},[e])}var _s=e=>({createMutableStore:wo,createReadonlyStore:wo,batch:xo}),vs=e=>new ys(e),ys=class extends Ca{constructor(e){super(e,_s)}};function bs({router:e,children:t,...n}){wr(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,z.jsx)(no.Provider,{value:e,children:t});return e.options.Wrap?(0,z.jsx)(e.options.Wrap,{children:r}):r}function xs({router:e,...t}){return(0,z.jsx)(bs,{router:e,...t,children:(0,z.jsx)(ms,{})})}function Ss(e){let t=ro(),n=(0,I.useRef)(void 0);return jo(t.stores.location,r=>{let i=e?.select?e.select(r):r;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=Dr(n.current,i);return n.current=e,e}return i})}var Cs;function B(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var ws=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ts=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Cs=globalThis).__zod_globalConfig??(Cs.__zod_globalConfig={});var Es=globalThis.__zod_globalConfig;function Ds(e){return e&&Object.assign(Es,e),Es}function Os(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ks(e,t){return typeof t==`bigint`?t.toString():t}function As(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function js(e){return e==null}function Ms(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ns(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Ps=Symbol(`evaluating`);function Fs(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ps)return r===void 0&&(r=Ps,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Is(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ls(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Rs(e){return JSON.stringify(e)}function zs(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Bs=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Vs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Hs=As(()=>{if(Es.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Us(e){if(Vs(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Vs(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Ws(e){return Us(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Gs=new Set([`string`,`number`,`symbol`]);function Ks(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function qs(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function V(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Js(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Ys={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Xs(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return qs(e,Ls(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Is(this,`shape`,e),e},checks:[]}))}function Zs(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return qs(e,Ls(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Is(this,`shape`,r),r},checks:[]}))}function Qs(e,t){if(!Us(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return qs(e,Ls(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Is(this,`shape`,n),n}}))}function $s(e,t){if(!Us(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return qs(e,Ls(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Is(this,`shape`,n),n}}))}function ec(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return qs(e,Ls(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Is(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function tc(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return qs(t,Ls(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Is(this,`shape`,i),i},checks:[]}))}function nc(e,t,n){return qs(t,Ls(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Is(this,`shape`,i),i}}))}function rc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ic(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ac(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function oc(e){return typeof e==`string`?e:e?.message}function sc(e,t,n){let r=e.message?e.message:oc(e.inst?._zod.def?.error?.(e))??oc(t?.error?.(e))??oc(n.customError?.(e))??oc(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function cc(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function lc(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var uc=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ks,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},dc=B(`$ZodError`,uc),fc=B(`$ZodError`,uc,{Parent:Error});function pc(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function mc(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var hc=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new ws;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>sc(e,a,Ds())));throw Bs(t,i?.callee),t}return o.value},gc=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>sc(e,a,Ds())));throw Bs(t,i?.callee),t}return o.value},_c=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ws;return a.issues.length?{success:!1,error:new(e??dc)(a.issues.map(e=>sc(e,i,Ds())))}:{success:!0,data:a.value}},vc=_c(fc),yc=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>sc(e,i,Ds())))}:{success:!0,data:a.value}},bc=yc(fc),xc=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return hc(e)(t,n,i)},Sc=e=>(t,n,r)=>hc(e)(t,n,r),Cc=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return gc(e)(t,n,i)},wc=e=>async(t,n,r)=>gc(e)(t,n,r),Tc=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _c(e)(t,n,i)},Ec=e=>(t,n,r)=>_c(e)(t,n,r),Dc=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return yc(e)(t,n,i)},Oc=e=>async(t,n,r)=>yc(e)(t,n,r),kc=/^[cC][0-9a-z]{6,}$/,Ac=/^[0-9a-z]+$/,jc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mc=/^[0-9a-vA-V]{20}$/,Nc=/^[A-Za-z0-9]{27}$/,Pc=/^[a-zA-Z0-9_-]{21}$/,Fc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ic=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Lc=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Rc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zc=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Bc(){return new RegExp(zc,`u`)}var Vc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Uc=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Wc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Gc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kc=/^[A-Za-z0-9_-]*$/,qc=/^https?$/,Jc=/^\+[1-9]\d{6,14}$/,Yc=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Xc=RegExp(`^${Yc}$`);function Zc(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Qc(e){return RegExp(`^${Zc(e)}$`)}function $c(e){let t=Zc({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Yc}T(?:${r})$`)}var el=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},tl=/^-?\d+$/,nl=/^-?\d+(?:\.\d+)?$/,rl=/^[^A-Z]*$/,il=/^[^a-z]*$/,al=B(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ol={number:`number`,bigint:`bigint`,object:`date`},sl=B(`$ZodCheckLessThan`,(e,t)=>{al.init(e,t);let n=ol[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cl=B(`$ZodCheckGreaterThan`,(e,t)=>{al.init(e,t);let n=ol[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ll=B(`$ZodCheckMultipleOf`,(e,t)=>{al.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Ns(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ul=B(`$ZodCheckNumberFormat`,(e,t)=>{al.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ys[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=tl)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),dl=B(`$ZodCheckMaxLength`,(e,t)=>{var n;al.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!js(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=cc(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fl=B(`$ZodCheckMinLength`,(e,t)=>{var n;al.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!js(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=cc(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pl=B(`$ZodCheckLengthEquals`,(e,t)=>{var n;al.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!js(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=cc(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ml=B(`$ZodCheckStringFormat`,(e,t)=>{var n,r;al.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),hl=B(`$ZodCheckRegex`,(e,t)=>{ml.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),gl=B(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=rl,ml.init(e,t)}),_l=B(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=il,ml.init(e,t)}),vl=B(`$ZodCheckIncludes`,(e,t)=>{al.init(e,t);let n=Ks(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),yl=B(`$ZodCheckStartsWith`,(e,t)=>{al.init(e,t);let n=RegExp(`^${Ks(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),bl=B(`$ZodCheckEndsWith`,(e,t)=>{al.init(e,t);let n=RegExp(`.*${Ks(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),xl=B(`$ZodCheckOverwrite`,(e,t)=>{al.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Sl=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
13
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
14
|
-
`))}},Cl={major:4,minor:4,patch:3},wl=B(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cl;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=rc(e),i;for(let a of t){if(a._zod.def.when){if(ic(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new ws;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=rc(e,t))});else{if(e.issues.length===t)continue;r||=rc(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(rc(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new ws;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new ws;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Fs(e,`~standard`,()=>({validate:t=>{try{let n=vc(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return bc(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Tl=B(`$ZodString`,(e,t)=>{wl.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??el(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),El=B(`$ZodStringFormat`,(e,t)=>{ml.init(e,t),Tl.init(e,t)}),Dl=B(`$ZodGUID`,(e,t)=>{t.pattern??=Ic,El.init(e,t)}),Ol=B(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Lc(e)}else t.pattern??=Lc();El.init(e,t)}),kl=B(`$ZodEmail`,(e,t)=>{t.pattern??=Rc,El.init(e,t)}),Al=B(`$ZodURL`,(e,t)=>{El.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===qc.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),jl=B(`$ZodEmoji`,(e,t)=>{t.pattern??=Bc(),El.init(e,t)}),Ml=B(`$ZodNanoID`,(e,t)=>{t.pattern??=Pc,El.init(e,t)}),Nl=B(`$ZodCUID`,(e,t)=>{t.pattern??=kc,El.init(e,t)}),Pl=B(`$ZodCUID2`,(e,t)=>{t.pattern??=Ac,El.init(e,t)}),Fl=B(`$ZodULID`,(e,t)=>{t.pattern??=jc,El.init(e,t)}),Il=B(`$ZodXID`,(e,t)=>{t.pattern??=Mc,El.init(e,t)}),Ll=B(`$ZodKSUID`,(e,t)=>{t.pattern??=Nc,El.init(e,t)}),Rl=B(`$ZodISODateTime`,(e,t)=>{t.pattern??=$c(t),El.init(e,t)}),zl=B(`$ZodISODate`,(e,t)=>{t.pattern??=Xc,El.init(e,t)}),Bl=B(`$ZodISOTime`,(e,t)=>{t.pattern??=Qc(t),El.init(e,t)}),Vl=B(`$ZodISODuration`,(e,t)=>{t.pattern??=Fc,El.init(e,t)}),Hl=B(`$ZodIPv4`,(e,t)=>{t.pattern??=Vc,El.init(e,t),e._zod.bag.format=`ipv4`}),Ul=B(`$ZodIPv6`,(e,t)=>{t.pattern??=Hc,El.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Wl=B(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Uc,El.init(e,t)}),Gl=B(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Wc,El.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Kl(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var ql=B(`$ZodBase64`,(e,t)=>{t.pattern??=Gc,El.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Kl(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Jl(e){if(!Kc.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Kl(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Yl=B(`$ZodBase64URL`,(e,t)=>{t.pattern??=Kc,El.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Jl(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Xl=B(`$ZodE164`,(e,t)=>{t.pattern??=Jc,El.init(e,t)});function Zl(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Ql=B(`$ZodJWT`,(e,t)=>{El.init(e,t),e._zod.check=n=>{Zl(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),$l=B(`$ZodNumber`,(e,t)=>{wl.init(e,t),e._zod.pattern=e._zod.bag.pattern??nl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),eu=B(`$ZodNumberFormat`,(e,t)=>{ul.init(e,t),$l.init(e,t)}),tu=B(`$ZodUnknown`,(e,t)=>{wl.init(e,t),e._zod.parse=e=>e}),nu=B(`$ZodNever`,(e,t)=>{wl.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ru(e,t,n){e.issues.length&&t.issues.push(...ac(n,e.issues)),t.value[n]=e.value}var iu=B(`$ZodArray`,(e,t)=>{wl.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>ru(t,n,e))):ru(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function au(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...ac(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function ou(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Js(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function su(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>au(e,n,i,t,u,d))):au(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var cu=B(`$ZodObject`,(e,t)=>{if(wl.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=As(()=>ou(t));Fs(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Vs,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>au(n,t,e,s,r,i))):au(a,t,e,s,r,i)}return i?su(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),lu=B(`$ZodObjectJIT`,(e,t)=>{cu.init(e,t);let n=e._zod.parse,r=As(()=>ou(t)),i=e=>{let t=new Sl([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Rs(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Rs(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
15
|
-
if (${n}.issues.length) {
|
|
16
|
-
if (${o} in input) {
|
|
17
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
18
|
-
...iss,
|
|
19
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
20
|
-
})));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (${n}.value === undefined) {
|
|
25
|
-
if (${o} in input) {
|
|
26
|
-
newResult[${o}] = undefined;
|
|
27
|
-
}
|
|
28
|
-
} else {
|
|
29
|
-
newResult[${o}] = ${n}.value;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
`):c?t.write(`
|
|
33
|
-
if (${n}.issues.length) {
|
|
34
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
35
|
-
...iss,
|
|
36
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
37
|
-
})));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (${n}.value === undefined) {
|
|
41
|
-
if (${o} in input) {
|
|
42
|
-
newResult[${o}] = undefined;
|
|
43
|
-
}
|
|
44
|
-
} else {
|
|
45
|
-
newResult[${o}] = ${n}.value;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
`):t.write(`
|
|
49
|
-
const ${n}_present = ${o} in input;
|
|
50
|
-
if (${n}.issues.length) {
|
|
51
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
52
|
-
...iss,
|
|
53
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
54
|
-
})));
|
|
55
|
-
}
|
|
56
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
57
|
-
payload.issues.push({
|
|
58
|
-
code: "invalid_type",
|
|
59
|
-
expected: "nonoptional",
|
|
60
|
-
input: undefined,
|
|
61
|
-
path: [${o}]
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (${n}_present) {
|
|
66
|
-
if (${n}.value === undefined) {
|
|
67
|
-
newResult[${o}] = undefined;
|
|
68
|
-
} else {
|
|
69
|
-
newResult[${o}] = ${n}.value;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Vs,s=!Es.jitless,c=s&&Hs.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?su([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function uu(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!rc(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>sc(e,r,Ds())))}),t)}var du=B(`$ZodUnion`,(e,t)=>{wl.init(e,t),Fs(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Fs(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Fs(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Fs(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ms(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>uu(t,r,e,i)):uu(o,r,e,i)}}),fu=B(`$ZodIntersection`,(e,t)=>{wl.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>mu(e,t,n)):mu(e,i,a)}});function pu(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Us(e)&&Us(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=pu(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=pu(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function mu(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),rc(e))return e;let o=pu(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var hu=B(`$ZodEnum`,(e,t)=>{wl.init(e,t);let n=Os(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Gs.has(typeof e)).map(e=>typeof e==`string`?Ks(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),gu=B(`$ZodLiteral`,(e,t)=>{if(wl.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Ks(e):e?Ks(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),_u=B(`$ZodTransform`,(e,t)=>{wl.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ts(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new ws;return n.value=i,n.fallback=!0,n}});function vu(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var yu=B(`$ZodOptional`,(e,t)=>{wl.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Fs(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Fs(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ms(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>vu(e,r)):vu(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),bu=B(`$ZodExactOptional`,(e,t)=>{yu.init(e,t),Fs(e._zod,`values`,()=>t.innerType._zod.values),Fs(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),xu=B(`$ZodNullable`,(e,t)=>{wl.init(e,t),Fs(e._zod,`optin`,()=>t.innerType._zod.optin),Fs(e._zod,`optout`,()=>t.innerType._zod.optout),Fs(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ms(e.source)}|null)$`):void 0}),Fs(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Su=B(`$ZodDefault`,(e,t)=>{wl.init(e,t),e._zod.optin=`optional`,Fs(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Cu(e,t)):Cu(r,t)}});function Cu(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var wu=B(`$ZodPrefault`,(e,t)=>{wl.init(e,t),e._zod.optin=`optional`,Fs(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Tu=B(`$ZodNonOptional`,(e,t)=>{wl.init(e,t),Fs(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Eu(t,e)):Eu(i,e)}});function Eu(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Du=B(`$ZodCatch`,(e,t)=>{wl.init(e,t),e._zod.optin=`optional`,Fs(e._zod,`optout`,()=>t.innerType._zod.optout),Fs(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>sc(e,n,Ds()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>sc(e,n,Ds()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Ou=B(`$ZodPipe`,(e,t)=>{wl.init(e,t),Fs(e._zod,`values`,()=>t.in._zod.values),Fs(e._zod,`optin`,()=>t.in._zod.optin),Fs(e._zod,`optout`,()=>t.out._zod.optout),Fs(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ku(e,t.in,n)):ku(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ku(e,t.out,n)):ku(r,t.out,n)}});function ku(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Au=B(`$ZodReadonly`,(e,t)=>{wl.init(e,t),Fs(e._zod,`propValues`,()=>t.innerType._zod.propValues),Fs(e._zod,`values`,()=>t.innerType._zod.values),Fs(e._zod,`optin`,()=>t.innerType?._zod?.optin),Fs(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ju):ju(r)}});function ju(e){return e.value=Object.freeze(e.value),e}var Mu=B(`$ZodCustom`,(e,t)=>{al.init(e,t),wl.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Nu(t,n,r,e));Nu(i,n,r,e)}});function Nu(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(lc(e))}}var Pu,Fu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Iu(){return new Fu}(Pu=globalThis).__zod_globalRegistry??(Pu.__zod_globalRegistry=Iu());var Lu=globalThis.__zod_globalRegistry;function Ru(e,t){return new e({type:`string`,...V(t)})}function zu(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...V(t)})}function Bu(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...V(t)})}function Vu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...V(t)})}function Hu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...V(t)})}function Uu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...V(t)})}function Wu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...V(t)})}function Gu(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...V(t)})}function Ku(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...V(t)})}function qu(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...V(t)})}function Ju(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...V(t)})}function Yu(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...V(t)})}function Xu(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...V(t)})}function Zu(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...V(t)})}function Qu(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...V(t)})}function $u(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...V(t)})}function ed(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...V(t)})}function td(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...V(t)})}function nd(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...V(t)})}function rd(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...V(t)})}function id(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...V(t)})}function ad(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...V(t)})}function od(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...V(t)})}function sd(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...V(t)})}function cd(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...V(t)})}function ld(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...V(t)})}function ud(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...V(t)})}function dd(e,t){return new e({type:`number`,coerce:!0,checks:[],...V(t)})}function fd(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...V(t)})}function pd(e){return new e({type:`unknown`})}function md(e,t){return new e({type:`never`,...V(t)})}function hd(e,t){return new sl({check:`less_than`,...V(t),value:e,inclusive:!1})}function gd(e,t){return new sl({check:`less_than`,...V(t),value:e,inclusive:!0})}function _d(e,t){return new cl({check:`greater_than`,...V(t),value:e,inclusive:!1})}function vd(e,t){return new cl({check:`greater_than`,...V(t),value:e,inclusive:!0})}function yd(e,t){return new ll({check:`multiple_of`,...V(t),value:e})}function bd(e,t){return new dl({check:`max_length`,...V(t),maximum:e})}function xd(e,t){return new fl({check:`min_length`,...V(t),minimum:e})}function Sd(e,t){return new pl({check:`length_equals`,...V(t),length:e})}function Cd(e,t){return new hl({check:`string_format`,format:`regex`,...V(t),pattern:e})}function wd(e){return new gl({check:`string_format`,format:`lowercase`,...V(e)})}function Td(e){return new _l({check:`string_format`,format:`uppercase`,...V(e)})}function Ed(e,t){return new vl({check:`string_format`,format:`includes`,...V(t),includes:e})}function Dd(e,t){return new yl({check:`string_format`,format:`starts_with`,...V(t),prefix:e})}function Od(e,t){return new bl({check:`string_format`,format:`ends_with`,...V(t),suffix:e})}function kd(e){return new xl({check:`overwrite`,tx:e})}function Ad(e){return kd(t=>t.normalize(e))}function jd(){return kd(e=>e.trim())}function Md(){return kd(e=>e.toLowerCase())}function Nd(){return kd(e=>e.toUpperCase())}function Pd(){return kd(e=>zs(e))}function Fd(e,t,n){return new e({type:`array`,element:t,...V(n)})}function Id(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...V(n)})}function Ld(e,t){let n=Rd(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(lc(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(lc(r))}},e(t.value,t)),t);return n}function Rd(e,t){let n=new al({check:`custom`,...V(t)});return n._zod.check=e,n}function zd(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Lu,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function Bd(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Bd(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Ud(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Vd(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
74
|
-
|
|
75
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Hd(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Gd(t,`input`,e.processors),output:Gd(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Ud(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Ud(r.element,n);if(r.type===`set`)return Ud(r.valueType,n);if(r.type===`lazy`)return Ud(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return Ud(r.innerType,n);if(r.type===`intersection`)return Ud(r.left,n)||Ud(r.right,n);if(r.type===`record`||r.type===`map`)return Ud(r.keyType,n)||Ud(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Ud(r.in,n)||Ud(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Ud(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Ud(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Ud(e,n))return!0;return!!(r.rest&&Ud(r.rest,n))}return!1}var Wd=(e,t={})=>n=>{let r=zd({...n,processors:t});return Bd(e,r),Vd(r,e),Hd(r,e)},Gd=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=zd({...i??{},target:a,io:t,processors:n});return Bd(e,o),Vd(o,e),Hd(o,e)},Kd={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},qd=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Kd[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Jd=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Yd=(e,t,n,r)=>{n.not={}},Xd=(e,t,n,r)=>{let i=e._zod.def,a=Os(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Zd=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Qd=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},$d=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ef=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Bd(a.element,t,{...r,path:[...r.path,`items`]})},tf=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=Bd(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Bd(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},nf=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Bd(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},rf=(e,t,n,r)=>{let i=e._zod.def,a=Bd(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Bd(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},af=(e,t,n,r)=>{let i=e._zod.def,a=Bd(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},of=(e,t,n,r)=>{let i=e._zod.def;Bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},sf=(e,t,n,r)=>{let i=e._zod.def;Bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},cf=(e,t,n,r)=>{let i=e._zod.def;Bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},lf=(e,t,n,r)=>{let i=e._zod.def;Bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},uf=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Bd(o,t,r);let s=t.seen.get(e);s.ref=o},df=(e,t,n,r)=>{let i=e._zod.def;Bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ff=(e,t,n,r)=>{let i=e._zod.def;Bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},pf=B(`ZodISODateTime`,(e,t)=>{Rl.init(e,t),Bf.init(e,t)});function mf(e){return sd(pf,e)}var hf=B(`ZodISODate`,(e,t)=>{zl.init(e,t),Bf.init(e,t)});function gf(e){return cd(hf,e)}var _f=B(`ZodISOTime`,(e,t)=>{Bl.init(e,t),Bf.init(e,t)});function vf(e){return ld(_f,e)}var yf=B(`ZodISODuration`,(e,t)=>{Vl.init(e,t),Bf.init(e,t)});function bf(e){return ud(yf,e)}var xf=B(`ZodError`,(e,t)=>{dc.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>mc(e,t)},flatten:{value:t=>pc(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ks,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ks,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Sf=hc(xf),Cf=gc(xf),wf=_c(xf),Tf=yc(xf),Ef=xc(xf),Df=Sc(xf),Of=Cc(xf),kf=wc(xf),Af=Tc(xf),jf=Ec(xf),Mf=Dc(xf),Nf=Oc(xf),Pf=new WeakMap;function Ff(e,t,n){let r=Object.getPrototypeOf(e),i=Pf.get(r);if(i||(i=new Set,Pf.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var If=B(`ZodType`,(e,t)=>(wl.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Gd(e,`input`),output:Gd(e,`output`)}}),e.toJSONSchema=Wd(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Sf(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>wf(e,t,n),e.parseAsync=async(t,n)=>Cf(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Tf(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ef(e,t,n),e.decode=(t,n)=>Df(e,t,n),e.encodeAsync=async(t,n)=>Of(e,t,n),e.decodeAsync=async(t,n)=>kf(e,t,n),e.safeEncode=(t,n)=>Af(e,t,n),e.safeDecode=(t,n)=>jf(e,t,n),e.safeEncodeAsync=async(t,n)=>Mf(e,t,n),e.safeDecodeAsync=async(t,n)=>Nf(e,t,n),Ff(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Ls(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return qs(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Kp(e,t))},superRefine(e,t){return this.check(qp(e,t))},overwrite(e){return this.check(kd(e))},optional(){return Op(this)},exactOptional(){return Ap(this)},nullable(){return Mp(this)},nullish(){return Op(Mp(this))},nonoptional(e){return Rp(this,e)},array(){return mp(this)},or(e){return vp([this,e])},and(e){return bp(this,e)},transform(e){return Hp(this,Ep(e))},default(e){return Pp(this,e)},prefault(e){return Ip(this,e)},catch(e){return Bp(this,e)},pipe(e){return Hp(this,e)},readonly(){return Wp(this)},describe(e){let t=this.clone();return Lu.add(t,{description:e}),t},meta(...e){if(e.length===0)return Lu.get(this);let t=this.clone();return Lu.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Lu.get(e)?.description},configurable:!0}),e)),Lf=B(`_ZodString`,(e,t)=>{Tl.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qd(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Ff(e,`_ZodString`,{regex(...e){return this.check(Cd(...e))},includes(...e){return this.check(Ed(...e))},startsWith(...e){return this.check(Dd(...e))},endsWith(...e){return this.check(Od(...e))},min(...e){return this.check(xd(...e))},max(...e){return this.check(bd(...e))},length(...e){return this.check(Sd(...e))},nonempty(...e){return this.check(xd(1,...e))},lowercase(e){return this.check(wd(e))},uppercase(e){return this.check(Td(e))},trim(){return this.check(jd())},normalize(...e){return this.check(Ad(...e))},toLowerCase(){return this.check(Md())},toUpperCase(){return this.check(Nd())},slugify(){return this.check(Pd())}})}),Rf=B(`ZodString`,(e,t)=>{Tl.init(e,t),Lf.init(e,t),e.email=t=>e.check(zu(Vf,t)),e.url=t=>e.check(Gu(Wf,t)),e.jwt=t=>e.check(od(ap,t)),e.emoji=t=>e.check(Ku(Gf,t)),e.guid=t=>e.check(Bu(Hf,t)),e.uuid=t=>e.check(Vu(Uf,t)),e.uuidv4=t=>e.check(Hu(Uf,t)),e.uuidv6=t=>e.check(Uu(Uf,t)),e.uuidv7=t=>e.check(Wu(Uf,t)),e.nanoid=t=>e.check(qu(Kf,t)),e.guid=t=>e.check(Bu(Hf,t)),e.cuid=t=>e.check(Ju(qf,t)),e.cuid2=t=>e.check(Yu(Jf,t)),e.ulid=t=>e.check(Xu(Yf,t)),e.base64=t=>e.check(rd(np,t)),e.base64url=t=>e.check(id(rp,t)),e.xid=t=>e.check(Zu(Xf,t)),e.ksuid=t=>e.check(Qu(Zf,t)),e.ipv4=t=>e.check($u(Qf,t)),e.ipv6=t=>e.check(ed($f,t)),e.cidrv4=t=>e.check(td(ep,t)),e.cidrv6=t=>e.check(nd(tp,t)),e.e164=t=>e.check(ad(ip,t)),e.datetime=t=>e.check(mf(t)),e.date=t=>e.check(gf(t)),e.time=t=>e.check(vf(t)),e.duration=t=>e.check(bf(t))});function zf(e){return Ru(Rf,e)}var Bf=B(`ZodStringFormat`,(e,t)=>{El.init(e,t),Lf.init(e,t)}),Vf=B(`ZodEmail`,(e,t)=>{kl.init(e,t),Bf.init(e,t)}),Hf=B(`ZodGUID`,(e,t)=>{Dl.init(e,t),Bf.init(e,t)}),Uf=B(`ZodUUID`,(e,t)=>{Ol.init(e,t),Bf.init(e,t)}),Wf=B(`ZodURL`,(e,t)=>{Al.init(e,t),Bf.init(e,t)}),Gf=B(`ZodEmoji`,(e,t)=>{jl.init(e,t),Bf.init(e,t)}),Kf=B(`ZodNanoID`,(e,t)=>{Ml.init(e,t),Bf.init(e,t)}),qf=B(`ZodCUID`,(e,t)=>{Nl.init(e,t),Bf.init(e,t)}),Jf=B(`ZodCUID2`,(e,t)=>{Pl.init(e,t),Bf.init(e,t)}),Yf=B(`ZodULID`,(e,t)=>{Fl.init(e,t),Bf.init(e,t)}),Xf=B(`ZodXID`,(e,t)=>{Il.init(e,t),Bf.init(e,t)}),Zf=B(`ZodKSUID`,(e,t)=>{Ll.init(e,t),Bf.init(e,t)}),Qf=B(`ZodIPv4`,(e,t)=>{Hl.init(e,t),Bf.init(e,t)}),$f=B(`ZodIPv6`,(e,t)=>{Ul.init(e,t),Bf.init(e,t)}),ep=B(`ZodCIDRv4`,(e,t)=>{Wl.init(e,t),Bf.init(e,t)}),tp=B(`ZodCIDRv6`,(e,t)=>{Gl.init(e,t),Bf.init(e,t)}),np=B(`ZodBase64`,(e,t)=>{ql.init(e,t),Bf.init(e,t)}),rp=B(`ZodBase64URL`,(e,t)=>{Yl.init(e,t),Bf.init(e,t)}),ip=B(`ZodE164`,(e,t)=>{Xl.init(e,t),Bf.init(e,t)}),ap=B(`ZodJWT`,(e,t)=>{Ql.init(e,t),Bf.init(e,t)}),op=B(`ZodNumber`,(e,t)=>{$l.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jd(e,t,n,r),Ff(e,`ZodNumber`,{gt(e,t){return this.check(_d(e,t))},gte(e,t){return this.check(vd(e,t))},min(e,t){return this.check(vd(e,t))},lt(e,t){return this.check(hd(e,t))},lte(e,t){return this.check(gd(e,t))},max(e,t){return this.check(gd(e,t))},int(e){return this.check(cp(e))},safe(e){return this.check(cp(e))},positive(e){return this.check(_d(0,e))},nonnegative(e){return this.check(vd(0,e))},negative(e){return this.check(hd(0,e))},nonpositive(e){return this.check(gd(0,e))},multipleOf(e,t){return this.check(yd(e,t))},step(e,t){return this.check(yd(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),sp=B(`ZodNumberFormat`,(e,t)=>{eu.init(e,t),op.init(e,t)});function cp(e){return fd(sp,e)}var lp=B(`ZodUnknown`,(e,t)=>{tu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function up(){return pd(lp)}var dp=B(`ZodNever`,(e,t)=>{nu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yd(e,t,n,r)});function fp(e){return md(dp,e)}var pp=B(`ZodArray`,(e,t)=>{iu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ef(e,t,n,r),e.element=t.element,Ff(e,`ZodArray`,{min(e,t){return this.check(xd(e,t))},nonempty(e){return this.check(xd(1,e))},max(e,t){return this.check(bd(e,t))},length(e,t){return this.check(Sd(e,t))},unwrap(){return this.element}})});function mp(e,t){return Fd(pp,e,t)}var hp=B(`ZodObject`,(e,t)=>{lu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tf(e,t,n,r),Fs(e,`shape`,()=>t.shape),Ff(e,`ZodObject`,{keyof(){return Sp(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:up()})},loose(){return this.clone({...this._zod.def,catchall:up()})},strict(){return this.clone({...this._zod.def,catchall:fp()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Qs(this,e)},safeExtend(e){return $s(this,e)},merge(e){return ec(this,e)},pick(e){return Xs(this,e)},omit(e){return Zs(this,e)},partial(...e){return tc(Dp,this,e[0])},required(...e){return nc(Lp,this,e[0])}})});function gp(e,t){return new hp({type:`object`,shape:e??{},...V(t)})}var _p=B(`ZodUnion`,(e,t)=>{du.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nf(e,t,n,r),e.options=t.options});function vp(e,t){return new _p({type:`union`,options:e,...V(t)})}var yp=B(`ZodIntersection`,(e,t)=>{fu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rf(e,t,n,r)});function bp(e,t){return new yp({type:`intersection`,left:e,right:t})}var xp=B(`ZodEnum`,(e,t)=>{hu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xd(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new xp({...t,checks:[],...V(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new xp({...t,checks:[],...V(r),entries:i})}});function Sp(e,t){return new xp({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...V(t)})}var Cp=B(`ZodLiteral`,(e,t)=>{gu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zd(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function wp(e,t){return new Cp({type:`literal`,values:Array.isArray(e)?e:[e],...V(t)})}var Tp=B(`ZodTransform`,(e,t)=>{_u.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$d(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ts(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(lc(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(lc(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Ep(e){return new Tp({type:`transform`,transform:e})}var Dp=B(`ZodOptional`,(e,t)=>{yu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ff(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Op(e){return new Dp({type:`optional`,innerType:e})}var kp=B(`ZodExactOptional`,(e,t)=>{bu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ff(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ap(e){return new kp({type:`optional`,innerType:e})}var jp=B(`ZodNullable`,(e,t)=>{xu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>af(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mp(e){return new jp({type:`nullable`,innerType:e})}var Np=B(`ZodDefault`,(e,t)=>{Su.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Pp(e,t){return new Np({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ws(t)}})}var Fp=B(`ZodPrefault`,(e,t)=>{wu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ip(e,t){return new Fp({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ws(t)}})}var Lp=B(`ZodNonOptional`,(e,t)=>{Tu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>of(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rp(e,t){return new Lp({type:`nonoptional`,innerType:e,...V(t)})}var zp=B(`ZodCatch`,(e,t)=>{Du.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Bp(e,t){return new zp({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Vp=B(`ZodPipe`,(e,t)=>{Ou.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uf(e,t,n,r),e.in=t.in,e.out=t.out});function Hp(e,t){return new Vp({type:`pipe`,in:e,out:t})}var Up=B(`ZodReadonly`,(e,t)=>{Au.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>df(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wp(e){return new Up({type:`readonly`,innerType:e})}var Gp=B(`ZodCustom`,(e,t)=>{Mu.init(e,t),If.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qd(e,t,n,r)});function Kp(e,t={}){return Id(Gp,e,t)}function qp(e,t){return Ld(e,t)}function Jp(e){return dd(op,e)}var Yp=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Xp=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Zp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Qp=e=>{let t=Zp(e);return t.charAt(0).toUpperCase()+t.slice(1)},$p={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},eee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},tee=(0,I.createContext)({}),nee=()=>(0,I.useContext)(tee),em=(0,I.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=nee()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,I.createElement)(`svg`,{ref:c,...$p,width:t??l??$p.width,height:t??l??$p.height,stroke:e??f,strokeWidth:m,className:Yp(`lucide`,p,i),...!a&&!eee(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,I.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),tm=(e,t)=>{let n=(0,I.forwardRef)(({className:n,...r},i)=>(0,I.createElement)(em,{ref:i,iconNode:t,className:Yp(`lucide-${Xp(Qp(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Qp(e),n},nm=tm(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),rm=tm(`bell`,[[`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`}]]),ree=tm(`book-open-text`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M16 12h2`,key:`7q9ll5`}],[`path`,{d:`M16 8h2`,key:`msurwy`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}],[`path`,{d:`M6 12h2`,key:`32wvfc`}],[`path`,{d:`M6 8h2`,key:`30oboj`}]]),im=tm(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),am=tm(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),om=tm(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),sm=tm(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),iee=tm(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),cm=tm(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),lm=tm(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),um=tm(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),aee=tm(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),oee=tm(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),see=tm(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),cee=tm(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),dm=tm(`copy`,[[`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`}]]),fm=tm(`download`,[[`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`}]]),pm=tm(`ellipsis-vertical`,[[`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`}]]),lee=tm(`eye`,[[`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`}]]),uee=tm(`flag`,[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]),dee=tm(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),mm=tm(`grip-vertical`,[[`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`}]]),fee=tm(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),pee=tm(`image`,[[`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`}]]),hm=tm(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),gm=tm(`lock`,[[`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`}]]),_m=tm(`log-out`,[[`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`}]]),vm=tm(`message-square`,[[`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`}]]),ym=tm(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),bm=tm(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),mee=tm(`monitor`,[[`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`}]]),hee=tm(`moon`,[[`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`}]]),gee=tm(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),_ee=tm(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),vee=tm(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),yee=tm(`pencil`,[[`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`}]]),bee=tm(`pin-off`,[[`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`}]]),xee=tm(`pin`,[[`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`}]]),xm=tm(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),See=tm(`refresh-cw`,[[`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`}]]),Sm=tm(`rotate-ccw`,[[`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`}]]),Cm=tm(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),wm=tm(`server`,[[`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`}]]),Tm=tm(`sliders-horizontal`,[[`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`}]]),Cee=tm(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Em=tm(`star`,[[`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`}]]),wee=tm(`sun`,[[`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`}]]),Dm=tm(`trash-2`,[[`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`}]]),Om=tm(`triangle-alert`,[[`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`}]]),Tee=tm(`upload`,[[`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`}]]),km=tm(`users`,[[`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`}]]),Eee=tm(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Am=tm(`wrench`,[[`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`}]]),jm=tm(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Mm(e,t){return new Proxy({},{get(n,r){if(typeof r==`string`)return Mm(e,[...t,r]);if(r===Qe){if(t.length<1){let n=[e,...t].join(`.`);throw Error(`API path is expected to be of the form \`${e}.childComponent.functionName\`. Found: \`${n}\``)}return`_reference/childComponent/`+t.join(`/`)}else return}})}var Dee=()=>Mm(`components`,[]),H=at;Dee();var Nm=null;function Pm(e,t){e.currentIndex=0,e.wipContextDeps=null,e.wipCommitCallbacks=[];let n=Nm;Nm=e;try{if(t(),e.isFirstRender=!1,e.cells.length!==e.currentIndex)throw Error(`Rendered ${e.currentIndex} hooks but expected ${e.cells.length}. Hooks must be called in the exact same order in every render.`)}finally{Nm=n}}function Fm(){if(!Nm)throw Error(`No resource fiber available`);return Nm}function Im(){return Nm}var Lm=Symbol(`tap.Context.defaultValue`),Rm=e=>e,zm=new Map,Bm=new Set,Vm=()=>new Map(zm),Hm=(e,t)=>{let n=zm;zm=e;try{return t()}finally{zm=n}},Um=(e,t)=>{e[Lm]=t},Wm=e=>typeof e==`object`&&!!e&&Lm in e,Gm=e=>typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Symbol.for(`react.context`),Km=e=>Wm(e)||Gm(e),qm=e=>{if(!Wm(e)){if(Gm(e)){Um(e,e._currentValue??e._currentValue2);return}throw Error("A tap resource's `use()` only accepts a tap context.")}},Jm=(e,t,n)=>{if(typeof e!=`object`||!e)throw Error(`useContextProvider only accepts a React context.`);qm(e);let r=e,i=Fm(),a=(0,I.useRef)(void 0),o=a.current===void 0||!Object.is(a.current.value,t);(0,I.useEffect)(()=>{a.current={value:t}},[t]);let s=zm.get(r),c=s!==void 0||zm.has(r);zm.set(r,{value:t,source:i});try{return Oee(r,o,n)}finally{c?zm.set(r,s):zm.delete(r)}},Oee=(e,t,n)=>{let r=Bm.has(e);t?Bm.add(e):Bm.delete(e);try{return n()}finally{r?Bm.add(e):Bm.delete(e)}},kee=e=>{qm(e);let t=e,n=Aee(t,e),r=Fm();return(r.wipContextDeps??=new Map).set(t,n.source),n.value},Aee=(e,t)=>zm.get(e)??{value:Rm(t)[Lm],source:null},jee=(e,t,n,r)=>{if(!r)return n;let i=n;for(let[n,a]of r)a===t||a===e||(i??=new Map).set(n,a);return i},Ym=(e,t=e.wipContextDeps)=>{let n=Im();!n||!t||(n.wipContextDeps=jee(n,e,n.wipContextDeps,t))},Xm=()=>Bm.size>0,Zm=e=>{if(!e.contextDeps||!Xm())return!1;for(let t of Bm.keys())if(e.contextDeps.has(t))return!0;return!1},Mee=[0,1,2,3];function Qm(e){let t=[];for(let n of Mee){let r=e[n];if(r!==void 0)for(let e=0;e<r.length;e++)try{r[e]()}catch(e){t.push(e)}}if(t.length>0){if(t.length===1)throw t[0];for(let e of t)console.error(e);throw AggregateError(t,`Errors during commit`)}}function $m(e){let t=[];for(let n of e.cells)if(n?.type===`effect`&&(n.deps=null,n.cleanup))try{n.cleanup?.()}catch(e){t.push(e)}finally{n.cleanup=void 0}if(t.length>0){if(t.length===1)throw t[0];for(let e of t)console.error(e);throw AggregateError(t,`Errors during cleanup`)}}var eh=typeof process<`u`&&!1,th=e=>({version:0,committedVersion:0,context:Vm(),dispatchUpdate:e,changelog:[],rollbackCallbacks:[]}),nh=e=>{e.committedVersion=e.version,e.changelog.length=0,e.rollbackCallbacks.length=0},rh=(e,t)=>{let n=e.version>t;if(e.version=t,n){for(let t=0;t<e.rollbackCallbacks.length;t++)e.rollbackCallbacks[t]();if(e.rollbackCallbacks.length=0,t===e.committedVersion)e.changelog.length=0;else{if(e.committedVersion>t)throw Error(`Version is less than committed version`);for(;e.committedVersion+e.changelog.length>t;)e.changelog.pop();for(let t=0;t<e.changelog.length;t++)ih(e.changelog[t]);nh(e)}}},ih=e=>{sh(e.fiber,e.cell),e.queued||(e.queued=!0,(e.cell.queue??=[]).push(e))},ah=(e,t,n)=>{let r=e.wipCommitCallbacks;(r[t]??=[]).push(n)},oh=(e,t)=>{e.rollbackCallbacks.push(t)},sh=(e,t)=>{t.isDirty||(t.isDirty=!0,e.markDirty?.(),oh(e.root,()=>{if(t.queue!==null){for(let e of t.queue)e.queued=!1;t.queue=null}t.workInProgress=t.current,t.isDirty=!1}))},ch=()=>{throw Error(`Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.`)},lh=()=>{throw Error(`Hook order changed between renders`)},Nee=(e,t,n)=>{if(e.isNeverMounted)throw Error(`Resource updated before mount`);let r=!1,i=!0;e.root.dispatchUpdate(()=>r?i:(r=!0,n&&e.root.changelog.length===0&&!t.cell.isDirty&&!t.hasEagerState&&(t.eagerState=n(t.cell.workInProgress,t.action),t.hasEagerState=!0,i=!Object.is(t.cell.current,t.eagerState)),i),()=>(r=!0,i=!0,ih(t),e.root.changelog.push(t),!0))},Pee=(e,t,n,r,i)=>{let a=r?r(n):n;eh&&e.devStrictMode&&r&&r(n);let o={type:`reducer`,workInProgress:a,current:a,isDirty:!1,queue:null,renderQueue:null,reducer:t,dispatch:n=>{let r=Im();if(r!==null){if(r!==e)throw Error(`Cannot update a resource while rendering a different resource.`);(e.renderPendingCells??=new Set).add(o),(o.renderQueue??=[]).push(n)}else Nee(e,{fiber:e,cell:o,action:n,hasEagerState:!1,eagerState:void 0,queued:!1},i?t:void 0)}};return o};function uh(e,t,n,r){let i=Fm(),a=i.currentIndex++,o=i.cells[a],s=(()=>{if(o!==void 0)return o.type===`reducer`?o:lh();!i.isFirstRender&&a>=i.cells.length&&ch();let s=Pee(i,e,t,n,r);return i.cells[a]=s,s})(),c=s.queue;if(c!==null){let t=e===s.reducer;for(let n=0;n<c.length;n++){let r=c[n];!r.hasEagerState||!t?(r.eagerState=e(s.workInProgress,r.action),r.hasEagerState=!0,eh&&i.devStrictMode&&(r.eagerState=e(s.workInProgress,r.action))):eh&&i.devStrictMode&&e(s.workInProgress,r.action),r.queued=!1,s.workInProgress=r.eagerState}s.queue=null}if(s.reducer=e,s.renderQueue!==null){let t=s.workInProgress;for(let n of s.renderQueue)t=e(t,n);s.renderQueue=null,i.renderPendingCells?.delete(s),Object.is(t,s.workInProgress)||(sh(i,s),s.workInProgress=t)}return s.isDirty&&ah(i,0,()=>{s.current=s.workInProgress,s.isDirty=!1}),[s.workInProgress,s.dispatch]}function dh(e,t,n){return uh(e,t,n,!1)}var Fee=(e,t)=>typeof t==`function`?t(e):t,Iee=e=>e===void 0?void 0:typeof e==`function`?e():e;function fh(e){return uh(Fee,e,Iee,!0)}var ph=(e,t)=>{eh&&e.length!==t.length&&console.error(`The final argument passed to a hook changed size between renders. The order and size of this array must remain constant.
|
|
76
|
-
|
|
77
|
-
Previous: [${e.join(`, `)}]\nIncoming: [${t.join(`, `)}]`);for(let n=0;n<e.length&&n<t.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0},mh=(e,t)=>{ah(e,0,()=>{t.current=t.wip,t.currentDeps=t.wipDeps,t.isDirty=!1})},hh=(e,t)=>{let n=Fm(),r=n.currentIndex++,i=n.cells[r];if(i===void 0){!n.isFirstRender&&r>=n.cells.length&&ch();let a=e();return eh&&n.devStrictMode&&e(),i={type:`memo`,current:a,currentDeps:t,wip:a,wipDeps:t,isDirty:!1},n.cells[r]=i,a}i.type!==`memo`&&lh();let a=i;if(ph(a.wipDeps,t))return a.isDirty&&mh(n,a),a.wip;let o=e();return eh&&n.devStrictMode&&e(),a.wip=o,a.wipDeps=t,a.isDirty||(a.isDirty=!0,oh(n.root,()=>{a.wip=a.current,a.wipDeps=a.currentDeps,a.isDirty=!1})),mh(n,a),o};function gh(e){return hh(()=>({current:e}),[])}var _h=(e,t)=>hh(()=>e,t),vh=()=>({type:`effect`,cleanup:void 0,deps:null});function yh(e,t){let n=Fm(),r=n.currentIndex++,i=n.cells[r],a=i===void 0?vh():i.type===`effect`?i:lh();if(i===void 0&&(!n.isFirstRender&&r>=n.cells.length&&ch(),n.cells[r]=a),!(t&&a.deps&&ph(a.deps,t))){if(a.deps!==null&&!!t!=!!a.deps)throw Error(`useEffect called with and without dependencies across re-renders`);ah(n,2,()=>{try{a.cleanup?.()}finally{a.cleanup=void 0}}),ah(n,3,()=>{try{let t=e();if(t!==void 0&&typeof t!=`function`)throw Error(`An effect function must either return a cleanup function or nothing. Received: ${typeof t}`);a.cleanup=t}finally{a.deps=t}})}}function bh(e){let t=Fm(),n=gh(e);return n.current!==e&&ah(t,1,()=>{n.current=e}),_h(((...e)=>{if(eh&&Im())throw Error(`useEffectEvent cannot be called during render`);return n.current(...e)}),[])}var xh=e=>{if(!Km(e))throw Error("A tap resource's `use()` only accepts a tap context.");return kee(e)},Sh=(e,t,n=t)=>{let r=gh(!0),i=r.current?n():t();r.current=!1;let[,a]=fh(0),o=bh(()=>{Object.is(i,t())||a(e=>e+1)});return yh(()=>(o(),e(o)),[e]),i},Lee=(e,t)=>{},U=s({createContext:()=>Ph,default:()=>I.default,use:()=>Fh,useCallback:()=>Oh,useContext:()=>Ih,useDebugValue:()=>Nh,useEffect:()=>kh,useEffectEvent:()=>jh,useLayoutEffect:()=>Ah,useMemo:()=>Dh,useReducer:()=>Ree,useRef:()=>Eh,useState:()=>Th,useSyncExternalStore:()=>Mh});l(U,u(f(),1));var Ch=()=>Im()!==null,wh=I.default,Th=e=>Ch()?fh(e):wh.useState(e),Ree=(e,t,n)=>Ch()?dh(e,t,n):wh.useReducer(e,t,n),Eh=e=>Ch()?gh(e):wh.useRef(e),Dh=(e,t)=>Ch()?hh(e,t):wh.useMemo(e,t),Oh=(e,t)=>Ch()?_h(e,t):wh.useCallback(e,t),kh=(e,t)=>Ch()?yh(e,t):wh.useEffect(e,t),Ah=(e,t)=>Ch()?yh(e,t):wh.useLayoutEffect(e,t),jh=e=>Ch()?bh(e):wh.useEffectEvent(e),Mh=(e,t,n)=>Ch()?Sh(e,t,n):wh.useSyncExternalStore(e,t,n),Nh=(e,t)=>Ch()?void 0:wh.useDebugValue(e,t),Ph=e=>{let t=wh.createContext(e);return Um(t,e),t},Fh=e=>Ch()&&Km(e)?xh(e):wh.use(e),Ih=e=>Ch()&&Km(e)?xh(e):wh.useContext(e),Lh=I.default,Rh=Symbol.for(`react.memo_cache_sentinel`),zh=e=>Array(e).fill(Rh),zee=e=>Lh.useMemo(()=>{let t=zh(e);return t[Rh]=!0,t},[]),W=e=>{let t=Im();if(t===null)return(Lh.__COMPILER_RUNTIME?.c??zee)(e);let n=t.memoCache,r=n.workInProgress;if(r===null){let e=n.current;r=e===null?[]:e.map(e=>e.slice()),n.workInProgress=r}let i=n.index++,a=r[i];return a===void 0?(a=zh(e),r[i]=a):eh&&a.length!==e&&console.error(`Expected a constant size argument for each invocation of c(). The previous cache was allocated with size ${a.length} but size ${e} was requested.`),a};function Bh(e){return(...t)=>({hook:e,args:t})}function Vh(e,t,n){return n?{...t,key:e,deps:n}:{...t,key:e}}var Bee=50,Hh={schedulers:new Set([]),isScheduled:!1},Vee=class{_task;_isDirty=!1;constructor(e){this._task=e}get isDirty(){return this._isDirty}markDirty(){this._isDirty=!0,Hh.schedulers.add(this),Hee()}runTask(){this._isDirty=!1,this._task()}},Hee=()=>{Hh.isScheduled||(Hh.isScheduled=!0,Uee())},Uh=()=>{try{let e=[],t=0;for(let n of Hh.schedulers)if(Hh.schedulers.delete(n),n.isDirty){if(t++,t>Bee)throw Error(`Maximum update depth exceeded. This can happen when a resource repeatedly calls setState inside useEffect.`);try{n.runTask()}catch(t){e.push(t)}}if(e.length>0){if(e.length===1)throw e[0];for(let t of e)console.error(t);throw AggregateError(e,`Errors occurred during flushSync`)}}finally{Hh.schedulers.clear(),Hh.isScheduled=!1}},Uee=(()=>{if(typeof MessageChannel<`u`){let e=new MessageChannel;return e.port1.onmessage=Uh,()=>e.port2.postMessage(null)}return()=>setTimeout(Uh,0)})(),Wh=e=>{let t=Hh;Hh={schedulers:new Set([]),isScheduled:!0};try{let t=e();return Uh(),t}finally{Hh=t}},Wee={useState:fh,useReducer:dh,useRef:gh,useMemo:hh,useCallback:_h,useEffect:yh,useLayoutEffect:yh,useInsertionEffect:yh,useEffectEvent:bh,useContext:xh,use:xh,useSyncExternalStore:Sh,useDebugValue:Lee},Gh=I.default,Kh=Gh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE??Gh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qh=Kh==null?null:`H`in Kh?{get current(){return Kh.H},set current(e){Kh.H=e}}:`ReactCurrentDispatcher`in Kh?{get current(){return Kh.ReactCurrentDispatcher.current},set current(e){Kh.ReactCurrentDispatcher.current=e}}:null;function Gee(e){if(!qh)return e();let t=qh.current;qh.current=Wee;try{return e()}finally{qh.current=t}}function Jh(e,t,n=void 0,r){return{hook:e,root:t,markDirty:n,devStrictMode:r,cells:[],contextDeps:null,wipContextDeps:null,commitCallbacks:null,wipCommitCallbacks:null,memoCache:{current:null,workInProgress:null,index:0},renderPendingCells:null,currentIndex:0,isFirstRender:!0,isMounted:!1,isNeverMounted:!0}}function Yh(e){if(!e.isMounted)throw Error(`Tried to unmount a fiber that is already unmounted`);e.isMounted=!1,$m(e)}function Xh(e,t){if(e.memoCache.workInProgress=null,e.renderPendingCells!==null){for(let t of e.renderPendingCells)t.renderQueue=null;e.renderPendingCells.clear()}let n=0,r;do{if(++n>25)throw Error(`Too many re-renders. tap limits the number of renders to prevent an infinite loop.`);e.memoCache.index=0,Pm(e,()=>{r=Gee(()=>e.hook(...t))})}while((e.renderPendingCells?.size??0)>0);return Ym(e),r}function Zh(e){let t=e.wipCommitCallbacks??e.commitCallbacks??[];e.wipCommitCallbacks=null,e.commitCallbacks=t,e.isMounted=!0,e.contextDeps=e.wipContextDeps,nh(e.root),e.memoCache.workInProgress!==null&&(e.memoCache.current=e.memoCache.workInProgress,e.memoCache.workInProgress=null),eh&&e.isNeverMounted&&e.devStrictMode===`root`&&(e.isNeverMounted=!1,Qm(t),$m(e)),e.isNeverMounted=!1,Qm(t)}var Kee=()=>{let e=Fm();return e.devStrictMode?e.isFirstRender?`child`:`root`:null},qee=()=>`child`,Qh=()=>null,Jee=()=>{if(!eh)return Qh;let e=(0,I.useRef)(0);return(0,I.useState)(()=>e.current++),e.current===2?qee:Qh},$h=()=>Im()?Kee:Jee(),Yee=e=>e(),Xee=e=>{let t=(0,I.useMemo)(()=>new Vee(()=>p()),[]),n=(0,I.useMemo)(()=>[],[]),r=$h(),i=(0,I.useMemo)(()=>{let e=th((r,i)=>{if(!t.isDirty){if(!r())return;i()}rh(e,e.committedVersion+e.changelog.length),n.push(i),t.markDirty()});return Jh(Yee,e,void 0,r())},[n,t,r]),a=Vm(),o=i.root.version-i.root.committedVersion,s=Hm(a,()=>Xh(i,[e])),c=(0,I.useRef)(!1),l=(0,I.useRef)([e]),u=(0,I.useRef)(s),d=(0,I.useMemo)(()=>new Set,[]),f=e=>{t.isDirty||u.current===e||(u.current=e,d.forEach(e=>e()))},p=(0,I.useEffectEvent)(()=>{rh(i.root,i.root.committedVersion),n.forEach(e=>{eh&&i.devStrictMode&&e(),e()}),rh(i.root,i.root.committedVersion+i.root.changelog.length),eh&&i.devStrictMode&&Hm(i.root.context,()=>Xh(i,l.current));let e=Hm(i.root.context,()=>Xh(i,l.current));if(t.isDirty)throw Error(`Scheduler is dirty, this should never happen`);nh(i.root),n.length=0,c.current&&Zh(i),f(e)});return(0,I.useEffect)(()=>(c.current=!0,()=>{c.current=!1,Yh(i)}),[i]),(0,I.useEffect)(()=>{l.current=[e],nh(i.root),n.splice(0,o),i.root.context=a,Zh(i),f(s)}),(0,I.useMemo)(()=>({getValue:()=>u.current,subscribe:e=>(d.add(e),()=>d.delete(e))}),[d])},Zee=()=>{let e=(0,I.useRef)(0),t=e.current,n=Fm();return{version:t,markDirty:(0,I.useMemo)(()=>()=>{e.current++,n?.markDirty?.()},[n]),root:n.root}},Qee=()=>{let e=(0,I.useMemo)(()=>th((e,t)=>{let i=!1;r(t=>(i=!e(),i?t:t+1)),i||n(t)}),[]),[t,n]=(0,I.useReducer)((t,n)=>(rh(e,t),t+ +!!n()),0),[,r]=(0,I.useState)(0);return rh(e,t),{root:e,version:t,markDirty:void 0}},eg=()=>{let e=$h(),{root:t,version:n,markDirty:r}=Im()?Zee():Qee();return{version:n,createFiber:(0,I.useCallback)((n,i,a)=>Jh(n,t,a?()=>{a(),r?.()}:r,e()),[])}},tg=(e,t,n)=>{let r=(0,I.useRef)(null),i=r.current??={wipDeps:null,wip:null,currentDeps:null,current:null};return i.wipDeps=i.currentDeps,i.wip=i.current,(0,I.useEffect)(()=>{i.currentDeps=i.wipDeps,i.current=i.wip}),!n&&i.currentDeps&&ph(i.currentDeps,t)?i.current:(i.wipDeps=t,i.wip=e(),i.wip)};function ng(e){let{version:t,createFiber:n}=eg(),r=(0,I.useMemo)(()=>n(e.hook,e.key),[e.hook,e.key,n]),i=tg(()=>({value:Xh(r,e.args)}),[r,t,e.args],Zm(r));return(0,I.useEffect)(()=>()=>Yh(r),[r]),(0,I.useEffect)(()=>{Zh(r)},[r,i]),i.value}var rg=(e,t)=>{let n=e.get(t);n&&(n.isDirty=!0)},ig=(e,t)=>!e.isDirty&&!Zm(e.fiber)&&t!==void 0&&e.committedDeps!==void 0&&ph(e.committedDeps,t),ag=e=>{if(!Xm())return!1;for(let{fiber:t}of e.values())if(Zm(t))return!0;return!1};function og(e){let t=(0,I.useMemo)(()=>new Map,[]),{version:n,createFiber:r}=eg(),i=ag(t),a=tg(()=>{let n=new Set,i=[],a=0;for(let o=0;o<e.length;o++){let s=e[o],c=s.key;if(c===void 0)throw Error(`useResources did not provide a key for array at index ${o}`);if(n.has(c))throw Error(`Duplicate key ${c} in useResources`);n.add(c);let l=t.get(c);if(!l){let e=r(s.hook,s.key,()=>rg(t,c));l={fiber:e,next:{value:Xh(e,s.args),deps:s.deps},isDirty:!1,committedDeps:void 0,committedValue:void 0},a++,t.set(c,l)}else if(l.fiber.hook!==s.hook){let e=r(s.hook,s.key,()=>rg(t,c)),n=Xh(e,s.args);l.next={value:n,deps:s.deps,remount:e}}else if(ig(l,s.deps))l.fiber.contextDeps&&Ym(l.fiber,l.fiber.contextDeps),l.next=`skip`;else{let e=Xh(l.fiber,s.args);l.next={value:e,deps:s.deps}}i.push(typeof l.next==`object`?l.next.value:l.committedValue)}if(t.size>i.length-a)for(let e of t.keys())n.has(e)||(t.get(e).next=`delete`);return i},[e,t,r,n],i);return(0,I.useEffect)(()=>()=>{for(let e of t.keys()){let n=t.get(e).fiber;Yh(n)}},[t]),(0,I.useEffect)(()=>{for(let[e,n]of t.entries()){let r=n.next;r===`delete`?(n.fiber.isMounted&&Yh(n.fiber),t.delete(e)):r===`skip`||(r.remount&&(Yh(n.fiber),n.fiber=r.remount),Zh(n.fiber),n.committedDeps=r.deps,n.committedValue=r.value,n.isDirty=!1)}},[a,t]),a}var sg=e=>e(),cg=e=>{let{createFiber:t}=eg(),n=(0,I.useMemo)(()=>t(sg,void 0),[t]),r=Xh(n,[e]);(0,I.useEffect)(()=>()=>{Yh(n)},[n]);let i=!1,a=()=>{i&&n.isMounted||(i=!0,Zh(n))};return(0,I.useEffect)(a),{value:r,effects:a}},lg=Bh(()=>{let e=W(4),[t,n]=Th(ug),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(e,t)=>(n(n=>({...n,renderers:{...n.renderers,[e]:[...n.renderers[e]??[],t]}})),()=>{n(n=>({...n,renderers:{...n.renderers,[e]:n.renderers[e]?.filter(e=>e!==t)??[]}}))}),e[0]=r):r=e[0];let i=r,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>(n(t=>({...t,fallbacks:[...t.fallbacks,e]})),()=>{n(t=>({...t,fallbacks:t.fallbacks.filter(t=>t!==e)}))}),e[1]=a):a=e[1];let o=a,s;return e[2]===t?s=e[3]:(s={getState:()=>t,setDataUI:i,setFallbackDataUI:o},e[2]=t,e[3]=s),s});function ug(){return{renderers:{},fallbacks:[]}}var dg=e=>{let t=Array.from(e).map(e=>e.getModelContext()).sort((e,t)=>(t.priority??0)-(e.priority??0)),n={};return t.reduce((e,t)=>{let r=t.priority??0;if(t.system&&(e.system?e.system+=`\n\n${t.system}`:e.system=t.system),t.tools)for(let[i,a]of Object.entries(t.tools)){let t=e.tools?.[i];if(t&&t!==a){let o=n[i];if(o===r)throw Error(`You tried to define a tool with the name ${i}, but it already exists.`);let s=o>r?t:a,c=o>r?a:t;e.tools[i]={...c,...s},n[i]=Math.max(o,r);continue}e.tools||={},e.tools[i]=a,n[i]??=r}return t.config&&(e.config={...e.config,...t.config}),t.callSettings&&(e.callSettings={...e.callSettings,...t.callSettings}),e},{})},fg=class{_providers=new Set;getModelContext(){return dg(this._providers)}registerModelContextProvider(e){this._providers.add(e);let t=e.subscribe?.(()=>{this.notifySubscribers()});return this.notifySubscribers(),()=>{this._providers.delete(e),t?.(),this.notifySubscribers()}}_subscribers=new Set;notifySubscribers(){for(let e of this._subscribers)e()}subscribe(e){return this._subscribers.add(e),()=>{this._subscribers.delete(e)}}},pg=[],mg={modelName:void 0,toolNames:pg},hg=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>e===t[n]),gg=(e,t)=>{let n=e.getModelContext(),r=n.config?.modelName,i=n.tools?Object.keys(n.tools).sort():pg,a=i.length?i:pg;return r===t.modelName&&hg(a,t.toolNames)?t:{modelName:r,toolNames:a}},_g=Bh(()=>{let e=W(11),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=new fg,e[0]=t):t=e[0];let n=t,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>gg(n,mg),e[1]=r):r=e[1];let[i,a]=Th(r),o,s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>(a(e=>gg(n,e)),n.subscribe(()=>{a(e=>gg(n,e))})),s=[n],e[2]=o,e[3]=s):(o=e[2],s=e[3]),kh(o,s);let c;e[4]===i?c=e[5]:(c=()=>gg(n,i),e[4]=i,e[5]=c);let l,u,d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>n.getModelContext(),u=e=>n.subscribe(e),d=e=>n.registerModelContextProvider(e),e[6]=l,e[7]=u,e[8]=d):(l=e[6],u=e[7],d=e[8]);let f;return e[9]===c?f=e[10]:(f={getState:c,getModelContext:l,subscribe:u,register:d},e[9]=c,e[10]=f),f}),vg=e=>e.display===void 0?e.type===`human`:e.display===`standalone`,yg=(e,t)=>{if(!(t.status?.type===`running`||t.status?.type===`requires-action`)){let n=e.complete;return typeof n==`function`?n({args:t.args,result:t.result}):n??null}let n=e.running;return typeof n==`function`?n({args:t.args}):n??null},bg=e=>function(t){return yg(e,t)},xg=Symbol(`assistant-ui.store.clientIndex`),Sg=e=>e[xg],Cg=Ph([]),wg=()=>Fh(Cg),$ee=(e,t)=>{let n=W(3),r=wg(),i;return n[0]!==e||n[1]!==r?(i=[...r,e],n[0]=e,n[1]=r,n[2]=i):i=n[2],Jm(Cg,i,t)},ete=new Set([`$$typeof`,`nodeType`,`then`]),Tg=(e,t)=>{if(e===Symbol.toStringTag)return t;if(typeof e!=`symbol`){if(e===`toJSON`)return()=>t;if(!ete.has(e))return!1}},Eg=class{getOwnPropertyDescriptor(e,t){let n=this.get(e,t);if(n!==void 0)return{value:n,writable:!1,enumerable:!0,configurable:!1}}set(){return!1}setPrototypeOf(){return!1}defineProperty(){return!1}deleteProperty(){return!1}preventExtensions(){return!1}},Dg=Symbol(`assistant-ui.store.getValue`),tte=e=>{let t=e[Dg];if(!t)throw Error(`Client scope contains a non-client resource. Ensure your Derived get() returns a client created with useClientResource(), not a plain resource.`);return t.getState?.()},Og=new Map;function nte(e){let t=Og.get(e);return t||(t=function(...t){if(!this||typeof this!=`object`)throw Error(`Method "${String(e)}" called without proper context. This may indicate the function was called incorrectly.`);let n=this[Dg];if(!n)throw Error(`Method "${String(e)}" called on invalid client proxy. Ensure you are calling this method on a valid client instance.`);let r=n[e];if(!r)throw Error(`Method "${String(e)}" is not implemented.`);if(typeof r!=`function`)throw Error(`"${String(e)}" is not a function.`);return r(...t)},Og.set(e,t)),t}var rte=class extends Eg{outputRef;index;boundFns;cachedReceiver;constructor(e,t){super(),this.outputRef=e,this.index=t}get(e,t,n){if(t===Dg)return this.outputRef.current;if(t===xg)return this.index;let r=Tg(t,`ClientProxy`);if(r!==!1)return r;let i=this.outputRef.current[t];if(typeof i==`function`){this.cachedReceiver!==n&&(this.boundFns=new Map,this.cachedReceiver=n);let e=this.boundFns.get(t);return e||(e=nte(t).bind(n),this.boundFns.set(t,e)),e}return i}ownKeys(){return Object.keys(this.outputRef.current)}has(e,t){return t===Dg||t===xg?!0:t in this.outputRef.current}},kg=e=>{let t=Eh(null),n=wg().length,r=Dh(()=>new Proxy({},new rte(t,n)),[n]),i=$ee(r,function(){return ng(e)});return t.current||=i,kh(()=>{t.current=i}),{methods:r,state:i.getState?.(),key:e.key}},ite=Bh(kg),Ag=Symbol(`assistant-ui.store.proxiedAssistantState`),jg=e=>e===`on`||e===`subscribe`||typeof e==`symbol`,Mg=e=>{class t extends Eg{get(t,n){let r=Tg(n,`AssistantState`);if(r!==!1)return r;let i=n;if(!jg(i))return tte(e[i]())}ownKeys(){return Object.keys(e).filter(e=>!jg(e))}has(t,n){return!jg(n)&&n in e}}return new Proxy({},new t)},ate=e=>e[Ag],ote=()=>()=>{},Ng=e=>{let t=(()=>{throw Error(e)});return t.source=null,t.query=null,t},Pg=new Proxy({},new class extends Eg{get(e,t){if(t===`subscribe`||t===`on`)return ote;if(t===Ag)return ste;let n=Tg(t,`DefaultAssistantClient`);return n===!1?Ng(`You are using a component or hook that requires an AuiProvider. Wrap your component in an <AuiProvider> component.`):n}ownKeys(){return[`subscribe`,`on`,Ag]}has(e,t){return t===`subscribe`||t===`on`||t===Ag}}),ste=Mg(Pg),cte=()=>new Proxy({},{get(e,t){let n=Tg(t,`AssistantClient`);return n===!1?Ng(`The current scope does not have a "${String(t)}" property.`):n}}),Fg=Ph(Pg),Ig=Symbol(`assistant-ui.store.useEffects`),lte=()=>{},ute=e=>e[Ig]??lte,dte=()=>{"use no memo";return kh(ute(Lg())),null},Lg=()=>Ih(Fg),Rg=({value:e,children:t})=>{"use no memo";return(0,z.jsxs)(Fg.Provider,{value:e,children:[(0,z.jsx)(dte,{}),t]})},zg=e=>null,Bg=Bh(zg),Vg=Symbol(`assistant-ui.transform-scopes`);function Hg(e,t){let n=e;if(n[Vg])throw Error(`transformScopes is already attached to this resource`);n[Vg]=t}function fte(e){return e[Vg]}var Ug=e=>typeof e==`string`?{scope:e.split(`.`)[0],event:e}:{scope:e.scope,event:e.event},Wg=Ph(null),pte=(e,t)=>Jm(Wg,e,t),Gg=()=>{let e=Fh(Wg);if(!e)throw Error(`AssistantTapContext is not available`);return e},Kg=()=>Gg().clientRef,qg=()=>{let e=W(3),{emit:t}=Gg(),n=wg(),r;return e[0]!==n||e[1]!==t?(r=(e,r)=>{t(e,r,n)},e[0]=n,e[1]=t,e[2]=r):r=e[2],jh(r)};function mte(e,t){let n={...e},r=new Set,i=!0;for(;i;){i=!1;for(let e of Object.values(n)){if(e.hook===zg||r.has(e.hook))continue;r.add(e.hook);let a=fte(e.hook);if(a){a(n,t),i=!0;break}}}let a={},o={};for(let[e,t]of Object.entries(n))t.hook===zg?o[e]=t:a[e]=t;return{rootClients:a,derivedClients:o}}var Jg=e=>Dh(()=>e,[...Object.entries(e).flat()]),hte=(e,t)=>{let n=W(6),r;n[0]!==t||n[1]!==e?(r=mte(e,t),n[0]=t,n[1]=e,n[2]=r):r=n[2];let{rootClients:i,derivedClients:a}=r,o=Jg(i),s=Jg(a),c;return n[3]!==o||n[4]!==s?(c={rootClients:o,derivedClients:s},n[3]=o,n[4]=s,n[5]=c):c=n[5],c},gte=Bh(()=>{let e=W(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=new Map,e[0]=t):t=e[0];let n=t,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,e[1]=r):r=e[1];let i=r,a;if(e[2]===Symbol.for(`react.memo_cache_sentinel`)){let t=new Set;a={on(e,t){let r=t;if(e===`*`)return i.add(r),()=>i.delete(r);let a=n.get(e);return a||(a=new Set,n.set(e,a)),a.add(r),()=>{a.delete(r),a.size===0&&n.delete(e)}},emit(e,t,r){let a=n.get(e);!a&&i.size===0||queueMicrotask(()=>{let n=[];if(a)for(let e of a)try{e(t,r)}catch(e){let t=e;n.push(t)}if(i.size>0){let a={event:e,payload:t};for(let e of i)try{e(a,r)}catch(e){let t=e;n.push(t)}}if(n.length>0){if(n.length===1)throw n[0];for(let e of n)console.error(e);throw AggregateError(n,`Errors occurred during event emission`)}})},subscribe(e){return t.add(e),()=>t.delete(e)},notifySubscribers(){for(let e of t)try{e()}catch(e){console.error(`NotificationManager: subscriber callback error`,e)}}},e[2]=a}else a=e[2];return a}),Yg=e=>Dh(()=>e,e),_te=({element:e,emit:t,clientRef:n})=>{let{methods:r,state:i}=pte({clientRef:n,emit:t},function(){return kg(e)});return Dh(()=>({state:i,methods:r}),[r,i])},vte=Bh(({element:e,notifications:t,clientRef:n,name:r})=>{let i=Xee(function(){return _te({element:e,emit:t.emit,clientRef:n})});return kh(()=>i.subscribe(t.notifySubscribers),[i,t]),Dh(()=>{let e=()=>i.getValue().methods;return Object.defineProperties(e,{source:{value:`root`,writable:!1},query:{value:{},writable:!1},name:{value:r,configurable:!0}}),e},[i,r])}),yte=Bh(()=>{let e=W(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n={clients:t,subscribe:void 0,on:void 0},e[1]=n):n=e[1],n}),bte=e=>{let t=W(14),{clients:n,clientRef:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=gte(),t[0]=i):i=t[0];let a=ng(i),o;t[1]!==r.parent||t[2]!==a.notifySubscribers?(o=()=>r.parent.subscribe(a.notifySubscribers),t[1]=r.parent,t[2]=a.notifySubscribers,t[3]=o):o=t[3];let s;t[4]!==r||t[5]!==a?(s=[r,a],t[4]=r,t[5]=a,t[6]=s):s=t[6],kh(o,s);let c;t[7]!==r||t[8]!==n||t[9]!==a?(c=Object.keys(n).map(e=>Vh(e,vte({element:n[e],notifications:a,clientRef:r,name:e}))),t[7]=r,t[8]=n,t[9]=a,t[10]=c):c=t[10];let l=Yg(og(c)),u;return t[11]!==a||t[12]!==l?(u={notifications:a,results:l},t[11]=a,t[12]=l,t[13]=u):u=t[13],u},xte=Bh(e=>{let{clientRef:t}=e,{notifications:n,results:r}=bte(e);return Dh(()=>({clients:r,subscribe:n.subscribe,on:function(e,r){if(!this)throw Error(`const { on } = useAui() is not supported. Use aui.on() instead.`);let{scope:i,event:a}=Ug(e);if(i!==`*`&&this[i].source===null)throw Error(`Scope "${i}" is not available. Use { scope: "*", event: "${a}" } to listen globally.`);let o=n.on(a,(e,t)=>{if(i===`*`){r(e);return}let n=this[i]();n===t[Sg(n)]&&r(e)});if(i!==`*`&&t.parent[i].source===null)return o;let s=t.parent.on(e,r);return()=>{o(),s()}}}),[r,n,t])}),Ste=Bh(({element:e,clientRef:t,name:n})=>{let r=Eh(e.args[0]);return r.current=e.args[0],Dh(()=>{let e=()=>r.current.get(t.current);return Object.defineProperties(e,{source:{value:r.current.source},query:{value:r.current.query},name:{value:n,configurable:!0}}),e},[t,n])}),Cte=(e,t)=>{let n;try{let e={};for(let n of Object.keys(t.query).sort())e[n]=t.query[n];n=JSON.stringify(e)}catch{n=String(t.query)}return`${e}::${t.source}::${n}`},wte=e=>{let t=W(3),{clients:n,clientRef:r}=e,i;return t[0]!==r||t[1]!==n?(i=Object.keys(n).map(e=>{let t=e,i=n[t];return Vh(Cte(t,i.args[0]),Ste({element:i,clientRef:r,name:t}))}),t[0]=r,t[1]=n,t[2]=i):i=t[2],Yg(og(i))},Tte=e=>{let t=W(3),{rootClients:n,clientRef:r}=e,i;return t[0]!==r||t[1]!==n?(i=Object.keys(n).length>0?xte({clients:n,clientRef:r}):yte(),t[0]=r,t[1]=n,t[2]=i):i=t[2],ng(i)},Ete=({parent:e,clients:t})=>{let{rootClients:n,derivedClients:r}=hte(t,e),i=Eh({parent:e,current:null}).current;kh(()=>{i.current=s});let a=Tte({rootClients:n,clientRef:i}),o=wte({clients:r,clientRef:i}),s=Dh(()=>{let t=e===Pg?cte():e,n=Object.create(t);Object.assign(n,{subscribe:a.subscribe??e.subscribe,on:a.on??e.on,[Ag]:Mg(n)});for(let e of a.clients)n[e.name]=e;for(let e of o)n[e.name]=e;return n},[e,a,o]);return i.current===null&&(i.current=s),s},Dte=e=>{let{value:t,effects:n}=cg(function(){return Ete(e)});return t[Ig]=n,t};function Xg(e,{parent:t}={parent:Lg()}){if(e)return Dte({parent:t??Pg,clients:e});if(t===null)throw Error(`received null parent, this usage is not allowed`);return t}var G=e=>{let t=W(6),n=Xg(),r;t[0]===n?r=t[1]:(r=ate(n),t[0]=n,t[1]=r);let i=r,a,o;t[2]!==i||t[3]!==e?(a=()=>e(i),o=()=>e(i),t[2]=i,t[3]=e,t[4]=a,t[5]=o):(a=t[4],o=t[5]);let s=Mh(n.subscribe,a,o);if(s===i)throw Error(`You tried to return the entire AssistantState. This is not supported due to technical limitations.`);return Nh(s),s},Ote=e=>{let t=Xg(),n=Eh(!1),r=n.current?null:e(t);return G(()=>n.current?e(t):r),()=>(n.current=!0,e(t))},kte=Object.freeze({});function Zg(e){let t=W(3),{getItemState:n,children:r}=e,i=Ote(n),a;return t[0]!==r||t[1]!==i?(a=r(i),t[0]=r,t[1]=i,t[2]=a):a=t[2],Ate(a)}var Ate=e=>{let t=typeof e==`object`&&e&&`type`in e?e:null,n=t?.type,r=t?.key;return Dh(()=>t,[n,r,typeof t?.props==`object`&&t.props!=null&&Object.entries(t.props).length===0?kte:t?.props])??e},jte=I.createContext(!0);function Qg(){throw Error(`A function wrapped in useEffectEvent can't be called during rendering.`)}var Mte=`use`in I.default?()=>{try{return I.use(jte)}catch{return!1}}:()=>!1;function Nte(e){let t=I.useRef(Qg);return I.useInsertionEffect(()=>{t.current=e},[e]),(...e)=>{Mte()&&Qg();let n=t.current;return n(...e)}}var $g=(e,t)=>{let n=W(11),r=Xg(),i=Nte(t),a;n[0]===e?a=n[1]:(a=Ug(e),n[0]=e,n[1]=a);let{scope:o,event:s}=a,c;n[2]!==r||n[3]!==i||n[4]!==s||n[5]!==o?(c=()=>r.on({scope:o,event:s},i),n[2]=r,n[3]=i,n[4]=s,n[5]=o,n[6]=c):c=n[6];let l;n[7]!==r||n[8]!==s||n[9]!==o?(l=[r,o,s],n[7]=r,n[8]=s,n[9]=o,n[10]=l):l=n[10],kh(c,l)},Pte=e=>{if(e.key===void 0)throw Error(`useClientLookup: Element has no key`);return e.key};function e_(e){let t=W(15),n;t[0]===e?n=t[1]:(n=e.map(Lte),t[0]=e,t[1]=n);let r=og(n),i;t[2]===r?i=t[3]:(i=Object.keys(r),t[2]=r,t[3]=i);let a=i,o;t[4]===r?o=t[5]:(o=r.reduce(Ite,{}),t[4]=r,t[5]=o);let s=o,c;t[6]===r?c=t[7]:(c=r.map(Fte),t[6]=r,t[7]=c);let l=c,u;t[8]!==s||t[9]!==a||t[10]!==r?(u=e=>{if(`index`in e){if(e.index<0||e.index>=a.length)throw Error(`useClientLookup: Index ${e.index} out of bounds (length: ${a.length})`);return r[e.index].methods}let t=s[e.key];if(t===void 0)throw Error(`useClientLookup: Key "${e.key}" not found`);return r[t].methods},t[8]=s,t[9]=a,t[10]=r,t[11]=u):u=t[11];let d;return t[12]!==l||t[13]!==u?(d={state:l,get:u},t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function Fte(e){return e.state}function Ite(e,t,n){return e[t.key]=n,e}function Lte(e){return Vh(Pte(e),ite(e),e.deps)}var t_=e=>{let t=W(15),{toolkit:n,mcpApp:r}=e,i;t[0]===r?i=t[1]:(i=r?[Vh(`mcpApp`,r)]:[],t[0]=r,t[1]=i);let a=og(i)[0],[o,s]=Th(zte),c;t[2]===o?c=t[3]:(c=Object.fromEntries(Object.entries(o).map(Vte)),t[2]=o,t[3]=c);let l;t[4]!==a||t[5]!==c||t[6]!==o?(l={toolUIs:o,mcpApp:a,tools:c},t[4]=a,t[5]=c,t[6]=o,t[7]=l):l=t[7];let u=l,d=Kg(),f;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=(e,t,n)=>{let r={render:t,standalone:n?.standalone??!1};return s(t=>({...t,[e]:[...t[e]??[],r]})),()=>{s(t=>{let n=t[e]?.filter(e=>e!==r)??[];if(n.length>0)return{...t,[e]:n};let i={...t};return delete i[e],i})}},t[8]=f):f=t[8];let p=f,m,h;t[9]!==d||t[10]!==n?(m=()=>{if(!n)return;let e=[];for(let[t,r]of Object.entries(n)){let n=`render`in r?r.render:void 0,i=`renderText`in r?r.renderText:void 0,a=n??(i?bg(i):void 0);a&&e.push(p(t,a,{standalone:vg(r)}))}let t=Object.entries(n).reduce(Hte,{});return e.push(d.current.modelContext().register({getModelContext:()=>({tools:t})})),()=>{e.forEach(Ute)}},h=[n,p,d],t[9]=d,t[10]=n,t[11]=m,t[12]=h):(m=t[11],h=t[12]),kh(m,h);let g;return t[13]===u?g=t[14]:(g={getState:()=>u,setToolUI:p},t[13]=u,t[14]=g),g},Rte=Bh(t_);Hg(t_,(e,t)=>{!e.modelContext&&t.modelContext.source===null&&(e.modelContext=_g())});function zte(){return{}}function Bte(e){return e.render}function Vte(e){let[t,n]=e;return[t,n.map(Bte)]}function Hte(e,t){let[n,r]=t;if(r.type===`mcp`)return e;let{display:i,render:a,renderText:o,...s}=r;return e[n]=s,e}function Ute(e){return e()}var n_=e=>Mh(e.subscribe,e.getState),r_=Bh(e=>{let t=W(8),{runtime:n}=e,r=n_(n),i;t[0]===r?i=t[1]:(i=()=>r,t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=()=>n,t[2]=n,t[3]=a);let o;return t[4]!==n.remove||t[5]!==i||t[6]!==a?(o={getState:i,remove:n.remove,__internal_getRuntime:a},t[4]=n.remove,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}),Wte=Bh(e=>{let t=W(5),{runtime:n,index:r}=e,i;t[0]!==r||t[1]!==n?(i=n.getAttachmentByIndex(r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;return t[3]===a?o=t[4]:(o=r_({runtime:a}),t[3]=a,t[4]=o),ng(o)}),Gte=Bh(({item:e,onSteer:t,onRemove:n})=>({getState:()=>e,steer:t,remove:n})),i_=Bh(e=>{let t=W(55),{threadIdRef:n,messageIdRef:r,runtime:i}=e,a=n_(i),o=qg(),s,c;t[0]!==o||t[1]!==r||t[2]!==i||t[3]!==n?(s=()=>{let e=[];for(let t of[`send`,`attachmentAdd`]){let a=i.unstable_on(t,()=>{o(`composer.${t}`,{threadId:n.current,...r&&{messageId:r.current}})});e.push(a)}return e.push(i.unstable_on(`attachmentAddError`,e=>{o(`composer.attachmentAddError`,{threadId:n.current,...r&&{messageId:r.current},...e.attachmentId&&{attachmentId:e.attachmentId},reason:e.reason,message:e.message})})),()=>{for(let t of e)t()}},c=[i,o,n,r],t[0]=o,t[1]=r,t[2]=i,t[3]=n,t[4]=s,t[5]=c):(s=t[4],c=t[5]),kh(s,c);let l;if(t[6]!==i||t[7]!==a.attachments){let e;t[9]===i?e=t[10]:(e=(e,t)=>Vh(e.id,Wte({runtime:i,index:t}),[i,t]),t[9]=i,t[10]=e),l=a.attachments.map(e),t[6]=i,t[7]=a.attachments,t[8]=l}else l=t[8];let u=e_(l),d=a.queue,f;if(t[11]!==d||t[12]!==i){let e;t[14]===i?e=t[15]:(e=e=>Vh(e.id,Gte({item:e,onSteer:()=>i.steerQueueItem(e.id),onRemove:()=>i.removeQueueItem(e.id)})),t[14]=i,t[15]=e),f=d.map(e),t[11]=d,t[12]=i,t[13]=f}else f=t[13];let p=e_(f),m=a.type??`thread`,h;t[16]!==u.state||t[17]!==d||t[18]!==a.attachmentAccept||t[19]!==a.canCancel||t[20]!==a.canSend||t[21]!==a.dictation||t[22]!==a.isEditing||t[23]!==a.isEmpty||t[24]!==a.quote||t[25]!==a.role||t[26]!==a.runConfig||t[27]!==a.text||t[28]!==m?(h={text:a.text,role:a.role,attachments:u.state,runConfig:a.runConfig,isEditing:a.isEditing,canCancel:a.canCancel,canSend:a.canSend,attachmentAccept:a.attachmentAccept,isEmpty:a.isEmpty,type:m,dictation:a.dictation,quote:a.quote,queue:d},t[16]=u.state,t[17]=d,t[18]=a.attachmentAccept,t[19]=a.canCancel,t[20]=a.canSend,t[21]=a.dictation,t[22]=a.isEditing,t[23]=a.isEmpty,t[24]=a.quote,t[25]=a.role,t[26]=a.runConfig,t[27]=a.text,t[28]=m,t[29]=h):h=t[29];let g=h,_;t[30]===g?_=t[31]:(_=()=>g,t[30]=g,t[31]=_);let v=i.beginEdit??Kte,y;t[32]===u?y=t[33]:(y=e=>`id`in e?u.get({key:e.id}):u.get(e),t[32]=u,t[33]=y);let b;t[34]===p?b=t[35]:(b=e=>p.get(e),t[34]=p,t[35]=b);let x;t[36]===i?x=t[37]:(x=()=>i,t[36]=i,t[37]=x);let S;return t[38]!==i.addAttachment||t[39]!==i.cancel||t[40]!==i.clearAttachments||t[41]!==i.reset||t[42]!==i.send||t[43]!==i.setQuote||t[44]!==i.setRole||t[45]!==i.setRunConfig||t[46]!==i.setText||t[47]!==i.startDictation||t[48]!==i.stopDictation||t[49]!==b||t[50]!==x||t[51]!==_||t[52]!==v||t[53]!==y?(S={getState:_,setText:i.setText,setRole:i.setRole,setRunConfig:i.setRunConfig,addAttachment:i.addAttachment,reset:i.reset,clearAttachments:i.clearAttachments,send:i.send,cancel:i.cancel,beginEdit:v,startDictation:i.startDictation,stopDictation:i.stopDictation,setQuote:i.setQuote,attachment:y,queueItem:b,__internal_getRuntime:x},t[38]=i.addAttachment,t[39]=i.cancel,t[40]=i.clearAttachments,t[41]=i.reset,t[42]=i.send,t[43]=i.setQuote,t[44]=i.setRole,t[45]=i.setRunConfig,t[46]=i.setText,t[47]=i.startDictation,t[48]=i.stopDictation,t[49]=b,t[50]=x,t[51]=_,t[52]=v,t[53]=y,t[54]=S):S=t[54],S});function Kte(){throw Error(`beginEdit is not supported in this runtime`)}var a_=e=>({get current(){return e()}}),qte=Bh(e=>{let t=W(13),{runtime:n}=e,r=n_(n),i;t[0]===r?i=t[1]:(i=()=>r,t[0]=r,t[1]=i);let a,o,s,c;t[2]===n?(a=t[3],o=t[4],s=t[5],c=t[6]):(a=e=>n.addToolResult(e),o=e=>n.resumeToolCall(e),s=e=>n.respondToToolApproval(e),c=()=>n,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let l;return t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==s||t[11]!==c?(l={getState:i,addToolResult:a,resumeToolCall:o,respondToToolApproval:s,__internal_getRuntime:c},t[7]=i,t[8]=a,t[9]=o,t[10]=s,t[11]=c,t[12]=l):l=t[12],l}),Jte=Bh(e=>{let t=W(5),{runtime:n,index:r}=e,i;t[0]!==r||t[1]!==n?(i=n.getAttachmentByIndex(r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;return t[3]===a?o=t[4]:(o=r_({runtime:a}),t[3]=a,t[4]=o),ng(o)}),Yte=Bh(e=>{let t=W(5),{runtime:n,index:r}=e,i;t[0]!==r||t[1]!==n?(i=n.getMessagePartByIndex(r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;return t[3]===a?o=t[4]:(o=qte({runtime:a}),t[3]=a,t[4]=o),ng(o)}),Xte=Bh(e=>{let t=W(55),{runtime:n,threadIdRef:r}=e,i=n_(n),[a,o]=Th(!1),[s,c]=Th(!1),l;t[0]===n?l=t[1]:(l=a_(()=>n.getState().id),t[0]=n,t[1]=l);let u=l,d;t[2]!==u||t[3]!==n.composer||t[4]!==r?(d=i_({runtime:n.composer,threadIdRef:r,messageIdRef:u}),t[2]=u,t[3]=n.composer,t[4]=r,t[5]=d):d=t[5];let f=kg(d),p;if(t[6]!==n||t[7]!==i.content){let e;t[9]===n?e=t[10]:(e=(e,t)=>Vh(`toolCallId`in e&&e.toolCallId!=null?`toolCallId-${e.toolCallId}`:`index-${t}`,Yte({runtime:n,index:t}),[n,t]),t[9]=n,t[10]=e),p=i.content.map(e),t[6]=n,t[7]=i.content,t[8]=p}else p=t[8];let m=e_(p),h;t[11]===i.attachments?h=t[12]:(h=i.attachments??[],t[11]=i.attachments,t[12]=h);let g;if(t[13]!==n||t[14]!==h){let e;t[16]===n?e=t[17]:(e=(e,t)=>Vh(e.id,Jte({runtime:n,index:t}),[n,t]),t[16]=n,t[17]=e),g=h.map(e),t[13]=n,t[14]=h,t[15]=g}else g=t[15];let _=e_(g),v=i,y;t[18]!==f.state||t[19]!==a||t[20]!==s||t[21]!==m.state||t[22]!==v?(y={...v,parts:m.state,composer:f.state,isCopied:a,isHovering:s},t[18]=f.state,t[19]=a,t[20]=s,t[21]=m.state,t[22]=v,t[23]=y):y=t[23];let b=y,x;t[24]===b?x=t[25]:(x=()=>b,t[24]=b,t[25]=x);let S;t[26]===f.methods?S=t[27]:(S=()=>f.methods,t[26]=f.methods,t[27]=S);let C,w,T,E,D,O,k;t[28]===n?(C=t[29],w=t[30],T=t[31],E=t[32],D=t[33],O=t[34],k=t[35]):(C=()=>n.delete(),w=e=>n.reload(e),T=()=>n.speak(),E=()=>n.stopSpeaking(),D=e=>n.submitFeedback(e),O=e=>n.switchToBranch(e),k=()=>n.unstable_getCopyText(),t[28]=n,t[29]=C,t[30]=w,t[31]=T,t[32]=E,t[33]=D,t[34]=O,t[35]=k);let A;t[36]===m?A=t[37]:(A=e=>`index`in e?m.get({index:e.index}):m.get({key:`toolCallId-${e.toolCallId}`}),t[36]=m,t[37]=A);let j;t[38]===_?j=t[39]:(j=e=>`id`in e?_.get({key:e.id}):_.get(e),t[38]=_,t[39]=j);let M;t[40]===n?M=t[41]:(M=()=>n,t[40]=n,t[41]=M);let N;return t[42]!==C||t[43]!==w||t[44]!==T||t[45]!==E||t[46]!==D||t[47]!==O||t[48]!==k||t[49]!==A||t[50]!==j||t[51]!==M||t[52]!==x||t[53]!==S?(N={getState:x,composer:S,delete:C,reload:w,speak:T,stopSpeaking:E,submitFeedback:D,switchToBranch:O,getCopyText:k,part:A,attachment:j,setIsCopied:o,setIsHovering:c,__internal_getRuntime:M},t[42]=C,t[43]=w,t[44]=T,t[45]=E,t[46]=D,t[47]=O,t[48]=k,t[49]=A,t[50]=j,t[51]=M,t[52]=x,t[53]=S,t[54]=N):N=t[54],N}),Zte=Bh(e=>{let t=W(6),{runtime:n,id:r,threadIdRef:i}=e,a;t[0]!==r||t[1]!==n?(a=n.getMessageById(r),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o=a,s;return t[3]!==o||t[4]!==i?(s=Xte({runtime:o,threadIdRef:i}),t[3]=o,t[4]=i,t[5]=s):s=t[5],ng(s)}),Qte=Bh(e=>{let t=W(58),{runtime:n}=e,r=n_(n),i=qg(),a,o;t[0]!==i||t[1]!==n?(a=()=>{let e=[];for(let t of[`runStart`,`runEnd`,`initialize`,`modelContextUpdate`]){let r=n.unstable_on(t,()=>{let e=n.getState()?.threadId||`unknown`;i(`thread.${t}`,{threadId:e})});e.push(r)}return()=>{for(let t of e)t()}},o=[n,i],t[0]=i,t[1]=n,t[2]=a,t[3]=o):(a=t[2],o=t[3]),kh(a,o);let s;t[4]===n?s=t[5]:(s=a_(()=>n.getState().threadId),t[4]=n,t[5]=s);let c=s,l;t[6]!==n.composer||t[7]!==c?(l=i_({runtime:n.composer,threadIdRef:c}),t[6]=n.composer,t[7]=c,t[8]=l):l=t[8];let u=kg(l),d;if(t[9]!==n||t[10]!==r.messages||t[11]!==c){let e;t[13]!==n||t[14]!==c?(e=e=>Vh(e.id,Zte({runtime:n,id:e.id,threadIdRef:c}),[n,e.id,c]),t[13]=n,t[14]=c,t[15]=e):e=t[15],d=r.messages.map(e),t[9]=n,t[10]=r.messages,t[11]=c,t[12]=d}else d=t[12];let f=e_(d),p=f.state.length===0&&!r.isLoading,m;t[16]!==u.state||t[17]!==f.state||t[18]!==r.capabilities||t[19]!==r.extras||t[20]!==r.isDisabled||t[21]!==r.isLoading||t[22]!==r.isRunning||t[23]!==r.speech||t[24]!==r.state||t[25]!==r.suggestions||t[26]!==r.voice||t[27]!==p?(m={isEmpty:p,isDisabled:r.isDisabled,isLoading:r.isLoading,isRunning:r.isRunning,capabilities:r.capabilities,state:r.state,suggestions:r.suggestions,extras:r.extras,speech:r.speech,voice:r.voice,composer:u.state,messages:f.state},t[16]=u.state,t[17]=f.state,t[18]=r.capabilities,t[19]=r.extras,t[20]=r.isDisabled,t[21]=r.isLoading,t[22]=r.isRunning,t[23]=r.speech,t[24]=r.state,t[25]=r.suggestions,t[26]=r.voice,t[27]=p,t[28]=m):m=t[28];let h=m,g;t[29]===h?g=t[30]:(g=()=>h,t[29]=h,t[30]=g);let _;t[31]===u.methods?_=t[32]:(_=()=>u.methods,t[31]=u.methods,t[32]=_);let v;t[33]===f?v=t[34]:(v=e=>`id`in e?f.get({key:e.id}):f.get(e),t[33]=f,t[34]=v);let y;t[35]===n?y=t[36]:(y=()=>n,t[35]=n,t[36]=y);let b;return t[37]!==n.append||t[38]!==n.cancelRun||t[39]!==n.connectVoice||t[40]!==n.deleteMessage||t[41]!==n.disconnectVoice||t[42]!==n.export||t[43]!==n.getModelContext||t[44]!==n.getVoiceVolume||t[45]!==n.import||t[46]!==n.muteVoice||t[47]!==n.reset||t[48]!==n.resumeRun||t[49]!==n.startRun||t[50]!==n.stopSpeaking||t[51]!==n.subscribeVoiceVolume||t[52]!==n.unmuteVoice||t[53]!==v||t[54]!==y||t[55]!==g||t[56]!==_?(b={getState:g,composer:_,append:n.append,deleteMessage:n.deleteMessage,startRun:n.startRun,resumeRun:n.resumeRun,cancelRun:n.cancelRun,getModelContext:n.getModelContext,export:n.export,import:n.import,reset:n.reset,stopSpeaking:n.stopSpeaking,connectVoice:n.connectVoice,disconnectVoice:n.disconnectVoice,getVoiceVolume:n.getVoiceVolume,subscribeVoiceVolume:n.subscribeVoiceVolume,muteVoice:n.muteVoice,unmuteVoice:n.unmuteVoice,message:v,__internal_getRuntime:y},t[37]=n.append,t[38]=n.cancelRun,t[39]=n.connectVoice,t[40]=n.deleteMessage,t[41]=n.disconnectVoice,t[42]=n.export,t[43]=n.getModelContext,t[44]=n.getVoiceVolume,t[45]=n.import,t[46]=n.muteVoice,t[47]=n.reset,t[48]=n.resumeRun,t[49]=n.startRun,t[50]=n.stopSpeaking,t[51]=n.subscribeVoiceVolume,t[52]=n.unmuteVoice,t[53]=v,t[54]=y,t[55]=g,t[56]=_,t[57]=b):b=t[57],b}),$te=Bh(e=>{let t=W(20),{runtime:n}=e,r=n_(n),i=qg(),a,o;t[0]!==i||t[1]!==n?(a=()=>{let e=[];for(let t of[`switchedTo`,`switchedAway`]){let r=n.unstable_on(t,()=>{i(`threadListItem.${t}`,{threadId:n.getState().id})});e.push(r)}return()=>{for(let t of e)t()}},o=[n,i],t[0]=i,t[1]=n,t[2]=a,t[3]=o):(a=t[2],o=t[3]),kh(a,o);let s;t[4]===r?s=t[5]:(s=()=>r,t[4]=r,t[5]=s);let c;t[6]===n?c=t[7]:(c=()=>n,t[6]=n,t[7]=c);let l;return t[8]!==n.archive||t[9]!==n.delete||t[10]!==n.detach||t[11]!==n.generateTitle||t[12]!==n.initialize||t[13]!==n.rename||t[14]!==n.switchTo||t[15]!==n.unarchive||t[16]!==n.updateCustom||t[17]!==s||t[18]!==c?(l={getState:s,switchTo:n.switchTo,rename:n.rename,updateCustom:n.updateCustom,archive:n.archive,unarchive:n.unarchive,delete:n.delete,generateTitle:n.generateTitle,initialize:n.initialize,detach:n.detach,__internal_getRuntime:c},t[8]=n.archive,t[9]=n.delete,t[10]=n.detach,t[11]=n.generateTitle,t[12]=n.initialize,t[13]=n.rename,t[14]=n.switchTo,t[15]=n.unarchive,t[16]=n.updateCustom,t[17]=s,t[18]=c,t[19]=l):l=t[19],l}),ene=Bh(e=>{let t=W(5),{runtime:n,id:r}=e,i;t[0]!==r||t[1]!==n?(i=n.getItemById(r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;return t[3]===a?o=t[4]:(o=$te({runtime:a}),t[3]=a,t[4]=o),ng(o)}),tne=Bh(e=>{let t=W(40),{runtime:n,__internal_assistantRuntime:r}=e,i=n_(n),a;t[0]===n.main?a=t[1]:(a=Qte({runtime:n.main}),t[0]=n.main,t[1]=a);let o=kg(a),s;t[2]!==n||t[3]!==i.threadItems?(s=Object.keys(i.threadItems).map(e=>Vh(e,ene({runtime:n,id:e}),[n,e])),t[2]=n,t[3]=i.threadItems,t[4]=s):s=t[4];let c=e_(s),l=i.newThreadId??null,u;t[5]!==o.state||t[6]!==i.archivedThreadIds||t[7]!==i.hasMore||t[8]!==i.isLoading||t[9]!==i.isLoadingMore||t[10]!==i.mainThreadId||t[11]!==i.threadIds||t[12]!==l||t[13]!==c.state?(u={mainThreadId:i.mainThreadId,newThreadId:l,isLoading:i.isLoading,isLoadingMore:i.isLoadingMore,hasMore:i.hasMore,threadIds:i.threadIds,archivedThreadIds:i.archivedThreadIds,threadItems:c.state,main:o.state},t[5]=o.state,t[6]=i.archivedThreadIds,t[7]=i.hasMore,t[8]=i.isLoading,t[9]=i.isLoadingMore,t[10]=i.mainThreadId,t[11]=i.threadIds,t[12]=l,t[13]=c.state,t[14]=u):u=t[14];let d=u,f;t[15]===d?f=t[16]:(f=()=>d,t[15]=d,t[16]=f);let p;t[17]===o.methods?p=t[18]:(p=()=>o.methods,t[17]=o.methods,t[18]=p);let m;t[19]!==d||t[20]!==c?(m=e=>{if(e===`main`)return c.get({key:d.mainThreadId});if(`id`in e)return c.get({key:e.id});let{index:t,archived:n}=e,r=n!==void 0&&n?d.archivedThreadIds[t]:d.threadIds[t];return c.get({key:r})},t[19]=d,t[20]=c,t[21]=m):m=t[21];let h,g,_,v,y;t[22]===n?(h=t[23],g=t[24],_=t[25],v=t[26],y=t[27]):(v=async(e,t)=>{await n.switchToThread(e,t)},y=async()=>{await n.switchToNewThread()},h=()=>n.getLoadThreadsPromise(),g=()=>n.reload(),_=()=>n.loadMore(),t[22]=n,t[23]=h,t[24]=g,t[25]=_,t[26]=v,t[27]=y);let b;t[28]===r?b=t[29]:(b=()=>r,t[28]=r,t[29]=b);let x;return t[30]!==h||t[31]!==g||t[32]!==_||t[33]!==b||t[34]!==f||t[35]!==p||t[36]!==m||t[37]!==v||t[38]!==y?(x={getState:f,thread:p,item:m,switchToThread:v,switchToNewThread:y,getLoadThreadsPromise:h,reload:g,loadMore:_,__internal_getAssistantRuntime:b},t[30]=h,t[31]=g,t[32]=_,t[33]=b,t[34]=f,t[35]=p,t[36]=m,t[37]=v,t[38]=y,t[39]=x):x=t[39],x}),nne=Bh(e=>({getState:()=>e})),rne=Bh(e=>{let t=W(11),n;t[0]===e?n=t[1]:(n=()=>({suggestions:(e??[]).map(ine)}),t[0]=e,t[1]=n);let[r]=Th(n),i;t[2]===r.suggestions?i=t[3]:(i=r.suggestions.map(ane),t[2]=r.suggestions,t[3]=i);let a=e_(i),o;t[4]===r?o=t[5]:(o=()=>r,t[4]=r,t[5]=o);let s;t[6]===a?s=t[7]:(s=e=>{let{index:t}=e;return a.get({index:t})},t[6]=a,t[7]=s);let c;return t[8]!==o||t[9]!==s?(c={getState:o,suggestion:s},t[8]=o,t[9]=s,t[10]=c):c=t[10],c});function ine(e){return typeof e==`string`?{title:e,label:``,prompt:e}:{title:e.title,label:e.label,prompt:e.prompt}}function ane(e,t){return Vh(t,nne(e),[e])}var one=(e,t)=>{e.thread??=Bg({source:`threads`,query:{type:`main`},get:e=>e.threads().thread(`main`)}),e.threadListItem??=Bg({source:`threads`,query:{type:`main`},get:e=>e.threads().item(`main`)}),e.composer??=Bg({source:`thread`,query:{},get:e=>e.threads().thread(`main`).composer()}),!e.modelContext&&t.modelContext.source===null&&(e.modelContext=_g()),!e.suggestions&&t.suggestions.source===null&&(e.suggestions=rne())},o_=e=>{let t=W(6),n=Kg(),r,i;t[0]!==n||t[1]!==e?(r=()=>e.registerModelContextProvider(n.current.modelContext()),i=[e,n],t[0]=n,t[1]=e,t[2]=r,t[3]=i):(r=t[2],i=t[3]),kh(r,i);let a;return t[4]===e?a=t[5]:(a=tne({runtime:e.threads,__internal_assistantRuntime:e}),t[4]=e,t[5]=a),ng(a)},sne=Bh(o_);Hg(o_,(e,t)=>{one(e,t),!e.tools&&t.tools.source===null&&(e.tools=Rte({})),!e.dataRenderers&&t.dataRenderers.source===null&&(e.dataRenderers=lg())});var cne=e=>e._core?.RenderComponent,lne=(0,U.memo)(({runtime:e,aui:t=null,children:n})=>{"use no memo";let r=Xg({threads:sne(e)},{parent:t}),i=cne(e),a=(0,z.jsxs)(Rg,{value:r,children:[i&&(0,z.jsx)(i,{}),n]});return t?(0,z.jsx)(Rg,{value:t,children:a}):a}),s_=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},une=(e=>e?s_(e):s_),dne=e=>e;function fne(e,t=dne){let n=I.useSyncExternalStore(e.subscribe,I.useCallback(()=>t(e.getState()),[e,t]),I.useCallback(()=>t(e.getInitialState()),[e,t]));return I.useDebugValue(n),n}var c_=e=>{let t=une(e),n=e=>fne(t,e);return Object.assign(n,t),n},l_=(e=>e?c_(e):c_),u_=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});if(!e||!t)throw Error(`Failed to create promise`);return{promise:n,resolve:e,reject:t}},pne=()=>{let e=[],t=!1,n,r,i=i=>{i.promise||=i.reader.read().then(({done:a,value:o})=>{i.promise=void 0,a?(e.splice(e.indexOf(i),1),t&&e.length===0&&n.close()):n.enqueue(o),r?.resolve(),r=void 0}).catch(t=>{console.error(t),e.forEach(e=>{e.reader.cancel()}),e.length=0,n.error(t),r?.reject(t),r=void 0})};return{readable:new ReadableStream({start(e){n=e},pull(){return r=u_(),e.forEach(e=>{i(e)}),r.promise},cancel(){e.forEach(e=>{e.reader.cancel()}),e.length=0}}),isSealed(){return t},seal(){t=!0,e.length===0&&n.close()},addStream(n){if(t)throw Error(`Cannot add streams after the run callback has settled.`);let r={reader:n.getReader()};e.push(r),i(r)},enqueue(e){this.addStream(new ReadableStream({start(t){t.enqueue(e),t.close()}}))}}},d_=class{_controller;_isClosed=!1;constructor(e){this._controller=e}append(e){return this._controller.enqueue({type:`text-delta`,path:[],textDelta:e}),this}close(){this._isClosed||(this._isClosed=!0,this._controller.enqueue({type:`part-finish`,path:[]}),this._controller.close())}},f_=e=>new ReadableStream({start(t){return e.start?.(new d_(t))},pull(t){return e.pull?.(new d_(t))},cancel(t){return e.cancel?.(t)}}),p_=()=>{let e;return[f_({start(t){e=t}}),e]},m_=class{_controller;_isClosed=!1;_mergeTask;constructor(e){this._controller=e;let t=f_({start:e=>{this._argsTextController=e}}),n=!1;this._mergeTask=t.pipeTo(new WritableStream({write:e=>{switch(e.type){case`text-delta`:n=!0,this._controller.enqueue(e);break;case`part-finish`:n||this._controller.enqueue({type:`text-delta`,textDelta:`{}`,path:[]}),this._controller.enqueue({type:`tool-call-args-text-finish`,path:[]});break;default:throw Error(`Unexpected chunk type: ${e.type}`)}}}))}get argsText(){return this._argsTextController}_argsTextController;async setResponse(e){this._argsTextController.close(),await Promise.resolve(),this._controller.enqueue({type:`result`,path:[],...e.artifact===void 0?{}:{artifact:e.artifact},result:e.result,isError:e.isError??!1,...e.modelContent===void 0?{}:{modelContent:e.modelContent},...e.messages===void 0?{}:{messages:e.messages}})}async close(){this._isClosed||(this._isClosed=!0,this._argsTextController.close(),await this._mergeTask,this._controller.enqueue({type:`part-finish`,path:[]}),this._controller.close())}},mne=e=>new ReadableStream({start(t){return e.start?.(new m_(t))},pull(t){return e.pull?.(new m_(t))},cancel(t){return e.cancel?.(t)}}),hne=()=>{let e;return[mne({start(t){e=t}}),e]},h_=class{value=-1;up(){return++this.value}},gne=class extends TransformStream{constructor(e){super({transform(t,n){n.enqueue({...t,path:[e,...t.path]})}})}};TransformStream;var _ne=class extends TransformStream{constructor(e){let t=new h_,n=new Map;super({transform(r,i){r.type===`part-start`&&r.path.length===0&&n.set(t.up(),e.up());let[a,...o]=r.path;if(a===void 0){i.enqueue(r);return}let s=n.get(a);if(s===void 0)throw Error(`Path not found`);i.enqueue({...r,path:[s,...o]})}})}},vne=class extends TransformStream{constructor(e){super();let t=e(super.readable);Object.defineProperty(this,"readable",{value:t,writable:!1})}},g_=class extends TransformStream{constructor(){let e=[];super({transform(t,n){if(t.type===`part-start`){if(t.path.length!==0){n.error(Error(`Nested parts are not supported`));return}e.push(t.part),n.enqueue(t);return}if(t.type===`text-delta`||t.type===`result`||t.type===`part-finish`||t.type===`tool-call-args-text-finish`){if(t.path.length!==1){n.error(Error(`${t.type} chunks must have a path of length 1`));return}let r=t.path[0];if(r<0||r>=e.length){n.error(Error(`Invalid path index: ${r}`));return}let i=e[r];n.enqueue({...t,meta:i});return}n.enqueue(t)}})}},__=(e,t=21)=>(n=t)=>{let r=``,i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r},yne=__(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,7),bne=class e{_state;_parentId;constructor(e){this._state=e||{merger:pne(),contentCounter:new h_}}get __internal_isClosed(){return this._state.merger.isSealed()}__internal_getReadable(){return this._state.merger.readable}__internal_subscribeToClose(e){this._state.closeSubscriber=e}_addPart(e,t){this._state.append&&(this._state.append.controller.close(),this._state.append=void 0),this.enqueue({type:`part-start`,part:e,path:[]}),this._state.merger.addStream(t.pipeThrough(new gne(this._state.contentCounter.value)))}merge(e){this._state.merger.addStream(e.pipeThrough(new _ne(this._state.contentCounter)))}appendText(e){(this._state.append?.kind!==`text`||this._state.append.parentId!==this._parentId)&&(this._state.append={kind:`text`,parentId:this._parentId,controller:this.addTextPart()}),this._state.append.controller.append(e)}appendReasoning(e){(this._state.append?.kind!==`reasoning`||this._state.append.parentId!==this._parentId)&&(this._state.append={kind:`reasoning`,parentId:this._parentId,controller:this.addReasoningPart()}),this._state.append.controller.append(e)}addTextPart(){let[e,t]=p_();return this._addPart(this._withParentIdOption({type:`text`}),e),t}addReasoningPart(){let[e,t]=p_();return this._addPart(this._withParentIdOption({type:`reasoning`}),e),t}addToolCallPart(e){let t=typeof e==`string`?{toolName:e}:e,n=t.toolName,r=t.toolCallId??yne(),[i,a]=hne();return this._addPart({type:`tool-call`,toolName:n,toolCallId:r,...this._parentId&&{parentId:this._parentId}},i),t.argsText!==void 0&&(a.argsText.append(t.argsText),a.argsText.close()),t.args!==void 0&&(a.argsText.append(JSON.stringify(t.args)),a.argsText.close()),t.response!==void 0&&a.setResponse(t.response),a}_finishedPartStream(){return new ReadableStream({start(e){e.enqueue({type:`part-finish`,path:[]}),e.close()}})}_withParentIdOption(e){return this._parentId?{...e,parentId:this._parentId}:e}appendSource(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}appendFile(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}appendData(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}enqueue(e){this._state.merger.enqueue(e),e.type===`part-start`&&e.path.length===0&&this._state.contentCounter.up()}withParentId(t){let n=new e(this._state);return n._parentId=t,n}close(){this._state.append?.controller?.close(),this._state.merger.seal(),this._state.closeSubscriber?.()}};function xne(e){let t=new bne;return(async()=>{try{await e(t)}catch(e){throw t.__internal_isClosed||t.enqueue({type:`error`,path:[],error:String(e)}),e}finally{t.__internal_isClosed||t.close()}})(),t.__internal_getReadable()}function Sne(){let{resolve:e,promise:t}=u_(),n;return[xne(r=>(n=r,n.__internal_subscribeToClose(e),t)),n]}function Cne(e){let t=[`ROOT`],n=-1,r=null,i=[],a;function o(){a!==void 0&&(i.push(JSON.parse(`"${a}"`)),a=void 0)}function s(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`),o();break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`),o();break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`),o();break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`),o();break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`),o();break}}function c(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop(),a=i.pop();break}}function l(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`),a=(Number(a)+1).toString();break;case`]`:n=r,t.pop(),a=i.pop();break}}for(let o=0;o<e.length;o++){let u=e[o];switch(t[t.length-1]){case`ROOT`:s(u,o,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`),a=``;break;case`}`:n=o,t.pop(),a=i.pop();break}break;case`INSIDE_OBJECT_AFTER_COMMA`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`),a=``;break}break;case`INSIDE_OBJECT_KEY`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`);break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`),a+=u;break;default:a+=u;break}break;case`INSIDE_OBJECT_AFTER_KEY`:switch(u){case`:`:t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`);break}break;case`INSIDE_OBJECT_BEFORE_VALUE`:s(u,o,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:c(u,o);break;case`INSIDE_STRING`:switch(u){case`"`:t.pop(),n=o,a=i.pop();break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=o}break;case`INSIDE_ARRAY_START`:switch(u){case`]`:n=o,t.pop(),a=i.pop();break;default:n=o,a=`0`,s(u,o,`INSIDE_ARRAY_AFTER_VALUE`);break}break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(u){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`),a=(Number(a)+1).toString();break;case`]`:n=o,t.pop(),a=i.pop();break;default:n=o;break}break;case`INSIDE_ARRAY_AFTER_COMMA`:s(u,o,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),t[t.length-1]===`INSIDE_STRING`?n=o:t[t.length-1]===`INSIDE_OBJECT_KEY`&&(a+=u);break;case`INSIDE_NUMBER`:switch(u){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=o;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),a=i.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&l(u,o),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&c(u,o);break;case`}`:t.pop(),a=i.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&c(u,o);break;case`]`:t.pop(),a=i.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&l(u,o);break;default:t.pop(),a=i.pop();break}break;case`INSIDE_LITERAL`:{let i=e.substring(r,o+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?c(u,o):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&l(u,o)):n=o;break}}}let u=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:u+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:u+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:u+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?u+=`true`.slice(t.length):`false`.startsWith(t)?u+=`false`.slice(t.length):`null`.startsWith(t)&&(u+=`null`.slice(t.length))}}return[u,i]}var v_=u(o(((e,t)=>{var n=typeof Buffer<`u`,r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,a){a==null&&typeof t==`object`&&t&&(a=t,t=void 0),n&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let s=JSON.parse(e,t);if(typeof s!=`object`||!s)return s;let c=a&&a.protoAction||`error`,l=a&&a.constructorAction||`error`;if(c===`ignore`&&l===`ignore`)return s;if(c!==`ignore`&&l!==`ignore`){if(r.test(e)===!1&&i.test(e)===!1)return s}else if(c!==`ignore`&&l===`ignore`){if(r.test(e)===!1)return s}else if(i.test(e)===!1)return s;return o(s,{protoAction:c,constructorAction:l,safe:a&&a.safe})}function o(e,{protoAction:t=`error`,constructorAction:n=`error`,safe:r}={}){let i=[e];for(;i.length;){let e=i;i=[];for(let a of e){if(t!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`__proto__`)){if(r===!0)return null;if(t===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.__proto__}if(n!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`constructor`)&&a.constructor!==null&&typeof a.constructor==`object`&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`)){if(r===!0)return null;if(n===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.constructor}for(let e in a){let t=a[e];t&&typeof t==`object`&&i.push(t)}}}return e}function s(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}function c(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return a(e,t,{safe:!0})}catch{return}finally{Error.stackTraceLimit=n}}t.exports=s,t.exports.default=s,t.exports.parse=s,t.exports.safeParse=c,t.exports.scan=o}))(),1),y_=Symbol(`aui.parse-partial-json-object.meta`),wne=e=>e?.[y_],b_=e=>{if(e.length===0)return{[y_]:{state:`partial`,partialPath:[]}};try{let t=v_.default.parse(e);if(typeof t!=`object`||!t)throw Error(`argsText is expected to be an object`);return t[y_]={state:`complete`,partialPath:[]},t}catch{try{let[t,n]=Cne(e),r=v_.default.parse(t);if(typeof r!=`object`||!r)throw Error(`argsText is expected to be an object`);return r[y_]={state:`partial`,partialPath:n},r}catch{return}}},x_=(e,t,n)=>{if(typeof e!=`object`||!e)return t.state;if(t.state===`complete`)return`complete`;if(n.length===0)return t.state;let[r,...i]=n;if(!Object.hasOwn(e,r))return`partial`;let[a,...o]=t.partialPath;if(r!==a)return`complete`;let s=e[r];return x_(s,{state:`partial`,partialPath:o},i)},S_=(e,t)=>{let n=wne(e);if(!n)throw Error(`unable to determine object state`);return x_(e,n,t.map(String))};async function*C_(){let e=this.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)break;yield n}}finally{e.releaseLock()}}function w_(e){return e[Symbol.asyncIterator]??=C_,e}var T_=Symbol.for(`aui.tool-response`),E_=class e{get[T_](){return!0}artifact;result;isError;modelContent;messages;constructor(e){e.artifact!==void 0&&(this.artifact=e.artifact),this.result=e.result,this.isError=e.isError??!1,e.modelContent!==void 0&&(this.modelContent=e.modelContent),e.messages!==void 0&&(this.messages=e.messages)}static[Symbol.hasInstance](e){return typeof e==`object`&&!!e&&T_ in e}static toResponse(t){return t instanceof e?t:new e({result:t===void 0?`<no result>`:t})}};function D_(e,t,n){try{let r=e();if(typeof r==`object`&&r&&`then`in r)return r.then(t,n);t(r)}catch(e){n(e)}}function O_(e,t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}var k_=class{resolve;reject;disposed=!1;fieldPath;constructor(e,t,n){this.resolve=e,this.reject=t,this.fieldPath=n}update(e){if(!this.disposed)try{if(S_(e,this.fieldPath)===`complete`){let t=O_(e,this.fieldPath);t!==void 0&&(this.resolve(t),this.dispose())}}catch(e){this.reject(e),this.dispose()}}end(e){if(!this.disposed)try{let t=O_(e,this.fieldPath);this.resolve(t)}catch(e){this.reject(e)}finally{this.dispose()}}dispose(){this.disposed=!0}},A_=class{controller;disposed=!1;fieldPath;constructor(e,t){this.controller=e,this.fieldPath=t}update(e){if(!this.disposed)try{let t=O_(e,this.fieldPath);t!==void 0&&this.controller.enqueue(t),S_(e,this.fieldPath)===`complete`&&(this.controller.close(),this.dispose())}catch(e){this.controller.error(e),this.dispose()}}end(){this.disposed||(this.controller.close(),this.dispose())}dispose(){this.disposed=!0}},j_=class{controller;disposed=!1;fieldPath;lastValue=void 0;constructor(e,t){this.controller=e,this.fieldPath=t}update(e){if(!this.disposed)try{let t=O_(e,this.fieldPath);if(t!==void 0&&typeof t==`string`){let e=t.substring(this.lastValue?.length||0);this.lastValue=t,this.controller.enqueue(e)}S_(e,this.fieldPath)===`complete`&&(this.controller.close(),this.dispose())}catch(e){this.controller.error(e),this.dispose()}}end(){this.disposed||(this.controller.close(),this.dispose())}dispose(){this.disposed=!0}},M_=class{controller;disposed=!1;fieldPath;processedIndexes=new Set;constructor(e,t){this.controller=e,this.fieldPath=t}update(e){if(!this.disposed)try{let t=O_(e,this.fieldPath);if(!Array.isArray(t))return;for(let n=0;n<t.length;n++)this.processedIndexes.has(n)||S_(e,[...this.fieldPath,n])===`complete`&&(this.controller.enqueue(t[n]),this.processedIndexes.add(n));S_(e,this.fieldPath)===`complete`&&(this.controller.close(),this.dispose())}catch(e){this.controller.error(e),this.dispose()}}end(){this.disposed||(this.controller.close(),this.dispose())}dispose(){this.disposed=!0}},N_=class{argTextDeltas;handles=new Set;args=b_(``);finished=!1;constructor(e){this.argTextDeltas=e,this.processStream()}async processStream(){try{let e=``,t=this.argTextDeltas.getReader();for(;;){let{value:n,done:r}=await t.read();if(r)break;e+=n;let i=b_(e);if(i!==void 0){this.args=i;for(let e of this.handles)e.update(i)}}}catch(e){console.error(`Error processing argument stream:`,e)}finally{this.finished=!0;for(let e of this.handles)e.end(this.args);this.handles.clear()}}get(...e){return new Promise((t,n)=>{let r=new k_(t,n,e);if(this.args&&S_(this.args,e)===`complete`){let n=O_(this.args,e);if(n!==void 0){t(n);return}}if(this.finished){r.end(this.args);return}this.handles.add(r),r.update(this.args)})}streamValues(...e){let t=e,n;return w_(new ReadableStream({start:e=>{n=new A_(e,t),this.finished||this.handles.add(n),n.update(this.args),this.finished&&n.end()},cancel:()=>{n&&(n.dispose(),this.handles.delete(n))}}))}streamText(...e){let t=e,n;return w_(new ReadableStream({start:e=>{n=new j_(e,t),this.finished||this.handles.add(n),n.update(this.args),this.finished&&n.end()},cancel:()=>{n&&(n.dispose(),this.handles.delete(n))}}))}forEach(...e){let t=e,n;return w_(new ReadableStream({start:e=>{n=new M_(e,t),this.finished||this.handles.add(n),n.update(this.args),this.finished&&n.end()},cancel:()=>{n&&(n.dispose(),this.handles.delete(n))}}))}},P_=class{promise;constructor(e){this.promise=e}get(){return this.promise}},F_=class{args;response;writable;resolve;argsText=``;constructor(){let e=new TransformStream;this.writable=e.writable,this.args=new N_(e.readable);let{promise:t,resolve:n}=u_();this.resolve=n,this.response=new P_(t)}async appendArgsTextDelta(e){let t=this.writable.getWriter();try{await t.write(e)}catch(e){console.warn(e)}finally{t.releaseLock()}this.argsText+=e}async finishArgsText(){let e=this.writable.getWriter();try{await e.close()}catch(e){console.warn(e)}finally{e.releaseLock()}}setResponse(e){this.resolve(e)}result={get:async()=>(await this.response.get()).result}},I_=class extends vne{constructor(e){let t=new Map,n=new Map;super(r=>{let i=new TransformStream({async transform(r,i){switch((r.type!==`part-finish`||r.meta.type!==`tool-call`)&&i.enqueue(r),r.type){case`part-start`:if(r.part.type===`tool-call`){let t=new F_;n.set(r.part.toolCallId,t),e.streamCall({reader:t,toolCallId:r.part.toolCallId,toolName:r.part.toolName})}break;case`text-delta`:if(r.meta.type===`tool-call`){let e=r.meta.toolCallId,t=n.get(e);if(!t)throw Error(`No controller found for tool call`);await t.appendArgsTextDelta(r.textDelta)}break;case`result`:{if(r.meta.type!==`tool-call`)break;let{toolCallId:e}=r.meta,t=n.get(e);if(!t)throw Error(`No controller found for tool call`);t.setResponse(new E_({result:r.result,artifact:r.artifact,isError:r.isError,modelContent:r.modelContent}));break}case`tool-call-args-text-finish`:{if(r.meta.type!==`tool-call`)break;let{toolCallId:a,toolName:o}=r.meta,s=n.get(a);if(!s)throw Error(`No controller found for tool call`);await s.finishArgsText();let c=!1,l=D_(()=>{let t;try{t=v_.default.parse(s.argsText)}catch(e){throw Error(`Function parameter parsing failed. ${JSON.stringify(e.message)}`)}let n=e.execute({toolCallId:a,toolName:o,args:t});return n!==void 0&&(c=!0,e.onExecutionStart?.(a,o)),n},t=>{if(c&&e.onExecutionEnd?.(a,o),t===void 0)return;let n=new E_({artifact:t.artifact,result:t.result,isError:t.isError,messages:t.messages,modelContent:t.modelContent});s.setResponse(n),i.enqueue({type:`result`,path:r.path,...n})},t=>{c&&e.onExecutionEnd?.(a,o);let n=new E_({result:String(t),isError:!0});s.setResponse(n),i.enqueue({type:`result`,path:r.path,...n})});l&&t.set(a,l);break}case`part-finish`:{if(r.meta.type!==`tool-call`)break;let{toolCallId:e}=r.meta,a=t.get(e);a?a.then(()=>{t.delete(e),n.delete(e),i.enqueue(r)}):i.enqueue(r)}}},async flush(){await Promise.all(t.values())}});return r.pipeThrough(new g_).pipeThrough(i)})}},L_=e=>typeof e==`object`&&!!e&&`~standard`in e&&e[`~standard`].version===1;function R_(e,t,n,r){let i=e?.[n.toolName];return i?.execute?(async e=>{if(t.aborted)return new E_({result:`Tool execution was cancelled.`,isError:!0});let a=e;if(L_(i.parameters)){let e=i.parameters[`~standard`].validate(n.args);e instanceof Promise&&(e=await e),e.issues&&(a=i.experimental_onSchemaValidationError??(()=>{throw Error(`Function parameter validation failed. ${JSON.stringify(e.issues)}`)}))}let o=new Promise(e=>{let n=()=>{queueMicrotask(()=>{queueMicrotask(()=>{e(new E_({result:`Tool execution was cancelled.`,isError:!0}))})})};t.aborted?n():t.addEventListener(`abort`,n,{once:!0})}),s=(async()=>{let e=await a(n.args,{toolCallId:n.toolCallId,abortSignal:t,human:e=>r(n.toolCallId,e)}),o=E_.toResponse(e);if(i.toModelOutput&&!o.isError&&o.modelContent===void 0)try{let e=await i.toModelOutput({toolCallId:n.toolCallId,input:n.args,output:o.result});return new E_({result:o.result,artifact:o.artifact,isError:o.isError,messages:o.messages,modelContent:e})}catch(e){console.warn(`[assistant-stream] tool "${n.toolName}" toModelOutput threw; falling back to default projection.`,e)}return o})();return Promise.race([s,o])})(i.execute):void 0}function z_(e,t,n,r,i){e?.[r.toolName]?.streamCall?.(n,{toolCallId:r.toolCallId,abortSignal:t,human:e=>i(r.toolCallId,e)})}function B_(e,t,n,r){let i=typeof e==`function`?e:()=>e,a=typeof t==`function`?t:()=>t;return new I_({execute:e=>R_(i(),a(),e,n),streamCall:({reader:e,...t})=>z_(i(),a(),e,t,n),onExecutionStart:r?.onExecutionStart,onExecutionEnd:r?.onExecutionEnd})}var V_=e=>{let t=W(7),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Bg({source:`message`,query:{type:`index`,index:n},get:e=>e.message().attachment({index:n})}),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={attachment:i},t[2]=i,t[3]=a);let o=Xg(a),s;return t[4]!==o||t[5]!==r?(s=(0,z.jsx)(Rg,{value:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},H_=e=>{let t=W(7),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Bg({source:`composer`,query:{type:`index`,index:n},get:e=>e.composer().attachment({index:n})}),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={attachment:i},t[2]=i,t[3]=a);let o=Xg(a),s;return t[4]!==o||t[5]!==r?(s=(0,z.jsx)(Rg,{value:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},U_=e=>{let t=W(10),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Bg({source:`thread`,query:{type:`index`,index:n},get:e=>e.thread().message({index:n})}),t[0]=n,t[1]=i);let a;t[2]===n?a=t[3]:(a=Bg({source:`message`,query:{},get:e=>e.thread().message({index:n}).composer()}),t[2]=n,t[3]=a);let o;t[4]!==i||t[5]!==a?(o={message:i,composer:a},t[4]=i,t[5]=a,t[6]=o):o=t[6];let s=Xg(o),c;return t[7]!==s||t[8]!==r?(c=(0,z.jsx)(Rg,{value:s,children:r}),t[7]=s,t[8]=r,t[9]=c):c=t[9],c},W_=e=>{let t=W(7),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Bg({source:`message`,query:{type:`index`,index:n},get:e=>e.message().part({index:n})}),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={part:i},t[2]=i,t[3]=a);let o=Xg(a),s;return t[4]!==o||t[5]!==r?(s=(0,z.jsx)(Rg,{value:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},G_=Bh(e=>{let t=W(7),{text:n,isRunning:r}=e,i;t[0]===r?i=t[1]:(i=r?{type:`running`}:{type:`complete`},t[0]=r,t[1]=i);let a;t[2]!==i||t[3]!==n?(a={type:`text`,text:n,status:i},t[2]=i,t[3]=n,t[4]=a):a=t[4];let o=a,s;return t[5]===o?s=t[6]:(s={getState:()=>o,addToolResult:q_,resumeToolCall:J_,respondToToolApproval:Y_},t[5]=o,t[6]=s),s}),K_=e=>{let t=W(8),{text:n,isRunning:r,children:i}=e,a=r===void 0?!1:r,o;t[0]!==a||t[1]!==n?(o=G_({text:n,isRunning:a}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let s;t[3]===o?s=t[4]:(s={part:o},t[3]=o,t[4]=s);let c=Xg(s),l;return t[5]!==c||t[6]!==i?(l=(0,z.jsx)(Rg,{value:c,children:i}),t[5]=c,t[6]=i,t[7]=l):l=t[7],l};function q_(){throw Error(`Not supported`)}function J_(){throw Error(`Not supported`)}function Y_(){throw Error(`Not supported`)}var X_=Object.freeze({type:`complete`}),Z_=Bh(e=>{let t=W(9),{parts:n,getMessagePart:r}=e,[i,a]=Th(!0),o=n[n.length-1]?.status??X_,s;t[0]!==i||t[1]!==n||t[2]!==o?(s={parts:n,collapsed:i,status:o},t[0]=i,t[1]=n,t[2]=o,t[3]=s):s=t[3];let c=s,l;t[4]===c?l=t[5]:(l=()=>c,t[4]=c,t[5]=l);let u;return t[6]!==r||t[7]!==l?(u={getState:l,setCollapsed:a,part:r},t[6]=r,t[7]=l,t[8]=u):u=t[8],u}),Q_=e=>{let t=W(5),{startIndex:n,endIndex:r,children:i}=e,a=G($_).slice(n,r+1),o=Xg(),s=Z_({parts:a,getMessagePart:e=>{let{index:t}=e;if(t<0||t>=a.length)throw Error(`ChainOfThought part index ${t} is out of bounds (0..${a.length-1})`);return o.message().part({index:n+t})}}),c;t[0]===s?c=t[1]:(c={chainOfThought:s},t[0]=s,t[1]=c);let l=Xg(c),u;return t[2]!==l||t[3]!==i?(u=(0,z.jsx)(Rg,{value:l,children:i}),t[2]=l,t[3]=i,t[4]=u):u=t[4],u};function $_(e){return e.message.parts}var ev=e=>{let t=W(7),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Bg({source:`suggestions`,query:{index:n},get:e=>e.suggestions().suggestion({index:n})}),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={suggestion:i},t[2]=i,t[3]=a);let o=Xg(a),s;return t[4]!==o||t[5]!==r?(s=(0,z.jsx)(Rg,{value:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},tv=e=>{let t=W(7),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Bg({source:`composer`,query:{index:n},get:e=>e.composer().queueItem({index:n})}),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={queueItem:i},t[2]=i,t[3]=a);let o=Xg(a),s;return t[4]!==o||t[5]!==r?(s=(0,z.jsx)(Rg,{value:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},nv=Symbol(`innerMessage`),rv=Symbol(`innerMessages`),iv=[],av=(e,t)=>{nv in e||(e[nv]=t)},ov=e=>{let t=`messages`in e?e.messages:e,n=t[rv]||t[nv];return n?Array.isArray(n)?n:(t[rv]=[n],t[rv]):iv},sv=Symbol(`skip-update`);function cv(e,t){if(e===void 0&&t===void 0)return!0;if(e===void 0||t===void 0)return!1;for(let n of Object.keys(e)){let r=e[n],i=t[n];if(!Object.is(r,i))return!1}return!0}var lv=class{_subscribers=new Set;subscribe(e){return this._subscribers.add(e),()=>this._subscribers.delete(e)}waitForUpdate(){return new Promise(e=>{let t=this.subscribe(()=>{t(),e()})})}_notifySubscribers(){let e=[];for(let t of this._subscribers)try{t()}catch(t){e.push(t)}if(e.length>0){if(e.length===1)throw e[0];for(let t of e)console.error(t);throw AggregateError(e)}}},uv=class{_subscriptions=new Set;_connection;get isConnected(){return!!this._connection}notifySubscribers(e){for(let t of this._subscriptions)t(e)}_updateConnection(){if(this._subscriptions.size>0){if(this._connection)return;this._connection=this._connect()}else this._connection?.(),this._connection=void 0}subscribe(e){return this._subscriptions.add(e),this._updateConnection(),()=>{this._subscriptions.delete(e),this._updateConnection()}}},dv=class extends uv{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e;let t=e.getState();if(t===sv)throw Error(`Entry not available in the store`);this._previousState=t}_previousState;getState=()=>(this.isConnected||this._syncState(),this._previousState);_syncState(){let e=this.binding.getState();return e===sv||cv(e,this._previousState)?!1:(this._previousState=e,!0)}_connect(){return this.binding.subscribe(()=>{this._syncState()&&this.notifySubscribers()})}},fv=class extends uv{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e}_previousStateDirty=!0;_previousState;getState=()=>{if(!this.isConnected||this._previousStateDirty){let e=this.binding.getState();e!==sv&&(this._previousState=e),this._previousStateDirty=!1}if(this._previousState===void 0)throw Error(`Entry not available in the store`);return this._previousState};_connect(){return this.binding.subscribe(()=>{this._previousStateDirty=!0,this.notifySubscribers()})}},pv=class extends uv{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e}getState(){return this.binding.getState()}outerSubscribe(e){return this.binding.subscribe(e)}_connect(){let e=()=>{this.notifySubscribers()},t=this.binding.getState(),n=t?.subscribe(e),r=this.outerSubscribe(()=>{let r=this.binding.getState();r!==t&&(t=r,n?.(),n=r?.subscribe(e),e())});return()=>{r?.(),n?.()}}},mv=class extends uv{config;constructor(e){super(),this.config=e}getState(){return this.config.binding.getState()}outerSubscribe(e){return this.config.binding.subscribe(e)}_connect(){let e=e=>{this.notifySubscribers(e)},t=this.config.binding.getState(),n=t?.unstable_on(this.config.event,e),r=this.outerSubscribe(()=>{let r=this.config.binding.getState();r!==t&&(t=r,n?.(),n=r?.unstable_on(this.config.event,e))});return()=>{r?.(),n?.()}}},hv=class{_core;get path(){return this._core.path}constructor(e){this._core=e,this.__internal_bindMethods()}__internal_bindMethods(){this.getState=this.getState.bind(this),this.remove=this.remove.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this._core.getState()}subscribe(e){return this._core.subscribe(e)}},gv=class extends hv{_composerApi;constructor(e,t){super(e),this._composerApi=t}remove(){let e=this._composerApi.getState();if(!e)throw Error(`Composer is not available`);return e.removeAttachment(this.getState().id)}},_v=class extends gv{get source(){return`thread-composer`}},vv=class extends gv{get source(){return`edit-composer`}},yv=class extends hv{get source(){return`message`}remove(){throw Error(`Message attachments cannot be removed`)}},bv=Object.freeze([]),xv=Object.freeze({}),Tne=e=>Object.freeze({type:`thread`,isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,canSend:e?.canSend??!1,isEmpty:e?.isEmpty??!0,attachments:e?.attachments??bv,text:e?.text??``,role:e?.role??`user`,runConfig:e?.runConfig??xv,attachmentAccept:e?.attachmentAccept??``,dictation:e?.dictation,quote:e?.quote,queue:e?.queue??bv,value:e?.text??``}),Ene=e=>Object.freeze({type:`edit`,isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,canSend:e?.canSend??!1,isEmpty:e?.isEmpty??!0,text:e?.text??``,role:e?.role??`user`,attachments:e?.attachments??bv,runConfig:e?.runConfig??xv,attachmentAccept:e?.attachmentAccept??``,dictation:e?.dictation,quote:e?.quote,queue:e?.queue??bv,parentId:e?.parentId??null,sourceId:e?.sourceId??null,value:e?.text??``}),Sv=class{_core;get path(){return this._core.path}constructor(e){this._core=e}__internal_bindMethods(){this.setText=this.setText.bind(this),this.setRunConfig=this.setRunConfig.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.addAttachment=this.addAttachment.bind(this),this.reset=this.reset.bind(this),this.clearAttachments=this.clearAttachments.bind(this),this.send=this.send.bind(this),this.cancel=this.cancel.bind(this),this.steerQueueItem=this.steerQueueItem.bind(this),this.removeQueueItem=this.removeQueueItem.bind(this),this.setRole=this.setRole.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.startDictation=this.startDictation.bind(this),this.stopDictation=this.stopDictation.bind(this),this.setQuote=this.setQuote.bind(this),this.unstable_on=this.unstable_on.bind(this)}setText(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.setText(e)}setRunConfig(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.setRunConfig(e)}addAttachment(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);return t.addAttachment(e)}reset(){let e=this._core.getState();if(!e)throw Error(`Composer is not available`);return e.reset()}clearAttachments(){let e=this._core.getState();if(!e)throw Error(`Composer is not available`);return e.clearAttachments()}send(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.send(e)}cancel(){let e=this._core.getState();if(!e)throw Error(`Composer is not available`);e.cancel()}steerQueueItem(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.steerQueueItem(e)}removeQueueItem(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.removeQueueItem(e)}setRole(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.setRole(e)}startDictation(){let e=this._core.getState();if(!e)throw Error(`Composer is not available`);e.startDictation()}stopDictation(){let e=this._core.getState();if(!e)throw Error(`Composer is not available`);e.stopDictation()}setQuote(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.setQuote(e)}subscribe(e){return this._core.subscribe(e)}_eventSubscriptionSubjects=new Map;unstable_on(e,t){let n=this._eventSubscriptionSubjects.get(e);return n||(n=new mv({event:e,binding:this._core}),this._eventSubscriptionSubjects.set(e,n)),n.subscribe(t)}},Dne=class extends Sv{get path(){return this._core.path}get type(){return`thread`}_getState;constructor(e){let t=new fv({path:e.path,getState:()=>Tne(e.getState()),subscribe:t=>e.subscribe(t)});super({path:e.path,getState:()=>e.getState(),subscribe:e=>t.subscribe(e)}),this._getState=t.getState.bind(t),this.__internal_bindMethods()}getState(){return this._getState()}getAttachmentByIndex(e){return new _v(new dv({path:{...this.path,attachmentSource:`thread-composer`,attachmentSelector:{type:`index`,index:e},ref:`${this.path.ref}.attachments[${e}]`},getState:()=>{let t=this.getState().attachments[e];return t?{...t,source:`thread-composer`}:sv},subscribe:e=>this._core.subscribe(e)}),this._core)}},One=class extends Sv{_beginEdit;get path(){return this._core.path}get type(){return`edit`}_getState;constructor(e,t){let n=new fv({path:e.path,getState:()=>Ene(e.getState()),subscribe:t=>e.subscribe(t)});super({path:e.path,getState:()=>e.getState(),subscribe:e=>n.subscribe(e)}),this._beginEdit=t,this._getState=n.getState.bind(n),this.__internal_bindMethods()}__internal_bindMethods(){super.__internal_bindMethods(),this.beginEdit=this.beginEdit.bind(this)}getState(){return this._getState()}beginEdit(){this._beginEdit()}getAttachmentByIndex(e){return new vv(new dv({path:{...this.path,attachmentSource:`edit-composer`,attachmentSelector:{type:`index`,index:e},ref:`${this.path.ref}.attachments[${e}]`},getState:()=>{let t=this.getState().attachments[e];return t?{...t,source:`edit-composer`}:sv},subscribe:e=>this._core.subscribe(e)}),this._core)}},Cv=e=>e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
78
|
-
|
|
79
|
-
`),wv={"allow-once":!0,"allow-always":!0,"reject-once":!1,"reject-always":!1},kne=(e,t)=>{let n,r;if(`optionId`in t){let i=e.options?.find(e=>e.id===t.optionId);if(!i)throw Error(`Tool approval has no option with id "${t.optionId}"`);if(`approved`in t)n=t.approved;else{if(!Object.hasOwn(wv,i.kind))throw Error(`Tool approval option "${i.id}" has a custom kind "${i.kind}"; respond with an explicit approved value instead`);n=wv[i.kind]}r=i.id}else n=t.approved;return{approvalId:e.id,approved:n,...r!==void 0&&{optionId:r},...t.reason!=null&&{reason:t.reason}}},Tv=class{contentBinding;messageApi;threadApi;get path(){return this.contentBinding.path}constructor(e,t,n){this.contentBinding=e,this.messageApi=t,this.threadApi=n,this.__internal_bindMethods()}__internal_bindMethods(){this.addToolResult=this.addToolResult.bind(this),this.resumeToolCall=this.resumeToolCall.bind(this),this.respondToToolApproval=this.respondToToolApproval.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this.contentBinding.getState()}addToolResult(e){let t=this.contentBinding.getState();if(!t)throw Error(`Message part is not available`);if(t.type!==`tool-call`)throw Error(`Tried to add tool result to non-tool message part`);if(!this.messageApi)throw Error(`Message API is not available. This is likely a bug in assistant-ui.`);if(!this.threadApi)throw Error(`Thread API is not available`);let n=this.messageApi.getState();if(!n)throw Error(`Message is not available`);let r=t.toolName,i=t.toolCallId,a=E_.toResponse(e);this.threadApi.getState().addToolResult({messageId:n.id,toolName:r,toolCallId:i,result:a.result,artifact:a.artifact,isError:a.isError})}resumeToolCall(e){let t=this.contentBinding.getState();if(!t)throw Error(`Message part is not available`);if(t.type!==`tool-call`)throw Error(`Tried to resume tool call on non-tool message part`);if(!this.threadApi)throw Error(`Thread API is not available`);let n=t.toolCallId;this.threadApi.getState().resumeToolCall({toolCallId:n,payload:e})}respondToToolApproval(e){let t=this.contentBinding.getState();if(!t)throw Error(`Message part is not available`);if(t.type!==`tool-call`)throw Error(`Tried to respond to tool approval on non-tool message part`);if(!t.approval||t.approval.approved!==void 0||t.approval.resolution!==void 0)throw Error(`Tool call has no pending approval`);if(!this.threadApi)throw Error(`Thread API is not available`);this.threadApi.getState().respondToToolApproval(kne(t.approval,e))}subscribe(e){return this.contentBinding.subscribe(e)}},Ev=Object.freeze({type:`complete`}),Ane=(e,t,n)=>{if(e.role!==`assistant`)return Ev;if(n.type===`tool-call`)return n.result?Ev:e.status;let r=t===Math.max(0,e.content.length-1);return e.status.type===`requires-action`?Ev:r?e.status:Ev},Dv=(e,t)=>{let n=e.content[t];if(!n)return sv;let r=Ane(e,t,n);return Object.freeze({...n,[nv]:n[nv],status:r})},jne=class{_core;_threadBinding;get path(){return this._core.path}constructor(e,t){this._core=e,this._threadBinding=t,this.composer=new One(new pv({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.composer`,composerSource:`edit`},getState:this._getEditComposerRuntimeCore,subscribe:e=>this._threadBinding.subscribe(e)}),()=>this._threadBinding.getState().beginEdit(this._core.getState().id)),this.__internal_bindMethods()}__internal_bindMethods(){this.reload=this.reload.bind(this),this.delete=this.delete.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getMessagePartByIndex=this.getMessagePartByIndex.bind(this),this.getMessagePartByToolCallId=this.getMessagePartByToolCallId.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_getCopyText=this.unstable_getCopyText.bind(this),this.speak=this.speak.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.submitFeedback=this.submitFeedback.bind(this),this.switchToBranch=this.switchToBranch.bind(this)}composer;_getEditComposerRuntimeCore=()=>this._threadBinding.getState().getEditComposer(this._core.getState().id);getState(){return this._core.getState()}delete(){let e=this._core.getState();return this._threadBinding.getState().deleteMessage(e.id)}reload(e={}){let t=this._getEditComposerRuntimeCore(),n=t??this._threadBinding.getState().composer,r=t??n,{runConfig:i=r.runConfig}=e,a=this._core.getState();if(a.role!==`assistant`)throw Error(`Can only reload assistant messages`);this._threadBinding.getState().startRun({parentId:a.parentId,sourceId:a.id,runConfig:i})}speak(){let e=this._core.getState();return this._threadBinding.getState().speak(e.id)}stopSpeaking(){let e=this._core.getState();if(this._threadBinding.getState().speech?.messageId===e.id)this._threadBinding.getState().stopSpeaking();else throw Error(`Message is not being spoken`)}submitFeedback({type:e}){let t=this._core.getState();this._threadBinding.getState().submitFeedback({messageId:t.id,type:e})}switchToBranch({position:e,branchId:t}){let n=this._core.getState();if(t&&e)throw Error(`May not specify both branchId and position`);if(!t&&!e)throw Error(`Must specify either branchId or position`);let r=this._threadBinding.getState().getBranches(n.id),i=t;if(e===`previous`?i=r[n.branchNumber-2]:e===`next`&&(i=r[n.branchNumber]),!i)throw Error(`Branch not found`);this._threadBinding.getState().switchToBranch(i)}unstable_getCopyText(){return Cv(this.getState())}subscribe(e){return this._core.subscribe(e)}getMessagePartByIndex(e){if(e<0)throw Error(`Message part index must be >= 0`);return new Tv(new dv({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.content[${e}]`,messagePartSelector:{type:`index`,index:e}},getState:()=>Dv(this.getState(),e),subscribe:e=>this._core.subscribe(e)}),this._core,this._threadBinding)}getMessagePartByToolCallId(e){return new Tv(new dv({path:{...this.path,ref:this.path.ref+`${this.path.ref}.content[toolCallId=${JSON.stringify(e)}]`,messagePartSelector:{type:`toolCallId`,toolCallId:e}},getState:()=>{let t=this._core.getState(),n=t.content.findIndex(t=>t.type===`tool-call`&&t.toolCallId===e);return n===-1?sv:Dv(t,n)},subscribe:e=>this._core.subscribe(e)}),this._core,this._threadBinding)}getAttachmentByIndex(e){return new yv(new dv({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.attachments[${e}]`,attachmentSource:`message`,attachmentSelector:{type:`index`,index:e}},getState:()=>{let t=this.getState().attachments?.[e];return t?{...t,source:`message`}:sv},subscribe:e=>this._core.subscribe(e)}))}},Mne=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{},...e.stream?{stream:e.stream}:{}}),Nne=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{}}),Pne=(e,t)=>typeof t==`string`?{createdAt:new Date,parentId:e.at(-1)?.id??null,sourceId:null,runConfig:{},role:`user`,content:[{type:`text`,text:t}],attachments:[],metadata:{custom:{}}}:{createdAt:t.createdAt??new Date,parentId:t.parentId??e.at(-1)?.id??null,sourceId:t.sourceId??null,role:t.role??`user`,content:t.content,attachments:t.attachments??[],metadata:t.metadata??{custom:{}},runConfig:t.runConfig??{},startRun:t.startRun},Fne=(e,t)=>{let n=e.messages.at(-1);return Object.freeze({threadId:t.id,metadata:t,capabilities:e.capabilities,isDisabled:e.isDisabled,isLoading:e.isLoading,isRunning:e.isRunning??(n?.role===`assistant`?n.status.type===`running`:!1),messages:e.messages,state:e.state,suggestions:e.suggestions,extras:e.extras,speech:e.speech,voice:e.voice})},Ov=class{get path(){return this._threadBinding.path}get __internal_threadBinding(){return this._threadBinding}_threadBinding;constructor(e,t){let n=new dv({path:e.path,getState:()=>Fne(e.getState(),t.getState()),subscribe:n=>{let r=e.subscribe(n),i=t.subscribe(n);return()=>{r(),i()}}});this._threadBinding={path:e.path,getState:()=>e.getState(),getStateState:()=>n.getState(),outerSubscribe:t=>e.outerSubscribe(t),subscribe:t=>e.subscribe(t)},this.composer=new Dne(new pv({path:{...this.path,ref:`${this.path.ref}.composer`,composerSource:`thread`},getState:()=>this._threadBinding.getState().composer,subscribe:e=>this._threadBinding.subscribe(e)})),this.__internal_bindMethods()}__internal_bindMethods(){this.append=this.append.bind(this),this.deleteMessage=this.deleteMessage.bind(this),this.resumeRun=this.resumeRun.bind(this),this.importExternalState=this.importExternalState.bind(this),this.exportExternalState=this.exportExternalState.bind(this),this.startRun=this.startRun.bind(this),this.cancelRun=this.cancelRun.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.connectVoice=this.connectVoice.bind(this),this.disconnectVoice=this.disconnectVoice.bind(this),this.muteVoice=this.muteVoice.bind(this),this.unmuteVoice=this.unmuteVoice.bind(this),this.getVoiceVolume=this.getVoiceVolume.bind(this),this.subscribeVoiceVolume=this.subscribeVoiceVolume.bind(this),this.export=this.export.bind(this),this.import=this.import.bind(this),this.reset=this.reset.bind(this),this.getMessageByIndex=this.getMessageByIndex.bind(this),this.getMessageById=this.getMessageById.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getModelContext=this.getModelContext.bind(this),this.getState=this.getState.bind(this)}composer;getState(){return this._threadBinding.getStateState()}append(e){this._threadBinding.getState().append(Pne(this._threadBinding.getState().messages,e))}deleteMessage(e){return this._threadBinding.getState().deleteMessage(e)}subscribe(e){return this._threadBinding.subscribe(e)}getModelContext(){return this._threadBinding.getState().getModelContext()}startRun(e){return this._threadBinding.getState().startRun(Nne(e))}resumeRun(e){return this._threadBinding.getState().resumeRun(Mne(e))}exportExternalState(){return this._threadBinding.getState().exportExternalState()}importExternalState(e){this._threadBinding.getState().importExternalState(e)}cancelRun(){this._threadBinding.getState().cancelRun()}stopSpeaking(){return this._threadBinding.getState().stopSpeaking()}connectVoice(){this._threadBinding.getState().connectVoice()}disconnectVoice(){this._threadBinding.getState().disconnectVoice()}getVoiceVolume(){return this._threadBinding.getState().getVoiceVolume()}subscribeVoiceVolume(e){return this._threadBinding.getState().subscribeVoiceVolume(e)}muteVoice(){this._threadBinding.getState().muteVoice()}unmuteVoice(){this._threadBinding.getState().unmuteVoice()}export(){return this._threadBinding.getState().export()}import(e){this._threadBinding.getState().import(e)}reset(e){this._threadBinding.getState().reset(e)}getMessageByIndex(e){if(e<0)throw Error(`Message index must be >= 0`);return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[${e}]`,messageSelector:{type:`index`,index:e}},()=>{let t=this._threadBinding.getState().messages,n=t[e];if(n)return{message:n,parentId:t[e-1]?.id??null,index:e}})}getMessageById(e){return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[messageId=${JSON.stringify(e)}]`,messageSelector:{type:`messageId`,messageId:e}},()=>this._threadBinding.getState().getMessageById(e))}_getMessageRuntime(e,t){return new jne(new dv({path:e,getState:()=>{let{message:e,parentId:n,index:r}=t()??{},{messages:i,speech:a}=this._threadBinding.getState();if(!e||n===void 0||r===void 0)return sv;let o=this._threadBinding.getState().getBranches(e.id);return{...e,[nv]:e[nv],index:r,isLast:i.at(-1)?.id===e.id,parentId:n,branchNumber:o.indexOf(e.id)+1,branchCount:o.length,speech:a?.messageId===e.id?a:void 0}},subscribe:e=>this._threadBinding.subscribe(e)}),this._threadBinding)}_eventSubscriptionSubjects=new Map;unstable_on(e,t){let n=this._eventSubscriptionSubjects.get(e);return n||(n=new mv({event:e,binding:this._threadBinding}),this._eventSubscriptionSubjects.set(e,n)),n.subscribe(t)}},Ine=Ph(null),Lne=()=>Ih(Ine),kv=class{_core;_threadListBinding;get path(){return this._core.path}constructor(e,t){this._core=e,this._threadListBinding=t,this.__internal_bindMethods()}__internal_bindMethods(){this.switchTo=this.switchTo.bind(this),this.rename=this.rename.bind(this),this.updateCustom=this.updateCustom.bind(this),this.archive=this.archive.bind(this),this.unarchive=this.unarchive.bind(this),this.delete=this.delete.bind(this),this.initialize=this.initialize.bind(this),this.generateTitle=this.generateTitle.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getState=this.getState.bind(this),this.detach=this.detach.bind(this)}getState(){return this._core.getState()}switchTo(e){let t=this._core.getState();return this._threadListBinding.switchToThread(t.id,e)}rename(e){let t=this._core.getState();return this._threadListBinding.rename(t.id,e)}updateCustom(e){let t=this._core.getState();if(!this._threadListBinding.updateCustom)throw Error(`Thread list runtime does not support updating custom metadata`);return this._threadListBinding.updateCustom(t.id,e)}archive(){let e=this._core.getState();return this._threadListBinding.archive(e.id)}unarchive(){let e=this._core.getState();return this._threadListBinding.unarchive(e.id)}delete(){let e=this._core.getState();return this._threadListBinding.delete(e.id)}initialize(){let e=this._core.getState();return this._threadListBinding.initialize(e.id)}generateTitle(){let e=this._core.getState();return this._threadListBinding.generateTitle(e.id)}unstable_on(e,t){let n=this._core.getState().isMain,r=this._core.getState().id;return this.subscribe(()=>{let i=this._core.getState(),a=i.isMain,o=i.id;n===a&&r===o||(n=a,r=o,!(e===`switchedTo`&&!a)&&(e===`switchedAway`&&a||t({})))})}subscribe(e){return this._core.subscribe(e)}detach(){let e=this._core.getState();this._threadListBinding.detach(e.id)}__internal_getRuntime(){return this}},Av=Promise.resolve(),Rne=e=>({mainThreadId:e.mainThreadId,newThreadId:e.newThreadId,threadIds:e.threadIds,archivedThreadIds:e.archivedThreadIds,isLoading:e.isLoading,isLoadingMore:e.isLoadingMore??!1,hasMore:e.hasMore??!1,threadItems:e.threadItems}),jv=(e,t)=>{if(t===void 0)return sv;let n=e.getItemById(t);return n?{id:n.id,remoteId:n.remoteId,externalId:n.externalId,title:n.title,status:n.status,lastMessageAt:n.lastMessageAt,custom:n.custom,isMain:n.id===e.mainThreadId}:sv},zne=class{_core;_runtimeFactory;_getState;constructor(e,t=Ov){this._core=e,this._runtimeFactory=t;let n=new fv({path:{},getState:()=>Rne(e),subscribe:t=>e.subscribe(t)});this._getState=n.getState.bind(n),this._mainThreadListItemRuntime=new kv(new dv({path:{ref:`threadItems[main]`,threadSelector:{type:`main`}},getState:()=>jv(this._core,this._core.mainThreadId),subscribe:e=>this._core.subscribe(e)}),this._core),this.main=new t(new pv({path:{ref:`threads.main`,threadSelector:{type:`main`}},getState:()=>e.getMainThreadRuntimeCore(),subscribe:t=>e.subscribe(t)}),this._mainThreadListItemRuntime),this.__internal_bindMethods()}__internal_bindMethods(){this.switchToThread=this.switchToThread.bind(this),this.switchToNewThread=this.switchToNewThread.bind(this),this.getLoadThreadsPromise=this.getLoadThreadsPromise.bind(this),this.reload=this.reload.bind(this),this.loadMore=this.loadMore.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getById=this.getById.bind(this),this.getItemById=this.getItemById.bind(this),this.getItemByIndex=this.getItemByIndex.bind(this),this.getArchivedItemByIndex=this.getArchivedItemByIndex.bind(this)}switchToThread(e,t){return this._core.switchToThread(e,t)}switchToNewThread(){return this._core.switchToNewThread()}getLoadThreadsPromise(){return this._core.getLoadThreadsPromise()}reload(){return this._core.reload?.()??Av}loadMore(){return this._core.loadMore?.()??Av}getState(){return this._getState()}subscribe(e){return this._core.subscribe(e)}_mainThreadListItemRuntime;main;get mainItem(){return this._mainThreadListItemRuntime}getById(e){return new this._runtimeFactory(new pv({path:{ref:`threads[threadId=${JSON.stringify(e)}]`,threadSelector:{type:`threadId`,threadId:e}},getState:()=>this._core.getThreadRuntimeCore(e),subscribe:e=>this._core.subscribe(e)}),this.mainItem)}getItemByIndex(e){return new kv(new dv({path:{ref:`threadItems[${e}]`,threadSelector:{type:`index`,index:e}},getState:()=>jv(this._core,this._core.threadIds[e]),subscribe:e=>this._core.subscribe(e)}),this._core)}getArchivedItemByIndex(e){return new kv(new dv({path:{ref:`archivedThreadItems[${e}]`,threadSelector:{type:`archiveIndex`,index:e}},getState:()=>jv(this._core,this._core.archivedThreadIds[e]),subscribe:e=>this._core.subscribe(e)}),this._core)}getItemById(e){return new kv(new dv({path:{ref:`threadItems[threadId=${e}]`,threadSelector:{type:`threadId`,threadId:e}},getState:()=>jv(this._core,e),subscribe:e=>this._core.subscribe(e)}),this._core)}},Mv=class{_core;threads;_thread;constructor(e){this._core=e,this.threads=new zne(e.threads),this._thread=this.threads.main,this.__internal_bindMethods()}__internal_bindMethods(){this.registerModelContextProvider=this.registerModelContextProvider.bind(this)}get thread(){return this._thread}registerModelContextProvider(e){return this._core.registerModelContextProvider(e)}},Nv=class{_contextProvider=new fg;registerModelContextProvider(e){return this._contextProvider.registerModelContextProvider(e)}getModelContextProvider(){return this._contextProvider}},Pv=Object.freeze([]),Fv=`DEFAULT_THREAD_ID`,Bne=Object.freeze([Fv]),Vne=Object.freeze({id:Fv,remoteId:void 0,externalId:void 0,status:`regular`}),Hne=Promise.resolve(),Iv=Object.freeze({[Fv]:Vne}),Une=class{threadFactory;_mainThreadId=Fv;_threads=Bne;_archivedThreads=Pv;_threadData=Iv;adapter={};get isLoading(){return this.adapter.isLoading??!1}get newThreadId(){}get threadIds(){return this._threads}get archivedThreadIds(){return this._archivedThreads}get threadItems(){return this._threadData}getLoadThreadsPromise(){return Hne}_mainThread;get mainThreadId(){return this._mainThreadId}constructor(e={},t){this.threadFactory=t,this.__internal_setAdapter(e,!0)}getMainThreadRuntimeCore(){return this._mainThread}getThreadRuntimeCore(){throw Error(`Method not implemented.`)}getItemById(e){return this._threadData[e]}__internal_setAdapter(e,t=!1){let n=this.adapter;this.adapter=e;let r=e.threadId??Fv,i=e.threads??Pv,a=e.archivedThreads??Pv,o=n.threadId??Fv,s=n.threads??Pv,c=n.archivedThreads??Pv;!t&&o===r&&s===i&&c===a||((s!==i||c!==a||o!==r)&&(this._threadData={...Iv,...Object.fromEntries(e.threads?.map(e=>[e.id,{...e,remoteId:e.remoteId,externalId:e.externalId,status:`regular`}])??[]),...Object.fromEntries(e.archivedThreads?.map(e=>[e.id,{...e,remoteId:e.remoteId,externalId:e.externalId,status:`archived`}])??[])}),s!==i&&(this._threads=this.adapter.threads?.map(e=>e.id)??Pv),c!==a&&(this._archivedThreads=this.adapter.archivedThreads?.map(e=>e.id)??Pv),(t||o!==r)&&(this._mainThreadId=r,this._mainThread=this.threadFactory()),this._threadData[this._mainThreadId]||(this._threadData={...this._threadData,[this._mainThreadId]:{id:this._mainThreadId,remoteId:void 0,externalId:void 0,status:`regular`}}),this._notifySubscribers())}async switchToThread(e,t){if(this._mainThreadId===e)return;let n=this.adapter.onSwitchToThread;if(!n)throw Error(`External store adapter does not support switching to thread`);await n(e)}async switchToNewThread(){let e=this.adapter.onSwitchToNewThread;if(!e)throw Error(`External store adapter does not support switching to new thread`);await e()}async rename(e,t){let n=this.adapter.onRename;if(!n)throw Error(`External store adapter does not support renaming`);await n(e,t)}async updateCustom(e,t){let n=this.adapter.onUpdateCustom;if(!n)throw Error(`External store adapter does not support updating custom metadata`);await n(e,t)}async detach(){}async archive(e){let t=this.adapter.onArchive;if(!t)throw Error(`External store adapter does not support archiving`);await t(e)}async unarchive(e){let t=this.adapter.onUnarchive;if(!t)throw Error(`External store adapter does not support unarchiving`);await t(e)}async delete(e){let t=this.adapter.onDelete;if(!t)throw Error(`External store adapter does not support deleting`);await t(e)}initialize(e){return Promise.resolve({remoteId:e,externalId:void 0})}generateTitle(){throw Error(`Method not implemented.`)}_subscriptions=new Set;subscribe(e){return this._subscriptions.add(e),()=>this._subscriptions.delete(e)}_notifySubscribers(){for(let e of this._subscriptions)e()}},Lv=__(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,7),Rv=Symbol(`autoStatus`),Wne=Object.freeze(Object.assign({type:`running`},{[Rv]:!0})),Gne=Object.freeze(Object.assign({type:`complete`,reason:`unknown`},{[Rv]:!0})),Kne=Object.freeze(Object.assign({type:`requires-action`,reason:`tool-calls`},{[Rv]:!0})),qne=Object.freeze(Object.assign({type:`requires-action`,reason:`interrupt`},{[Rv]:!0})),Jne=e=>e[Rv]===!0,zv=(e,t,n,r,i)=>e&&i?Object.assign({type:`incomplete`,reason:`error`,error:i},{[Rv]:!0}):e&&t?Wne:n?qne:r?Kne:Gne,Bv=(e,t)=>{if(e.startsWith(`data-`))return{type:`data`,name:e.substring(5),data:t}},Vv=(e,t,n)=>{let{role:r,id:i,createdAt:a,attachments:o,status:s,metadata:c}=e,l={id:i??t,createdAt:a??new Date},u=typeof e.content==`string`?[{type:`text`,text:e.content}]:e.content,d=({image:e,...t})=>e.match(/^data:image\/(png|jpeg|jpg|gif|webp|svg\+xml);base64,(.*)$/)||/^(https:\/\/|blob:)/.test(e)?{...t,image:e}:(console.warn(`Invalid image data format detected`),null);if(r!==`user`&&o?.length)throw Error(`attachments are only supported for user messages`);if(r!==`assistant`&&s)throw Error(`status is only supported for assistant messages`);if(r!==`assistant`&&c?.steps)throw Error(`metadata.steps is only supported for assistant messages`);switch(r){case`assistant`:return{...l,role:r,content:u.map(e=>{let t=e.type;switch(t){case`text`:case`reasoning`:return e.text.trim().length===0?null:e;case`file`:case`source`:return e;case`image`:return d(e);case`data`:return e;case`generative-ui`:return e;case`tool-call`:{let{parentId:t,messages:n,...r}=e,i={...r,toolCallId:e.toolCallId??`tool-${Lv()}`,...t!==void 0&&{parentId:t},...n!==void 0&&{messages:n}};return e.args?{...i,args:e.args,argsText:e.argsText??JSON.stringify(e.args)}:{...i,args:b_(e.argsText??``)??{},argsText:e.argsText??``}}default:{let n=Bv(t,e.data);if(n)return n;throw Error(`Unsupported assistant message part type: ${t}`)}}}).filter(e=>!!e),status:s??n,metadata:{unstable_state:c?.unstable_state??null,unstable_annotations:c?.unstable_annotations??[],unstable_data:c?.unstable_data??[],custom:c?.custom??{},steps:c?.steps??[],...c?.timing&&{timing:c.timing},...c?.submittedFeedback&&{submittedFeedback:c.submittedFeedback},...c?.isOptimistic&&{isOptimistic:!0}}};case`user`:return{...l,role:r,content:u.map(e=>{let t=e.type;switch(t){case`text`:case`image`:case`audio`:case`file`:case`data`:return e;default:{let n=Bv(t,e.data);if(n)return n;throw Error(`Unsupported user message part type: ${t}`)}}}),attachments:(o??[]).map(e=>({...e,content:e.content.map(e=>Bv(e.type,e.data)??e)})),metadata:{custom:c?.custom??{}}};case`system`:if(u.length!==1||u[0].type!==`text`)throw Error(`System messages must have exactly one text message part.`);return{...l,role:r,content:u,metadata:{custom:c?.custom??{}}};default:throw Error(`Unknown message role: ${r}`)}},Hv={fromArray:e=>{let t=e.map(e=>Vv(e,Lv(),zv(!1,!1,!1,!1,void 0)));return{messages:t.map((e,n)=>({parentId:n>0?t[n-1].id:null,message:e}))}},fromBranchableArray:(e,t)=>{let n=zv(!1,!1,!1,!1,void 0);return{...t?.headId===void 0?void 0:{headId:t.headId},messages:e.map(({message:e,parentId:t})=>{if(!e.id)throw Error(`ExportedMessageRepository.fromBranchableArray: Each message must have an 'id' field set.`);return{parentId:t,message:Vv(e,e.id,n)}})}}},Uv=e=>e.next?Uv(e.next):`current`in e?e:null,Yne=class{func;_value=null;constructor(e){this.func=e}get value(){return this._value===null&&(this._value=this.func()),this._value}dirty(){this._value=null}},Wv=class{messages=new Map;head=null;root={children:[],next:null};updateLevels(e,t){e.level=t;for(let n of e.children){let e=this.messages.get(n);e&&this.updateLevels(e,t+1)}}performOp(e,t,n){let r=t.prev??this.root,i=e??this.root;if(!(n===`relink`&&r===i)){if(n!==`link`&&(r.children=r.children.filter(e=>e!==t.current.id),r.next===t)){let e=r.children.at(-1),t=e?this.messages.get(e):null;if(t===void 0)throw Error(`MessageRepository(performOp/cut): Fallback sibling message not found. This is likely an internal bug in assistant-ui.`);r.next=t}if(n!==`cut`){for(let n=e;n;n=n.prev)if(n.current.id===t.current.id)throw Error(`MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui.`);i.children=[...i.children,t.current.id],(Uv(t)===this.head||i.next===null)&&(i.next=t),t.prev=e;let n=e?e.level+1:0;this.updateLevels(t,n)}}}_messages=new Yne(()=>{let e=Array((this.head?.level??-1)+1);for(let t=this.head;t;t=t.prev)e[t.level]=t.current;return e});get headId(){return this.head?.current.id??null}getMessages(e){if(e===void 0||e===this.head?.current.id)return this._messages.value;let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(getMessages): Head message not found. This is likely an internal bug in assistant-ui.`);let n=Array(t.level+1);for(let e=t;e;e=e.prev)n[e.level]=e.current;return n}addOrUpdateMessage(e,t){let n=this.messages.get(t.id),r=e?this.messages.get(e):null;if(r===void 0)throw Error(`MessageRepository(addOrUpdateMessage): Parent message not found. This is likely an internal bug in assistant-ui.`);if(n){n.current=t,this.performOp(r,n,`relink`),this._messages.dirty();return}let i={prev:r,current:t,next:null,children:[],level:r?r.level+1:0};this.messages.set(t.id,i),this.performOp(r,i,`link`),this.head===r&&(this.head=i),this._messages.dirty()}getMessage(e){let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui.`);return{parentId:t.prev?.current.id??null,message:t.current,index:t.level}}deleteMessage(e,t){let n=this.messages.get(e);if(!n)throw Error(`MessageRepository(deleteMessage): Message not found. This is likely an internal bug in assistant-ui.`);let r=t===void 0?n.prev:t===null?null:this.messages.get(t);if(r===void 0)throw Error(`MessageRepository(deleteMessage): Replacement not found. This is likely an internal bug in assistant-ui.`);for(let e of n.children){let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(deleteMessage): Child message not found. This is likely an internal bug in assistant-ui.`);this.performOp(r,t,`relink`)}this.performOp(null,n,`cut`),this.messages.delete(e),this.head===n&&(this.head=Uv(r??this.root)),this._messages.dirty()}getBranches(e){let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(getBranches): Message not found. This is likely an internal bug in assistant-ui.`);let{children:n}=t.prev??this.root;return n}evictOffBranchOptimisticMessages(e,t){if(!e)return;let n=new Set;for(let e=t;e;e=e.prev)n.add(e.current.id);let r=[];for(let t=e;t&&!n.has(t.current.id);t=t.prev)t.current.metadata?.isOptimistic&&r.push(t.current.id);for(let e of r)this.messages.has(e)&&this.deleteMessage(e)}switchToBranch(e){let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(switchToBranch): Branch not found. This is likely an internal bug in assistant-ui.`);let n=this.head,r=t.prev??this.root;r.next=t,this.head=Uv(t),this.evictOffBranchOptimisticMessages(n,this.head),this._messages.dirty()}resetHead(e){if(e===null){this.clear();return}let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(resetHead): Branch not found. This is likely an internal bug in assistant-ui.`);let n=this.head;if(t.children.length>0){let e=t=>{for(let n of t.children){let t=this.messages.get(n);t&&(e(t),this.messages.delete(n))}};e(t),t.children=[],t.next=null}this.head=t;for(let e=t;e;e=e.prev)e.prev?e.prev.next=e:this.root.next=e;this.evictOffBranchOptimisticMessages(n,this.head),this._messages.dirty()}clear(){this.messages.clear(),this.head=null,this.root={children:[],next:null},this._messages.dirty()}export(){let e=[];for(let[,t]of this.messages)t.current.metadata?.isOptimistic||e.push({message:t.current,parentId:t.prev?.current.id??null});let t=this.head;for(;t?.current.metadata?.isOptimistic;)t=t.prev;return{headId:t?.current.id??null,messages:e}}import({headId:e,messages:t}){for(let{message:e,parentId:n}of t)this.addOrUpdateMessage(n,e);this.resetHead(e??t.at(-1)?.message.id??null)}},Gv=Object.freeze([]);function Kv(e,t){if(t===`*`)return!0;let n=t.split(`,`).map(e=>e.trim().toLowerCase()),r=`.${e.name.split(`.`).pop().toLowerCase()}`,i=e.type.toLowerCase();for(let e of n){if(e.startsWith(`.`)&&e===r||e.includes(`/`)&&e===i)return!0;if(e.endsWith(`/*`)){let t=e.split(`/`)[0];if(i.startsWith(`${t}/`))return!0}}return!1}function Xne(e,t){return e.length===t.length?e.every((e,n)=>e.id===t[n].id):!1}function Zne(e){let t=Lv();return e.type===`image`?{id:t,type:`image`,name:e.filename??`image`,content:[e],status:{type:`complete`}}:e.type===`file`?{id:t,type:`document`,name:e.filename??`document`,contentType:e.mimeType,content:[e],status:{type:`complete`}}:e.type===`audio`?{id:t,type:`audio`,name:`audio.${e.audio.format}`,contentType:`audio/${e.audio.format}`,content:[e],status:{type:`complete`}}:{id:t,type:`data`,name:e.name,content:[e],status:{type:`complete`}}}function Qne(e){let t=[];for(let n of e)n.type!==`text`&&t.push(Zne(n));return t}var qv=e=>e.status.type===`complete`,Jv=class extends lv{isEditing=!0;get attachmentAccept(){return this.getAttachmentAdapter()?.accept??`*`}_attachments=[];get attachments(){return this._attachments}setAttachments(e){this._attachments=e,this._notifySubscribers()}get isEmpty(){return!this.text.trim()&&!this.attachments.length}_text=``;get text(){return this._text}_role=`user`;get role(){return this._role}_runConfig={};get runConfig(){return this._runConfig}_quote=void 0;get quote(){return this._quote}setQuote(e){this._quote!==e&&(this._quote=e,this._notifySubscribers())}setText(e){if(this._text!==e){if(this._text=e,this._dictation){this._dictationBaseText=e,this._currentInterimText=``;let{status:t,inputDisabled:n}=this._dictation;this._dictation=n?{status:t,inputDisabled:n}:{status:t}}this._notifySubscribers()}}setRole(e){this._role!==e&&(this._role=e,this._notifySubscribers())}setRunConfig(e){this._runConfig!==e&&(this._runConfig=e,this._notifySubscribers())}_emptyTextAndAttachments(){this._attachments=[],this._text=``,this._notifySubscribers()}async _onClearAttachments(){let e=this.getAttachmentAdapter();if(e){let t=this._attachments.filter(e=>!qv(e));await Promise.all(t.map(t=>e.remove(t)))}}async reset(){if(this._attachments.length===0&&this._text===``&&this._role===`user`&&Object.keys(this._runConfig).length===0&&this._quote===void 0)return;this._role=`user`,this._runConfig={},this._quote=void 0;let e=this._onClearAttachments();this._emptyTextAndAttachments(),await e}async clearAttachments(){let e=this._onClearAttachments();this.setAttachments([]),await e}async send(e){if(!this.canSend)return;this._dictationSession&&(this._dictationSession.cancel(),this._cleanupDictation());let t=this.getAttachmentAdapter(),n=this.attachments.length>0?Promise.all(this.attachments.map(async e=>{if(qv(e))return e;if(!t)throw Error(`Attachments are not supported`);return await t.send(e)})):[],r=this.text,i=this._quote;this._quote=void 0,this._emptyTextAndAttachments();let a={createdAt:new Date,role:this.role,content:r?[{type:`text`,text:r}]:[],attachments:await n,runConfig:this.runConfig,metadata:{custom:{...i?{quote:i}:{}}}};this.handleSend(a,e),this._notifyEventSubscribers(`send`,{})}cancel(){this.handleCancel()}get queue(){return Gv}steerQueueItem(e){}removeQueueItem(e){}async addAttachment(e){if(!(e instanceof File)){let t=this.getAttachmentAdapter();if(t&&!Kv({name:e.name,type:e.contentType??``},t.accept)){let n=`File type ${e.contentType||`unknown`} is not accepted. Accepted types: ${t.accept}`,r=Error(n);throw this._safeEmitAttachmentAddError(`not-accepted`,n,void 0,r),r}let n={id:e.id??Lv(),type:e.type??`document`,name:e.name,contentType:e.contentType,content:e.content,status:{type:`complete`}};this._attachments=[...this._attachments,n],this._notifySubscribers(),this._notifyEventSubscribers(`attachmentAdd`,{});return}let t=e=>{let t=this._attachments.findIndex(t=>t.id===e.id);t===-1?this._attachments=[...this._attachments,e]:this._attachments=[...this._attachments.slice(0,t),e,...this._attachments.slice(t+1)],this._notifySubscribers()},n=this.getAttachmentAdapter();if(!n){let e=`Attachments are not supported`,t=Error(e);throw this._safeEmitAttachmentAddError(`no-adapter`,e,void 0,t),t}if(!Kv({name:e.name,type:e.type},n.accept)){let t=`File type ${e.type||`unknown`} is not accepted. Accepted types: ${n.accept}`,r=Error(t);throw this._safeEmitAttachmentAddError(`not-accepted`,t,void 0,r),r}let r;try{let i=n.add({file:e});if(Symbol.asyncIterator in i)for await(let e of i)r=e,t(e);else r=await i,t(r)}catch(e){throw r&&t({...r,status:{type:`incomplete`,reason:`error`}}),this._safeEmitAttachmentAddError(`adapter-error`,e instanceof Error?e.message:String(e),r?.id,e instanceof Error?e:void 0),e}r?.status.type===`incomplete`&&r.status.reason===`error`?this._safeEmitAttachmentAddError(`adapter-error`,`Attachment upload did not complete successfully.`,r?.id):this._notifyEventSubscribers(`attachmentAdd`,{})}_safeEmitAttachmentAddError(e,t,n,r){try{this._notifyEventSubscribers(`attachmentAddError`,{reason:e,message:t,...n!==void 0&&{attachmentId:n},...r!==void 0&&{error:r}})}catch(e){console.error(`[assistant-ui] attachmentAddError subscriber threw:`,e)}}async removeAttachment(e){let t=this._attachments.findIndex(t=>t.id===e);if(t===-1)throw Error(`Attachment not found`);let n=this._attachments[t];if(!qv(n)){let e=this.getAttachmentAdapter();if(!e)throw Error(`Attachments are not supported`);await e.remove(n)}this._attachments=this._attachments.filter(t=>t.id!==e),this._notifySubscribers()}_dictation;_dictationSession;_dictationUnsubscribes=[];_dictationBaseText=``;_currentInterimText=``;_dictationSessionIdCounter=0;_activeDictationSessionId;_isCleaningDictation=!1;get dictation(){return this._dictation}_isActiveSession(e,t){return this._activeDictationSessionId===e&&this._dictationSession===t}startDictation(){let e=this.getDictationAdapter();if(!e)throw Error(`Dictation adapter not configured`);if(this._dictationSession){for(let e of this._dictationUnsubscribes)e();this._dictationUnsubscribes=[],this._dictationSession.stop().catch(()=>{}),this._dictationSession=void 0}let t=e.disableInputDuringDictation??!1;this._dictationBaseText=this._text,this._currentInterimText=``;let n=e.listen();this._dictationSession=n;let r=++this._dictationSessionIdCounter;this._activeDictationSessionId=r,this._dictation={status:n.status,inputDisabled:t},this._notifySubscribers();let i=n.onSpeech(e=>{if(!this._isActiveSession(r,n))return;let t=e.isFinal!==!1,i=this._dictationBaseText&&!this._dictationBaseText.endsWith(` `)&&e.transcript?` `:``;if(t){if(this._dictationBaseText=this._dictationBaseText+i+e.transcript,this._currentInterimText=``,this._text=this._dictationBaseText,this._dictation){let{transcript:e,...t}=this._dictation;this._dictation=t}this._notifySubscribers()}else this._currentInterimText=i+e.transcript,this._text=this._dictationBaseText+this._currentInterimText,this._dictation&&={...this._dictation,transcript:e.transcript},this._notifySubscribers()});this._dictationUnsubscribes.push(i);let a=n.onSpeechStart(()=>{this._isActiveSession(r,n)&&(this._dictation={status:{type:`running`},inputDisabled:t,...this._dictation?.transcript&&{transcript:this._dictation.transcript}},this._notifySubscribers())});this._dictationUnsubscribes.push(a);let o=n.onSpeechEnd(()=>{this._cleanupDictation({sessionId:r})});this._dictationUnsubscribes.push(o);let s=setInterval(()=>{this._isActiveSession(r,n)&&n.status.type===`ended`&&this._cleanupDictation({sessionId:r})},100);this._dictationUnsubscribes.push(()=>clearInterval(s))}stopDictation(){if(!this._dictationSession)return;let e=this._dictationSession,t=this._activeDictationSessionId;e.stop().finally(()=>{this._cleanupDictation({sessionId:t})})}_cleanupDictation(e){if(!(e?.sessionId!==void 0&&e.sessionId!==this._activeDictationSessionId||this._isCleaningDictation)){this._isCleaningDictation=!0;try{for(let e of this._dictationUnsubscribes)e();this._dictationUnsubscribes=[],this._dictationSession=void 0,this._activeDictationSessionId=void 0,this._dictation=void 0,this._dictationBaseText=``,this._currentInterimText=``,this._notifySubscribers()}finally{this._isCleaningDictation=!1}}}_eventSubscribers=new Map;_notifyEventSubscribers(e,t){let n=this._eventSubscribers.get(e);if(n)for(let e of n)e(t)}unstable_on(e,t){let n=t,r=this._eventSubscribers.get(e);return r||(r=new Set,this._eventSubscribers.set(e,r)),r.add(n),()=>{this._eventSubscribers.get(e)?.delete(n)}}},Yv=class extends Jv{runtime;_canCancel=!1;get canCancel(){return this._canCancel}get canSend(){return!this.isEmpty&&!this.runtime.isSendDisabled}get queue(){return this.runtime.getQueueItems?.()??Gv}steerQueueItem(e){this.runtime.steerQueueItem?.(e)}removeQueueItem(e){this.runtime.removeQueueItem?.(e)}getAttachmentAdapter(){return this.runtime.adapters?.attachments}getDictationAdapter(){return this.runtime.adapters?.dictation}constructor(e){super(),this.runtime=e,this.connect()}connect(){let e=this.runtime.isSendDisabled,t=this.queue;return this.runtime.subscribe(()=>{let n=!1;this.canCancel!==this.runtime.capabilities.cancel&&(this._canCancel=this.runtime.capabilities.cancel,n=!0),e!==this.runtime.isSendDisabled&&(e=this.runtime.isSendDisabled,n=!0),t!==this.queue&&(t=this.queue,n=!0),n&&this._notifySubscribers()})}async handleSend(e,t){this.runtime.append({...e,parentId:this.runtime.messages.at(-1)?.id??null,sourceId:null,startRun:t?.startRun,steer:t?.steer})}async handleCancel(){this.runtime.cancelRun()}},$ne=class extends Jv{runtime;endEditCallback;get canCancel(){return!0}get canSend(){return!this.isEmpty}getAttachmentAdapter(){return this.runtime.adapters?.attachments}getDictationAdapter(){return this.runtime.adapters?.dictation}_previousText;_previousAttachments;_nonTextPassthrough;_parentId;_sourceId;constructor(e,t,{parentId:n,message:r}){super(),this.runtime=e,this.endEditCallback=t,this._parentId=n,this._sourceId=r.id,this._previousText=Cv(r),this.setText(this._previousText),this.setRole(r.role),r.role===`user`?(this._previousAttachments=[...r.attachments??[],...Qne(r.content)],this._nonTextPassthrough=[]):(this._previousAttachments=r.attachments??[],this._nonTextPassthrough=r.content.filter(e=>e.type!==`text`)),this.setAttachments(this._previousAttachments),this.setRunConfig({...e.composer.runConfig})}get parentId(){return this._parentId}get sourceId(){return this._sourceId}async handleSend(e,t){let n=Cv(e),r=!Xne(e.attachments??[],this._previousAttachments);if(n!==this._previousText||r||t?.startRun){let n=this._nonTextPassthrough.length>0?[...e.content,...this._nonTextPassthrough]:e.content;this.runtime.append({...e,content:n,parentId:this._parentId,sourceId:this._sourceId,startRun:t?.startRun})}this.handleCancel()}handleCancel(){this.endEditCallback(),this._notifySubscribers()}},ere=class{_contextProvider;_subscriptions=new Set;_isInitialized=!1;repository=new Wv;_voiceMessages=[];_voiceGeneration=0;_cachedMergedMessages=null;_cachedVoiceGeneration=-1;_cachedMergedBase=null;_markVoiceMessagesDirty(){this._voiceGeneration++,this._cachedMergedMessages=null}_getBaseMessages(){return this.repository.getMessages()}get messages(){if(this._voiceMessages.length===0)return this._getBaseMessages();let e=this._getBaseMessages();return(this._cachedVoiceGeneration!==this._voiceGeneration||this._cachedMergedBase!==e)&&(this._cachedMergedMessages=[...e,...this._voiceMessages],this._cachedVoiceGeneration=this._voiceGeneration,this._cachedMergedBase=e),this._cachedMergedMessages}get state(){let e;for(let t of this.messages)t.role===`assistant`&&(e=t);return e?.metadata.unstable_state??null}composer=new Yv(this);constructor(e){this._contextProvider=e}getModelContext(){return this._contextProvider.getModelContext()}_editComposers=new Map;getEditComposer(e){return this._editComposers.get(e)}beginEdit(e){if(this._editComposers.has(e))throw Error(`Edit already in progress`);this._editComposers.set(e,new $ne(this,()=>this._editComposers.delete(e),this.repository.getMessage(e))),this._notifySubscribers()}getMessageById(e){try{return this.repository.getMessage(e)}catch{let t=this.repository.getMessages(),n=this._voiceMessages.findIndex(t=>t.id===e);return n===-1?void 0:{parentId:n>0?this._voiceMessages[n-1].id:t.at(-1)?.id??null,message:this._voiceMessages[n],index:t.length+n}}}getBranches(e){return this._voiceMessages.some(t=>t.id===e)?[]:this.repository.getBranches(e)}switchToBranch(e){this.repository.switchToBranch(e),this._notifySubscribers()}_notifySubscribers(){for(let e of this._subscriptions)e()}_notifyEventSubscribers(e,t){let n=this._eventSubscribers.get(e);if(n)for(let e of n)e(t)}subscribe(e){return this._subscriptions.add(e),()=>this._subscriptions.delete(e)}submitFeedback({messageId:e,type:t}){let n=this.adapters?.feedback;if(!n)throw Error(`Feedback adapter not configured`);let{message:r,parentId:i}=this.repository.getMessage(e);if(n.submit({message:r,type:t}),r.role===`assistant`){let e={...r,metadata:{...r.metadata,submittedFeedback:{type:t}}};this.repository.addOrUpdateMessage(i,e)}this._notifySubscribers()}_stopSpeaking;speech;speak(e){let t=this.adapters?.speech;if(!t)throw Error(`Speech adapter not configured`);let{message:n}=this.repository.getMessage(e);this._stopSpeaking?.();let r=t.speak(Cv(n)),i=r.subscribe(()=>{r.status.type===`ended`?(this._stopSpeaking=void 0,this.speech=void 0):this.speech={messageId:e,status:r.status},this._notifySubscribers()});this.speech={messageId:e,status:r.status},this._notifySubscribers(),this._stopSpeaking=()=>{r.cancel(),i(),this.speech=void 0,this._stopSpeaking=void 0}}stopSpeaking(){if(!this._stopSpeaking)throw Error(`No message is being spoken`);this._stopSpeaking(),this._notifySubscribers()}_voiceSession;_voiceUnsubs=[];voice;_voiceVolume=0;_voiceVolumeSubscribers=new Set;getVoiceVolume=()=>this._voiceVolume;subscribeVoiceVolume=e=>(this._voiceVolumeSubscribers.add(e),()=>this._voiceVolumeSubscribers.delete(e));connectVoice(){let e=this.adapters?.voice;if(!e)throw Error(`Voice adapter not configured`);this.disconnectVoice();let t=e.connect({});this._voiceSession=t;let n=[],r=`listening`;this.voice={status:t.status,isMuted:t.isMuted,mode:r},this._voiceVolume=0,this._notifySubscribers(),n.push(t.onStatusChange(e=>{e.type===`ended`?(this._finishVoiceAssistantMessage(),this._voiceSession=void 0,this.voice=void 0):this.voice={status:e,isMuted:t.isMuted,mode:r},this._notifySubscribers()})),n.push(t.onModeChange(e=>{r=e,this.voice&&(this.voice={...this.voice,mode:e},this._notifySubscribers())})),n.push(t.onVolumeChange(e=>{this._voiceVolume=e;for(let e of this._voiceVolumeSubscribers)e()})),n.push(t.onTranscript(e=>{this._handleVoiceTranscript(e)})),this._voiceUnsubs=n}_currentAssistantMsg=null;_handleVoiceTranscript(e){if(this.ensureInitialized(),e.role===`user`)this._finishVoiceAssistantMessage(),this._currentAssistantMsg=null,e.isFinal&&(this._voiceMessages.push({id:Lv(),role:`user`,content:[{type:`text`,text:e.text}],metadata:{custom:{}},createdAt:new Date,status:{type:`complete`,reason:`unknown`},attachments:[]}),this._markVoiceMessagesDirty(),this._notifySubscribers());else{if(!this._currentAssistantMsg)this._currentAssistantMsg={id:Lv(),role:`assistant`,content:[{type:`text`,text:e.text}],metadata:{unstable_state:this.state,unstable_annotations:[],unstable_data:[],steps:[],custom:{}},status:{type:`running`},createdAt:new Date},this._voiceMessages.push(this._currentAssistantMsg);else{let t=this._voiceMessages.indexOf(this._currentAssistantMsg);if(t===-1)return;let n={...this._currentAssistantMsg,content:[{type:`text`,text:e.text}],...e.isFinal?{status:{type:`complete`,reason:`stop`}}:{}};this._voiceMessages[t]=n,this._currentAssistantMsg=n}e.isFinal&&(this._currentAssistantMsg=null),this._markVoiceMessagesDirty(),this._notifySubscribers()}}_finishVoiceAssistantMessage(){let e=this._voiceMessages.at(-1);if(e?.role===`assistant`&&e.status.type===`running`){let t=this._voiceMessages.length-1;this._voiceMessages[t]={...e,status:{type:`complete`,reason:`stop`}},this._markVoiceMessagesDirty(),this._notifySubscribers()}}disconnectVoice(){this._finishVoiceAssistantMessage(),this._currentAssistantMsg=null;for(let e of this._voiceUnsubs)e();this._voiceUnsubs=[],this._voiceSession?.disconnect(),this._voiceSession=void 0,this.voice=void 0,this._voiceVolume=0;for(let e of this._voiceVolumeSubscribers)e();this._voiceMessages=[],this._markVoiceMessagesDirty(),this._notifySubscribers()}muteVoice(){if(!this._voiceSession)throw Error(`No active voice session`);this._voiceSession.mute(),this.voice={...this.voice,isMuted:!0},this._notifySubscribers()}unmuteVoice(){if(!this._voiceSession)throw Error(`No active voice session`);this._voiceSession.unmute(),this.voice={...this.voice,isMuted:!1},this._notifySubscribers()}ensureInitialized(){this._isInitialized||(this._isInitialized=!0,this._notifyEventSubscribers(`initialize`,{}))}export(){return this.repository.export()}import(e){this.ensureInitialized(),this.repository.clear(),this.repository.import(e),this._notifySubscribers()}reset(e){this.import(Hv.fromArray(e??[]))}_eventSubscribers=new Map;unstable_on(e,t){let n=t;if(e===`modelContextUpdate`)return this._contextProvider.subscribe?.(()=>n({}))??(()=>{});let r=this._eventSubscribers.get(e);return r||(r=new Set,this._eventSubscribers.set(e,r)),r.add(n),e===`initialize`&&this._isInitialized&&queueMicrotask(()=>{r.has(n)&&n({})}),()=>{this._eventSubscribers.get(e)?.delete(n)}}},Xv=class{cache=new WeakMap;convertMessages(e,t){return e.map((e,n)=>{let r=t(this.cache.get(e),e,n);return this.cache.set(e,r),r})}};function Zv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Qv(e,t=0){return t>100?!1:e===null||typeof e==`string`||typeof e==`boolean`?!0:typeof e==`number`?!Number.isNaN(e)&&Number.isFinite(e):Array.isArray(e)?e.every(e=>Qv(e,t+1)):Zv(e)?Object.entries(e).every(([e,n])=>typeof e==`string`&&Qv(n,t+1)):!1}var tre=100,$v=(e,t,n)=>{if(e===t)return!0;if(n>tre||e==null||t==null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,r)=>$v(e,t[r],n+1));if(Array.isArray(t)||!Zv(e)||!Zv(t))return!1;let r=Object.keys(e),i=Object.keys(t);return r.length===i.length?r.every(r=>Object.hasOwn(t,r)&&$v(e[r],t[r],n+1)):!1},nre=(e,t)=>!Qv(e)||!Qv(t)?!1:$v(e,t,0),ey=e=>{try{return JSON.parse(e),!0}catch{return!1}},ty=e=>{try{return JSON.parse(e)}catch{return}},ny=(e,t)=>{let n=ty(e),r=ty(t);return n===void 0||r===void 0?!1:nre(n,r)},rre=class{_getTools;_callbacks;_entries=new Map;_skipExecuteStreamIds=new Set;_humanInput=new Map;_executing=new Set;_settledResolvers=[];_statuses=new Map;_ac=new AbortController;_pendingRestore=!0;_lastSnapshot=null;_isRunning=!1;_controller;_pipelineDead=!1;_pipelineRestartUsed=!1;constructor(e,t){this._getTools=e,this._callbacks=t,this._initPipeline()}_initPipeline(){let[e,t]=Sne();this._controller=t;let n=B_(()=>this._getWrappedTools(),()=>this._ac.signal,(e,t)=>this._onHumanInput(e,t),{onExecutionStart:e=>this._onExecutionStart(e),onExecutionEnd:e=>this._onExecutionEnd(e)});e.pipeThrough(n).pipeThrough(new g_).pipeTo(new WritableStream({write:e=>{try{if(e.type!==`result`)return;this._handleResultChunk(e)}catch(e){console.error(`[ToolInvocationTracker] result chunk handling failed`,e)}}})).catch(e=>{console.error(`[ToolInvocationTracker] stream pipeline failed; will attempt single restart on next setState`,e),this._pipelineDead=!0})}setState(e){try{if(this._pipelineDead){if(this._pipelineRestartUsed)return;this._pipelineRestartUsed=!0,this._pipelineDead=!1,this._demoteEntriesToRestored(),this._executing.clear(),this._ac=new AbortController,this._initPipeline()}if(this._lastSnapshot&&this._lastSnapshot.messages===e.messages&&this._lastSnapshot.isRunning===e.isRunning&&this._lastSnapshot.isLoading===e.isLoading)return;e.isLoading===!0&&(this._pendingRestore=!0);let t=this._isRunning;this._isRunning=e.isRunning;try{this._processMessages(e.messages)}catch(e){throw this._isRunning=t,e}this._lastSnapshot=e,this._pendingRestore=!1}catch(e){console.error(`[ToolInvocationTracker] setState failed; snapshot dropped`,e)}}reset(){try{this._pendingRestore=!0,this._entries.clear(),this._lastSnapshot=null,this.abort().finally(()=>{this._executing.clear()})}catch(e){console.error(`[ToolInvocationTracker] reset failed`,e)}}abort(){try{return this._humanInput.forEach(({reject:e})=>{try{e(Error(`Tool execution aborted`))}catch{}}),this._humanInput.clear(),this._ac.abort(),this._ac=new AbortController,this._executing.size===0?Promise.resolve():new Promise(e=>{this._settledResolvers.push(e)})}catch(e){return console.error(`[ToolInvocationTracker] abort failed`,e),Promise.resolve()}}resume(e,t){try{let n=this._humanInput.get(e);return n?(this._humanInput.delete(e),this._setStatus(e,{type:`executing`}),n.resolve(t),!0):!1}catch(e){return console.error(`[ToolInvocationTracker] resume failed`,e),!1}}getStatuses(){return this._statuses}_getWrappedTools(){let e=this._getTools();if(e)return Object.fromEntries(Object.entries(e).map(([e,t])=>{let n=t.execute;return n===void 0?[e,t]:[e,{...t,execute:(...[e,t])=>this._skipExecuteStreamIds.has(t.toolCallId)?new Promise(()=>{}):n(e,t)}]}))}_onHumanInput(e,t){return new Promise((n,r)=>{let i=this._humanInput.get(e);if(i)try{i.reject(Error(`Human input request was superseded by a new request`))}catch{}this._humanInput.set(e,{resolve:n,reject:r}),this._setStatus(e,{type:`interrupt`,payload:{type:`human`,payload:t}})})}_onExecutionStart(e){this._skipExecuteStreamIds.has(e)||(this._executing.add(e),this._setStatus(e,{type:`executing`}))}_onExecutionEnd(e){this._executing.delete(e)&&(this._deleteStatus(e),this._executing.size===0&&this._settledResolvers.splice(0).forEach(e=>{try{e()}catch{}}))}_handleResultChunk(e){let t=e.meta.toolCallId,n=this._entries.get(t);!n&&this._skipExecuteStreamIds.has(t)||n?.hasResult||this._invokeOnResult({type:`add-tool-result`,toolCallId:t,toolName:e.meta.toolName,result:e.result,isError:e.isError,...e.artifact!==void 0&&{artifact:e.artifact},...e.modelContent!==void 0&&{modelContent:e.modelContent}})}_invokeOnResult(e){try{this._callbacks.onResult(e)}catch(e){console.error(`[ToolInvocationTracker] onResult callback threw; result dropped`,e)}}_invokeOnStatusesChange(){try{this._callbacks.onStatusesChange(this._statuses)}catch(e){console.error(`[ToolInvocationTracker] onStatusesChange callback threw; status change not propagated`,e)}}_setStatus(e,t){let n=new Map(this._statuses);n.set(e,t),this._statuses=n,this._invokeOnStatusesChange()}_deleteStatus(e){if(!this._statuses.has(e))return;let t=new Map(this._statuses);t.delete(e),this._statuses=t,this._invokeOnStatusesChange()}_hasExecutableTool(e){let t=this._getTools()?.[e];return t?.execute!==void 0||t?.streamCall!==void 0}_shouldCloseArgsStream({toolName:e,argsText:t,hasResult:n}){return n?!0:(this._hasExecutableTool(e)||!this._isRunning)&&ey(t)}_startActiveEntry(e,t,n){let r=this._controller.addToolCallPart({toolName:t,toolCallId:e});n&&this._skipExecuteStreamIds.add(e);let i={toolName:t,controller:r,argsText:``,hasResult:!1,argsComplete:!1};return this._entries.set(e,i),i}_demoteEntriesToRestored(){for(let[e,t]of this._entries)t.controller&&this._entries.set(e,{toolName:t.toolName,argsText:t.argsText,hasResult:t.hasResult})}_processArgsText(e,t){if(!e.controller)return;let n=t.result!==void 0;if(t.argsText!==e.argsText){let r=!0;if(e.argsComplete)ny(e.argsText,t.argsText)&&(e.argsText=t.argsText),r=!1;else if(!t.argsText.startsWith(e.argsText))if(ey(e.argsText)&&ey(t.argsText)&&ny(e.argsText,t.argsText)){let i=this._shouldCloseArgsStream({toolName:t.toolName,argsText:t.argsText,hasResult:n});i&&e.controller.argsText.close(),e.argsText=t.argsText,e.argsComplete=i,r=!1}else r=!1;if(r&&e.controller){let r=t.argsText.slice(e.argsText.length);e.controller.argsText.append(r);let i=this._shouldCloseArgsStream({toolName:t.toolName,argsText:t.argsText,hasResult:n});i&&e.controller.argsText.close(),e.argsText=t.argsText,e.argsComplete=i}}!e.argsComplete&&e.controller&&this._shouldCloseArgsStream({toolName:t.toolName,argsText:t.argsText,hasResult:n})&&(e.controller.argsText.close(),e.argsText=t.argsText,e.argsComplete=!0)}_processMessages(e){let t=this._pendingRestore;for(let n of e)if(!(!n||!Array.isArray(n.content)))for(let e of n.content){if(!e||e.type!==`tool-call`)continue;let n=this._entries.get(e.toolCallId);if(t){n?.controller||this._entries.set(e.toolCallId,{toolName:e.toolName,argsText:e.argsText,hasResult:e.result!==void 0}),e.messages&&this._processMessages(e.messages);continue}let r=n;if(r&&!r.controller){if(!(e.argsText!==r.argsText||e.result!==void 0!==r.hasResult)){e.messages&&this._processMessages(e.messages);continue}this._entries.delete(e.toolCallId),r=void 0}if(r||=this._startActiveEntry(e.toolCallId,e.toolName,e.result!==void 0),this._processArgsText(r,e),e.result!==void 0&&!r.hasResult){let{controller:t}=r;if(!t)continue;r.hasResult=!0,r.argsComplete=!0,t.setResponse(new E_({result:e.result,artifact:e.artifact,isError:e.isError,...e.modelContent===void 0?{}:{modelContent:e.modelContent}})),t.close()}e.messages&&this._processMessages(e.messages)}}},ire=Object.freeze([]),ry=(e,t)=>{let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0},are=(e,t)=>e&&t[t.length-1]?.role!==`assistant`,ore=class extends ere{_capabilities={switchToBranch:!1,switchBranchDuringRun:!1,edit:!1,delete:!1,reload:!1,cancel:!1,unstable_copy:!1,speech:!1,dictation:!1,voice:!1,attachments:!1,feedback:!1,queue:!1};get capabilities(){return this._capabilities}_messages;isDisabled;isSendDisabled;get isLoading(){return this._store.isLoading??!1}get isRunning(){return this._store.isRunning}_getBaseMessages(){return this._messages}get state(){return this._store.state??super.state}get adapters(){return this._store.adapters}suggestions=[];extras=void 0;_converter=new Xv;_store;_toolInvocations=null;beginEdit(e){if(!this._store.onEdit)throw Error(`Runtime does not support editing.`);super.beginEdit(e)}constructor(e,t){super(e),this.__internal_setAdapter(t)}__internal_setAdapter(e){if(this._store===e)return;let t=e.isRunning??!1;this.isDisabled=e.isDisabled??!1,this.isSendDisabled=e.isSendDisabled??!1;let n=this._store;this._store=e,this.extras!==e.extras&&(this.extras=e.extras);let r=e.suggestions??ire;ry(this.suggestions,r)||(this.suggestions=r);let i={switchToBranch:this._store.setMessages!==void 0,switchBranchDuringRun:!1,edit:this._store.onEdit!==void 0,delete:this._store.onDelete!==void 0||this._store.setMessages!==void 0,reload:this._store.onReload!==void 0,cancel:this._store.onCancel!==void 0,speech:this._store.adapters?.speech!==void 0,dictation:this._store.adapters?.dictation!==void 0,voice:this._store.adapters?.voice!==void 0,unstable_copy:this._store.unstable_capabilities?.copy!==!1,attachments:!!this._store.adapters?.attachments,feedback:!!this._store.adapters?.feedback,queue:this._store.queue!==void 0};ry(this._capabilities,i)||(this._capabilities=i);let a;if(e.messageRepository){if(n&&n.isRunning===e.isRunning&&n.messageRepository===e.messageRepository){this._notifySubscribers();return}this.repository.clear(),this.repository.import(e.messageRepository),a=this.repository.getMessages()}else if(e.messages){if(n){if(n.convertMessage!==e.convertMessage)this._converter=new Xv;else if(n.isRunning===e.isRunning&&n.messages===e.messages){this._notifySubscribers();return}}a=e.convertMessage?this._converter.convertMessages(e.messages,(n,r,i)=>{if(!e.convertMessage)return r;let a=zv(i===(e.messages?.length??0)-1,t,!1,!1,void 0);if(n&&(n.role!==`assistant`||!Jne(n.status)||n.status===a))return n;let o=Vv(e.convertMessage(r,i),i.toString(),a);return av(o,r),o}):e.messages;for(let e=0;e<a.length;e++){let t=a[e],n=a[e-1];this.repository.addOrUpdateMessage(n?.id??null,t)}}else throw Error(`ExternalStoreAdapter must provide either 'messages' or 'messageRepository'`);a.length>0&&this.ensureInitialized(),(n?.isRunning??!1)!==(e.isRunning??!1)&&(e.isRunning?this._notifyEventSubscribers(`runStart`,{}):this._notifyEventSubscribers(`runEnd`,{}));let o=null;are(t,a)&&(o=Lv(),this.repository.addOrUpdateMessage(a.at(-1)?.id??null,Vv({role:`assistant`,content:[],metadata:{isOptimistic:!0}},o,{type:`running`}))),this.repository.resetHead(o??a.at(-1)?.id??null),this._messages=this.repository.getMessages(),this._driveToolInvocations(),this._notifySubscribers()}_driveToolInvocations(){if(!this._store.unstable_enableToolInvocations){this._toolInvocations&&(this._toolInvocations.reset(),this._toolInvocations=null,this._store.setToolStatuses?.({}));return}this._toolInvocations||=new rre(()=>this.getModelContext().tools,{onResult:e=>{try{let t=this._findMessageIdForToolCall(e.toolCallId);if(t===void 0)return;this._store.onAddToolResult?.({messageId:t,toolCallId:e.toolCallId,toolName:e.toolName,result:e.result,isError:e.isError,...e.artifact!==void 0&&{artifact:e.artifact},...e.modelContent!==void 0&&{modelContent:e.modelContent}})}catch(e){console.error(`[ExternalStoreThreadRuntimeCore] onAddToolResult dispatch failed`,e)}},onStatusesChange:e=>{this._store.setToolStatuses?.(Object.fromEntries(e))}}),this._toolInvocations.setState({messages:this._messages,isRunning:this._store.isRunning??!1,...this._store.isLoading!==void 0&&{isLoading:this._store.isLoading}})}_toolCallToMessageId=new Map;_messagesForToolCallIndex=null;_findMessageIdForToolCall(e){if(this._messagesForToolCallIndex!==this._messages){this._toolCallToMessageId.clear();let e=t=>{for(let n of t)if(Array.isArray(n.content))for(let t of n.content)!t||t.type!==`tool-call`||(this._toolCallToMessageId.set(t.toolCallId,n.id),t.messages&&e(t.messages))};e(this._messages),this._messagesForToolCallIndex=this._messages}return this._toolCallToMessageId.get(e)}switchToBranch(e){if(!this._store.setMessages)throw Error(`Runtime does not support switching branches.`);this._store.isRunning||(this.repository.switchToBranch(e),this.updateMessages(this.repository.getMessages()))}async append(e){let t=e.parentId!==(this.messages.at(-1)?.id??null);if(!t&&this._store.queue){this._store.queue.enqueue(e,{steer:e.steer??!1});return}if((e.startRun??e.role===`user`)&&await this._toolInvocations?.abort(),t){if(!this._store.onEdit)throw Error(`Runtime does not support editing messages.`);this._store.queue?.clear(`edit`),await this._store.onEdit(e)}else await this._store.onNew(e)}async deleteMessage(e){if(this._store.onDelete){await this._store.onDelete(e);return}if(!this._store.setMessages)throw Error(`Runtime does not support deleting messages.`);this._store.isRunning&&await this._toolInvocations?.abort();let t=this.repository.getMessages();if(t.findIndex(t=>t.id===e)===-1)throw Error(`Message not found.`);this.updateMessages(t.filter(t=>t.id!==e))}getQueueItems(){return this._store?.queue?.items??Gv}steerQueueItem(e){this._store?.queue?.steer(e)}removeQueueItem(e){this._store?.queue?.remove(e)}async startRun(e){if(!this._store.onReload)throw Error(`Runtime does not support reloading messages.`);this._store.queue?.clear(`reload`),await this._toolInvocations?.abort(),await this._store.onReload(e.parentId,e)}async resumeRun(e){if(!this._store.onResume)throw Error(`Runtime does not support resuming runs.`);await this._store.onResume(e)}exportExternalState(){if(!this._store.onExportExternalState)throw Error(`Runtime does not support exporting external states.`);return this._store.onExportExternalState()}importExternalState(e){if(!this._store.onLoadExternalState)throw Error(`Runtime does not support importing external states.`);this._toolInvocations&&(this._toolInvocations.reset(),this._store.setToolStatuses?.({})),this._store.onLoadExternalState(e)}cancelRun(){if(!this._store.onCancel)throw Error(`Runtime does not support cancelling runs.`);this._store.queue?.clear(`cancel-run`),this._toolInvocations?.abort(),this._store.onCancel();let e=this.repository.getMessages().at(-1);e&&e.metadata.isOptimistic&&e.content.length===0&&this.repository.deleteMessage(e.id);let t=this.repository.getMessages(),n=t[t.length-1];n?.role===`user`&&n.id===t.at(-1)?.id?(this.repository.deleteMessage(n.id),this.composer.text.trim()||this.composer.setText(Cv(n)),t=this.repository.getMessages()):this._notifySubscribers(),setTimeout(()=>{this.updateMessages(t)},0)}addToolResult(e){if(!this._store.onAddToolResult)throw Error(`Runtime does not support tool results.`);this._store.onAddToolResult?.(e)}resumeToolCall(e){if(!(this._toolInvocations?.resume(e.toolCallId,e.payload)??!1)){if(this._store.onResumeToolCall){this._store.onResumeToolCall(e);return}throw Error(`Tool call ${e.toolCallId} is not waiting for resume.`)}}respondToToolApproval(e){if(!this._store.onRespondToToolApproval)throw Error(`Runtime does not support tool approvals.`);this._store.onRespondToToolApproval(e)}reset(e){let t=new Wv;t.import(Hv.fromArray(e??[])),this.updateMessages(t.getMessages())}import(e){super.import(e),this._store.onImport&&this._store.onImport(this.repository.getMessages())}updateMessages=e=>{this._store.convertMessage===void 0?this._store.setMessages?.(e):this._store.setMessages?.(e.flatMap(ov))}},iy=e=>e.adapters?.threadList??{},sre=class extends Nv{threads;constructor(e){super(),this.threads=new Une(iy(e),()=>new ore(this._contextProvider,e))}setAdapter(e){this.threads.__internal_setAdapter(iy(e)),this.threads.getMainThreadRuntimeCore().__internal_setAdapter(e)}},cre=e=>{let t=W(11),n;t[0]===e?n=t[1]:(n=()=>new sre(e),t[0]=e,t[1]=n);let[r]=Th(n),i;t[2]!==r||t[3]!==e?(i=()=>{r.setAdapter(e)},t[2]=r,t[3]=e,t[4]=i):i=t[4],kh(i);let{modelContext:a}=Lne()??{},o,s;t[5]!==a||t[6]!==r?(o=()=>{if(a)return r.registerModelContextProvider(a)},s=[a,r],t[5]=a,t[6]=r,t[7]=o,t[8]=s):(o=t[7],s=t[8]),kh(o,s);let c;return t[9]===r?c=t[10]:(c=new Mv(r),t[9]=r,t[10]=c),c},ay=(e,t)=>e.Message===t.Message&&e.EditComposer===t.EditComposer&&e.UserEditComposer===t.UserEditComposer&&e.AssistantEditComposer===t.AssistantEditComposer&&e.SystemEditComposer===t.SystemEditComposer&&e.UserMessage===t.UserMessage&&e.AssistantMessage===t.AssistantMessage&&e.SystemMessage===t.SystemMessage,lre=()=>null,ure=(e,t,n)=>{switch(t){case`user`:return n?e.UserEditComposer??e.EditComposer??e.UserMessage??e.Message:e.UserMessage??e.Message;case`assistant`:return n?e.AssistantEditComposer??e.EditComposer??e.AssistantMessage??e.Message:e.AssistantMessage??e.Message;case`system`:return n?e.SystemEditComposer??e.EditComposer??e.SystemMessage??e.Message:e.SystemMessage??e.Message??lre;default:throw Error(`Unknown message role: ${t}`)}},oy=e=>{let t=W(6),{components:n}=e,r=G(fre),i=G(pre),a;t[0]!==n||t[1]!==i||t[2]!==r?(a=ure(n,r,i),t[0]=n,t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s;return t[4]===o?s=t[5]:(s=(0,z.jsx)(o,{}),t[4]=o,t[5]=s),s},sy=(0,U.memo)(e=>{let t=W(5),{index:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,z.jsx)(oy,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,z.jsx)(U_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.index===t.index&&ay(e.components,t.components));sy.displayName=`ThreadPrimitive.MessageByIndex`;var cy=({children:e})=>{let t=G(e=>e.thread.messages.length);return Dh(()=>t===0?null:Array.from({length:t},(t,n)=>(0,z.jsx)(U_,{index:n,children:(0,z.jsx)(Zg,{getItemState:e=>e.thread().message({index:n}).getState(),children:t=>e({get message(){return t()}})})},n)),[t,e])},ly=e=>{let t=W(4),{components:n,children:r}=e;if(n){let e;return t[0]===n?e=t[1]:(e=(0,z.jsx)(cy,{children:()=>(0,z.jsx)(oy,{components:n})}),t[0]=n,t[1]=e),e}let i;return t[2]===r?i=t[3]:(i=(0,z.jsx)(cy,{children:r}),t[2]=r,t[3]=i),i};ly.displayName=`ThreadPrimitive.Messages`;var dre=(0,U.memo)(ly,(e,t)=>e.children||t.children?e.children===t.children:ay(e.components,t.components));function fre(e){return e.message.role}function pre(e){return e.message.composer.isEditing}var uy=e=>{let t=e.message.metadata;if(!(!t||typeof t!=`object`))return t.custom?.quote},mre=class extends Error{componentName;constructor(e,t=`Component "${e}" is not in the generative-ui allowlist.`){super(t),this.name=`GenerativeUIRenderError`,this.componentName=e}},hre=e=>typeof e==`object`&&!!e,dy=(e,t,n,r)=>{if(e==null)return null;if(typeof e==`string`)return e;if(!hre(e)||!(`component`in e))return null;let{component:i,props:a,children:o,key:s}=e,c=t[i];if(!c){if(n)return(0,z.jsx)(n,{component:i,props:a},s??r);throw new mre(i)}let l=o?.length?o.map((e,i)=>dy(e,t,n,`${r}/${i}`)):void 0;return(0,U.createElement)(c,{...a??{},key:s??r},...l??[])},gre=e=>{if(!e||e.root===void 0||e.root===null)return[];let t=e.root;return Array.isArray(t)?t:[t]},fy=e=>{let t=W(11),{spec:n,components:r,Fallback:i}=e,a;t[0]===n?a=t[1]:(a=gre(n),t[0]=n,t[1]=a);let o=a,s;if(t[2]!==i||t[3]!==r||t[4]!==o){let e;t[6]!==i||t[7]!==r?(e=(e,t)=>dy(e,r,i,`${t}`),t[6]=i,t[7]=r,t[8]=e):e=t[8],s=o.map(e),t[2]=i,t[3]=r,t[4]=o,t[5]=s}else s=t[5];let c;return t[9]===s?c=t[10]:(c=(0,z.jsx)(z.Fragment,{children:s}),t[9]=s,t[10]=c),c};fy.displayName=`GenerativeUIRender`;var py=e=>{let t=W(4),{components:n,spec:r,Fallback:i}=e,a=G(_re),o=r??a;if(!o)return null;let s;return t[0]!==i||t[1]!==n||t[2]!==o?(s=(0,z.jsx)(fy,{spec:o,components:n,Fallback:i}),t[0]=i,t[1]=n,t[2]=o,t[3]=s):s=t[3],s};py.displayName=`MessagePrimitive.GenerativeUI`;function _re(e){let t=e.part;return t?.type===`generative-ui`?t.spec:void 0}var vre=`ui://`,yre=e=>!!e?.startsWith(vre),my=e=>Symbol.iterator in e,hy=e=>`entries`in e,gy=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},bre=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function xre(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:my(e)&&my(t)?hy(e)&&hy(t)?gy(e,t):bre(e,t):gy({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function _y(e){let t=I.useRef(void 0);return n=>{let r=e(n);return xre(t.current,r)?t.current:t.current=r}}var vy=e=>{let t=-1;return{startGroup:e=>{t===-1&&(t=e)},endGroup:(n,r)=>{t!==-1&&(r.push({type:e,startIndex:t,endIndex:n}),t=-1)},finalize:(n,r)=>{t!==-1&&r.push({type:e,startIndex:t,endIndex:n})}}},Sre=(e,t,n)=>{let r=[];if(t){let t=vy(`chainOfThoughtGroup`);for(let n=0;n<e.length;n++){let i=e[n];i===`tool-call`||i===`reasoning`?t.startGroup(n):(t.endGroup(n-1,r),r.push({type:`single`,index:n}))}t.finalize(e.length-1,r)}else{let t=vy(`toolGroup`),n=vy(`reasoningGroup`);for(let i=0;i<e.length;i++){let a=e[i];a===`tool-call`?(n.endGroup(i-1,r),t.startGroup(i)):a===`reasoning`?(t.endGroup(i-1,r),n.startGroup(i)):(t.endGroup(i-1,r),n.endGroup(i-1,r),r.push({type:`single`,index:i}))}t.finalize(e.length-1,r),n.finalize(e.length-1,r)}if(n){let e=new Set;for(let t of r){if(t.type===`single`)continue;let r=n[t.startIndex];r!==void 0&&!e.has(r)&&(e.add(r),t.idKey=`id:${r}`)}}return r},Cre=e=>{let t=W(10),n=G(_y(Lre)),r=G(_y(zre)),i;bb0:{if(n.length===0){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0];let n;t[1]===r?n=t[2]:(n={ranges:e,partIds:r},t[1]=r,t[2]=n),i=n;break bb0}let a;t[3]!==n||t[4]!==r||t[5]!==e?(a=Sre(n,e,r),t[3]=n,t[4]=r,t[5]=e,t[6]=a):a=t[6];let o;t[7]!==r||t[8]!==a?(o={ranges:a,partIds:r},t[7]=r,t[8]=a,t[9]=o):o=t[9],i=o}return i},wre=e=>{let t=W(9),n,r;t[0]===e?(n=t[1],r=t[2]):({Fallback:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]!==n||t[4]!==r.toolName?(i=e=>e.tools.toolUIs[r.toolName]?.[0]?.render??n,t[3]=n,t[4]=r.toolName,t[5]=i):i=t[5];let a=G(i);if(!a)return null;let o;return t[6]!==a||t[7]!==r?(o=(0,z.jsx)(a,{...r}),t[6]=a,t[7]=r,t[8]=o):o=t[8],o},yy=(e,t,n)=>e.renderers[t]?.[0]||(e.fallbacks[0]??n),Tre=e=>{let t=W(9),n,r;t[0]===e?(n=t[1],r=t[2]):({Fallback:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]!==n||t[4]!==r.name?(i=e=>yy(e.dataRenderers,r.name,n),t[3]=n,t[4]=r.name,t[5]=i):i=t[5];let a=G(i);if(!a)return null;let o;return t[6]!==a||t[7]!==r?(o=(0,z.jsx)(a,{...r}),t[6]=a,t[7]=r,t[8]=o):o=t[8],o},by={Text:()=>null,Reasoning:()=>null,Source:()=>null,Image:()=>null,File:()=>null,Unstable_Audio:()=>null,ToolGroup:({children:e})=>e,ReasoningGroup:({children:e})=>e},Ere=e=>{let t=W(47),{components:n}=e,r;t[0]===n?r=t[1]:(r=n===void 0?{}:n,t[0]=n,t[1]=r);let{Text:i,Reasoning:a,Image:o,Source:s,File:c,Unstable_Audio:l,tools:u,data:d,generativeUI:f}=r,p=i===void 0?by.Text:i,m=a===void 0?by.Reasoning:a,h=o===void 0?by.Image:o,g=s===void 0?by.Source:s,_=c===void 0?by.File:c,v=l===void 0?by.Unstable_Audio:l,y;t[2]===u?y=t[3]:(y=u===void 0?{}:u,t[2]=u,t[3]=y);let b=y,x=Xg(),S=G(Bre),C=S.type;if(C===`tool-call`){let e;t[4]===x?e=t[5]:(e=x.part(),t[4]=x,t[5]=e);let n=e.addToolResult,r;t[6]===x?r=t[7]:(r=x.part(),t[6]=x,t[7]=r);let i=r.resumeToolCall,a;t[8]===x?a=t[9]:(a=x.part(),t[8]=x,t[9]=a);let o=a.respondToToolApproval;if(`Override`in b){let e;return t[10]!==n||t[11]!==S||t[12]!==o||t[13]!==i||t[14]!==b.Override?(e=(0,z.jsx)(b.Override,{...S,addResult:n,resume:i,respondToApproval:o}),t[10]=n,t[11]=S,t[12]=o,t[13]=i,t[14]=b.Override,t[15]=e):e=t[15],e}let s=b.by_name?.[S.toolName]??b.Fallback,c;return t[16]!==s||t[17]!==n||t[18]!==S||t[19]!==o||t[20]!==i?(c=(0,z.jsx)(wre,{...S,Fallback:s,addResult:n,resume:i,respondToApproval:o}),t[16]=s,t[17]=n,t[18]=S,t[19]=o,t[20]=i,t[21]=c):c=t[21],c}if(S.status?.type===`requires-action`)throw Error(`Encountered unexpected requires-action status`);switch(C){case`text`:{let e;return t[22]!==p||t[23]!==S?(e=(0,z.jsx)(p,{...S}),t[22]=p,t[23]=S,t[24]=e):e=t[24],e}case`reasoning`:{let e;return t[25]!==m||t[26]!==S?(e=(0,z.jsx)(m,{...S}),t[25]=m,t[26]=S,t[27]=e):e=t[27],e}case`source`:{let e;return t[28]!==g||t[29]!==S?(e=(0,z.jsx)(g,{...S}),t[28]=g,t[29]=S,t[30]=e):e=t[30],e}case`image`:{let e;return t[31]!==h||t[32]!==S?(e=(0,z.jsx)(h,{...S}),t[31]=h,t[32]=S,t[33]=e):e=t[33],e}case`file`:{let e;return t[34]!==_||t[35]!==S?(e=(0,z.jsx)(_,{...S}),t[34]=_,t[35]=S,t[36]=e):e=t[36],e}case`audio`:{let e;return t[37]!==v||t[38]!==S?(e=(0,z.jsx)(v,{...S}),t[37]=v,t[38]=S,t[39]=e):e=t[39],e}case`data`:{let e=d?.by_name?.[S.name]??d?.Fallback,n;return t[40]!==e||t[41]!==S?(n=(0,z.jsx)(Tre,{...S,Fallback:e}),t[40]=e,t[41]=S,t[42]=n):n=t[42],n}case`generative-ui`:{if(!f?.components)return null;let e=S,n;return t[43]!==f.Fallback||t[44]!==f.components||t[45]!==e.spec?(n=(0,z.jsx)(fy,{spec:e.spec,components:f.components,Fallback:f.Fallback}),t[43]=f.Fallback,t[44]=f.components,t[45]=e.spec,t[46]=n):n=t[46],n}default:return console.warn(`Unknown message part type: ${C}`),null}},xy=(0,U.memo)(e=>{let t=W(5),{index:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,z.jsx)(Ere,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,z.jsx)(W_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.index===t.index&&e.components?.Text===t.components?.Text&&e.components?.Reasoning===t.components?.Reasoning&&e.components?.Source===t.components?.Source&&e.components?.Image===t.components?.Image&&e.components?.File===t.components?.File&&e.components?.Unstable_Audio===t.components?.Unstable_Audio&&e.components?.tools===t.components?.tools&&e.components?.data===t.components?.data&&e.components?.generativeUI===t.components?.generativeUI&&e.components?.ToolGroup===t.components?.ToolGroup&&e.components?.ReasoningGroup===t.components?.ReasoningGroup);xy.displayName=`MessagePrimitive.PartByIndex`;var Dre=e=>{let t=W(6),{status:n,component:r}=e,i=n.type===`running`,a;t[0]!==r||t[1]!==n?(a=(0,z.jsx)(r,{type:`text`,text:``,status:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,z.jsx)(K_,{text:``,isRunning:i,children:a}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o},Ore=Object.freeze({type:`complete`}),kre=Object.freeze({type:`running`}),Sy=(0,U.memo)(e=>{let t=W(6),{components:n}=e,r=G(Vre);if(n?.Empty){let e;return t[0]!==n.Empty||t[1]!==r?(e=(0,z.jsx)(n.Empty,{status:r}),t[0]=n.Empty,t[1]=r,t[2]=e):e=t[2],e}if(r.type!==`running`)return null;let i=n?.Text??by.Text,a;return t[3]!==r||t[4]!==i?(a=(0,z.jsx)(Dre,{status:r,component:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a},(e,t)=>e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),Are=(0,U.memo)(e=>{let t=W(4),{components:n,enabled:r}=e,i;if(t[0]===r?i=t[1]:(i=e=>{if(!r||e.message.parts.length===0)return!1;let t=e.message.parts[e.message.parts.length-1];return t?.type!==`text`&&t?.type!==`reasoning`},t[0]=r,t[1]=i),!G(i))return null;let a;return t[2]===n?a=t[3]:(a=(0,z.jsx)(Sy,{components:n}),t[2]=n,t[3]=a),a},(e,t)=>e.enabled===t.enabled&&e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),jre=(0,U.memo)(e=>{let t=W(4),{Quote:n}=e,r=G(uy);if(!r)return null;let i;return t[0]!==n||t[1]!==r.messageId||t[2]!==r.text?(i=(0,z.jsx)(n,{text:r.text,messageId:r.messageId}),t[0]=n,t[1]=r.messageId,t[2]=r.text,t[3]=i):i=t[3],i});function Cy(e,t){return(e.toolUIs[t.toolName]?.[0]?.render??null)||(yre(t.mcp?.app?.resourceUri)&&e.mcpApp?e.mcpApp.render:null)}var wy=()=>{let e=W(12),t=Xg(),n=G(Hre),r=G(Ure);if(!r||n.type!==`tool-call`)return null;let i;e[0]===t?i=e[1]:(i=t.part(),e[0]=t,e[1]=i);let a=i.addToolResult,o;e[2]===t?o=e[3]:(o=t.part(),e[2]=t,e[3]=o);let s=o.resumeToolCall,c;e[4]===t?c=e[5]:(c=t.part(),e[4]=t,e[5]=c);let l;return e[6]!==r||e[7]!==n||e[8]!==i.addToolResult||e[9]!==o.resumeToolCall||e[10]!==c.respondToToolApproval?(l=(0,z.jsx)(r,{...n,addResult:a,resume:s,respondToApproval:c.respondToToolApproval}),e[6]=r,e[7]=n,e[8]=i.addToolResult,e[9]=o.resumeToolCall,e[10]=c.respondToToolApproval,e[11]=l):l=e[11],l},Ty=()=>{let e=W(3),t=G(Wre),n=G(Gre);if(!n||t.type!==`data`)return null;let r=t,i;return e[0]!==n||e[1]!==r?(i=(0,z.jsx)(n,{...r}),e[0]=n,e[1]=r,e[2]=i):i=e[2],i},Mre=()=>{let e=W(2),t=G(Kre);if(t===`tool-call`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsx)(wy,{}),e[0]=t):t=e[0],t}if(t===`data`){let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsx)(Ty,{}),e[1]=t):t=e[1],t}return null},Nre=Object.freeze({type:`text`,text:``,status:kre}),Ey=({index:e,children:t})=>{let n=Xg(),r=G(e=>e.dataRenderers);return(0,z.jsx)(W_,{index:e,children:(0,z.jsx)(Zg,{getItemState:t=>t.message().part({index:e}).getState(),children:i=>t({get part(){let t=i();if(t.type===`tool-call`){let r=Cy(n.tools().getState(),t)!==null,i=n.message().part({index:e});return{...t,toolUI:r?(0,z.jsx)(wy,{}):null,addResult:i.addToolResult,resume:i.resumeToolCall,respondToApproval:i.respondToToolApproval}}if(t.type===`data`){let e=yy(r,t.name,void 0)!==void 0;return{...t,dataRendererUI:e?(0,z.jsx)(Ty,{}):null}}return t}})})})},Pre=e=>{let t=W(9),{children:n}=e,r=G(qre),i=G(Jre),a=r===0&&i;if(r===0){if(!a)return null;let e;t[0]===n?e=t[1]:(e=n({part:Nre}),t[0]=n,t[1]=e);let r;return t[2]===e?r=t[3]:(r=(0,z.jsx)(K_,{text:``,isRunning:!0,children:e}),t[2]=e,t[3]=r),r}let o;if(t[4]!==n||t[5]!==r){let e;t[7]===n?e=t[8]:(e=(e,t)=>(0,z.jsx)(Ey,{index:t,children:e=>n(e)??(0,z.jsx)(Mre,{})},t),t[7]=n,t[8]=e),o=(0,z.jsx)(z.Fragment,{children:Array.from({length:r},e)}),t[4]=n,t[5]=r,t[6]=o}else o=t[6];return o},Dy=e=>{let t=W(5),{components:n,unstable_showEmptyOnNonTextEnd:r,children:i}=e,a=r===void 0?!0:r;if(i){let e;return t[0]===i?e=t[1]:(e=(0,z.jsx)(Pre,{children:i}),t[0]=i,t[1]=e),e}let o;return t[2]!==n||t[3]!==a?(o=(0,z.jsx)(Fre,{components:n,unstable_showEmptyOnNonTextEnd:a}),t[2]=n,t[3]=a,t[4]=o):o=t[4],o};Dy.displayName=`MessagePrimitive.Parts`;var Fre=e=>{let t=W(15),{components:n,unstable_showEmptyOnNonTextEnd:r}=e,i=G(Yre),{ranges:a,partIds:o}=Cre(!!n?.ChainOfThought),s;bb0:{if(i===0){let e;t[0]===n?e=t[1]:(e=(0,z.jsx)(Sy,{components:n}),t[0]=n,t[1]=e),s=e;break bb0}let e;if(t[2]!==n||t[3]!==a||t[4]!==o){let r=new Set,i=e=>{let t=o[e];return t!==void 0&&!r.has(t)?(r.add(t),`part-id:${t}`):`part-${e}`};e=a.map(e=>{if(e.type===`single`)return(0,z.jsx)(xy,{index:e.index,components:n},e.index);if(e.type===`chainOfThoughtGroup`){let t=n?.ChainOfThought;return t?(0,z.jsx)(Q_,{startIndex:e.startIndex,endIndex:e.endIndex,children:(0,z.jsx)(t,{})},`chainOfThought-${e.idKey??e.startIndex}`):null}else if(e.type===`toolGroup`)return(0,z.jsx)(n?.ToolGroup??by.ToolGroup,{startIndex:e.startIndex,endIndex:e.endIndex,children:Array.from({length:e.endIndex-e.startIndex+1},(t,r)=>{let a=e.startIndex+r;return(0,z.jsx)(xy,{index:a,components:n},i(a))})},`tool-${e.idKey??e.startIndex}`);else return(0,z.jsx)(n?.ReasoningGroup??by.ReasoningGroup,{startIndex:e.startIndex,endIndex:e.endIndex,children:Array.from({length:e.endIndex-e.startIndex+1},(t,r)=>{let i=e.startIndex+r;return(0,z.jsx)(xy,{index:i,components:n},`part-${i}`)})},`reasoning-${e.startIndex}`)}),t[2]=n,t[3]=a,t[4]=o,t[5]=e}else e=t[5];s=e}let c=s,l;t[6]===n?l=t[7]:(l=n?.Quote&&(0,z.jsx)(jre,{Quote:n.Quote}),t[6]=n,t[7]=l);let u;t[8]!==n||t[9]!==r?(u=(0,z.jsx)(Are,{components:n,enabled:r}),t[8]=n,t[9]=r,t[10]=u):u=t[10];let d;return t[11]!==c||t[12]!==l||t[13]!==u?(d=(0,z.jsxs)(z.Fragment,{children:[l,c,u]}),t[11]=c,t[12]=l,t[13]=u,t[14]=d):d=t[14],d};function Ire(e){return e.type}function Lre(e){return e.message.parts.map(Ire)}function Rre(e){return e.type===`tool-call`?e.toolCallId:void 0}function zre(e){return e.message.parts.map(Rre)}function Bre(e){return e.part}function Vre(e){return e.message.status??Ore}function Hre(e){return e.part}function Ure(e){return e.part.type===`tool-call`?Cy(e.tools,e.part):null}function Wre(e){return e.part}function Gre(e){return e.part.type===`data`?yy(e.dataRenderers,e.part.name,void 0)??null:null}function Kre(e){return e.part.type}function qre(e){return e.message.parts.length}function Jre(e){return(e.message.status?.type??`complete`)===`running`}function Yre(e){return e.message.parts.length}var Xre=Symbol.for(`@assistant-ui/groupBy.memoKey`),Oy=e=>{let t=e.nextChildIdx++;return e.nodeKey===``?String(t):`${e.nodeKey}.${t}`},ky=(e,t)=>{if(!(t===void 0||e.claimed.has(t)))return e.claimed.add(t),`id:${t}`},Zre=(e,t)=>{let n={key:``,nodeKey:``,indices:[],children:[],nextChildIdx:0,claimed:new Set},r=[n],i=()=>{let e=r.pop(),n=r[r.length-1];n.children.push({type:`group`,key:e.key,nodeKey:e.nodeKey,idKey:ky(n,t?.[e.indices[0]]),indices:e.indices,children:e.children})};for(let n=0;n<e.length;n++){let a=e[n],o=0;for(;o<r.length-1&&o<a.length&&r[o+1].key===a[o];)o++;for(;r.length-1>o;)i();for(;r.length-1<a.length;){let e=r[r.length-1];r.push({key:a[r.length-1],nodeKey:Oy(e),indices:[],children:[],nextChildIdx:0,claimed:new Set})}let s=r[r.length-1];s.children.push({type:`part`,index:n,nodeKey:Oy(s),idKey:ky(s,t?.[n])});for(let e=1;e<r.length;e++)r[e].indices.push(n)}for(;r.length>1;)i();return n.children},Qre=Object.freeze({type:`complete`}),$re=(e,t,n)=>{if(!n)return!1;switch(e){case`never`:return!1;case`always`:return!0;case`empty`:return t.length===0;case`no-text`:{let e=t[t.length-1];return e===void 0||e.type!==`text`&&e.type!==`reasoning`}}},Ay=()=>{throw Error("MessagePrimitive.GroupedParts: rendered `children` under a leaf part. `children` is only meaningful for `group-…` cases — add a matching case for the part type or return `null` to skip it.")},jy=(e,t,n)=>{if(e.type===`part`)return(0,z.jsx)(Ey,{index:e.index,children:({part:e})=>n({part:e,children:(0,z.jsx)(Ay,{})})},e.idKey?`part-${e.idKey}`:`part-${e.index}`);let r=t[e.indices.at(-1)]?.status??Qre;return(0,z.jsx)(U.Fragment,{children:n({part:{type:e.key,status:r,indices:e.indices},children:(0,z.jsx)(z.Fragment,{children:e.children.map(e=>jy(e,t,n))})})},e.idKey??e.nodeKey)},My=({groupBy:e,indicator:t=`no-text`,children:n})=>{let r=G(_y(e=>e.message.parts)),i=G(e=>e.tools.toolUIs),a=G(e=>t===`never`?!1:e.message.status?.type===`running`);return(0,z.jsxs)(z.Fragment,{children:[Dh(()=>{let t={toolUIs:i};return Zre(r.map(n=>e(n,t)??[]),r.map(e=>e.type===`tool-call`?e.toolCallId:void 0))},[r,e[Xre]??e,i]).map(e=>jy(e,r,n)),$re(t,r,a)&&n({part:{type:`indicator`},children:(0,z.jsx)(Ay,{})})]})};My.displayName=`MessagePrimitive.GroupedParts`;var Ny=(0,U.memo)(e=>{let t=W(5),{children:n}=e,r=G(uy);if(!r)return null;let i;t[0]!==n||t[1]!==r?(i=n(r),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;return t[3]===i?a=t[4]:(a=(0,z.jsx)(z.Fragment,{children:i}),t[3]=i,t[4]=a),a});Ny.displayName=`MessagePrimitive.Quote`;var Py=(e,t)=>{switch(t.type){case`image`:return e?.Image??e?.Attachment;case`document`:return e?.Document??e?.Attachment;case`file`:return e?.File??e?.Attachment;default:return e?.Attachment}},eie=e=>{let t=W(5),{components:n}=e,r=G(tie);if(!r)return null;let i=r,a;t[0]!==n||t[1]!==i?(a=Py(n,i),t[0]=n,t[1]=i,t[2]=a):a=t[2];let o=a;if(!o)return null;let s;return t[3]===o?s=t[4]:(s=(0,z.jsx)(o,{}),t[3]=o,t[4]=s),s},Fy=(0,U.memo)(e=>{let t=W(5),{index:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,z.jsx)(eie,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,z.jsx)(V_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.index===t.index&&e.components?.Image===t.components?.Image&&e.components?.Document===t.components?.Document&&e.components?.File===t.components?.File&&e.components?.Attachment===t.components?.Attachment);Fy.displayName=`MessagePrimitive.AttachmentByIndex`;var Iy=({children:e})=>{let t=G(e=>e.message.role===`user`?(e.message.attachments??[]).length:0);return Dh(()=>Array.from({length:t},(t,n)=>(0,z.jsx)(V_,{index:n,children:(0,z.jsx)(Zg,{getItemState:e=>e.message().attachment({index:n}).getState(),children:t=>e({get attachment(){return t()}})})},n)),[t,e])},Ly=e=>{let t=W(4),{components:n,children:r}=e;if(n){let e;return t[0]===n?e=t[1]:(e=(0,z.jsx)(Iy,{children:e=>{let{attachment:t}=e,r=Py(n,t);return r?(0,z.jsx)(r,{}):null}}),t[0]=n,t[1]=e),e}let i;return t[2]===r?i=t[3]:(i=(0,z.jsx)(Iy,{children:r}),t[2]=r,t[3]=i),i};Ly.displayName=`MessagePrimitive.Attachments`;function tie(e){return e.attachment}var Ry=(e,t)=>{switch(t.type){case`image`:return e?.Image??e?.Attachment;case`document`:return e?.Document??e?.Attachment;case`file`:return e?.File??e?.Attachment;default:return e?.Attachment}},nie=e=>{let t=W(5),{components:n}=e,r=G(rie);if(!r)return null;let i;t[0]!==r||t[1]!==n?(i=Ry(n,r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i;if(!a)return null;let o;return t[3]===a?o=t[4]:(o=(0,z.jsx)(a,{}),t[3]=a,t[4]=o),o},zy=(0,U.memo)(e=>{let t=W(5),{index:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,z.jsx)(nie,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,z.jsx)(H_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.index===t.index&&e.components?.Image===t.components?.Image&&e.components?.Document===t.components?.Document&&e.components?.File===t.components?.File&&e.components?.Attachment===t.components?.Attachment);zy.displayName=`ComposerPrimitive.AttachmentByIndex`;var By=({children:e})=>{let t=G(e=>e.composer.attachments.length);return Dh(()=>Array.from({length:t},(t,n)=>(0,z.jsx)(H_,{index:n,children:(0,z.jsx)(Zg,{getItemState:e=>e.composer().attachment({index:n}).getState(),children:t=>e({get attachment(){return t()}})})},n)),[t,e])},Vy=e=>{let t=W(4),{components:n,children:r}=e;if(n){let e;return t[0]===n?e=t[1]:(e=(0,z.jsx)(By,{children:e=>{let{attachment:t}=e,r=Ry(n,t);return r?(0,z.jsx)(r,{}):null}}),t[0]=n,t[1]=e),e}let i;return t[2]===r?i=t[3]:(i=(0,z.jsx)(By,{children:r}),t[2]=r,t[3]=i),i};Vy.displayName=`ComposerPrimitive.Attachments`;function rie(e){return e.attachment}var Hy=(0,U.memo)(({children:e})=>{let t=G(e=>e.composer.queue.length);return Dh(()=>Array.from({length:t},(t,n)=>(0,z.jsx)(tv,{index:n,children:(0,z.jsx)(Zg,{getItemState:e=>e.composer().queueItem({index:n}).getState(),children:t=>e({get queueItem(){return t()}})})},n)),[t,e])});Hy.displayName=`ComposerPrimitive.Queue`;var Uy=e=>{let{children:t}=e;return G(iie)?t:null};Uy.displayName=`MessagePartPrimitive.InProgress`;function iie(e){return e.part.status.type===`running`}var Wy=e=>{let t=W(2),{components:n}=e,r=n.Suggestion,i;return t[0]===r?i=t[1]:(i=(0,z.jsx)(r,{}),t[0]=r,t[1]=i),i},Gy=(0,U.memo)(e=>{let t=W(5),{index:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,z.jsx)(Wy,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,z.jsx)(ev,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.index===t.index&&e.components.Suggestion===t.components.Suggestion);Gy.displayName=`ThreadPrimitive.SuggestionByIndex`;var Ky=({children:e})=>{let t=G(e=>e.suggestions.suggestions.length);return Dh(()=>t===0?null:Array.from({length:t},(t,n)=>(0,z.jsx)(ev,{index:n,children:(0,z.jsx)(Zg,{getItemState:e=>e.suggestions().suggestion({index:n}).getState(),children:t=>e({get suggestion(){return t()}})})},n)),[t,e])},qy=e=>{let t=W(4),{components:n,children:r}=e;if(n){let e;return t[0]===n?e=t[1]:(e=(0,z.jsx)(Ky,{children:()=>(0,z.jsx)(Wy,{components:n})}),t[0]=n,t[1]=e),e}let i;return t[2]===r?i=t[3]:(i=(0,z.jsx)(Ky,{children:r}),t[2]=r,t[3]=i),i};qy.displayName=`ThreadPrimitive.Suggestions`;var aie=(0,U.memo)(qy,(e,t)=>e.children||t.children?e.children===t.children:e.components.Suggestion===t.components.Suggestion),oie=e=>{let t=W(3),n;return t[0]!==e.dictation||t[1]!==e.editing?(n=t=>{if(e.editing===!0&&!t.composer.isEditing||e.editing===!1&&t.composer.isEditing)return!1;let n=t.composer.dictation!=null;return!(e.dictation===!0&&!n||e.dictation===!1&&n)},t[0]=e.dictation,t[1]=e.editing,t[2]=n):n=t[2],G(n)},Jy=e=>{let t=W(3),n,r;return t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),oie(r)?n:null};Jy.displayName=`ComposerPrimitive.If`;var sie=()=>{let e=W(5),t=Xg(),n=G(cie),r;e[0]===t?r=e[1]:(r=e=>{t.composer().send(e)},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={send:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function cie(e){return!e.composer.canSend||e.thread.isRunning&&!e.thread.capabilities.queue}var lie=()=>{let e=W(5),t=Xg(),n=G(uie),r;e[0]===t?r=e[1]:(r=()=>{t.composer().cancel()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==i||e[3]!==n?(a={cancel:i,disabled:n},e[2]=i,e[3]=n,e[4]=a):a=e[4],a};function uie(e){return!e.composer.canCancel}var die=()=>{let e=W(5),t=Xg(),n=G(fie),r;e[0]===t?r=e[1]:(r=()=>{t.composer().startDictation()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={startDictation:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function fie(e){return e.composer.dictation!=null||!e.thread.capabilities.dictation||!e.composer.isEditing}var pie=()=>{let e=W(5),t=Xg(),n=G(mie),r;e[0]===t?r=e[1]:(r=e=>t.composer().addAttachment(e),e[0]=t,e[1]=r);let i=r,a;return e[2]!==i||e[3]!==n?(a={addAttachment:i,disabled:n},e[2]=i,e[3]=n,e[4]=a):a=e[4],a};function mie(e){return!e.composer.isEditing}var hie=e=>{let t=W(12),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{copiedDuration:r,copyToClipboard:i}=n,a=r===void 0?3e3:r,o=Xg(),s=G(_ie),c=G(vie),l=G(yie),u=G(bie),d;t[2]!==o||t[3]!==u||t[4]!==a||t[5]!==i||t[6]!==l?(d=()=>{let e=l?u:o.message().getCopyText();if(!e)return;let t=i??xie;Promise.resolve(t(e)).then(()=>{o.message().setIsCopied(!0),setTimeout(()=>o.message().setIsCopied(!1),a)},Sie)},t[2]=o,t[3]=u,t[4]=a,t[5]=i,t[6]=l,t[7]=d):d=t[7];let f=d,p;return t[8]!==f||t[9]!==s||t[10]!==c?(p={copy:f,disabled:s,isCopied:c},t[8]=f,t[9]=s,t[10]=c,t[11]=p):p=t[11],p};function gie(e){return e.type===`text`&&e.text.length>0}function _ie(e){return!((e.message.role!==`assistant`||e.message.status?.type!==`running`)&&e.message.parts.some(gie))}function vie(e){return e.message.isCopied}function yie(e){return e.composer.isEditing}function bie(e){return e.composer.text}function xie(){}function Sie(){}var Cie=()=>{let e=W(5),t=Xg(),n=G(wie),r;e[0]===t?r=e[1]:(r=()=>{t.composer().beginEdit()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={edit:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function wie(e){return e.composer.isEditing}var Tie=()=>{let e=W(5),t=Xg(),n=G(Eie),r;e[0]===t?r=e[1]:(r=()=>{t.message().reload()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={reload:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function Eie(e){return e.thread.isRunning||e.thread.isDisabled||e.message.role!==`assistant`}var Die=()=>{let e=W(5),t=Xg(),n=G(kie),r;e[0]===t?r=e[1]:(r=()=>{t.message().submitFeedback({type:`positive`})},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={submit:i,isSubmitted:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a},Oie=()=>{let e=W(5),t=Xg(),n=G(Aie),r;e[0]===t?r=e[1]:(r=()=>{t.message().submitFeedback({type:`negative`})},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={submit:i,isSubmitted:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function kie(e){return e.message.metadata.submittedFeedback?.type===`positive`}function Aie(e){return e.message.metadata.submittedFeedback?.type===`negative`}var jie=()=>{let e=W(5),t=Xg(),n=G(Nie),r;e[0]===t?r=e[1]:(r=async()=>{t.message().speak()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={speak:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function Mie(e){return e.type===`text`&&e.text.length>0}function Nie(e){return!((e.message.role!==`assistant`||e.message.status?.type!==`running`)&&e.message.parts.some(Mie))}var Pie=()=>{let e=W(5),t=Xg(),n=G(Fie),r;e[0]===t?r=e[1]:(r=()=>{t.message().stopSpeaking()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={stopSpeaking:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function Fie(e){return e.message.speech==null}var Iie=e=>{let t=W(8),{prompt:n,send:r,clearComposer:i}=e,a=i===void 0?!0:i,o=Xg(),s=G(Lie),c=r??!1,l;t[0]!==o||t[1]!==a||t[2]!==n||t[3]!==c?(l=()=>{let e=o.thread().getState().isRunning;if(c&&!e)o.thread().append({content:[{type:`text`,text:n}],runConfig:o.composer().getState().runConfig}),a&&o.composer().setText(``);else if(a)o.composer().setText(n);else{let e=o.composer().getState().text;o.composer().setText(e.trim()?`${e} ${n}`:n)}},t[0]=o,t[1]=a,t[2]=n,t[3]=c,t[4]=l):l=t[4];let u=l,d;return t[5]!==s||t[6]!==u?(d={trigger:u,disabled:s},t[5]=s,t[6]=u,t[7]=d):d=t[7],d};function Lie(e){return e.thread.isDisabled}var Rie=()=>G(zie);function zie(e){return e.message.status?.type===`incomplete`&&e.message.status.reason===`error`?e.message.status.error??`An error occurred`:void 0}var Bie=e=>{let{cloud:t,initialMessages:n,maxSteps:r,adapters:i,unstable_humanToolNames:a,unstable_enableMessageQueue:o,...s}=e;return{localRuntimeOptions:{cloud:t,initialMessages:n,maxSteps:r,adapters:i,unstable_humanToolNames:a,unstable_enableMessageQueue:o},otherOptions:s}},Vie=/:([\w-]{1,64})\[([^\]\n]{1,1024})\](?:\{name=([^}\n]{1,1024})\})?/gu,Yy={serialize(e){let t=e.id===e.label?``:`{name=${e.id}}`;return`:${e.type}[${e.label}]${t}`},parse(e){let t=[],n=0;for(let r of e.matchAll(Vie)){r.index>n&&t.push({kind:`text`,text:e.slice(n,r.index)});let i=r[2];t.push({kind:`mention`,type:r[1],label:i,id:r[3]??i}),n=r.index+r[0].length}return n<e.length&&t.push({kind:`text`,text:e.slice(n)}),t}};function Hie(e,t){function n(n){let r=Ih(e);if(!n?.optional&&!r)throw Error(`This component must be used within ${t}.`);return r}return n}function Xy(e,t){function n(n){let r=e(n);return r?r[t]:null}function r(e){let t=W(5),r=!1,i;typeof e==`function`?i=e:e&&typeof e==`object`&&(r=!!e.optional,i=e.selector);let a;t[0]===r?a=t[1]:(a={optional:r},t[0]=r,t[1]=a);let o=n(a);if(!o)return null;let s;return t[2]!==i||t[3]!==o?(s=i?o(i):o(),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}return{[t]:r,[`${t}Store`]:n}}var Zy=Ph(null),{useThreadViewport:Qy,useThreadViewportStore:$y}=Xy(Hie(Zy,`ThreadPrimitive.Viewport`),`useThreadViewport`),eb=e=>{let t=new Map,n=()=>{let n=0;for(let e of t.values())n+=e;e(n)};return{register:()=>{let e=Symbol();return t.set(e,0),{setHeight:r=>{t.get(e)!==r&&(t.set(e,r),n())},unregister:()=>{t.delete(e),n()}}}}},Uie=(e={})=>{let t=new Set,n=eb(e=>{a.setState({height:{...a.getState().height,viewport:e}})}),r=eb(e=>{a.setState({height:{...a.getState().height,inset:e}})}),i=(e,t)=>(a.setState({element:{...a.getState().element,[e]:t}}),()=>{a.getState().element[e]===t&&a.setState({element:{...a.getState().element,[e]:null}})}),a=l_(()=>({isAtBottom:!0,scrollToBottom:({behavior:e=`auto`}={})=>{for(let n of t)n({behavior:e})},onScrollToBottom:e=>(t.add(e),()=>{t.delete(e)}),turnAnchor:e.turnAnchor??`bottom`,topAnchorMessageClamp:{tallerThan:e.topAnchorMessageClamp?.tallerThan??`10em`,visibleHeight:e.topAnchorMessageClamp?.visibleHeight??`6em`},height:{viewport:0,inset:0},element:{viewport:null,anchor:null,target:null},targetConfig:null,topAnchorTurn:null,registerViewport:n.register,registerContentInset:r.register,registerViewportElement:e=>i(`viewport`,e),registerAnchorElement:e=>i(`anchor`,e),registerAnchorTargetElement:(e,t)=>(a.setState({element:{...a.getState().element,target:e},targetConfig:e&&t?t:null}),()=>{a.getState().element.target===e&&a.setState({element:{...a.getState().element,target:null},targetConfig:null})}),setTopAnchorTurn:e=>{a.setState({topAnchorTurn:e})}}));return a},tb=e=>e,Wie=e=>{let t=W(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={optional:!0},t[0]=n):n=t[0];let r=$y(n),i;t[1]===e?i=t[2]:(i=()=>Uie(e),t[1]=e,t[2]=i);let[a]=Th(i),o,s;t[3]!==r||t[4]!==a?(o=()=>r?.getState().onScrollToBottom(()=>{a.getState().scrollToBottom()}),s=[r,a],t[3]=r,t[4]=a,t[5]=o,t[6]=s):(o=t[5],s=t[6]),kh(o,s);let c,l;return t[7]!==r||t[8]!==a?(c=()=>{if(r)return a.subscribe(e=>{r.getState().isAtBottom!==e.isAtBottom&&tb(r).setState({isAtBottom:e.isAtBottom})})},l=[a,r],t[7]=r,t[8]=a,t[9]=c,t[10]=l):(c=t[9],l=t[10]),kh(c,l),a},nb=e=>{let t=W(7),{children:n,options:r}=e,i;t[0]===r?i=t[1]:(i=r===void 0?{}:r,t[0]=r,t[1]=i);let a=Wie(i),o;t[2]===a?o=t[3]:(o=()=>({useThreadViewport:a}),t[2]=a,t[3]=o);let[s]=Th(o),c;return t[4]!==n||t[5]!==s?(c=(0,z.jsx)(Zy.Provider,{value:s,children:n}),t[4]=n,t[5]=s,t[6]=c):c=t[6],c},Gie=()=>{let e=W(3),t=Xg(),n,r;return e[0]===t?(n=e[1],r=e[2]):(n=()=>{},r=[t],e[0]=t,e[1]=n,e[2]=r),kh(n,r),null},Kie=(0,U.memo)(e=>{let t=W(7),{children:n,aui:r,runtime:i}=e,a=r??null,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,z.jsx)(Gie,{}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,z.jsx)(nb,{children:n}),t[1]=n,t[2]=s);let c;return t[3]!==i||t[4]!==a||t[5]!==s?(c=(0,z.jsxs)(lne,{runtime:i,aui:a,children:[o,s]}),t[3]=i,t[4]=a,t[5]=s,t[6]=c):c=t[6],c}),qie=e=>{let t=e;t.__isBound||=(t.__internal_bindMethods?.(),!0)};function Jie(e,t){let n=W(4),r=t===void 0?Yie:t;qie(e);let i,a;n[0]!==e||n[1]!==r?(i=()=>r(e.getState()),a=()=>r(e.getState()),n[0]=e,n[1]=r,n[2]=i,n[3]=a):(i=n[2],a=n[3]);let o=Mh(e.subscribe,i,a);return Nh(o),o}var Yie=e=>e;function rb(e){function t(t){let n=!1,r;typeof t==`function`?r=t:t&&(n=!!t.optional,r=t.selector);let i=e({optional:n});return i?Jie(i,r):null}return t}function Xie(e){let t=W(2),n=Xg(),r;t[0]===n?r=t[1]:(r=()=>n.attachment.source?n.attachment().__internal_getRuntime?.()??null:null,t[0]=n,t[1]=r);let i=G(r);if(!i&&!e?.optional)throw Error(`AttachmentRuntime is not available`);return i}var ib=rb(Xie);function Zie(e){let t=W(2),n=Xg(),r;t[0]===n?r=t[1]:(r=()=>n.message.source?n.message().__internal_getRuntime?.()??null:null,t[0]=n,t[1]=r);let i=G(r);if(!i&&!e?.optional)throw Error(`MessageRuntime is not available`);return i}var ab=rb(Zie);function ob(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function sb(...e){return t=>{let n=!1,r=e.map(e=>{let r=ob(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():ob(e[t],null)}}}}function cb(...e){return I.useCallback(sb(...e),e)}var lb=Object.defineProperty,ub=(e,t)=>{let n={};for(var r in e)lb(n,r,{get:e[r],enumerable:!0});return t||lb(n,Symbol.toStringTag,{value:`Module`}),n};function db(e){let t=I.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];hb(r)&&typeof gb==`function`&&(r=gb(r._payload)),I.Children.forEach(r,e=>{if(tae(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;hb(n)&&typeof gb==`function`&&(n=gb(n._payload)),a=Qie(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=I.cloneElement(a,void 0,s):!o&&I.Children.count(r)===1&&I.isValidElement(r)&&(a=r);let c=a?eae(a):void 0,l=cb(n,c);if(!a){if(r||r===0)throw Error(o?aae(e):iae(e));return r}let u=$ie(i,a.props??{});return a.type!==I.Fragment&&(u.ref=n?l:c),I.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var fb=db(`Slot`),pb=Symbol.for(`radix.slottable`);function mb(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=pb,t}var Qie=(e,t)=>{if(`child`in e.props){let t=e.props.child;return I.isValidElement(t)?I.cloneElement(t,void 0,e.props.children(t.props.children)):null}return I.isValidElement(t)?t:null};function $ie(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}}function eae(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)}function tae(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===pb}var nae=Symbol.for(`react.lazy`);function hb(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===nae&&`_payload`in e&&rae(e._payload)}function rae(e){return typeof e==`object`&&!!e&&`then`in e}var iae=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,aae=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,gb=I.use,_b=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=db(`Primitive.${t}`),r=I.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,z.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vb(e,t){e&&Bo.flushSync(()=>e.dispatchEvent(t))}var oae=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`];function sae(e){let t=(0,U.forwardRef)((t,n)=>{let r=W(17),i,a,o,s;r[0]===t?(i=r[1],a=r[2],o=r[3],s=r[4]):({render:o,asChild:i,children:a,...s}=t,r[0]=t,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c=e;if(o&&(0,U.isValidElement)(o)){let e=a===void 0?o.props.children:a,t=s,i;r[5]!==o||r[6]!==e?(i=(0,U.cloneElement)(o,void 0,e),r[5]=o,r[6]=e,r[7]=i):i=r[7];let l;return r[8]!==n||r[9]!==t||r[10]!==i?(l=(0,z.jsx)(c,{...t,asChild:!0,ref:n,children:i}),r[8]=n,r[9]=t,r[10]=i,r[11]=l):l=r[11],l}let l=s,u;return r[12]!==i||r[13]!==a||r[14]!==n||r[15]!==l?(u=(0,z.jsx)(c,{...l,asChild:i,ref:n,children:a}),r[12]=i,r[13]=a,r[14]=n,r[15]=l,r[16]=u):u=r[16],u});return t.displayName=typeof e==`string`?e:e.displayName??e.name??`Component`,t}function cae(e){let t=_b[e],n=sae(t);return n.displayName=`Primitive.${e}`,n}var yb=oae.reduce((e,t)=>(e[t]=cae(t),e),{}),lae=e=>{let t=W(5),{hideWhenRunning:n,autohide:r,autohideFloat:i,forceVisible:a}=e,o;return t[0]!==r||t[1]!==i||t[2]!==a||t[3]!==n?(o=e=>{if(n&&e.thread.isRunning)return`hidden`;let t=r===`always`||r===`not-last`&&!e.message.isLast,o=a||e.message.isHovering;return t?o?i===`always`||i===`single-branch`&&e.message.branchCount<=1?`floating`:`normal`:`hidden`:`normal`},t[0]=r,t[1]=i,t[2]=a,t[3]=n,t[4]=o):o=t[4],G(o)},uae=Ph(null),bb=(0,U.forwardRef)((e,t)=>{let n=W(18),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({hideWhenRunning:a,autohide:r,autohideFloat:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let[s,c]=Th(0),l;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=!1;return c(dae),()=>{e||(e=!0,c(fae))}},n[5]=l):l=n[5];let u=l,d;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(d={acquireInteractionLock:u},n[6]=d):d=n[6];let f=d,p=s>0,m;n[7]!==r||n[8]!==i||n[9]!==a||n[10]!==p?(m={hideWhenRunning:a,autohide:r,autohideFloat:i,forceVisible:p},n[7]=r,n[8]=i,n[9]=a,n[10]=p,n[11]=m):m=n[11];let h=lae(m);if(h===`hidden`)return null;let g;n[12]===h?g=n[13]:(g=h===`floating`?{"data-floating":`true`}:null,n[12]=h,n[13]=g);let _;return n[14]!==t||n[15]!==o||n[16]!==g?(_=(0,z.jsx)(uae.Provider,{value:f,children:(0,z.jsx)(yb.div,{...g,...o,ref:t})}),n[14]=t,n[15]=o,n[16]=g,n[17]=_):_=n[17],_});bb.displayName=`ActionBarPrimitive.Root`;function dae(e){return e+1}function fae(e){return Math.max(0,e-1)}typeof window<`u`&&window.document&&window.document.createElement;function K(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var pae=e=>{let t=W(4),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{copiedDuration:r}=n,i=r===void 0?3e3:r,a;t[2]===i?a=t[3]:(a={copiedDuration:i,copyToClipboard:mae},t[2]=i,t[3]=a);let{copy:o,disabled:s}=hie(a);return s?null:o},xb=(0,U.forwardRef)((e,t)=>{let n=W(20),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({copiedDuration:r,onClick:a,disabled:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=G(hae),c;n[5]===r?c=n[6]:(c={copiedDuration:r},n[5]=r,n[6]=c);let l=pae(c),u;n[7]===s?u=n[8]:(u=s?{"data-copied":`true`}:{},n[7]=s,n[8]=u);let d=i||!l,f;n[9]===l?f=n[10]:(f=()=>{l?.()},n[9]=l,n[10]=f);let p;n[11]!==a||n[12]!==f?(p=K(a,f),n[11]=a,n[12]=f,n[13]=p):p=n[13];let m;return n[14]!==t||n[15]!==o||n[16]!==u||n[17]!==d||n[18]!==p?(m=(0,z.jsx)(yb.button,{type:`button`,...u,...o,ref:t,disabled:d,onClick:p}),n[14]=t,n[15]=o,n[16]=u,n[17]=d,n[18]=p,n[19]=m):m=n[19],m});xb.displayName=`ActionBarPrimitive.Copy`;function mae(e){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API is unavailable`)):navigator.clipboard.writeText(e)}function hae(e){return e.message.isCopied}var Sb=(e,t,n=[])=>{let r=(0,U.forwardRef)((e,r)=>{let i=W(6),a={},o={};Object.keys(e).forEach(t=>{n.includes(t)?a[t]=e[t]:o[t]=e[t]});let s=t(a)??void 0,c=yb,l=o.disabled||!s,u=K(o.onClick,s),d;return i[0]!==r||i[1]!==o||i[2]!==c.button||i[3]!==l||i[4]!==u?(d=(0,z.jsx)(c.button,{...o,type:`button`,ref:r,disabled:l,onClick:u}),i[0]=r,i[1]=o,i[2]=c.button,i[3]=l,i[4]=u,i[5]=d):d=i[5],d});return r.displayName=e,r},gae=Sb(`ActionBarPrimitive.Reload`,()=>{let{disabled:e,reload:t}=Tie();return e?null:t}),_ae=Sb(`ActionBarPrimitive.Edit`,()=>{let{disabled:e,edit:t}=Cie();return e?null:t}),vae=Sb(`ActionBarPrimitive.Speak`,()=>{let{disabled:e,speak:t}=jie();return e?null:t});function Cb(e){let t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>((...e)=>t.current?.(...e)),[])}function wb(e,t=globalThis?.document){let n=Cb(e);I.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var yae=()=>{let{disabled:e,stopSpeaking:t}=Pie();return e?null:t},Tb=(0,U.forwardRef)((e,t)=>{let n=W(12),r=yae(),i;n[0]===r?i=n[1]:(i=e=>{r&&(e.preventDefault(),r())},n[0]=r,n[1]=i),wb(i);let a=!r,o;n[2]===r?o=n[3]:(o=()=>{r?.()},n[2]=r,n[3]=o);let s;n[4]!==e.onClick||n[5]!==o?(s=K(e.onClick,o),n[4]=e.onClick,n[5]=o,n[6]=s):s=n[6];let c;return n[7]!==e||n[8]!==t||n[9]!==a||n[10]!==s?(c=(0,z.jsx)(yb.button,{type:`button`,disabled:a,...e,ref:t,onClick:s}),n[7]=e,n[8]=t,n[9]=a,n[10]=s,n[11]=c):c=n[11],c});Tb.displayName=`ActionBarPrimitive.StopSpeaking`;var bae=()=>{let{submit:e}=Die();return e},Eb=(0,U.forwardRef)((e,t)=>{let n=W(17),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({onClick:i,disabled:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=G(xae),s=bae(),c;n[4]===o?c=n[5]:(c=o?{"data-submitted":`true`}:{},n[4]=o,n[5]=c);let l=r||!s,u;n[6]===s?u=n[7]:(u=()=>{s?.()},n[6]=s,n[7]=u);let d;n[8]!==i||n[9]!==u?(d=K(i,u),n[8]=i,n[9]=u,n[10]=d):d=n[10];let f;return n[11]!==t||n[12]!==a||n[13]!==c||n[14]!==l||n[15]!==d?(f=(0,z.jsx)(yb.button,{type:`button`,...c,...a,ref:t,disabled:l,onClick:d}),n[11]=t,n[12]=a,n[13]=c,n[14]=l,n[15]=d,n[16]=f):f=n[16],f});Eb.displayName=`ActionBarPrimitive.FeedbackPositive`;function xae(e){return e.message.metadata.submittedFeedback?.type===`positive`}var Sae=()=>{let{submit:e}=Oie();return e},Db=(0,U.forwardRef)((e,t)=>{let n=W(17),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({onClick:i,disabled:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=G(Cae),s=Sae(),c;n[4]===o?c=n[5]:(c=o?{"data-submitted":`true`}:{},n[4]=o,n[5]=c);let l=r||!s,u;n[6]===s?u=n[7]:(u=()=>{s?.()},n[6]=s,n[7]=u);let d;n[8]!==i||n[9]!==u?(d=K(i,u),n[8]=i,n[9]=u,n[10]=d):d=n[10];let f;return n[11]!==t||n[12]!==a||n[13]!==c||n[14]!==l||n[15]!==d?(f=(0,z.jsx)(yb.button,{type:`button`,...c,...a,ref:t,disabled:l,onClick:d}),n[11]=t,n[12]=a,n[13]=c,n[14]=l,n[15]=d,n[16]=f):f=n[16],f});Db.displayName=`ActionBarPrimitive.FeedbackNegative`;function Cae(e){return e.message.metadata.submittedFeedback?.type===`negative`}var wae=e=>{let t=W(6),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{filename:r,onExport:i}=n,a=Xg(),o=G(Eae),s;return t[2]!==a||t[3]!==r||t[4]!==i?(s=async()=>{let e=a.message().getCopyText();if(!e)return;if(i){await i(e);return}let t=new Blob([e],{type:`text/markdown`}),n=URL.createObjectURL(t),o=document.createElement(`a`);o.href=n,o.download=r??`message-${Date.now()}.md`,o.click(),URL.revokeObjectURL(n)},t[2]=a,t[3]=r,t[4]=i,t[5]=s):s=t[5],o?s:null},Ob=(0,U.forwardRef)((e,t)=>{let n=W(19),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({filename:i,onExport:o,onClick:a,disabled:r,...s}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c;n[6]!==i||n[7]!==o?(c={filename:i,onExport:o},n[6]=i,n[7]=o,n[8]=c):c=n[8];let l=wae(c),u=r||!l,d;n[9]===l?d=n[10]:(d=()=>{l?.()},n[9]=l,n[10]=d);let f;n[11]!==a||n[12]!==d?(f=K(a,d),n[11]=a,n[12]=d,n[13]=f):f=n[13];let p;return n[14]!==t||n[15]!==s||n[16]!==u||n[17]!==f?(p=(0,z.jsx)(yb.button,{type:`button`,...s,ref:t,disabled:u,onClick:f}),n[14]=t,n[15]=s,n[16]=u,n[17]=f,n[18]=p):p=n[18],p});Ob.displayName=`ActionBarPrimitive.ExportMarkdown`;function Tae(e){return e.type===`text`&&e.text.length>0}function Eae(e){return(e.message.role!==`assistant`||e.message.status?.type!==`running`)&&e.message.parts.some(Tae)}var kb=ub({Copy:()=>xb,Edit:()=>_ae,ExportMarkdown:()=>Ob,FeedbackNegative:()=>Db,FeedbackPositive:()=>Eb,Reload:()=>gae,Root:()=>bb,Speak:()=>vae,StopSpeaking:()=>Tb}),Ab=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Dae=`VisuallyHidden`,jb=I.forwardRef((e,t)=>(0,z.jsx)(_b.span,{...e,ref:t,style:{...Ab,...e.style}}));jb.displayName=Dae;var Oae=jb;function kae(e,t){let n=I.createContext(t);n.displayName=e+`Context`;let r=e=>{let{children:t,...r}=e,i=I.useMemo(()=>r,Object.values(r));return(0,z.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=I.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Mb(e,t=[]){let n=[];function r(t,r){let i=I.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=I.useMemo(()=>o,Object.values(o));return(0,z.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=I.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>I.createContext(e));return function(n){let r=n?.[e]||t;return I.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Aae(i,...t)]}function Aae(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Nb(e){let t=e+`CollectionProvider`,[n,r]=Mb(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=I.useRef(null),a=I.useRef(new Map).current;return(0,z.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=db(s),l=I.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,z.jsx)(c,{ref:cb(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=db(u),p=I.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=I.useRef(null),s=cb(t,o),c=a(u,n);return I.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,z.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return I.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Pb=globalThis?.document?I.useLayoutEffect:()=>{},jae=I.useInsertionEffect||Pb;function Fb({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Mae({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=I.useRef(e!==void 0);I.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,I.useCallback(t=>{if(s){let n=Nae(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Mae({defaultProp:e,onChange:t}){let[n,r]=I.useState(e),i=I.useRef(n),a=I.useRef(t);return jae(()=>{a.current=t},[t]),I.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Nae(e){return typeof e==`function`}function Pae(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}var Ib=e=>{let{present:t,children:n}=e,r=Fae(t),i=typeof n==`function`?n({present:r.isPresent}):I.Children.only(n),a=Iae(r.ref,Lae(i));return typeof n==`function`||r.isPresent?I.cloneElement(i,{ref:a}):null};Ib.displayName=`Presence`;function Fae(e){let[t,n]=I.useState(),r=I.useRef(null),i=I.useRef(e),a=I.useRef(`none`),[o,s]=Pae(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return I.useEffect(()=>{let e=Rb(r.current);a.current=o===`mounted`?e:`none`},[o]),Pb(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Rb(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Pb(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Rb(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Rb(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:I.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Lb(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Iae(...e){let t=I.useRef(e);return t.current=e,I.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Lb(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():Lb(n[e],null)}}},[])}function Rb(e){return e?.animationName||`none`}function Lae(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Rae=I.useId||(()=>void 0),zae=0;function zb(e){let[t,n]=I.useState(Rae());return Pb(()=>{e||n(e=>e??String(zae++))},[e]),e||(t?`radix-${t}`:``)}var Bae=I.createContext(void 0);function Bb(e){let t=I.useContext(Bae);return e||t||`ltr`}var Vae=`DismissableLayer`,Vb=`dismissableLayer.update`,Hae=`dismissableLayer.pointerDownOutside`,Uae=`dismissableLayer.focusOutside`,Hb,Ub=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wb=I.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=I.useContext(Ub),[u,d]=I.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=I.useState({}),m=cb(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Kae(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=qae(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return wb(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),I.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Hb=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Gb(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(u),l.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=Hb))}},[u,f,n,l]),I.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Gb())},[u,l]),I.useEffect(()=>{let e=()=>p({});return document.addEventListener(Vb,e),()=>document.removeEventListener(Vb,e)},[]),(0,z.jsx)(_b.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:K(e.onFocusCapture,S.onFocusCapture),onBlurCapture:K(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,x.onPointerDownCapture)})});Wb.displayName=Vae;var Wae=`DismissableLayerBranch`,Gae=I.forwardRef((e,t)=>{let n=I.useContext(Ub),r=I.useRef(null),i=cb(t,r);return I.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,z.jsx)(_b.div,{...e,ref:i})});Gae.displayName=Wae;function Kae(e,t=globalThis?.document){let n=Cb(e),r=I.useRef(!1),i=I.useRef(()=>{});return I.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Kb(Hae,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qae(e,t=globalThis?.document){let n=Cb(e),r=I.useRef(!1);return I.useEffect(()=>{let e=e=>{e.target&&!r.current&&Kb(Uae,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Gb(){let e=new CustomEvent(Vb);document.dispatchEvent(e)}function Kb(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?vb(i,a):i.dispatchEvent(a)}var qb=`focusScope.autoFocusOnMount`,Jb=`focusScope.autoFocusOnUnmount`,Yb={bubbles:!1,cancelable:!0},Xb=`FocusScope`,Zb=I.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=I.useState(null),l=Cb(i),u=Cb(a),d=I.useRef(null),f=cb(t,e=>c(e)),p=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ix(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ix(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ix(s)};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]),I.useEffect(()=>{if(s){ax.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(qb,Yb);s.addEventListener(qb,l),s.dispatchEvent(t),t.defaultPrevented||(Qb(cx(ex(s)),{select:!0}),document.activeElement===e&&ix(s))}return()=>{s.removeEventListener(qb,l),setTimeout(()=>{let t=new CustomEvent(Jb,Yb);s.addEventListener(Jb,u),s.dispatchEvent(t),t.defaultPrevented||ix(e??document.body,{select:!0}),s.removeEventListener(Jb,u),ax.remove(p)},0)}}},[s,l,u,p]);let m=I.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]=$b(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ix(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ix(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,z.jsx)(_b.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Zb.displayName=Xb;function Qb(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ix(r,{select:t}),document.activeElement!==n)return}function $b(e){let t=ex(e);return[tx(t,e),tx(t.reverse(),e)]}function ex(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)t.push(n.currentNode);return t}function tx(e,t){for(let n of e)if(!nx(n,{upTo:t}))return n}function nx(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}function rx(e){return e instanceof HTMLInputElement&&`select`in e}function ix(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rx(e)&&t&&e.select()}}var ax=ox();function ox(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=sx(e,t),e.unshift(t)},remove(t){e=sx(e,t),e[0]?.resume()}}}function sx(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function cx(e){return e.filter(e=>e.tagName!==`A`)}var lx=`Portal`,ux=I.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=I.useState(!1);Pb(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Bo.createPortal((0,z.jsx)(_b.div,{...r,ref:t}),o):null});ux.displayName=lx;var dx=0,fx=null;function px(){I.useEffect(()=>{fx||={start:mx(),end:mx()};let{start:e,end:t}=fx;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),dx++,()=>{dx===1&&(fx?.start.remove(),fx?.end.remove(),fx=null),dx=Math.max(0,dx-1)}},[])}function mx(){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}var hx=function(){return hx=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},hx.apply(this,arguments)};function gx(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 _x(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 vx=`right-scroll-bar-position`,yx=`width-before-scroll-bar`,bx=`with-scroll-bars-hidden`,xx=`--removed-body-scroll-bar-size`;function Sx(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Cx(e,t){var n=(0,I.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 wx=typeof window<`u`?I.useLayoutEffect:I.useEffect,Tx=new WeakMap;function Ex(e,t){var n=Cx(t||null,function(t){return e.forEach(function(e){return Sx(e,t)})});return wx(function(){var t=Tx.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Sx(e,null)}),i.forEach(function(e){r.has(e)||Sx(e,a)})}Tx.set(n,e)},[e]),n}function Dx(e){return e}function Ox(e,t){t===void 0&&(t=Dx);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 kx(e){e===void 0&&(e={});var t=Ox(null);return t.options=hx({async:!0,ssr:!1},e),t}var Ax=function(e){var t=e.sideCar,n=gx(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 I.createElement(r,hx({},n))};Ax.isSideCarExport=!0;function jx(e,t){return e.useMedium(t),Ax}var Mx=kx(),Nx=function(){},Px=I.forwardRef(function(e,t){var n=I.useRef(null),r=I.useState({onScrollCapture:Nx,onWheelCapture:Nx,onTouchMoveCapture:Nx}),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`:_,y=e.gapMode,b=gx(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ex([n,t]),C=hx(hx({},b),i);return I.createElement(I.Fragment,null,u&&I.createElement(x,{sideCar:Mx,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?I.cloneElement(I.Children.only(s),hx(hx({},C),{ref:S})):I.createElement(v,hx({},C,{className:c,ref:S}),s))});Px.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Px.classNames={fullWidth:yx,zeroRight:vx};var Fx,Ix=function(){if(Fx)return Fx;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Lx(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ix();return t&&e.setAttribute(`nonce`,t),e}function Rx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zx(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Bx=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Lx())&&(Rx(t,n),zx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Vx=function(){var e=Bx();return function(t,n){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Hx=function(){var e=Vx();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ux={left:0,top:0,right:0,gap:0},Wx=function(e){return parseInt(e||``,10)||0},Gx=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[Wx(n),Wx(r),Wx(i)]},Kx=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ux;var t=Gx(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])}},qx=Hx(),Jx=`data-scroll-locked`,Yx=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
80
|
-
.${bx} {
|
|
81
|
-
overflow: hidden ${r};
|
|
82
|
-
padding-right: ${s}px ${r};
|
|
83
|
-
}
|
|
84
|
-
body[${Jx}] {
|
|
85
|
-
overflow: hidden ${r};
|
|
86
|
-
overscroll-behavior: contain;
|
|
87
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
88
|
-
padding-left: ${i}px;
|
|
89
|
-
padding-top: ${a}px;
|
|
90
|
-
padding-right: ${o}px;
|
|
91
|
-
margin-left:0;
|
|
92
|
-
margin-top:0;
|
|
93
|
-
margin-right: ${s}px ${r};
|
|
94
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.${vx} {
|
|
98
|
-
right: ${s}px ${r};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.${yx} {
|
|
102
|
-
margin-right: ${s}px ${r};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.${vx} .${vx} {
|
|
106
|
-
right: 0 ${r};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.${yx} .${yx} {
|
|
110
|
-
margin-right: 0 ${r};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
body[${Jx}] {
|
|
114
|
-
${xx}: ${s}px;
|
|
115
|
-
}
|
|
116
|
-
`},Xx=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Zx=function(){I.useEffect(function(){return document.body.setAttribute(Jx,(Xx()+1).toString()),function(){var e=Xx()-1;e<=0?document.body.removeAttribute(Jx):document.body.setAttribute(Jx,e.toString())}},[])},Qx=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Zx();var a=I.useMemo(function(){return Kx(i)},[i]);return I.createElement(qx,{styles:Yx(a,!t,i,n?``:`!important`)})},$x=!1;if(typeof window<`u`)try{var eS=Object.defineProperty({},"passive",{get:function(){return $x=!0,!0}});window.addEventListener(`test`,eS,eS),window.removeEventListener(`test`,eS,eS)}catch{$x=!1}var tS=$x?{passive:!1}:!1,nS=function(e){return e.tagName===`TEXTAREA`},rS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!nS(e)&&n[t]===`visible`)},iS=function(e){return rS(e,`overflowY`)},aS=function(e){return rS(e,`overflowX`)},oS=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),lS(e,r)){var i=uS(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sS=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},cS=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},lS=function(e,t){return e===`v`?iS(t):aS(t)},uS=function(e,t){return e===`v`?sS(t):cS(t)},dS=function(e,t){return e===`h`&&t===`rtl`?-1:1},fS=function(e,t,n,r,i){var a=dS(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=uS(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&lS(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},pS=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mS=function(e){return[e.deltaX,e.deltaY]},hS=function(e){return e&&`current`in e?e.current:e},gS=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_S=function(e){return`
|
|
117
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
118
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
119
|
-
`},vS=0,yS=[];function bS(e){var t=I.useRef([]),n=I.useRef([0,0]),r=I.useRef(),i=I.useState(vS++)[0],a=I.useState(Hx)[0],o=I.useRef(e);I.useEffect(function(){o.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=_x([e.lockRef.current],(e.shards||[]).map(hS),!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=I.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=pS(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=oS(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=oS(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 fS(h,t,e,h===`h`?s:c,!0)},[]),c=I.useCallback(function(e){var n=e;if(!(!yS.length||yS[yS.length-1]!==a)){var r=`deltaY`in n?mS(n):pS(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&gS(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(hS).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=I.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:xS(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=I.useCallback(function(e){n.current=pS(e),r.current=void 0},[]),d=I.useCallback(function(t){l(t.type,mS(t),t.target,s(t,e.lockRef.current))},[]),f=I.useCallback(function(t){l(t.type,pS(t),t.target,s(t,e.lockRef.current))},[]);I.useEffect(function(){return yS.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,tS),document.addEventListener(`touchmove`,c,tS),document.addEventListener(`touchstart`,u,tS),function(){yS=yS.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,tS),document.removeEventListener(`touchmove`,c,tS),document.removeEventListener(`touchstart`,u,tS)}},[]);var p=e.removeScrollBar,m=e.inert;return I.createElement(I.Fragment,null,m?I.createElement(a,{styles:_S(i)}):null,p?I.createElement(Qx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xS(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var SS=jx(Mx,bS),CS=I.forwardRef(function(e,t){return I.createElement(Px,hx({},e,{ref:t,sideCar:SS}))});CS.classNames=Px.classNames;var wS=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},TS=new WeakMap,ES=new WeakMap,DS={},OS=0,kS=function(e){return e&&(e.host||kS(e.parentNode))},AS=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=kS(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})},jS=function(e,t,n,r){var i=AS(t,Array.isArray(e)?e:[e]);DS[n]||(DS[n]=new WeakMap);var a=DS[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=(TS.get(e)||0)+1,l=(a.get(e)||0)+1;TS.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ES.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(),OS++,function(){o.forEach(function(e){var t=TS.get(e)-1,i=a.get(e)-1;TS.set(e,t),a.set(e,i),t||(ES.has(e)||e.removeAttribute(r),ES.delete(e)),i||e.removeAttribute(n)}),OS--,OS||(TS=new WeakMap,TS=new WeakMap,ES=new WeakMap,DS={})}},MS=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||wS(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),jS(r,i,n,`aria-hidden`)):function(){return null}},NS=`Dialog`,[PS,FS]=Mb(NS),[IS,LS]=PS(NS),RS=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=I.useRef(null),c=I.useRef(null),[l,u]=Fb({prop:r,defaultProp:i??!1,onChange:a,caller:NS});return(0,z.jsx)(IS,{scope:t,triggerRef:s,contentRef:c,contentId:zb(),titleId:zb(),descriptionId:zb(),open:l,onOpenChange:u,onOpenToggle:I.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};RS.displayName=NS;var zS=`DialogTrigger`,BS=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=LS(zS,n),a=cb(t,i.triggerRef);return(0,z.jsx)(_b.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":tC(i.open),...r,ref:a,onClick:K(e.onClick,i.onOpenToggle)})});BS.displayName=zS;var VS=`DialogPortal`,[Jae,HS]=PS(VS,{forceMount:void 0}),US=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=LS(VS,t);return(0,z.jsx)(Jae,{scope:t,forceMount:n,children:I.Children.map(r,e=>(0,z.jsx)(Ib,{present:n||a.open,children:(0,z.jsx)(ux,{asChild:!0,container:i,children:e})}))})};US.displayName=VS;var WS=`DialogOverlay`,GS=I.forwardRef((e,t)=>{let n=HS(WS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=LS(WS,e.__scopeDialog);return a.modal?(0,z.jsx)(Ib,{present:r||a.open,children:(0,z.jsx)(Xae,{...i,ref:t})}):null});GS.displayName=WS;var Yae=db(`DialogOverlay.RemoveScroll`),Xae=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=LS(WS,n);return(0,z.jsx)(CS,{as:Yae,allowPinchZoom:!0,shards:[i.contentRef],children:(0,z.jsx)(_b.div,{"data-state":tC(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),KS=`DialogContent`,qS=I.forwardRef((e,t)=>{let n=HS(KS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=LS(KS,e.__scopeDialog);return(0,z.jsx)(Ib,{present:r||a.open,children:a.modal?(0,z.jsx)(Zae,{...i,ref:t}):(0,z.jsx)(Qae,{...i,ref:t})})});qS.displayName=KS;var Zae=I.forwardRef((e,t)=>{let n=LS(KS,e.__scopeDialog),r=I.useRef(null),i=cb(t,n.contentRef,r);return I.useEffect(()=>{let e=r.current;if(e)return MS(e)},[]),(0,z.jsx)(JS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:K(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:K(e.onFocusOutside,e=>e.preventDefault())})}),Qae=I.forwardRef((e,t)=>{let n=LS(KS,e.__scopeDialog),r=I.useRef(!1),i=I.useRef(!1);return(0,z.jsx)(JS,{...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()}})}),JS=I.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=LS(KS,n),c=I.useRef(null),l=cb(t,c);return px(),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Zb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,z.jsx)(Wb,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":tC(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(eoe,{titleId:s.titleId}),(0,z.jsx)(noe,{contentRef:c,descriptionId:s.descriptionId})]})]})}),YS=`DialogTitle`,XS=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=LS(YS,n);return(0,z.jsx)(_b.h2,{id:i.titleId,...r,ref:t})});XS.displayName=YS;var ZS=`DialogDescription`,QS=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=LS(ZS,n);return(0,z.jsx)(_b.p,{id:i.descriptionId,...r,ref:t})});QS.displayName=ZS;var $S=`DialogClose`,eC=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=LS($S,n);return(0,z.jsx)(_b.button,{type:`button`,...r,ref:t,onClick:K(e.onClick,()=>i.onOpenChange(!1))})});eC.displayName=$S;function tC(e){return e?`open`:`closed`}var nC=`DialogTitleWarning`,[$ae,rC]=kae(nC,{contentName:KS,titleName:YS,docsSlug:`dialog`}),eoe=({titleId:e})=>{let t=rC(nC),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
120
|
-
|
|
121
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
122
|
-
|
|
123
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return I.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},toe=`DialogDescriptionWarning`,noe=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rC(toe).contentName}}.`;return I.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},iC=RS,roe=BS,aC=US,oC=GS,sC=qS,cC=XS,lC=QS,uC=eC,dC=`AlertDialog`,[ioe,aoe]=Mb(dC,[FS]),fC=FS(),pC=e=>{let{__scopeAlertDialog:t,...n}=e,r=fC(t);return(0,z.jsx)(iC,{...r,...n,modal:!0})};pC.displayName=dC;var ooe=`AlertDialogTrigger`,soe=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=fC(n);return(0,z.jsx)(roe,{...i,...r,ref:t})});soe.displayName=ooe;var coe=`AlertDialogPortal`,mC=e=>{let{__scopeAlertDialog:t,...n}=e,r=fC(t);return(0,z.jsx)(aC,{...r,...n})};mC.displayName=coe;var loe=`AlertDialogOverlay`,hC=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=fC(n);return(0,z.jsx)(oC,{...i,...r,ref:t})});hC.displayName=loe;var gC=`AlertDialogContent`,[uoe,doe]=ioe(gC),foe=mb(`AlertDialogContent`),_C=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=fC(n),o=I.useRef(null),s=cb(t,o),c=I.useRef(null);return(0,z.jsx)($ae,{contentName:gC,titleName:vC,docsSlug:`alert-dialog`,children:(0,z.jsx)(uoe,{scope:n,cancelRef:c,children:(0,z.jsxs)(sC,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:K(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,z.jsx)(foe,{children:r}),(0,z.jsx)(moe,{contentRef:o})]})})})});_C.displayName=gC;var vC=`AlertDialogTitle`,yC=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=fC(n);return(0,z.jsx)(cC,{...i,...r,ref:t})});yC.displayName=vC;var bC=`AlertDialogDescription`,xC=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=fC(n);return(0,z.jsx)(lC,{...i,...r,ref:t})});xC.displayName=bC;var poe=`AlertDialogAction`,SC=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=fC(n);return(0,z.jsx)(uC,{...i,...r,ref:t})});SC.displayName=poe;var CC=`AlertDialogCancel`,wC=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=doe(CC,n),a=fC(n),o=cb(t,i);return(0,z.jsx)(uC,{...a,...r,ref:o})});wC.displayName=CC;var moe=({contentRef:e})=>{let t=`\`${gC}\` requires a description for the component to be accessible for screen reader users.
|
|
124
|
-
|
|
125
|
-
You can add a description to the \`${gC}\` by passing a \`${bC}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
126
|
-
|
|
127
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${gC}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
128
|
-
|
|
129
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return I.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},hoe=pC,goe=mC,_oe=hC,voe=_C,yoe=SC,boe=wC,xoe=yC,Soe=xC;function TC(e){let t=I.useRef({value:e,previous:e});return I.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function EC(e){let[t,n]=I.useState(void 0);return Pb(()=>{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)}else n(void 0)},[e]),t}var DC=`Checkbox`,[Coe,woe]=Mb(DC),[Toe,OC]=Coe(DC);function Eoe(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]=Fb({prop:n,defaultProp:i??!1,onChange:c,caller:DC}),[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useRef(!1),y=m?!!o||!!m.closest(`form`):!0,b={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,required:l,defaultChecked:IC(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:_};return(0,z.jsx)(Toe,{scope:t,...b,children:Doe(d)?d(b):r})}var kC=`CheckboxTrigger`,AC=I.forwardRef(({__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,isFormControl:p,bubbleInput:m}=OC(kC,e),h=cb(i,u),g=I.useRef(c);return I.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,z.jsx)(_b.button,{type:`button`,role:`checkbox`,"aria-checked":IC(c)?`mixed`:c,"aria-required":l,"data-state":LC(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:K(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:K(n,e=>{d(e=>IC(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});AC.displayName=kC;var jC=I.forwardRef((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,z.jsx)(Eoe,{__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,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(AC,{...d,ref:t,__scopeCheckbox:n}),e&&(0,z.jsx)(FC,{__scopeCheckbox:n})]})})});jC.displayName=DC;var MC=`CheckboxIndicator`,NC=I.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=OC(MC,n);return(0,z.jsx)(Ib,{present:r||IC(a.checked)||a.checked===!0,children:(0,z.jsx)(_b.span,{"data-state":LC(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});NC.displayName=MC;var PC=`CheckboxBubbleInput`,FC=I.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=OC(PC,e),m=cb(n,p),h=TC(a),g=EC(r);I.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=IC(a),n.call(e,IC(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=I.useRef(IC(a)?!1:a);return(0,z.jsx)(_b.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});FC.displayName=PC;function Doe(e){return typeof e==`function`}function IC(e){return e===`indeterminate`}function LC(e){return IC(e)?`indeterminate`:e?`checked`:`unchecked`}var Ooe=[`top`,`right`,`bottom`,`left`],RC=Math.min,zC=Math.max,BC=Math.round,VC=Math.floor,HC=e=>({x:e,y:e}),koe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function UC(e,t,n){return zC(e,RC(t,n))}function WC(e,t){return typeof e==`function`?e(t):e}function GC(e){return e.split(`-`)[0]}function KC(e){return e.split(`-`)[1]}function qC(e){return e===`x`?`y`:`x`}function JC(e){return e===`y`?`height`:`width`}function YC(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function XC(e){return qC(YC(e))}function Aoe(e,t,n){n===void 0&&(n=!1);let r=KC(e),i=XC(e),a=JC(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ew(o)),[o,ew(o)]}function joe(e){let t=ew(e);return[ZC(e),t,ZC(t)]}function ZC(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var QC=[`left`,`right`],$C=[`right`,`left`],Moe=[`top`,`bottom`],Noe=[`bottom`,`top`];function Poe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?$C:QC:t?QC:$C;case`left`:case`right`:return t?Moe:Noe;default:return[]}}function Foe(e,t,n,r){let i=KC(e),a=Poe(GC(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ZC)))),a}function ew(e){let t=GC(e);return koe[t]+e.slice(t.length)}function Ioe(e){return{top:0,right:0,bottom:0,left:0,...e}}function tw(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ioe(e)}function nw(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 rw(e,t,n){let{reference:r,floating:i}=e,a=YC(t),o=XC(t),s=JC(o),c=GC(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}}switch(KC(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Loe(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}=WC(t,e),p=tw(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=nw(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=nw(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 Roe=50,zoe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Loe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=rw(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<Roe&&(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}=rw(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Boe=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}=WC(e,t)||{};if(l==null)return{};let d=tw(u),f={x:n,y:r},p=XC(i),m=JC(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=RC(d[_],T),D=RC(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=UC(O,A,k),M=!c.arrow&&KC(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Voe=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}=WC(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=GC(r),_=YC(o),v=GC(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ew(o)]:joe(o)),x=p!==`none`;!d&&x&&b.push(...Foe(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=Aoe(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`&&_!==YC(t))||T.every(e=>YC(e.placement)===_?e.overflows[0]>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=YC(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function iw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function aw(e){return Ooe.some(t=>e[t]>=0)}var Hoe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=WC(e,t);switch(i){case`referenceHidden`:{let e=iw(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:aw(e)}}}case`escaped`:{let e=iw(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:aw(e)}}}default:return{}}}}},ow=new Set([`left`,`top`]);async function Uoe(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=GC(n),s=KC(n),c=YC(n)===`y`,l=ow.has(o)?-1:1,u=a&&c?-1:1,d=WC(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 Woe=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 Uoe(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}}}}},Goe=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}=WC(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=YC(GC(i)),p=qC(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=UC(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=UC(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Koe=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}=WC(e,t),u={x:n,y:r},d=YC(i),f=qC(d),p=u[f],m=u[d],h=WC(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=ow.has(GC(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}}}},qoe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=WC(e,t),u=await o.detectOverflow(t,l),d=GC(i),f=KC(i),p=YC(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=RC(h-u[g],v),x=RC(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=zC(u.left,0),t=zC(u.right,0),n=zC(u.top,0),r=zC(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:zC(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:zC(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function sw(){return typeof window<`u`}function cw(e){return dw(e)?(e.nodeName||``).toLowerCase():`#document`}function lw(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function uw(e){return((dw(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function dw(e){return sw()?e instanceof Node||e instanceof lw(e).Node:!1}function fw(e){return sw()?e instanceof Element||e instanceof lw(e).Element:!1}function pw(e){return sw()?e instanceof HTMLElement||e instanceof lw(e).HTMLElement:!1}function mw(e){return!sw()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof lw(e).ShadowRoot}function hw(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Sw(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Joe(e){return/^(table|td|th)$/.test(cw(e))}function gw(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Yoe=/transform|translate|scale|rotate|perspective|filter/,Xoe=/paint|layout|strict|content/,_w=e=>!!e&&e!==`none`,vw;function yw(e){let t=fw(e)?Sw(e):e;return _w(t.transform)||_w(t.translate)||_w(t.scale)||_w(t.rotate)||_w(t.perspective)||!bw()&&(_w(t.backdropFilter)||_w(t.filter))||Yoe.test(t.willChange||``)||Xoe.test(t.contain||``)}function Zoe(e){let t=ww(e);for(;pw(t)&&!xw(t);){if(yw(t))return t;if(gw(t))return null;t=ww(t)}return null}function bw(){return vw??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),vw}function xw(e){return/^(html|body|#document)$/.test(cw(e))}function Sw(e){return lw(e).getComputedStyle(e)}function Cw(e){return fw(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ww(e){if(cw(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||mw(e)&&e.host||uw(e);return mw(t)?t.host:t}function Tw(e){let t=ww(e);return xw(t)?e.ownerDocument?e.ownerDocument.body:e.body:pw(t)&&hw(t)?t:Tw(t)}function Ew(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Tw(e),i=r===e.ownerDocument?.body,a=lw(r);if(i){let e=Dw(a);return t.concat(a,a.visualViewport||[],hw(r)?r:[],e&&n?Ew(e):[])}else return t.concat(r,Ew(r,[],n))}function Dw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ow(e){let t=Sw(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=pw(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=BC(n)!==a||BC(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function kw(e){return fw(e)?e:e.contextElement}function Aw(e){let t=kw(e);if(!pw(t))return HC(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ow(t),o=(a?BC(n.width):n.width)/r,s=(a?BC(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Qoe=HC(0);function jw(e){let t=lw(e);return!bw()||!t.visualViewport?Qoe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $oe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==lw(e)?!1:t}function Mw(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=kw(e),o=HC(1);t&&(r?fw(r)&&(o=Aw(r)):o=Aw(e));let s=$oe(a,n,r)?jw(a):HC(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){let e=lw(a),t=r&&fw(r)?lw(r):r,n=e,i=Dw(n);for(;i&&r&&t!==n;){let e=Aw(i),t=i.getBoundingClientRect(),r=Sw(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=lw(i),i=Dw(n)}}return nw({width:u,height:d,x:c,y:l})}function Nw(e,t){let n=Cw(e).scrollLeft;return t?t.left+n:Mw(uw(e)).left+n}function Pw(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Nw(e,n),y:n.top+t.scrollTop}}function ese(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=uw(r),s=t?gw(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=HC(1),u=HC(0),d=pw(r);if((d||!d&&!a)&&((cw(r)!==`body`||hw(o))&&(c=Cw(r)),d)){let e=Mw(r);l=Aw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Pw(o,c):HC(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 tse(e){return Array.from(e.getClientRects())}function nse(e){let t=uw(e),n=Cw(e),r=e.ownerDocument.body,i=zC(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=zC(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Nw(e),s=-n.scrollTop;return Sw(r).direction===`rtl`&&(o+=zC(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Fw=25;function rse(e,t){let n=lw(e),r=uw(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=bw();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Nw(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Fw&&(a-=o)}else l<=Fw&&(a+=l);return{width:a,height:o,x:s,y:c}}function ise(e,t){let n=Mw(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=pw(e)?Aw(e):HC(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Iw(e,t,n){let r;if(t===`viewport`)r=rse(e,n);else if(t===`document`)r=nse(uw(e));else if(fw(t))r=ise(t,n);else{let n=jw(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return nw(r)}function Lw(e,t){let n=ww(e);return n===t||!fw(n)||xw(n)?!1:Sw(n).position===`fixed`||Lw(n,t)}function ase(e,t){let n=t.get(e);if(n)return n;let r=Ew(e,[],!1).filter(e=>fw(e)&&cw(e)!==`body`),i=null,a=Sw(e).position===`fixed`,o=a?ww(e):e;for(;fw(o)&&!xw(o);){let t=Sw(o),n=yw(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||hw(o)&&!n&&Lw(e,o))?r=r.filter(e=>e!==o):i=t,o=ww(o)}return t.set(e,r),r}function ose(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?gw(t)?[]:ase(t,this._c):[].concat(n),r],o=Iw(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=Iw(t,a[e],i);s=zC(n.top,s),c=RC(n.right,c),l=RC(n.bottom,l),u=zC(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function sse(e){let{width:t,height:n}=Ow(e);return{width:t,height:n}}function cse(e,t,n){let r=pw(t),i=uw(t),a=n===`fixed`,o=Mw(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=HC(0);function l(){c.x=Nw(i)}if(r||!r&&!a)if((cw(t)!==`body`||hw(i))&&(s=Cw(t)),r){let e=Mw(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Pw(i,s):HC(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Rw(e){return Sw(e).position===`static`}function zw(e,t){if(!pw(e)||Sw(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return uw(e)===n&&(n=n.ownerDocument.body),n}function Bw(e,t){let n=lw(e);if(gw(e))return n;if(!pw(e)){let t=ww(e);for(;t&&!xw(t);){if(fw(t)&&!Rw(t))return t;t=ww(t)}return n}let r=zw(e,t);for(;r&&Joe(r)&&Rw(r);)r=zw(r,t);return r&&xw(r)&&Rw(r)&&!yw(r)?n:r||Zoe(e)||n}var lse=async function(e){let t=this.getOffsetParent||Bw,n=this.getDimensions,r=await n(e.floating);return{reference:cse(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function use(e){return Sw(e).direction===`rtl`}var dse={convertOffsetParentRelativeRectToViewportRelativeRect:ese,getDocumentElement:uw,getClippingRect:ose,getOffsetParent:Bw,getElementRects:lse,getClientRects:tse,getDimensions:sse,getScale:Aw,isElement:fw,isRTL:use};function Vw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fse(e,t){let n=null,r,i=uw(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=VC(d),h=VC(i.clientWidth-(u+f)),g=VC(i.clientHeight-(d+p)),_=VC(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:zC(0,RC(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Vw(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function pse(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=kw(e),u=i||a?[...l?Ew(l):[],...t?Ew(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?fse(l,n):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?Mw(e):null;c&&g();function g(){let t=Mw(e);h&&!Vw(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 mse=Woe,hse=Goe,gse=Voe,_se=qoe,vse=Hoe,Hw=Boe,yse=Koe,bse=(e,t,n)=>{let r=new Map,i={platform:dse,...n},a={...i.platform,_c:r};return zoe(e,t,{...i,platform:a})},Uw=typeof document<`u`?I.useLayoutEffect:function(){};function Ww(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(!Ww(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)&&!Ww(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Gw(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kw(e,t){let n=Gw(e);return Math.round(t*n)/n}function qw(e){let t=I.useRef(e);return Uw(()=>{t.current=e}),t}function xse(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]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=I.useState(r);Ww(f,r)||p(r);let[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=I.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=I.useRef(null),C=I.useRef(null),w=I.useRef(u),T=c!=null,E=qw(c),D=qw(i),O=qw(l),k=I.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),bse(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Ww(w.current,t)&&(w.current=t,Bo.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Uw(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=I.useRef(!1);Uw(()=>(A.current=!0,()=>{A.current=!1}),[]),Uw(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=I.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=I.useMemo(()=>({reference:b,floating:x}),[b,x]),N=I.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Kw(M.floating,u.x),r=Kw(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Gw(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Sse=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?{}:Hw({element:r.current,padding:i}).fn(n):r?Hw({element:r,padding:i}).fn(n):{}}}},Cse=(e,t)=>{let n=mse(e);return{name:n.name,fn:n.fn,options:[e,t]}},wse=(e,t)=>{let n=hse(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tse=(e,t)=>({fn:yse(e).fn,options:[e,t]}),Ese=(e,t)=>{let n=gse(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dse=(e,t)=>{let n=_se(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ose=(e,t)=>{let n=vse(e);return{name:n.name,fn:n.fn,options:[e,t]}},kse=(e,t)=>{let n=Sse(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ase=`Arrow`,Jw=I.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,z.jsx)(_b.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,z.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Jw.displayName=Ase;var jse=Jw,Yw=`Popper`,[Xw,Zw]=Mb(Yw),[Mse,Qw]=Xw(Yw),$w=e=>{let{__scopePopper:t,children:n}=e,[r,i]=I.useState(null),[a,o]=I.useState(void 0);return(0,z.jsx)(Mse,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};$w.displayName=Yw;var eT=`PopperAnchor`,tT=I.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Qw(eT,n),o=I.useRef(null),s=a.onAnchorChange,c=cb(t,I.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=I.useRef(null);I.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&oT(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,z.jsx)(_b.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});tT.displayName=eT;var nT=`PopperContent`,[Nse,Pse]=Xw(nT),rT=I.forwardRef((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=Qw(nT,n),[_,v]=I.useState(null),y=cb(t,e=>v(e)),[b,x]=I.useState(null),S=EC(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=l?Array.isArray(l)?l:[l]:void 0,O=D!==void 0&&D.length>0,k={padding:E,boundary:D?.filter(Ise),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:ee}=xse({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>pse(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Cse({mainAxis:i+w,alignmentAxis:o}),c&&wse({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Tse():void 0,...k}),c&&Ese({...k}),Dse({...k,apply:({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`)}}),b&&kse({element:b,padding:s}),Lse({arrowWidth:C,arrowHeight:w}),f&&Ose({strategy:`referenceHidden`,...k})]}),te=g.setPlacementState;Pb(()=>(te(M),()=>{te(void 0)}),[M,te]);let[P,F]=oT(M),ne=Cb(m);Pb(()=>{N&&ne?.()},[N,ne]);let re=ee.arrow?.x,ie=ee.arrow?.y,ae=ee.arrow?.centerOffset!==0,[oe,se]=I.useState();return Pb(()=>{_&&se(window.getComputedStyle(_).zIndex)},[_]),(0,z.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[ee.transformOrigin?.x,ee.transformOrigin?.y].join(` `),...ee.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(Nse,{scope:n,placedSide:P,placedAlign:F,onArrowChange:x,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,z.jsx)(_b.div,{"data-side":P,"data-align":F,...h,ref:y,style:{...h.style,animation:N?void 0:`none`}})})})});rT.displayName=nT;var iT=`PopperArrow`,Fse={top:`bottom`,right:`left`,bottom:`top`,left:`right`},aT=I.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Pse(iT,n),a=Fse[i.placedSide];return(0,z.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,z.jsx)(jse,{...r,ref:t,style:{...r.style,display:`block`}})})});aT.displayName=iT;function Ise(e){return e!==null}var Lse=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]=oT(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}}}});function oT(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var sT=$w,cT=tT,lT=rT,uT=aT,dT=`rovingFocusGroup.onEntryFocus`,Rse={bubbles:!1,cancelable:!0},fT=`RovingFocusGroup`,[pT,mT,zse]=Nb(fT),[Bse,hT]=Mb(fT,[zse]),[Vse,Hse]=Bse(fT),gT=I.forwardRef((e,t)=>(0,z.jsx)(pT.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(pT.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(Use,{...e,ref:t})})}));gT.displayName=fT;var Use=I.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=I.useRef(null),p=cb(t,f),m=Bb(a),[h,g]=Fb({prop:o,defaultProp:s??null,onChange:c,caller:fT}),[_,v]=I.useState(!1),y=Cb(l),b=mT(n),x=I.useRef(!1),[S,C]=I.useState(0);return I.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(dT,y),()=>e.removeEventListener(dT,y)},[y]),(0,z.jsx)(Vse,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:I.useCallback(e=>g(e),[g]),onItemShiftTab:I.useCallback(()=>v(!0),[]),onFocusableItemAdd:I.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:I.useCallback(()=>C(e=>e-1),[]),children:(0,z.jsx)(_b.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:K(e.onMouseDown,()=>{x.current=!0}),onFocus:K(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(dT,Rse);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);yT([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:K(e.onBlur,()=>v(!1))})})}),_T=`RovingFocusGroupItem`,vT=I.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=zb(),l=a||c,u=Hse(_T,n),d=u.currentTabStopId===l,f=mT(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return I.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,z.jsx)(pT.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,z.jsx)(_b.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:K(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:K(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:K(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Kse(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?qse(n,r+1):n.slice(r+1)}setTimeout(()=>yT(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});vT.displayName=_T;var Wse={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Gse(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Kse(e,t,n){let r=Gse(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Wse[r]}function yT(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qse(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Jse=gT,Yse=vT,bT=[`Enter`,` `],Xse=[`ArrowDown`,`PageUp`,`Home`],xT=[`ArrowUp`,`PageDown`,`End`],Zse=[...Xse,...xT],Qse={ltr:[...bT,`ArrowRight`],rtl:[...bT,`ArrowLeft`]},$se={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},ST=`Menu`,[CT,ece,tce]=Nb(ST),[wT,TT]=Mb(ST,[tce,Zw,hT]),ET=Zw(),DT=hT(),[OT,kT]=wT(ST),[nce,AT]=wT(ST),jT=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ET(t),[c,l]=I.useState(null),u=I.useRef(!1),d=Cb(a),f=Bb(i);return I.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,z.jsx)(sT,{...s,children:(0,z.jsx)(OT,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,z.jsx)(nce,{scope:t,onClose:I.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};jT.displayName=ST;var rce=`MenuAnchor`,MT=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ET(n);return(0,z.jsx)(cT,{...i,...r,ref:t})});MT.displayName=rce;var NT=`MenuPortal`,[ice,PT]=wT(NT,{forceMount:void 0}),FT=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=kT(NT,t);return(0,z.jsx)(ice,{scope:t,forceMount:n,children:(0,z.jsx)(Ib,{present:n||a.open,children:(0,z.jsx)(ux,{asChild:!0,container:i,children:r})})})};FT.displayName=NT;var IT=`MenuContent`,[ace,LT]=wT(IT),RT=I.forwardRef((e,t)=>{let n=PT(IT,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=kT(IT,e.__scopeMenu),o=AT(IT,e.__scopeMenu);return(0,z.jsx)(CT.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(Ib,{present:r||a.open,children:(0,z.jsx)(CT.Slot,{scope:e.__scopeMenu,children:o.modal?(0,z.jsx)(oce,{...i,ref:t}):(0,z.jsx)(sce,{...i,ref:t})})})})}),oce=I.forwardRef((e,t)=>{let n=kT(IT,e.__scopeMenu),r=I.useRef(null),i=cb(t,r);return I.useEffect(()=>{let e=r.current;if(e)return MS(e)},[]),(0,z.jsx)(zT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:K(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),sce=I.forwardRef((e,t)=>{let n=kT(IT,e.__scopeMenu);return(0,z.jsx)(zT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),cce=db(`MenuContent.ScrollLock`),zT=I.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=kT(IT,n),_=AT(IT,n),v=ET(n),y=DT(n),b=ece(n),[x,S]=I.useState(null),C=I.useRef(null),w=cb(t,C,g.onContentChange),T=I.useRef(0),E=I.useRef(``),D=I.useRef(0),O=I.useRef(null),k=I.useRef(`right`),A=I.useRef(0),j=m?CS:I.Fragment,M=m?{as:cce,allowPinchZoom:!0}:void 0,N=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=xce(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};I.useEffect(()=>()=>window.clearTimeout(T.current),[]),px();let ee=I.useCallback(e=>k.current===O.current?.side&&Cce(e,O.current?.area),[]);return(0,z.jsx)(ace,{scope:n,searchRef:E,onItemEnter:I.useCallback(e=>{ee(e)&&e.preventDefault()},[ee]),onItemLeave:I.useCallback(e=>{ee(e)||(C.current?.focus(),S(null))},[ee]),onTriggerLeave:I.useCallback(e=>{ee(e)&&e.preventDefault()},[ee]),pointerGraceTimerRef:D,onPointerGraceIntentChange:I.useCallback(e=>{O.current=e},[]),children:(0,z.jsx)(j,{...M,children:(0,z.jsx)(Zb,{asChild:!0,trapped:i,onMountAutoFocus:K(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,z.jsx)(Wb,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,z.jsx)(Jse,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:K(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,z.jsx)(lT,{role:`menu`,"aria-orientation":`vertical`,"data-state":cE(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:K(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=C.current;if(e.target!==i||!Zse.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);xT.includes(e.key)&&a.reverse(),yce(a)}),onBlur:K(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:K(e.onPointerMove,dE(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});RT.displayName=IT;var lce=`MenuGroup`,BT=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(_b.div,{role:`group`,...r,ref:t})});BT.displayName=lce;var uce=`MenuLabel`,VT=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(_b.div,{...r,ref:t})});VT.displayName=uce;var HT=`MenuItem`,UT=`menu.itemSelect`,WT=I.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=I.useRef(null),o=AT(HT,e.__scopeMenu),s=LT(HT,e.__scopeMenu),c=cb(t,a),l=I.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(UT,{bubbles:!0,cancelable:!0});e.addEventListener(UT,e=>r?.(e),{once:!0}),vb(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,z.jsx)(GT,{...i,ref:c,disabled:n,onClick:K(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:K(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:K(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||bT.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});WT.displayName=HT;var GT=I.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=LT(HT,n),s=DT(n),c=I.useRef(null),l=cb(t,c),[u,d]=I.useState(!1),[f,p]=I.useState(``);return I.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,z.jsx)(CT.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,z.jsx)(Yse,{asChild:!0,...s,focusable:!r,children:(0,z.jsx)(_b.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:K(e.onPointerMove,dE(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:K(e.onPointerLeave,dE(e=>o.onItemLeave(e))),onFocus:K(e.onFocus,()=>d(!0)),onBlur:K(e.onBlur,()=>d(!1))})})})}),dce=`MenuCheckboxItem`,KT=I.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,z.jsx)(QT,{scope:e.__scopeMenu,checked:n,children:(0,z.jsx)(WT,{role:`menuitemcheckbox`,"aria-checked":lE(n)?`mixed`:n,...i,ref:t,"data-state":uE(n),onSelect:K(i.onSelect,()=>r?.(lE(n)?!0:!n),{checkForDefaultPrevented:!1})})})});KT.displayName=dce;var qT=`MenuRadioGroup`,[fce,pce]=wT(qT,{value:void 0,onValueChange:()=>{}}),JT=I.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Cb(r);return(0,z.jsx)(fce,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,z.jsx)(BT,{...i,ref:t})})});JT.displayName=qT;var YT=`MenuRadioItem`,XT=I.forwardRef((e,t)=>{let{value:n,...r}=e,i=pce(YT,e.__scopeMenu),a=n===i.value;return(0,z.jsx)(QT,{scope:e.__scopeMenu,checked:a,children:(0,z.jsx)(WT,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":uE(a),onSelect:K(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});XT.displayName=YT;var ZT=`MenuItemIndicator`,[QT,mce]=wT(ZT,{checked:!1}),$T=I.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=mce(ZT,n);return(0,z.jsx)(Ib,{present:r||lE(a.checked)||a.checked===!0,children:(0,z.jsx)(_b.span,{...i,ref:t,"data-state":uE(a.checked)})})});$T.displayName=ZT;var hce=`MenuSeparator`,eE=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(_b.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});eE.displayName=hce;var gce=`MenuArrow`,tE=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ET(n);return(0,z.jsx)(uT,{...i,...r,ref:t})});tE.displayName=gce;var nE=`MenuSub`,[_ce,rE]=wT(nE),vce=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=kT(nE,t),o=ET(t),[s,c]=I.useState(null),[l,u]=I.useState(null),d=Cb(i);return I.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,z.jsx)(sT,{...o,children:(0,z.jsx)(OT,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,z.jsx)(_ce,{scope:t,contentId:zb(),triggerId:zb(),trigger:s,onTriggerChange:c,children:n})})})};vce.displayName=nE;var iE=`MenuSubTrigger`,aE=I.forwardRef((e,t)=>{let n=kT(iE,e.__scopeMenu),r=AT(iE,e.__scopeMenu),i=rE(iE,e.__scopeMenu),a=LT(iE,e.__scopeMenu),o=I.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=I.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return I.useEffect(()=>u,[u]),I.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,z.jsx)(MT,{asChild:!0,...l,children:(0,z.jsx)(GT,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":cE(n.open),...e,ref:sb(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:K(e.onPointerMove,dE(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:K(e.onPointerLeave,dE(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:K(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Qse[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});aE.displayName=iE;var oE=`MenuSubContent`,sE=I.forwardRef((e,t)=>{let n=PT(IT,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=kT(IT,e.__scopeMenu),s=AT(IT,e.__scopeMenu),c=rE(oE,e.__scopeMenu),l=I.useRef(null),u=cb(t,l);return(0,z.jsx)(CT.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(Ib,{present:r||o.open,children:(0,z.jsx)(CT.Slot,{scope:e.__scopeMenu,children:(0,z.jsx)(zT,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:K(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:K(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:K(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=$se[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});sE.displayName=oE;function cE(e){return e?`open`:`closed`}function lE(e){return e===`indeterminate`}function uE(e){return lE(e)?`indeterminate`:e?`checked`:`unchecked`}function yce(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function bce(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function xce(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=bce(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Sce(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Cce(e,t){return t?Sce({x:e.clientX,y:e.clientY},t):!1}function dE(e){return t=>t.pointerType===`mouse`?e(t):void 0}var wce=jT,Tce=MT,Ece=FT,Dce=RT,Oce=BT,kce=VT,Ace=WT,jce=KT,Mce=JT,Nce=XT,Pce=$T,Fce=eE,Ice=tE,Lce=aE,Rce=sE,fE=`DropdownMenu`,[zce,Bce]=Mb(fE,[TT]),pE=TT(),[Vce,mE]=zce(fE),hE=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=pE(t),l=I.useRef(null),[u,d]=Fb({prop:i,defaultProp:a??!1,onChange:o,caller:fE});return(0,z.jsx)(Vce,{scope:t,triggerId:zb(),triggerRef:l,contentId:zb(),open:u,onOpenChange:d,onOpenToggle:I.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,z.jsx)(wce,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};hE.displayName=fE;var gE=`DropdownMenuTrigger`,_E=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=mE(gE,n),o=pE(n);return(0,z.jsx)(Tce,{asChild:!0,...o,children:(0,z.jsx)(_b.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:sb(t,a.triggerRef),onPointerDown:K(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:K(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});_E.displayName=gE;var Hce=`DropdownMenuPortal`,vE=e=>{let{__scopeDropdownMenu:t,...n}=e,r=pE(t);return(0,z.jsx)(Ece,{...r,...n})};vE.displayName=Hce;var yE=`DropdownMenuContent`,bE=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=mE(yE,n),a=pE(n),o=I.useRef(!1);return(0,z.jsx)(Dce,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:K(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:K(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});bE.displayName=yE;var Uce=`DropdownMenuGroup`,Wce=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(Oce,{...i,...r,ref:t})});Wce.displayName=Uce;var Gce=`DropdownMenuLabel`,xE=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(kce,{...i,...r,ref:t})});xE.displayName=Gce;var Kce=`DropdownMenuItem`,SE=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(Ace,{...i,...r,ref:t})});SE.displayName=Kce;var qce=`DropdownMenuCheckboxItem`,Jce=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(jce,{...i,...r,ref:t})});Jce.displayName=qce;var Yce=`DropdownMenuRadioGroup`,CE=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(Mce,{...i,...r,ref:t})});CE.displayName=Yce;var Xce=`DropdownMenuRadioItem`,wE=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(Nce,{...i,...r,ref:t})});wE.displayName=Xce;var Zce=`DropdownMenuItemIndicator`,TE=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(Pce,{...i,...r,ref:t})});TE.displayName=Zce;var Qce=`DropdownMenuSeparator`,EE=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(Fce,{...i,...r,ref:t})});EE.displayName=Qce;var $ce=`DropdownMenuArrow`,ele=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(Ice,{...i,...r,ref:t})});ele.displayName=$ce;var tle=`DropdownMenuSubTrigger`,nle=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(Lce,{...i,...r,ref:t})});nle.displayName=tle;var rle=`DropdownMenuSubContent`,ile=I.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=pE(n);return(0,z.jsx)(Rce,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});ile.displayName=rle;var ale=hE,ole=_E,sle=vE,cle=bE,lle=xE,ule=SE,dle=CE,fle=wE,ple=TE,mle=EE;function DE(e,[t,n]){return Math.min(n,Math.max(t,e))}var OE=`Popover`,[kE,hle]=Mb(OE,[Zw]),AE=Zw(),[gle,jE]=kE(OE),ME=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=AE(t),c=I.useRef(null),[l,u]=I.useState(!1),[d,f]=Fb({prop:r,defaultProp:i??!1,onChange:a,caller:OE});return(0,z.jsx)(sT,{...s,children:(0,z.jsx)(gle,{scope:t,contentId:zb(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:I.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:I.useCallback(()=>u(!0),[]),onCustomAnchorRemove:I.useCallback(()=>u(!1),[]),modal:o,children:n})})};ME.displayName=OE;var NE=`PopoverAnchor`,_le=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=jE(NE,n),a=AE(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return I.useEffect(()=>(o(),()=>s()),[o,s]),(0,z.jsx)(cT,{...a,...r,ref:t})});_le.displayName=NE;var PE=`PopoverTrigger`,FE=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=jE(PE,n),a=AE(n),o=cb(t,i.triggerRef),s=(0,z.jsx)(_b.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":HE(i.open),...r,ref:o,onClick:K(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,z.jsx)(cT,{asChild:!0,...a,children:s})});FE.displayName=PE;var IE=`PopoverPortal`,[vle,yle]=kE(IE,{forceMount:void 0}),LE=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=jE(IE,t);return(0,z.jsx)(vle,{scope:t,forceMount:n,children:(0,z.jsx)(Ib,{present:n||a.open,children:(0,z.jsx)(ux,{asChild:!0,container:i,children:r})})})};LE.displayName=IE;var RE=`PopoverContent`,zE=I.forwardRef((e,t)=>{let n=yle(RE,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=jE(RE,e.__scopePopover);return(0,z.jsx)(Ib,{present:r||a.open,children:a.modal?(0,z.jsx)(xle,{...i,ref:t}):(0,z.jsx)(Sle,{...i,ref:t})})});zE.displayName=RE;var ble=db(`PopoverContent.RemoveScroll`),xle=I.forwardRef((e,t)=>{let n=jE(RE,e.__scopePopover),r=I.useRef(null),i=cb(t,r),a=I.useRef(!1);return I.useEffect(()=>{let e=r.current;if(e)return MS(e)},[]),(0,z.jsx)(CS,{as:ble,allowPinchZoom:!0,children:(0,z.jsx)(BE,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:K(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Sle=I.forwardRef((e,t)=>{let n=jE(RE,e.__scopePopover),r=I.useRef(!1),i=I.useRef(!1);return(0,z.jsx)(BE,{...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()}})}),BE=I.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=jE(RE,n),p=AE(n);return px(),(0,z.jsx)(Zb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,z.jsx)(Wb,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,z.jsx)(lT,{"data-state":HE(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)`}})})})}),VE=`PopoverClose`,Cle=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=jE(VE,n);return(0,z.jsx)(_b.button,{type:`button`,...r,ref:t,onClick:K(e.onClick,()=>i.onOpenChange(!1))})});Cle.displayName=VE;var wle=`PopoverArrow`,Tle=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=AE(n);return(0,z.jsx)(uT,{...i,...r,ref:t})});Tle.displayName=wle;function HE(e){return e?`open`:`closed`}var UE=ME,WE=FE,GE=LE,KE=zE,Ele=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Dle=[` `,`Enter`],qE=`Select`,[JE,YE,Ole]=Nb(qE),[XE,kle]=Mb(qE,[Ole,Zw]),ZE=Zw(),[Ale,QE]=XE(qE),[jle,Mle]=XE(qE),Nle=`SelectProvider`;function $E(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=ZE(t),[_,v]=I.useState(null),[y,b]=I.useState(null),[x,S]=I.useState(!1),C=Bb(l),[w,T]=Fb({prop:r,defaultProp:i??!1,onChange:a,caller:qE}),[E,D]=Fb({prop:o,defaultProp:s,onChange:c,caller:qE}),O=I.useRef(null),k=_?!!m||!!_.closest(`form`):!0,[A,j]=I.useState(new Set),M=zb(),N=Array.from(A).map(e=>e.props.value).join(`;`),ee=I.useCallback(e=>{j(t=>new Set(t).add(e))},[]),te=I.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),P={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:M,value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:A,nativeSelectKey:N,isFormControl:k};return(0,z.jsx)(sT,{...g,children:(0,z.jsx)(Ale,{scope:t,...P,children:(0,z.jsx)(JE.Provider,{scope:t,children:(0,z.jsx)(jle,{scope:t,onNativeOptionAdd:ee,onNativeOptionRemove:te,children:Xle(h)?h(P):n})})})})}$E.displayName=Nle;var eD=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,z.jsx)($E,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,z.jsxs)(z.Fragment,{children:[n,e?(0,z.jsx)(ID,{__scopeSelect:t}):null]})})};eD.displayName=qE;var tD=`SelectTrigger`,nD=I.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=ZE(n),o=QE(tD,n),s=o.disabled||r,c=cb(t,o.onTriggerChange),l=YE(n),u=I.useRef(`touch`),[d,f,p]=RD(e=>{let t=l().filter(e=>!e.disabled),n=zD(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,z.jsx)(cT,{asChild:!0,...a,children:(0,z.jsx)(_b.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":LD(o.value)?``:void 0,...i,ref:c,onClick:K(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:K(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:K(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Ele.includes(e.key)&&(m(),e.preventDefault())})})})});nD.displayName=tD;var rD=`SelectValue`,iD=I.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=QE(rD,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=cb(t,c.onValueNodeChange);Pb(()=>{l(u)},[l,u]);let f=LD(c.value);return(0,z.jsx)(_b.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,z.jsx)(I.Fragment,{children:f?o:a},f?`placeholder`:`value`)})});iD.displayName=rD;var Ple=`SelectIcon`,aD=I.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,z.jsx)(_b.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});aD.displayName=Ple;var oD=`SelectPortal`,[Fle,Ile]=XE(oD,{forceMount:void 0}),sD=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,z.jsx)(Fle,{scope:e.__scopeSelect,forceMount:n,children:(0,z.jsx)(ux,{asChild:!0,...r})})};sD.displayName=oD;var cD=`SelectContent`,lD=I.forwardRef((e,t)=>{let n=Ile(cD,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=QE(cD,e.__scopeSelect),[o,s]=I.useState();return Pb(()=>{s(new DocumentFragment)},[]),(0,z.jsx)(Ib,{present:r||a.open,children:({present:e})=>e?(0,z.jsx)(mD,{...i,ref:t}):(0,z.jsx)(uD,{...i,fragment:o})})});lD.displayName=cD;var uD=I.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?Bo.createPortal((0,z.jsx)(fD,{scope:n,children:(0,z.jsx)(JE.Slot,{scope:n,children:(0,z.jsx)(`div`,{ref:t,children:r})})}),i):null});uD.displayName=`SelectContentFragment`;var dD=10,[fD,pD]=XE(cD),Lle=`SelectContentImpl`,Rle=db(`SelectContent.RemoveScroll`),mD=I.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=QE(cD,n),[y,b]=I.useState(null),[x,S]=I.useState(null),C=cb(t,e=>b(e)),[w,T]=I.useState(null),[E,D]=I.useState(null),O=YE(n),[k,A]=I.useState(!1),j=I.useRef(!1);I.useEffect(()=>{if(y)return MS(y)},[y]),px();let M=I.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),N=I.useCallback(()=>M([w,y]),[M,w,y]);I.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:ee,triggerPointerDownPosRef:te}=v;I.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(te.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(te.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||ee(!1),document.removeEventListener(`pointermove`,t),te.current=null};return te.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,ee,te]),I.useEffect(()=>{let e=()=>ee(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ee]);let[P,F]=RD(e=>{let t=O().filter(e=>!e.disabled),n=zD(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=I.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(j.current=!0))},[v.value]),re=I.useCallback(()=>y?.focus(),[y]),ie=I.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),ae=r===`popper`?gD:hD,oe=ae===gD?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,z.jsx)(fD,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ne,selectedItem:w,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:k,searchRef:P,children:(0,z.jsx)(CS,{as:Rle,allowPinchZoom:!0,children:(0,z.jsx)(Zb,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:K(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,z.jsx)(Wb,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,z.jsx)(ae,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...oe,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:K(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&F(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});mD.displayName=Lle;var zle=`SelectItemAlignedPosition`,hD=I.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=QE(cD,n),o=pD(cD,n),[s,c]=I.useState(null),[l,u]=I.useState(null),d=cb(t,e=>u(e)),f=YE(n),p=I.useRef(!1),m=I.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=I.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-dD,d=DE(a,[dD,Math.max(dD,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-dD,d=DE(a,[dD,Math.max(dD,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-dD*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-dD,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${dD}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Pb(()=>y(),[y]);let[b,x]=I.useState();return Pb(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,z.jsx)(Vle,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:I.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,z.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,z.jsx)(_b.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});hD.displayName=zle;var Ble=`SelectPopperPosition`,gD=I.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=dD,...a}=e,o=ZE(n);return(0,z.jsx)(lT,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});gD.displayName=Ble;var[Vle,_D]=XE(cD,{}),vD=`SelectViewport`,yD=I.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=pD(vD,n),o=_D(vD,n),s=cb(t,a.onViewportChange),c=I.useRef(0);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,z.jsx)(JE.Slot,{scope:n,children:(0,z.jsx)(_b.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:K(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-dD*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});yD.displayName=vD;var bD=`SelectGroup`,[Hle,Ule]=XE(bD),Wle=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=zb();return(0,z.jsx)(Hle,{scope:n,id:i,children:(0,z.jsx)(_b.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Wle.displayName=bD;var xD=`SelectLabel`,Gle=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ule(xD,n);return(0,z.jsx)(_b.div,{id:i.id,...r,ref:t})});Gle.displayName=xD;var SD=`SelectItem`,[Kle,CD]=XE(SD),wD=I.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=QE(SD,n),c=pD(SD,n),l=s.value===r,[u,d]=I.useState(a??``),[f,p]=I.useState(!1),m=cb(t,e=>c.itemRefCallback?.(e,r,i)),h=zb(),g=I.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,z.jsx)(Kle,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:I.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,z.jsx)(JE.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,z.jsx)(_b.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:K(o.onFocus,()=>p(!0)),onBlur:K(o.onBlur,()=>p(!1)),onClick:K(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:K(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:K(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:K(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:K(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:K(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(Dle.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});wD.displayName=SD;var TD=`SelectItemText`,ED=I.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=QE(TD,n),s=pD(TD,n),c=CD(TD,n),l=Mle(TD,n),[u,d]=I.useState(null),f=cb(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=I.useMemo(()=>(0,z.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Pb(()=>(h(m),()=>g(m)),[h,g,m]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(_b.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Bo.createPortal(a.children,o.valueNode):null]})});ED.displayName=TD;var DD=`SelectItemIndicator`,OD=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return CD(DD,n).isSelected?(0,z.jsx)(_b.span,{"aria-hidden":!0,...r,ref:t}):null});OD.displayName=DD;var kD=`SelectScrollUpButton`,AD=I.forwardRef((e,t)=>{let n=pD(kD,e.__scopeSelect),r=_D(kD,e.__scopeSelect),[i,a]=I.useState(!1),o=cb(t,r.onScrollButtonChange);return Pb(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,z.jsx)(ND,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});AD.displayName=kD;var jD=`SelectScrollDownButton`,MD=I.forwardRef((e,t)=>{let n=pD(jD,e.__scopeSelect),r=_D(jD,e.__scopeSelect),[i,a]=I.useState(!1),o=cb(t,r.onScrollButtonChange);return Pb(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,z.jsx)(ND,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});MD.displayName=jD;var ND=I.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=pD(`SelectScrollButton`,n),o=I.useRef(null),s=YE(n),c=I.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return I.useEffect(()=>()=>c(),[c]),Pb(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,z.jsx)(_b.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:K(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:K(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:K(i.onPointerLeave,()=>{c()})})}),qle=`SelectSeparator`,Jle=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,z.jsx)(_b.div,{"aria-hidden":!0,...r,ref:t})});Jle.displayName=qle;var PD=`SelectArrow`,Yle=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=ZE(n);return pD(PD,n).position===`popper`?(0,z.jsx)(uT,{...i,...r,ref:t}):null});Yle.displayName=PD;var FD=`SelectBubbleInput`,ID=I.forwardRef(({__scopeSelect:e,...t},n)=>{let r=QE(FD,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=I.useRef(null),m=cb(n,p),h=i??``,g=TC(h);return I.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,z.jsxs)(_b.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Ab,...t.style},ref:m,defaultValue:h,children:[LD(i)?(0,z.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});ID.displayName=FD;function Xle(e){return typeof e==`function`}function LD(e){return e===``||e===void 0}function RD(e){let t=Cb(e),n=I.useRef(``),r=I.useRef(0),i=I.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=I.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function zD(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Zle(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Zle(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[BD,Qle]=Mb(`Tooltip`,[Zw]),VD=Zw(),HD=`TooltipProvider`,$le=700,UD=`tooltip.open`,[eue,WD]=BD(HD),GD=e=>{let{__scopeTooltip:t,delayDuration:n=$le,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=I.useRef(!0),s=I.useRef(!1),c=I.useRef(0);return I.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,z.jsx)(eue,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:I.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};GD.displayName=HD;var KD=`Tooltip`,[tue,qD]=BD(KD),JD=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=WD(KD,e.__scopeTooltip),l=VD(t),[u,d]=I.useState(null),f=zb(),p=I.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=I.useRef(!1),[_,v]=Fb({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(UD))):c.onClose(),a?.(e)},caller:KD}),y=I.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=I.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=I.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=I.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return I.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,z.jsx)(sT,{...l,children:(0,z.jsx)(tue,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:I.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:I.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};JD.displayName=KD;var YD=`TooltipTrigger`,XD=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=qD(YD,n),a=WD(YD,n),o=VD(n),s=cb(t,I.useRef(null),i.onTriggerChange),c=I.useRef(!1),l=I.useRef(!1),u=I.useCallback(()=>c.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,z.jsx)(cT,{asChild:!0,...o,children:(0,z.jsx)(_b.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:K(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:K(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:K(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:K(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:K(e.onBlur,i.onClose),onClick:K(e.onClick,i.onClose)})})});XD.displayName=YD;var ZD=`TooltipPortal`,[nue,rue]=BD(ZD,{forceMount:void 0}),QD=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=qD(ZD,t);return(0,z.jsx)(nue,{scope:t,forceMount:n,children:(0,z.jsx)(Ib,{present:n||a.open,children:(0,z.jsx)(ux,{asChild:!0,container:i,children:r})})})};QD.displayName=ZD;var $D=`TooltipContent`,eO=I.forwardRef((e,t)=>{let n=rue($D,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=qD($D,e.__scopeTooltip);return(0,z.jsx)(Ib,{present:r||o.open,children:o.disableHoverableContent?(0,z.jsx)(tO,{side:i,...a,ref:t}):(0,z.jsx)(iue,{side:i,...a,ref:t})})}),iue=I.forwardRef((e,t)=>{let n=qD($D,e.__scopeTooltip),r=WD($D,e.__scopeTooltip),i=I.useRef(null),a=cb(t,i),[o,s]=I.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=I.useCallback(()=>{s(null),d(!1)},[d]),p=I.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=lue(r,cue(r,n.getBoundingClientRect())),a=uue(t.getBoundingClientRect());s(fue([...i,...a])),d(!0)},[d]);return I.useEffect(()=>()=>f(),[f]),I.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),I.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!due(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,z.jsx)(tO,{...e,ref:a})}),[aue,oue]=BD(KD,{isInside:!1}),sue=mb(`TooltipContent`),tO=I.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=qD($D,n),l=VD(n),{onClose:u}=c;return I.useEffect(()=>(document.addEventListener(UD,u),()=>document.removeEventListener(UD,u)),[u]),I.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,z.jsx)(Wb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,z.jsxs)(lT,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,z.jsx)(sue,{children:r}),(0,z.jsx)(aue,{scope:n,isInside:!0,children:(0,z.jsx)(Oae,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});eO.displayName=$D;var nO=`TooltipArrow`,rO=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=VD(n);return oue(nO,n).isInside?null:(0,z.jsx)(uT,{...i,...r,ref:t})});rO.displayName=nO;function cue(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function lue(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function uue(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function due(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function fue(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),pue(t)}function pue(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var mue=GD,hue=JD,gue=XD,_ue=QD,vue=eO,yue=rO,iO=(0,U.forwardRef)((e,t)=>{let n=W(3),r;return n[0]!==e||n[1]!==t?(r=(0,z.jsx)(yb.div,{...e,ref:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});iO.displayName=`AttachmentPrimitive.Root`;var aO=(0,U.forwardRef)((e,t)=>{let n=W(4),r=G(bue),i;return n[0]!==r||n[1]!==e||n[2]!==t?(i=(0,z.jsxs)(yb.div,{...e,ref:t,children:[`.`,r]}),n[0]=r,n[1]=e,n[2]=t,n[3]=i):i=n[3],i});aO.displayName=`AttachmentPrimitive.unstable_Thumb`;function bue(e){let t=e.attachment.name.split(`.`);return t.length>1?t.pop():``}var oO=()=>{let e=W(2),t=G(xue),n;return e[0]===t?n=e[1]:(n=(0,z.jsx)(z.Fragment,{children:t}),e[0]=t,e[1]=n),n};oO.displayName=`AttachmentPrimitive.Name`;function xue(e){return e.attachment.name}var Sue=Sb(`AttachmentPrimitive.Remove`,()=>{let e=W(2),t=Xg(),n;return e[0]===t?n=e[1]:(n=()=>{t.attachment().remove()},e[0]=t,e[1]=n),n}),sO=ub({Name:()=>oO,Remove:()=>Sue,Root:()=>iO,unstable_Thumb:()=>aO}),Cue=e=>{let t=W(12),n;return t[0]!==e.assistant||t[1]!==e.copied||t[2]!==e.hasAttachments||t[3]!==e.hasBranches||t[4]!==e.hasContent||t[5]!==e.last||t[6]!==e.lastOrHover||t[7]!==e.speaking||t[8]!==e.submittedFeedback||t[9]!==e.system||t[10]!==e.user?(n=t=>{let{role:n,attachments:r,parts:i,branchCount:a,isLast:o,speech:s,isCopied:c,isHovering:l}=t.message;return!(e.hasBranches===!0&&a<2||e.user&&n!==`user`||e.assistant&&n!==`assistant`||e.system&&n!==`system`||e.lastOrHover===!0&&!l&&!o||e.last!==void 0&&e.last!==o||e.copied===!0&&!c||e.copied===!1&&c||e.speaking===!0&&s==null||e.speaking===!1&&s!=null||e.hasAttachments===!0&&(n!==`user`||!r?.length)||e.hasAttachments===!1&&n===`user`&&r?.length||e.hasContent===!0&&i.length===0||e.hasContent===!1&&i.length>0||e.submittedFeedback!==void 0&&(t.message.metadata.submittedFeedback?.type??null)!==e.submittedFeedback)},t[0]=e.assistant,t[1]=e.copied,t[2]=e.hasAttachments,t[3]=e.hasBranches,t[4]=e.hasContent,t[5]=e.last,t[6]=e.lastOrHover,t[7]=e.speaking,t[8]=e.submittedFeedback,t[9]=e.system,t[10]=e.user,t[11]=n):n=t[11],G(n)},cO=e=>{let t=W(3),n,r;return t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),Cue(r)?n:null};cO.displayName=`MessagePrimitive.If`;var lO=Ph(null),uO=()=>Ih(lO),wue=e=>{let t=W(8),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Map,t[0]=r):r=t[0];let i=Eh(r),a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],t[1]=a):a=t[1];let o=Eh(a),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=Array.from(i.current.entries());e.sort(Tue),o.current=e.map(Eue)},t[2]=s):s=t[2];let c=s,l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(e,t)=>{let n=t?.priority??0;return i.current.set(e,n),c(),()=>{i.current.delete(e),c()}},t[3]=l):l=t[3];let u=l,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o.current,t[4]=d):d=t[4];let f=d,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p={register:u,getPlugins:f},t[5]=p):p=t[5];let m=p,h;return t[6]===n?h=t[7]:(h=(0,z.jsx)(lO.Provider,{value:m,children:n}),t[6]=n,t[7]=h),h};function Tue(e,t){return t[1]-e[1]}function Eue(e){let[t]=e;return t}var dO=Ph(null),fO=Ph(null),pO=()=>{let e=Ih(dO);if(!e)throw Error(`useTriggerPopoverRootContext must be used within ComposerPrimitive.TriggerPopoverRoot`);return e},mO=()=>Ih(dO),Due=()=>{let e=Ih(fO);if(!e)throw Error(`useTriggerPopoverAriaPublish must be used within ComposerPrimitive.TriggerPopoverRoot`);return e},Oue=()=>{let e=pO();return Mh(e.subscribe,e.getTriggers,e.getTriggers)},kue=new Map,hO=()=>()=>{},gO=()=>kue,Aue=()=>{let e=mO();return Mh(e?e.subscribe:hO,e?e.getTriggers:gO,e?e.getTriggers:gO)},_O=()=>null,jue=()=>{let e=mO();return Mh(e?e.subscribeAria:hO,e?e.getActiveAria:_O,e?e.getActiveAria:_O)};function vO(){let e=W(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=new Set,e[0]=t):t=e[0];let n=Eh(t),r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{for(let e of n.current)e()},e[1]=r):r=e[1];let i=r,a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>(n.current.add(e),()=>{n.current.delete(e)}),e[2]=a):a=e[2];let o=a,s;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={notify:i,subscribe:o},e[3]=s):s=e[3],s}var yO=e=>{let t=W(21),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Map,t[0]=r):r=t[0];let i=Eh(r),a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=new Set,t[1]=a):a=t[1];let o=Eh(a),{notify:s,subscribe:c}=vO(),l;t[2]===s?l=t[3]:(l=e=>{let{char:t}=e;if(i.current.has(t))return Mue;let n=new Map(i.current);n.set(t,e),i.current=n,s();for(let t of o.current)t.added(e);return()=>{let e=new Map(i.current);e.delete(t),i.current=e,s();for(let e of o.current)e.removed(t)}},t[2]=s,t[3]=l);let u=l,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>i.current,t[4]=d):d=t[4];let f=d,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>(o.current.add(e),()=>{o.current.delete(e)}),t[5]=p):p=t[5];let m=p,h=Eh(null),g=Eh(null),{notify:_,subscribe:v}=vO(),y;t[6]===_?y=t[7]:(y=(e,t)=>{if(t===null){if(g.current!==e)return;h.current=null,g.current=null,_();return}let n=h.current;g.current===e&&n!==null&&n.popoverId===t.popoverId&&n.highlightedItemId===t.highlightedItemId||(h.current=t,g.current=e,_())},t[6]=_,t[7]=y);let b=y,x;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>h.current,t[8]=x):x=t[8];let S=x,C;t[9]!==u||t[10]!==c||t[11]!==v?(C={register:u,getTriggers:f,subscribe:c,subscribeLifecycle:m,getActiveAria:S,subscribeAria:v},t[9]=u,t[10]=c,t[11]=v,t[12]=C):C=t[12];let w=C,T;t[13]===b?T=t[14]:(T={setActiveAria:b},t[13]=b,t[14]=T);let E=T,D;t[15]!==E||t[16]!==n?(D=(0,z.jsx)(fO.Provider,{value:E,children:n}),t[15]=E,t[16]=n,t[17]=D):D=t[17];let O;return t[18]!==D||t[19]!==w?(O=(0,z.jsx)(dO.Provider,{value:w,children:D}),t[18]=D,t[19]=w,t[20]=O):O=t[20],O},bO=e=>{let t=W(4),{children:n}=e;if(uO()){let e;return t[0]===n?e=t[1]:(e=(0,z.jsx)(yO,{children:n}),t[0]=n,t[1]=e),e}let r;return t[2]===n?r=t[3]:(r=(0,z.jsx)(wue,{children:(0,z.jsx)(yO,{children:n})}),t[2]=n,t[3]=r),r};bO.displayName=`ComposerPrimitive.TriggerPopoverRoot`;function Mue(){}var xO=/\s/u;function Nue(e,t,n){let r=e.slice(0,n);for(let e=r.length-1;e>=0;e--){let n=r[e];if(xO.test(n))return null;if(r.startsWith(t,e)){if(e>0&&!xO.test(r[e-1]))continue;return{query:r.slice(e+t.length),offset:e}}}return null}var Pue=Bh(e=>{let t=W(7),{text:n,triggerChar:r}=e,[i,a]=Th(n.length),o=Math.min(i,n.length),s;t[0]!==o||t[1]!==n||t[2]!==r?(s=Nue(n,r,o),t[0]=o,t[1]=n,t[2]=r,t[3]=s):s=t[3];let c=s,l=c?.query??``,u;return t[4]!==l||t[5]!==c?(u={trigger:c,query:l,setCursorPosition:a},t[4]=l,t[5]=c,t[6]=u):u=t[6],u});function Fue(e){return`type`in e}var Iue=Bh(e=>{let t=W(25),{navigableList:n,isSearchMode:r,activeCategoryId:i,query:a,popoverId:o,open:s,selectItem:c,selectCategory:l,goBack:u,close:d}=e,[f,p]=Th(0),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{p(0)},t[0]=m):m=t[0];let h;t[1]===n?h=t[2]:(h=[n],t[1]=n,t[2]=h),kh(m,h);let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{p(0)},t[3]=g):g=t[3];let _;t[4]!==i||t[5]!==r?(_=[r,i],t[4]=i,t[5]=r,t[6]=_):_=t[6],kh(g,_);let v;t[7]!==f||t[8]!==n.length?(v=e=>{e<0||e>=n.length||e!==f&&p(e)},t[7]=f,t[8]=n.length,t[9]=v):v=t[9];let y=jh(v),b;t[10]!==i||t[11]!==d||t[12]!==u||t[13]!==f||t[14]!==n||t[15]!==s||t[16]!==a||t[17]!==l||t[18]!==c?(b=e=>{if(!s)return!1;switch(e.key){case`ArrowDown`:return e.preventDefault(),p(e=>{let t=n.length;return t===0?0:e<t-1?e+1:0}),!0;case`ArrowUp`:return e.preventDefault(),p(e=>{let t=n.length;return t===0?0:e>0?e-1:t-1}),!0;case`Enter`:case`Tab`:{if(e.shiftKey)return!1;e.preventDefault();let t=n[f];return t&&(Fue(t)?c(t):l(t.id)),!0}case`Escape`:return e.preventDefault(),d(),!0;case`Backspace`:return i&&a===``?(e.preventDefault(),u(),!0):!1;default:return!1}},t[10]=i,t[11]=d,t[12]=u,t[13]=f,t[14]=n,t[15]=s,t[16]=a,t[17]=l,t[18]=c,t[19]=b):b=t[19];let x=jh(b),S=n[f],C=s&&S?`${o}-option-${S.id}`:void 0,w;return t[20]!==x||t[21]!==y||t[22]!==f||t[23]!==C?(w={highlightedIndex:f,highlightedItemId:C,highlightIndex:y,handleKeyDown:x},t[20]=x,t[21]=y,t[22]=f,t[23]=C,t[24]=w):w=t[24],w});function SO(e,t){return e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)||(e.description?.toLowerCase().includes(t)??!1)}var Lue=Bh(e=>{let t=W(38),{adapter:n,query:r,open:i}=e,[a,o]=Th(null),s,c;t[0]===i?(s=t[1],c=t[2]):(s=()=>{i||o(null)},c=[i],t[0]=i,t[1]=s,t[2]=c),kh(s,c);let l;bb0:{if(!i||!n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[3]=e):e=t[3],l=e;break bb0}let e;t[4]===n?e=t[5]:(e=n.categories(),t[4]=n,t[5]=e),l=e}let u=l,d=i?a:null,f;bb1:{if(!d||!n){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[6]=e):e=t[6],f=e;break bb1}let e;t[7]!==n||t[8]!==d?(e=n.categoryItems(d),t[7]=n,t[8]=d,t[9]=e):e=t[9],f=e}let p=f,m;bb2:{if(!i||!n||d){m=null;break bb2}if(!r&&u.length>0){m=null;break bb2}if(n.search){let e;t[10]!==n||t[11]!==r?(e=n.search(r),t[10]=n,t[11]=r,t[12]=e):e=t[12],m=e;break bb2}let e;if(t[13]!==n||t[14]!==u||t[15]!==r){e=[];let i=r.toLowerCase();for(let t of u)for(let r of n.categoryItems(t.id))SO(r,i)&&e.push(r);t[13]=n,t[14]=u,t[15]=r,t[16]=e}else e=t[16];m=e}let h=m,g=h!==null,_;bb3:{if(g){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[17]=e):e=t[17],_=e;break bb3}if(!r){_=u;break bb3}let e;if(t[18]!==u||t[19]!==r){let n=r.toLowerCase();e=u.filter(e=>e.label.toLowerCase().includes(n)),t[18]=u,t[19]=r,t[20]=e}else e=t[20];_=e}let v=_,y;bb4:{if(g){let e;t[21]===h?e=t[22]:(e=h??[],t[21]=h,t[22]=e),y=e;break bb4}if(!r){y=p;break bb4}let e;if(t[23]!==p||t[24]!==r){let n=r.toLowerCase();e=p.filter(e=>SO(e,n)),t[23]=p,t[24]=r,t[25]=e}else e=t[25];y=e}let b=y,x;bb5:{if(g){let e;t[26]===h?e=t[27]:(e=h??[],t[26]=h,t[27]=e),x=e;break bb5}if(d){x=b;break bb5}x=v}let S=x,C;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{o(e)},t[28]=C):C=t[28];let w=jh(C),T;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{o(null)},t[29]=T):T=t[29];let E=jh(T),D;return t[30]!==d||t[31]!==v||t[32]!==b||t[33]!==E||t[34]!==g||t[35]!==S||t[36]!==w?(D={categories:v,items:b,isSearchMode:g,activeCategoryId:d,navigableList:S,selectCategory:w,goBack:E},t[30]=d,t[31]=v,t[32]=b,t[33]=E,t[34]=g,t[35]=S,t[36]=w,t[37]=D):D=t[37],D}),Rue=Bh(e=>{let t=W(15),{behavior:n,trigger:r,aui:i,triggerChar:a,setCursorPosition:o,onSelected:s}=e,c=Eh(null),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=e=>(c.current=e,()=>{c.current===e&&(c.current=null)}),t[0]=l):l=t[0];let u=jh(l),d;t[1]!==i||t[2]!==n||t[3]!==s||t[4]!==r||t[5]!==a?(d=e=>{if(!r||!n)return;if(c.current?.(e)){s();return}let t=i.composer().getState().text,o=t.slice(0,r.offset),l=t.slice(r.offset+a.length+r.query.length),u=()=>{let t=n.formatter.serialize(e);i.composer().setText(o+t+(l.startsWith(` `)?l:` ${l}`))};n.kind===`directive`?(u(),n.onInserted?.(e)):(n.removeOnExecute?i.composer().setText(o+(l.startsWith(` `)?l.slice(1):l)):u(),n.onExecute(e)),s()},t[1]=i,t[2]=n,t[3]=s,t[4]=r,t[5]=a,t[6]=d):d=t[6];let f=jh(d),p;t[7]!==s||t[8]!==o||t[9]!==r?(p=()=>{s(),r&&o(r.offset)},t[7]=s,t[8]=o,t[9]=r,t[10]=p):p=t[10];let m=jh(p),h;return t[11]!==m||t[12]!==u||t[13]!==f?(h={selectItem:f,close:m,registerSelectItemOverride:u},t[11]=m,t[12]=u,t[13]=f,t[14]=h):h=t[14],h}),zue=Bh(e=>{let t=W(45),{adapter:n,text:r,triggerChar:i,behavior:a,aui:o,popoverId:s}=e,c;t[0]!==r||t[1]!==i?(c=Pue({text:r,triggerChar:i}),t[0]=r,t[1]=i,t[2]=c):c=t[2];let l=ng(c),u=l.trigger!==null&&n!==void 0&&a!==void 0,d;t[3]!==n||t[4]!==l.query||t[5]!==u?(d=Lue({adapter:n,query:l.query,open:u}),t[3]=n,t[4]=l.query,t[5]=u,t[6]=d):d=t[6];let f=ng(d),p;t[7]===f?p=t[8]:(p=()=>{f.goBack()},t[7]=f,t[8]=p);let m=jh(p),h;t[9]!==o||t[10]!==a||t[11]!==l.setCursorPosition||t[12]!==l.trigger||t[13]!==m||t[14]!==i?(h=Rue({behavior:a,trigger:l.trigger,aui:o,triggerChar:i,setCursorPosition:l.setCursorPosition,onSelected:m}),t[9]=o,t[10]=a,t[11]=l.setCursorPosition,t[12]=l.trigger,t[13]=m,t[14]=i,t[15]=h):h=t[15];let g=ng(h),_;t[16]!==l.query||t[17]!==f.activeCategoryId||t[18]!==f.goBack||t[19]!==f.isSearchMode||t[20]!==f.navigableList||t[21]!==f.selectCategory||t[22]!==u||t[23]!==s||t[24]!==g.close||t[25]!==g.selectItem?(_=Iue({navigableList:f.navigableList,isSearchMode:f.isSearchMode,activeCategoryId:f.activeCategoryId,query:l.query,popoverId:s,open:u,selectItem:g.selectItem,selectCategory:f.selectCategory,goBack:f.goBack,close:g.close}),t[16]=l.query,t[17]=f.activeCategoryId,t[18]=f.goBack,t[19]=f.isSearchMode,t[20]=f.navigableList,t[21]=f.selectCategory,t[22]=u,t[23]=s,t[24]=g.close,t[25]=g.selectItem,t[26]=_):_=t[26];let v=ng(_),y;return t[27]!==l.query||t[28]!==l.setCursorPosition||t[29]!==v.handleKeyDown||t[30]!==v.highlightIndex||t[31]!==v.highlightedIndex||t[32]!==v.highlightedItemId||t[33]!==f.activeCategoryId||t[34]!==f.categories||t[35]!==f.goBack||t[36]!==f.isSearchMode||t[37]!==f.items||t[38]!==f.selectCategory||t[39]!==u||t[40]!==s||t[41]!==g.close||t[42]!==g.registerSelectItemOverride||t[43]!==g.selectItem?(y={open:u,query:l.query,activeCategoryId:f.activeCategoryId,categories:f.categories,items:f.items,highlightedIndex:v.highlightedIndex,isSearchMode:f.isSearchMode,popoverId:s,highlightedItemId:v.highlightedItemId,selectCategory:f.selectCategory,goBack:f.goBack,selectItem:g.selectItem,close:g.close,highlightIndex:v.highlightIndex,handleKeyDown:v.handleKeyDown,setCursorPosition:l.setCursorPosition,registerSelectItemOverride:g.registerSelectItemOverride},t[27]=l.query,t[28]=l.setCursorPosition,t[29]=v.handleKeyDown,t[30]=v.highlightIndex,t[31]=v.highlightedIndex,t[32]=v.highlightedItemId,t[33]=f.activeCategoryId,t[34]=f.categories,t[35]=f.goBack,t[36]=f.isSearchMode,t[37]=f.items,t[38]=f.selectCategory,t[39]=u,t[40]=s,t[41]=g.close,t[42]=g.registerSelectItemOverride,t[43]=g.selectItem,t[44]=y):y=t[44],y}),CO=Ph(null),wO=()=>{let e=Ih(CO);if(!e)throw Error(`useTriggerPopoverScopeContext must be used within ComposerPrimitive.TriggerPopover`);return e},Bue=()=>Ih(CO),TO=Ph(null),EO=()=>{let e=Ih(TO);if(!e)throw Error(`TriggerPopover.Directive / TriggerPopover.Action must be rendered inside ComposerPrimitive.TriggerPopover`);return e},DO=(0,U.forwardRef)((e,t)=>{let n=W(59),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({char:a,adapter:r,"aria-label":i,children:o,...s}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c=Xg(),l=G(Vue),u=(0,U.useId)(),d=Eh(null),[f,p]=Th(null),m=Eh(0),h;n[6]===a?h=n[7]:(h=e=>(m.current+=1,d.current=e,p(e),()=>{m.current=Math.max(0,m.current-1),d.current===e&&(d.current=null,p(null))}),n[6]=a,n[7]=h);let g=h,_;n[8]===g?_=n[9]:(_={register:g},n[8]=g,n[9]=_);let v=_,y=f??void 0,b;n[10]!==r||n[11]!==c||n[12]!==a||n[13]!==u||n[14]!==y||n[15]!==l?(b=zue({adapter:r,text:l,triggerChar:a,behavior:y,aui:c,popoverId:u}),n[10]=r,n[11]=c,n[12]=a,n[13]=u,n[14]=y,n[15]=l,n[16]=b):b=n[16];let x=ng(b),S;n[17]===x?S=n[18]:(S=()=>x,n[17]=x,n[18]=S);let C=jh(S),w=pO(),T;n[19]!==f||n[20]!==a||n[21]!==C||n[22]!==w?(T=()=>w.register({char:a,...f?{behavior:f}:{},resource:C()}),n[19]=f,n[20]=a,n[21]=C,n[22]=w,n[23]=T):T=n[23];let E;n[24]!==f||n[25]!==a||n[26]!==w?(E=[w,a,f],n[24]=f,n[25]=a,n[26]=w,n[27]=E):E=n[27],kh(T,E);let D=uO(),O;n[28]!==C||n[29]!==D?(O=()=>{if(D)return D.register(C())},n[28]=C,n[29]=D,n[30]=O):O=n[30];let k;n[31]===D?k=n[32]:(k=[D],n[31]=D,n[32]=k),kh(O,k);let A=f!==null&&x.open,j=Due(),M,N;n[33]!==j||n[34]!==a||n[35]!==A?(M=()=>{if(A)return()=>{j.setActiveAria(a,null)}},N=[j,a,A],n[33]=j,n[34]=a,n[35]=A,n[36]=M,n[37]=N):(M=n[36],N=n[37]),kh(M,N);let ee,te;n[38]!==j||n[39]!==a||n[40]!==A||n[41]!==u||n[42]!==x.highlightedItemId?(ee=()=>{A&&j.setActiveAria(a,{popoverId:u,highlightedItemId:x.highlightedItemId})},te=[j,a,u,A,x.highlightedItemId],n[38]=j,n[39]=a,n[40]=A,n[41]=u,n[42]=x.highlightedItemId,n[43]=ee,n[44]=te):(ee=n[43],te=n[44]),kh(ee,te);let P;n[45]!==i||n[46]!==o||n[47]!==t||n[48]!==A||n[49]!==u||n[50]!==s||n[51]!==x.highlightedItemId?(P=A?(0,z.jsx)(yb.div,{role:`listbox`,id:u,"aria-label":i??`Suggestions`,"aria-activedescendant":x.highlightedItemId,"data-state":`open`,...s,ref:t,children:o}):o,n[45]=i,n[46]=o,n[47]=t,n[48]=A,n[49]=u,n[50]=s,n[51]=x.highlightedItemId,n[52]=P):P=n[52];let F;n[53]!==x||n[54]!==P?(F=(0,z.jsx)(CO.Provider,{value:x,children:P}),n[53]=x,n[54]=P,n[55]=F):F=n[55];let ne;return n[56]!==v||n[57]!==F?(ne=(0,z.jsx)(TO.Provider,{value:v,children:F}),n[56]=v,n[57]=F,n[58]=ne):ne=n[58],ne});DO.displayName=`ComposerPrimitive.TriggerPopover`;function Vue(e){return e.composer.text}var OO=()=>{let e=W(2),{disabled:t,send:n}=sie(),r;return e[0]===n?r=e[1]:(r=()=>n(),e[0]=n,e[1]=r),t?null:r},Hue=Sb(`ComposerPrimitive.Send`,OO),kO=(0,U.forwardRef)((e,t)=>{let n=W(12),r,i;n[0]===e?(r=n[1],i=n[2]):({onSubmit:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=OO(),o;n[3]===a?o=n[4]:(o=e=>{e.preventDefault(),a&&a()},n[3]=a,n[4]=o);let s=o,c;n[5]!==s||n[6]!==r?(c=K(r,s),n[5]=s,n[6]=r,n[7]=c):c=n[7];let l;return n[8]!==t||n[9]!==i||n[10]!==c?(l=(0,z.jsx)(yb.form,{...i,ref:t,onSubmit:c}),n[8]=t,n[9]=i,n[10]=c,n[11]=l):l=n[11],l});kO.displayName=`ComposerPrimitive.Root`;var AO=e=>{let t=W(4),n=Cb(e),r=Qy(jO),i,a;t[0]!==n||t[1]!==r?(i=()=>r(n),a=[r,n],t[0]=n,t[1]=r,t[2]=i,t[3]=a):(i=t[2],a=t[3]),kh(i,a)};function jO(e){return e.onScrollToBottom}var MO=()=>!1,NO=()=>{},PO=e=>{let t=W(4),n;t[0]===e?n=t[1]:(n=t=>{if(typeof window>`u`||e===null)return NO;let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},t[0]=e,t[1]=n);let r=n,i;return t[2]===e?i=t[3]:(i=()=>typeof window>`u`||e===null?!1:window.matchMedia(e).matches,t[2]=e,t[3]=i),Mh(r,i,MO)};function FO(){return FO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FO.apply(null,arguments)}function IO(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var LO=I.useLayoutEffect,RO=function(e){var t=I.useRef(e);return LO(function(){t.current=e}),t},zO=function(e,t){if(typeof e==`function`){e(t);return}e.current=t},BO=function(e,t){var n=I.useRef();return I.useCallback(function(r){e.current=r,n.current&&zO(n.current,null),n.current=t,t&&zO(t,r)},[t])},VO={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`},HO=function(e){Object.keys(VO).forEach(function(t){e.style.setProperty(t,VO[t],`important`)})},UO=null,WO=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize};function GO(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),UO||(UO=document.createElement(`textarea`),UO.setAttribute(`tabindex`,`-1`),UO.setAttribute(`aria-hidden`,`true`),HO(UO)),UO.parentNode===null&&document.body.appendChild(UO);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach(function(e){var t=e;UO.style[t]=o[t]}),HO(UO),UO.value=t;var c=WO(UO,e);UO.value=t,c=WO(UO,e),UO.value=`x`;var l=UO.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);var d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}var KO=function(){},qO=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},JO=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],YO=!!document.documentElement.currentStyle,XO=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n=qO(JO,t),r=n.boxSizing;return r===``?null:(YO&&r===`border-box`&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+`px`),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function ZO(e,t,n){var r=RO(n);I.useLayoutEffect(function(){var n=function(e){return r.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var QO=function(e,t){ZO(document.body,`reset`,function(n){e.current.form===n.target&&t(n)})},$O=function(e){ZO(window,`resize`,e)},ek=function(e){ZO(document.fonts,`loadingdone`,e)},tk=[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`],nk=I.forwardRef(function(e,t){var n=e.cacheMeasurements,r=e.maxRows,i=e.minRows,a=e.onChange,o=a===void 0?KO:a,s=e.onHeightChange,c=s===void 0?KO:s,l=IO(e,tk),u=l.value!==void 0,d=I.useRef(null),f=BO(d,t),p=I.useRef(0),m=I.useRef(),h=function(){var e=d.current,t=n&&m.current?m.current:XO(e);if(t){m.current=t;var a=GO(t,e.value||e.placeholder||`x`,i,r),o=a[0],s=a[1];p.current!==o&&(p.current=o,e.style.setProperty(`height`,o+`px`,`important`),c(o,{rowHeight:s}))}};return I.useLayoutEffect(h),QO(d,function(){if(!u){var e=d.current.value;requestAnimationFrame(function(){var t=d.current;t&&e!==t.value&&h()})}}),$O(h),ek(h),I.createElement(`textarea`,FO({},l,{onChange:function(e){u||h(),o(e)},ref:f}))}),rk=`(pointer: coarse) and (not (any-pointer: fine))`,ik=(0,U.forwardRef)(({autoFocus:e=!1,asChild:t,render:n,disabled:r,onChange:i,onKeyDown:a,onPaste:o,onSelect:s,submitOnEnter:c,submitMode:l,cancelOnEscape:u=!0,unstable_focusOnRunStart:d=!0,unstable_focusOnScrollToBottom:f=!0,unstable_focusOnThreadSwitched:p=!0,unstable_insertNewlineOnTouchEnter:m=!1,addAttachmentOnPaste:h=!0,...g},_)=>{let v=Xg(),y=uO(),b=jue(),x=l??(c===!1?`none`:`enter`),S=PO(m?rk:null),C=m&&S&&x===`enter`?`none`:x,w=G(e=>e.composer.isEditing?e.composer.text:``),T=G(e=>e.thread.isDisabled||e.composer.dictation?.inputDisabled)||r,E=Eh(null),D=cb(_,E),O=Eh(!1);wb(e=>{if(!E.current?.contains(e.target))return;if(y){for(let t of y.getPlugins())if(t.handleKeyDown(e))return}if(!u)return;let t=v.composer();t.getState().canCancel&&(t.cancel(),e.preventDefault())});let k=e=>{if(!T&&!e.nativeEvent.isComposing){if(y){for(let t of y.getPlugins())if(t.handleKeyDown(e))return}if(e.key===`Enter`){let t=v.thread().getState(),n=t.capabilities.queue;if(e.shiftKey&&(e.ctrlKey||e.metaKey)&&n&&x!==`none`&&v.composer().getState().canSend){e.preventDefault(),v.composer().send({steer:!0});return}if(e.shiftKey||t.isRunning&&!n)return;let r=!1;C===`ctrlEnter`?r=e.ctrlKey||e.metaKey:C===`enter`&&(r=!0),r&&(e.preventDefault(),E.current?.closest(`form`)?.requestSubmit())}}},A=async e=>{if(!h)return;let t=v.thread().getState().capabilities,n=Array.from(e.clipboardData?.files||[]);if(t.attachments&&n.length>0)try{e.preventDefault(),await Promise.all(n.map(e=>v.composer().addAttachment(e)))}catch(e){console.error(`Error adding attachment:`,e)}},j=e&&!T,M=Oh(()=>{let e=E.current;!e||!j||(e.focus({preventScroll:!0}),e.setSelectionRange(e.value.length,e.value.length))},[j]);kh(()=>M(),[M]),AO(()=>{v.composer().getState().type===`thread`&&f&&M()}),kh(()=>{if(!(v.composer().getState().type!==`thread`||!d))return v.on(`thread.runStart`,M)},[d,M,v]),kh(()=>{if(!(v.composer().getState().type!==`thread`||!p))return v.on(`threadListItem.switchedTo`,M)},[p,M,v]);let N=b?{"aria-controls":b.popoverId,"aria-expanded":!0,"aria-haspopup":`listbox`,"aria-activedescendant":b.highlightedItemId}:{},ee={name:`input`,value:w,...g,...N,ref:D,disabled:T,onChange:K(i,e=>{if(!v.composer().getState().isEditing)return;let t=e.nativeEvent.isComposing===!0;O.current&&!t&&(O.current=!1);let n=t||O.current;if(Wh(()=>{v.composer().setText(e.target.value)}),n)return;let r=e.target.selectionStart??e.target.value.length;if(y)for(let e of y.getPlugins())e.setCursorPosition(r)}),onKeyDown:K(a,k),onCompositionStart:K(g.onCompositionStart,()=>{O.current=!0}),onCompositionEnd:K(g.onCompositionEnd,e=>{if(O.current=!1,!v.composer().getState().isEditing)return;let t=e.target;Wh(()=>{v.composer().setText(t.value)});let n=t.selectionStart??t.value.length;if(y)for(let e of y.getPlugins())e.setCursorPosition(n)}),onSelect:K(s,e=>{if(O.current)return;let t=e.target,n=t.selectionStart??t.value.length;if(y)for(let e of y.getPlugins())e.setCursorPosition(n)}),onPaste:K(o,A)};if(n&&(0,U.isValidElement)(n)){let e=g.children===void 0?n.props.children:g.children;return(0,z.jsx)(fb,{...ee,children:(0,U.cloneElement)(n,void 0,e)})}return(0,z.jsx)(t?fb:nk,{...ee})});ik.displayName=`ComposerPrimitive.Input`;var ak=Sb(`ComposerPrimitive.Cancel`,()=>{let{disabled:e,cancel:t}=lie();return e?null:t}),ok=Sb(`ComposerPrimitive.AddAttachment`,e=>{let t=W(6),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{multiple:r}=n,i=r===void 0?!0:r,{disabled:a,addAttachment:o}=pie(),s=Xg(),c;return t[2]!==o||t[3]!==s||t[4]!==i?(c=()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=i,e.hidden=!0;let t=s.composer().getState().attachmentAccept;t!==`*`&&(e.accept=t),document.body.appendChild(e),e.onchange=t=>{let n=t.target.files;if(n){for(let e of n)o(e);document.body.removeChild(e)}},e.oncancel=()=>{(!e.files||e.files.length===0)&&document.body.removeChild(e)},e.click()},t[2]=o,t[3]=s,t[4]=i,t[5]=c):c=t[5],a?null:c},[`multiple`]),sk=(0,U.forwardRef)((e,t)=>{let n=W(30),{disabled:r,asChild:i,render:a,children:o,...s}=e,c=i===void 0?!1:i,[l,u]=Th(!1),d=Xg(),f;n[0]===r?f=n[1]:(f=e=>{r||(e.preventDefault(),u(!0))},n[0]=r,n[1]=f);let p=f,m;n[2]!==r||n[3]!==l?(m=e=>{r||(e.preventDefault(),l||u(!0))},n[2]=r,n[3]=l,n[4]=m):m=n[4];let h=m,g;n[5]===r?g=n[6]:(g=e=>{if(r)return;e.preventDefault();let t=e.relatedTarget;t&&e.currentTarget.contains(t)||u(!1)},n[5]=r,n[6]=g);let _=g,v;n[7]!==d||n[8]!==r?(v=async e=>{if(r)return;e.preventDefault(),u(!1);let t=Array.from(e.dataTransfer.files);await Promise.all(t.map(async e=>{try{await d.composer().addAttachment(e)}catch(e){console.error(`Failed to add attachment:`,e)}}))},n[7]=d,n[8]=r,n[9]=v):v=n[9];let y=v,b;n[10]===l?b=n[11]:(b=l?{"data-dragging":`true`}:null,n[10]=l,n[11]=b);let x=K(s.onDragEnterCapture,p),S=K(s.onDragOverCapture,h),C=K(s.onDragLeaveCapture,_),w=K(s.onDropCapture,y),T;n[12]!==t||n[13]!==s||n[14]!==w||n[15]!==b||n[16]!==x||n[17]!==S||n[18]!==C?(T={...b,...s,onDragEnterCapture:x,onDragOverCapture:S,onDragLeaveCapture:C,onDropCapture:w,ref:t},n[12]=t,n[13]=s,n[14]=w,n[15]=b,n[16]=x,n[17]=S,n[18]=C,n[19]=T):T=n[19];let E=T;if(a&&(0,U.isValidElement)(a)){let e=o===void 0?a.props.children:o,t;n[20]!==a||n[21]!==e?(t=(0,U.cloneElement)(a,void 0,e),n[20]=a,n[21]=e,n[22]=t):t=n[22];let r;return n[23]!==E||n[24]!==t?(r=(0,z.jsx)(fb,{...E,children:t}),n[23]=E,n[24]=t,n[25]=r):r=n[25],r}let D=c?fb:`div`,O;return n[26]!==D||n[27]!==o||n[28]!==E?(O=(0,z.jsx)(D,{...E,children:o}),n[26]=D,n[27]=o,n[28]=E,n[29]=O):O=n[29],O});sk.displayName=`ComposerPrimitive.AttachmentDropzone`;var ck=Sb(`ComposerPrimitive.Dictate`,()=>{let{disabled:e,startDictation:t}=die();return e?null:t}),lk=Sb(`ComposerPrimitive.StopDictation`,()=>{let e=W(2),t=Xg(),n=G(uk),r;return e[0]===t?r=e[1]:(r=()=>{t.composer().stopDictation()},e[0]=t,e[1]=r),n?r:null});function uk(e){return e.composer.dictation!=null}var dk=(0,U.forwardRef)((e,t)=>{let n=W(7),r,i;n[0]===e?(r=n[1],i=n[2]):({children:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=G(fk);if(!a)return null;let o=r??a,s;return n[3]!==t||n[4]!==i||n[5]!==o?(s=(0,z.jsx)(yb.span,{...i,ref:t,children:o}),n[3]=t,n[4]=i,n[5]=o,n[6]=s):s=n[6],s});dk.displayName=`ComposerPrimitive.DictationTranscript`;function fk(e){return e.composer.dictation?.transcript}var pk=(0,U.forwardRef)((e,t)=>{let n=W(3);if(!G(gk))return null;let r;return n[0]!==t||n[1]!==e?(r=(0,z.jsx)(yb.div,{...e,ref:t}),n[0]=t,n[1]=e,n[2]=r):r=n[2],r});pk.displayName=`ComposerPrimitive.Quote`;var mk=(0,U.forwardRef)((e,t)=>{let n=W(7),r,i;n[0]===e?(r=n[1],i=n[2]):({children:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=G(_k);if(!a)return null;let o=r??a,s;return n[3]!==t||n[4]!==i||n[5]!==o?(s=(0,z.jsx)(yb.span,{...i,ref:t,children:o}),n[3]=t,n[4]=i,n[5]=o,n[6]=s):s=n[6],s});mk.displayName=`ComposerPrimitive.QuoteText`;var hk=(0,U.forwardRef)((e,t)=>{let n=W(12),r,i;n[0]===e?(r=n[1],i=n[2]):({onClick:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=Xg(),o;n[3]===a?o=n[4]:(o=()=>{a.composer().setQuote(void 0)},n[3]=a,n[4]=o);let s=o,c;n[5]!==s||n[6]!==r?(c=K(r,s),n[5]=s,n[6]=r,n[7]=c):c=n[7];let l;return n[8]!==t||n[9]!==i||n[10]!==c?(l=(0,z.jsx)(yb.button,{type:`button`,...i,ref:t,onClick:c}),n[8]=t,n[9]=i,n[10]=c,n[11]=l):l=n[11],l});hk.displayName=`ComposerPrimitive.QuoteDismiss`;function gk(e){return e.composer.quote}function _k(e){return e.composer.quote?.text}var vk=(0,U.forwardRef)((e,t)=>{let n=W(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({children:i,"aria-label":r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{categories:o,activeCategoryId:s,isSearchMode:c,open:l}=wO();if(!l||s||c)return null;let u=r??`Categories`,d;n[4]!==o||n[5]!==i?(d=i(o),n[4]=o,n[5]=i,n[6]=d):d=n[6];let f;return n[7]!==t||n[8]!==a||n[9]!==u||n[10]!==d?(f=(0,z.jsx)(yb.div,{role:`group`,"aria-label":u,...a,ref:t,children:d}),n[7]=t,n[8]=a,n[9]=u,n[10]=d,n[11]=f):f=n[11],f});vk.displayName=`ComposerPrimitive.TriggerPopoverCategories`;var yk=(0,U.forwardRef)((e,t)=>{let n=W(30),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({categoryId:r,onClick:i,onMouseMove:a,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let{selectCategory:s,highlightIndex:c,categories:l,highlightedIndex:u,activeCategoryId:d,isSearchMode:f,popoverId:p}=wO(),m;n[5]!==r||n[6]!==s?(m=()=>{s(r)},n[5]=r,n[6]=s,n[7]=m):m=n[7];let h=m,g;if(n[8]!==l||n[9]!==r){let e;n[11]===r?e=n[12]:(e=e=>e.id===r,n[11]=r,n[12]=e),g=l.findIndex(e),n[8]=l,n[9]=r,n[10]=g}else g=n[10];let _=g,v=!d&&!f&&_===u,y;n[13]!==_||n[14]!==c?(y=()=>{c(_)},n[13]=_,n[14]=c,n[15]=y):y=n[15];let b=y,x=`${p}-option-${r}`,S=v?``:void 0,C;n[16]!==h||n[17]!==i?(C=K(i,h),n[16]=h,n[17]=i,n[18]=C):C=n[18];let w;n[19]!==b||n[20]!==a?(w=K(a,b),n[19]=b,n[20]=a,n[21]=w):w=n[21];let T;return n[22]!==t||n[23]!==v||n[24]!==o||n[25]!==x||n[26]!==S||n[27]!==C||n[28]!==w?(T=(0,z.jsx)(yb.button,{type:`button`,role:`option`,id:x,"aria-selected":v,"data-highlighted":S,...o,ref:t,onClick:C,onMouseMove:w}),n[22]=t,n[23]=v,n[24]=o,n[25]=x,n[26]=S,n[27]=C,n[28]=w,n[29]=T):T=n[29],T});yk.displayName=`ComposerPrimitive.TriggerPopoverCategoryItem`;var bk=(0,U.forwardRef)((e,t)=>{let n=W(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({children:i,"aria-label":r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{items:o,activeCategoryId:s,isSearchMode:c,open:l}=wO();if(!l||!s&&!c)return null;let u=r??`Items`,d;n[4]!==i||n[5]!==o?(d=i(o),n[4]=i,n[5]=o,n[6]=d):d=n[6];let f;return n[7]!==t||n[8]!==a||n[9]!==u||n[10]!==d?(f=(0,z.jsx)(yb.div,{role:`group`,"aria-label":u,...a,ref:t,children:d}),n[7]=t,n[8]=a,n[9]=u,n[10]=d,n[11]=f):f=n[11],f});bk.displayName=`ComposerPrimitive.TriggerPopoverItems`;var xk=(0,U.forwardRef)((e,t)=>{let n=W(30),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({item:i,index:r,onClick:a,onMouseMove:o,...s}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let{selectItem:c,highlightIndex:l,items:u,highlightedIndex:d,activeCategoryId:f,isSearchMode:p,popoverId:m}=wO(),h;n[6]!==i||n[7]!==c?(h=()=>{c(i)},n[6]=i,n[7]=c,n[8]=h):h=n[8];let g=h,_;n[9]!==r||n[10]!==i.id||n[11]!==u?(_=r??u.findIndex(e=>e.id===i.id),n[9]=r,n[10]=i.id,n[11]=u,n[12]=_):_=n[12];let v=_,y=(p||f!==null)&&v===d,b;n[13]!==l||n[14]!==v?(b=()=>{l(v)},n[13]=l,n[14]=v,n[15]=b):b=n[15];let x=b,S=`${m}-option-${i.id}`,C=y?``:void 0,w;n[16]!==g||n[17]!==a?(w=K(a,g),n[16]=g,n[17]=a,n[18]=w):w=n[18];let T;n[19]!==x||n[20]!==o?(T=K(o,x),n[19]=x,n[20]=o,n[21]=T):T=n[21];let E;return n[22]!==t||n[23]!==y||n[24]!==s||n[25]!==S||n[26]!==C||n[27]!==w||n[28]!==T?(E=(0,z.jsx)(yb.button,{type:`button`,role:`option`,id:S,"aria-selected":y,"data-highlighted":C,...s,ref:t,onClick:w,onMouseMove:T}),n[22]=t,n[23]=y,n[24]=s,n[25]=S,n[26]=C,n[27]=w,n[28]=T,n[29]=E):E=n[29],E});xk.displayName=`ComposerPrimitive.TriggerPopoverItem`;var Sk=(0,U.forwardRef)((e,t)=>{let n=W(10),r,i;n[0]===e?(r=n[1],i=n[2]):({onClick:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{activeCategoryId:a,isSearchMode:o,goBack:s,open:c}=wO();if(!c||!a||o)return null;let l;n[3]!==s||n[4]!==r?(l=K(r,s),n[3]=s,n[4]=r,n[5]=l):l=n[5];let u;return n[6]!==t||n[7]!==i||n[8]!==l?(u=(0,z.jsx)(yb.button,{type:`button`,...i,ref:t,onClick:l}),n[6]=t,n[7]=i,n[8]=l,n[9]=u):u=n[9],u});Sk.displayName=`ComposerPrimitive.TriggerPopoverBack`;var Ck=({formatter:e,onExecute:t,removeOnExecute:n})=>{let{register:r}=EO(),i=Eh(t);return i.current=t,kh(()=>r({kind:`action`,formatter:e??Yy,onExecute:e=>i.current(e),...n===void 0?{}:{removeOnExecute:n}}),[r,e,n]),null};Ck.displayName=`ComposerPrimitive.TriggerPopoverAction`;var wk=({formatter:e,onInserted:t})=>{let{register:n}=EO(),r=Eh(t);return r.current=t,kh(()=>n({kind:`directive`,formatter:e??Yy,onInserted:e=>r.current?.(e)}),[n,e]),null};wk.displayName=`ComposerPrimitive.TriggerPopoverDirective`;var Tk=Object.assign(DO,{Directive:wk,Action:Ck}),Ek=ub({AddAttachment:()=>ok,AttachmentByIndex:()=>zy,AttachmentDropzone:()=>sk,Attachments:()=>Vy,Cancel:()=>ak,Dictate:()=>ck,DictationTranscript:()=>dk,If:()=>Jy,Input:()=>ik,Queue:()=>Hy,Quote:()=>pk,QuoteDismiss:()=>hk,QuoteText:()=>mk,Root:()=>kO,Send:()=>Hue,StopDictation:()=>lk,Unstable_TriggerPopover:()=>Tk,Unstable_TriggerPopoverBack:()=>Sk,Unstable_TriggerPopoverCategories:()=>vk,Unstable_TriggerPopoverCategoryItem:()=>yk,Unstable_TriggerPopoverItem:()=>xk,Unstable_TriggerPopoverItems:()=>bk,Unstable_TriggerPopoverRoot:()=>bO,unstable_useTriggerPopoverRootContext:()=>pO,unstable_useTriggerPopoverRootContextOptional:()=>mO,unstable_useTriggerPopoverScopeContext:()=>wO,unstable_useTriggerPopoverScopeContextOptional:()=>Bue,unstable_useTriggerPopoverTriggers:()=>Oue,unstable_useTriggerPopoverTriggersOptional:()=>Aue}),Dk=()=>G(Ok);function Ok(e){if(e.part.type!==`text`&&e.part.type!==`reasoning`)throw Error(`MessagePartText can only be used inside text or reasoning message parts.`);return e.part}var kk=Ph(null),Ak=e=>({useSmoothStatus:l_(()=>e)}),jk=e=>{let t=W(6),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={optional:!0},t[0]=r):r=t[0];let i=Nk(r),a=Xg(),o;t[1]===a?o=t[2]:(o=()=>Ak(a.part().getState().status),t[1]=a,t[2]=o);let[s]=Th(o);if(i)return n;let c;return t[3]!==n||t[4]!==s?(c=(0,z.jsx)(kk.Provider,{value:s,children:n}),t[3]=n,t[4]=s,t[5]=c):c=t[5],c},Mk=e=>{let t=(0,U.forwardRef)((t,n)=>{let r=W(3),i=t,a;return r[0]!==n||r[1]!==i?(a=(0,z.jsx)(jk,{children:(0,z.jsx)(e,{...i,ref:n})}),r[0]=n,r[1]=i,r[2]=a):a=r[2],a});return t.displayName=e.displayName,t};function Nk(e){let t=Ih(kk);if(!e?.optional&&!t)throw Error(`This component must be used within a SmoothContextProvider.`);return t}var{useSmoothStatus:Pk,useSmoothStatusStore:Fk}=Xy(Nk,`useSmoothStatus`),Ik=250,Lk=5,Rk=class{currentText;setText;animationFrameId=null;lastUpdateTime=Date.now();targetText=``;drainMs=Ik;maxCharIntervalMs=Lk;maxCharsPerFrame=1/0;constructor(e,t){this.currentText=e,this.setText=t}start(){this.animationFrameId===null&&(this.lastUpdateTime=Date.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}animate=()=>{let e=Date.now(),t=e-this.lastUpdateTime,n=this.targetText.length-this.currentText.length,r=Math.min(this.maxCharIntervalMs,this.drainMs/n),i=Math.min(n,this.maxCharsPerFrame),a=0;for(;t>=r&&a<i;)a++,t-=r;a===i&&i===this.maxCharsPerFrame&&(t=0),a===n?this.animationFrameId=null:this.animationFrameId=requestAnimationFrame(this.animate),a!==0&&(this.currentText=this.targetText.slice(0,this.currentText.length+a),this.lastUpdateTime=e-t,this.setText(this.currentText))}},zk=Object.freeze({type:`running`}),Bk=(e,t)=>e!==void 0&&e>0?e:t,Vk=(e,t=!1)=>{let{text:n}=e,r=typeof t==`object`&&t?t:void 0,i=t!==!1&&t!==null,a=Bk(r?.drainMs,Ik),o=Bk(r?.maxCharIntervalMs,Lk),s=Bk(r?.maxCharsPerFrame,1/0),[c,l]=Th(e.status.type===`running`?``:n),u=Xg(),d=G(()=>u.part()),[f,p]=Th(d);(d!==f||!n.startsWith(c))&&(p(d),l(e.status.type===`running`?``:n));let m=Fk({optional:!0}),h=Cb(t=>{if(l(t),m){let n=c!==t||e.status.type===`running`?zk:e.status;tb(m).setState(n,!0)}});kh(()=>{if(m){let t=i&&(c!==n||e.status.type===`running`)?zk:e.status;tb(m).setState(t,!0)}},[m,i,n,c,e.status]);let[g]=Th(new Rk(c,h));kh(()=>{g.drainMs=a,g.maxCharIntervalMs=o,g.maxCharsPerFrame=s},[g,a,o,s]);let _=Eh(d);return kh(()=>{if(!i){g.stop();return}let t=_.current!==d;if(_.current=d,t||!n.startsWith(g.targetText)){e.status.type===`running`?(g.currentText=``,g.targetText=n,g.start()):(g.currentText=n,g.targetText=n,g.stop());return}g.targetText=n,g.start()},[g,i,n,e.status.type,d]),kh(()=>()=>{g.stop()},[g]),Dh(()=>i?{...e,text:c,status:n===c?e.status:zk}:e,[i,c,e,n])},Hk=()=>G(Uk);function Uk(e){if(e.part.type!==`image`)throw Error(`MessagePartImage can only be used inside image message parts.`);return e.part}var Wk=(0,U.forwardRef)((e,t)=>{let n=W(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({smooth:i,component:a,...r}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=i===void 0?!0:i,s=a===void 0?`span`:a,{text:c,status:l}=Vk(Dk(),o),u;return n[4]!==s||n[5]!==t||n[6]!==r||n[7]!==l.type||n[8]!==c?(u=(0,z.jsx)(s,{"data-status":l.type,...r,ref:t,children:c}),n[4]=s,n[5]=t,n[6]=r,n[7]=l.type,n[8]=c,n[9]=u):u=n[9],u});Wk.displayName=`MessagePartPrimitive.Text`;var Gk=(0,U.forwardRef)((e,t)=>{let n=W(4),{image:r}=Hk(),i;return n[0]!==t||n[1]!==r||n[2]!==e?(i=(0,z.jsx)(yb.img,{src:r,...e,ref:t}),n[0]=t,n[1]=r,n[2]=e,n[3]=i):i=n[3],i});Gk.displayName=`MessagePartPrimitive.Image`;var Kk=e=>{let t=W(2),n=Eh(void 0),r;return t[0]===e?r=t[1]:(r=t=>{n.current&&=(n.current(),void 0),t&&(n.current=e(t))},t[0]=e,t[1]=r),r},qk=(e,t)=>{let n=e.trim().match(/^(\d+(?:\.\d+)?|\.\d+)(em|px|rem)$/);if(!n)return 1/0;let r=Number(n[1]),i=n[2];return i===`px`?r:i===`em`?r*(parseFloat(getComputedStyle(t).fontSize)||16):i===`rem`?r*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):1/0},Jk=e=>e.dataset.messageId,Yk=()=>{let e=document.createElement(`div`);return e.dataset.auiTopAnchorReserve=``,e.style.height=`0px`,e.style.flexShrink=`0`,e.style.pointerEvents=`none`,e.setAttribute(`aria-hidden`,`true`),e},Xk=(e,t)=>{let n=`${t}px`;return e.style.height===n?!1:(e.style.height=n,!0)},Zk=e=>{let t=window.devicePixelRatio||1;return Math.round(e*t)/t},Qk=()=>{let e=W(4),t=Xg(),n;e[0]===t?n=e[1]:(n=()=>t.message(),e[0]=t,e[1]=n);let r=G(n),i;return e[2]===r?i=e[3]:(i=e=>{let t=()=>{r.setIsHovering(!0)},n=()=>{r.setIsHovering(!1)};return e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,n),e.matches(`:hover`)&&queueMicrotask(()=>r.setIsHovering(!0)),()=>{e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,n),r.setIsHovering(!1)}},e[2]=r,e[3]=i),Kk(i)},$k=()=>{let e=W(2),t=Qy(oA),n;return e[0]===t?n=e[1]:(n=e=>e.message.role===`user`&&e.message.index>0&&e.message.index===e.thread.messages.length-2&&e.thread.messages.at(-1)?.role===`assistant`&&(e.message.id===t||e.thread.isRunning),e[0]=t,e[1]=n),G(n)},eA=()=>{let e=W(2),t=Qy(sA),n;return e[0]===t?n=e[1]:(n=e=>e.message.isLast&&e.message.role===`assistant`&&e.message.index>=1&&e.thread.messages.at(e.message.index-1)?.role===`user`&&(e.message.id===t||e.thread.isRunning),e[0]=t,e[1]=n),G(n)},tA=(e,t)=>{let n=W(3),r;return n[0]!==e||n[1]!==t?(r=n=>{if(e)return t.getState().registerAnchorElement(n)},n[0]=e,n[1]=t,n[2]=r):r=n[2],Kk(r)},nA=e=>{let t=W(3),{active:n,threadViewportStore:r}=e,i;return t[0]!==n||t[1]!==r?(i=e=>{if(!n)return;let t=r.getState(),i=t.topAnchorMessageClamp;return t.registerAnchorTargetElement(e,{tallerThan:qk(i.tallerThan,e),visibleHeight:qk(i.visibleHeight,e)})},t[0]=n,t[1]=r,t[2]=i):i=t[2],Kk(i)},rA=e=>{let t=W(7),n,r;t[0]===e?(n=t[1],r=t[2]):({forwardedRef:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=Qk(),a=cb(n,i),o=G(cA),s;return t[3]!==o||t[4]!==r||t[5]!==a?(s=(0,z.jsx)(yb.div,{...r,ref:a,"data-message-id":o}),t[3]=o,t[4]=r,t[5]=a,t[6]=s):s=t[6],s},iA=e=>{let t=W(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({forwardedRef:n,threadViewportStore:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=Qk(),o=$k(),s=eA(),c=tA(o,i),l;t[4]!==s||t[5]!==i?(l={active:s,threadViewportStore:i},t[4]=s,t[5]=i,t[6]=l):l=t[6];let u=nA(l),d=cb(n,a,c,u),f=G(lA),p=o?``:void 0,m=s?``:void 0,h;return t[7]!==f||t[8]!==r||t[9]!==d||t[10]!==p||t[11]!==m?(h=(0,z.jsx)(yb.div,{...r,ref:d,"data-message-id":f,"data-aui-top-anchor-user":p,"data-aui-top-anchor-target":m}),t[7]=f,t[8]=r,t[9]=d,t[10]=p,t[11]=m,t[12]=h):h=t[12],h},aA=(0,U.forwardRef)((e,t)=>{let n=W(7),r=$y();if(r.getState().turnAnchor===`top`){let i;return n[0]!==t||n[1]!==e||n[2]!==r?(i=(0,z.jsx)(iA,{...e,forwardedRef:t,threadViewportStore:r}),n[0]=t,n[1]=e,n[2]=r,n[3]=i):i=n[3],i}let i;return n[4]!==t||n[5]!==e?(i=(0,z.jsx)(rA,{...e,forwardedRef:t}),n[4]=t,n[5]=e,n[6]=i):i=n[6],i});aA.displayName=`MessagePrimitive.Root`;function oA(e){return e.topAnchorTurn?.anchorId}function sA(e){return e.topAnchorTurn?.targetId}function cA(e){return e.message.id}function lA(e){return e.message.id}var uA={...by,Text:()=>(0,z.jsxs)(`p`,{style:{whiteSpace:`pre-line`},children:[(0,z.jsx)(Wk,{}),(0,z.jsx)(Uy,{children:(0,z.jsx)(`span`,{style:{fontFamily:`revert`},children:` ●`})})]}),Image:()=>(0,z.jsx)(Gk,{})},dA=e=>{let t=W(10);if(`children`in e){let n;return t[0]===e.children?n=t[1]:(n=(0,z.jsx)(Dy,{children:e.children}),t[0]=e.children,t[1]=n),n}let n,r;t[2]===e?(n=t[3],r=t[4]):({components:n,...r}=e,t[2]=e,t[3]=n,t[4]=r);let i;t[5]===n?i=t[6]:(i=n?{Text:n.Text??uA.Text,Image:n.Image??uA.Image,Reasoning:n.Reasoning??by.Reasoning,Source:n.Source??by.Source,File:n.File??by.File,Unstable_Audio:n.Unstable_Audio??by.Unstable_Audio,...`ChainOfThought`in n?{ChainOfThought:n.ChainOfThought}:{tools:n.tools,data:n.data,ToolGroup:n.ToolGroup??by.ToolGroup,ReasoningGroup:n.ReasoningGroup??by.ReasoningGroup},Empty:n.Empty,Quote:n.Quote,generativeUI:n.generativeUI}:uA,t[5]=n,t[6]=i);let a=i,o;return t[7]!==r||t[8]!==a?(o=(0,z.jsx)(Dy,{components:a,...r}),t[7]=r,t[8]=a,t[9]=o):o=t[9],o};dA.displayName=`MessagePrimitive.Parts`;var fA=e=>{let{children:t}=e;return Rie()===void 0?null:t};fA.displayName=`MessagePrimitive.Error`;var pA=e=>{let t=new Map;for(let n=0;n<e.length;n++){let r=e[n]?.parentId??`__ungrouped_${n}`,i=t.get(r)??[];i.push(n),t.set(r,i)}let n=[];for(let[e,r]of t){let t=e.startsWith(`__ungrouped_`)?void 0:e;n.push({groupKey:t,indices:r})}return n},mA=e=>{let t=W(4),n=G(TA),r;bb0:{if(n.length===0){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0],r=e;break bb0}let i;t[1]!==e||t[2]!==n?(i=e(n),t[1]=e,t[2]=n,t[3]=i):i=t[3],r=i}return r},hA=e=>{let t=W(9),n,r;t[0]===e?(n=t[1],r=t[2]):({Fallback:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]!==n||t[4]!==r.toolName?(i=e=>{let t=e.tools.tools[r.toolName]??n;return Array.isArray(t)?t[0]??n:t},t[3]=n,t[4]=r.toolName,t[5]=i):i=t[5];let a=G(i);if(!a)return null;let o;return t[6]!==a||t[7]!==r?(o=(0,z.jsx)(a,{...r}),t[6]=a,t[7]=r,t[8]=o):o=t[8],o},gA=e=>{let t=W(9),n,r;t[0]===e?(n=t[1],r=t[2]):({Fallback:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]!==n||t[4]!==r.name?(i=e=>{let t=e.dataRenderers.renderers[r.name]??n;return Array.isArray(t)?t[0]??n:t},t[3]=n,t[4]=r.name,t[5]=i):i=t[5];let a=G(i);if(!a)return null;let o;return t[6]!==a||t[7]!==r?(o=(0,z.jsx)(a,{...r}),t[6]=a,t[7]=r,t[8]=o):o=t[8],o},_A={Text:()=>(0,z.jsxs)(`p`,{style:{whiteSpace:`pre-line`},children:[(0,z.jsx)(Wk,{}),(0,z.jsx)(Uy,{children:(0,z.jsx)(`span`,{style:{fontFamily:`revert`},children:` ●`})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>(0,z.jsx)(Gk,{}),File:()=>null,Unstable_Audio:()=>null,Group:({children:e})=>e},vA=e=>{let t=W(43),{components:n}=e,r;t[0]===n?r=t[1]:(r=n===void 0?{}:n,t[0]=n,t[1]=r);let{Text:i,Reasoning:a,Image:o,Source:s,File:c,Unstable_Audio:l,tools:u,data:d}=r,f=i===void 0?_A.Text:i,p=a===void 0?_A.Reasoning:a,m=o===void 0?_A.Image:o,h=s===void 0?_A.Source:s,g=c===void 0?_A.File:c,_=l===void 0?_A.Unstable_Audio:l,v;t[2]===u?v=t[3]:(v=u===void 0?{}:u,t[2]=u,t[3]=v);let y=v,b=Xg(),x=G(EA),S=x.type;if(S===`tool-call`){let e;t[4]===b?e=t[5]:(e=b.part(),t[4]=b,t[5]=e);let n=e.addToolResult,r;t[6]===b?r=t[7]:(r=b.part(),t[6]=b,t[7]=r);let i=r.resumeToolCall,a;t[8]===b?a=t[9]:(a=b.part(),t[8]=b,t[9]=a);let o=a.respondToToolApproval;if(`Override`in y){let e;return t[10]!==n||t[11]!==x||t[12]!==o||t[13]!==i||t[14]!==y.Override?(e=(0,z.jsx)(y.Override,{...x,addResult:n,resume:i,respondToApproval:o}),t[10]=n,t[11]=x,t[12]=o,t[13]=i,t[14]=y.Override,t[15]=e):e=t[15],e}let s=y.by_name?.[x.toolName]??y.Fallback,c;return t[16]!==s||t[17]!==n||t[18]!==x||t[19]!==o||t[20]!==i?(c=(0,z.jsx)(hA,{...x,Fallback:s,addResult:n,resume:i,respondToApproval:o}),t[16]=s,t[17]=n,t[18]=x,t[19]=o,t[20]=i,t[21]=c):c=t[21],c}if(x.status?.type===`requires-action`)throw Error(`Encountered unexpected requires-action status`);switch(S){case`text`:{let e;return t[22]!==f||t[23]!==x?(e=(0,z.jsx)(f,{...x}),t[22]=f,t[23]=x,t[24]=e):e=t[24],e}case`reasoning`:{let e;return t[25]!==p||t[26]!==x?(e=(0,z.jsx)(p,{...x}),t[25]=p,t[26]=x,t[27]=e):e=t[27],e}case`source`:{let e;return t[28]!==h||t[29]!==x?(e=(0,z.jsx)(h,{...x}),t[28]=h,t[29]=x,t[30]=e):e=t[30],e}case`image`:{let e;return t[31]!==m||t[32]!==x?(e=(0,z.jsx)(m,{...x}),t[31]=m,t[32]=x,t[33]=e):e=t[33],e}case`file`:{let e;return t[34]!==g||t[35]!==x?(e=(0,z.jsx)(g,{...x}),t[34]=g,t[35]=x,t[36]=e):e=t[36],e}case`audio`:{let e;return t[37]!==_||t[38]!==x?(e=(0,z.jsx)(_,{...x}),t[37]=_,t[38]=x,t[39]=e):e=t[39],e}case`data`:{let e=d?.by_name?.[x.name]??d?.Fallback,n;return t[40]!==e||t[41]!==x?(n=(0,z.jsx)(gA,{...x,Fallback:e}),t[40]=e,t[41]=x,t[42]=n):n=t[42],n}default:return console.warn(`Unknown message part type: ${S}`),null}},yA=(0,U.memo)(e=>{let t=W(5),{partIndex:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,z.jsx)(vA,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,z.jsx)(W_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.partIndex===t.partIndex&&e.components?.Text===t.components?.Text&&e.components?.Reasoning===t.components?.Reasoning&&e.components?.Source===t.components?.Source&&e.components?.Image===t.components?.Image&&e.components?.File===t.components?.File&&e.components?.Unstable_Audio===t.components?.Unstable_Audio&&e.components?.tools===t.components?.tools&&e.components?.data===t.components?.data&&e.components?.Group===t.components?.Group),bA=e=>{let t=W(6),{status:n,component:r}=e,i=n.type===`running`,a;t[0]!==r||t[1]!==n?(a=(0,z.jsx)(r,{type:`text`,text:``,status:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,z.jsx)(K_,{text:``,isRunning:i,children:a}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o},xA=Object.freeze({type:`complete`}),SA=(0,U.memo)(e=>{let t=W(6),{components:n}=e,r=G(DA);if(n?.Empty){let e;return t[0]!==n.Empty||t[1]!==r?(e=(0,z.jsx)(n.Empty,{status:r}),t[0]=n.Empty,t[1]=r,t[2]=e):e=t[2],e}let i=n?.Text??_A.Text,a;return t[3]!==r||t[4]!==i?(a=(0,z.jsx)(bA,{status:r,component:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a},(e,t)=>e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),CA=e=>{let t=W(9),{groupingFunction:n,components:r}=e,i=G(OA),a=mA(n),o;bb0:{if(i===0){let e;t[0]===r?e=t[1]:(e=(0,z.jsx)(SA,{components:r}),t[0]=r,t[1]=e),o=e;break bb0}let e;if(t[2]!==r||t[3]!==a){let n;t[5]===r?n=t[6]:(n=(e,t)=>(0,z.jsx)(r?.Group??_A.Group,{groupKey:e.groupKey,indices:e.indices,children:e.indices.map(e=>(0,z.jsx)(yA,{partIndex:e,components:r},e))},`group-${t}-${e.groupKey??`ungrouped`}`),t[5]=r,t[6]=n),e=a.map(n),t[2]=r,t[3]=a,t[4]=e}else e=t[4];o=e}let s=o,c;return t[7]===s?c=t[8]:(c=(0,z.jsx)(z.Fragment,{children:s}),t[7]=s,t[8]=c),c};CA.displayName=`MessagePrimitive.Unstable_PartsGrouped`;var wA=e=>{let t=W(6),n,r;t[0]===e?(n=t[1],r=t[2]):({components:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,z.jsx)(CA,{...r,components:n,groupingFunction:pA}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i};wA.displayName=`MessagePrimitive.Unstable_PartsGroupedByParentId`;function TA(e){return e.message.parts}function EA(e){return e.part}function DA(e){return e.message.status??xA}function OA(e){return e.message.parts.length}var kA=ub({AttachmentByIndex:()=>Fy,Attachments:()=>Ly,Content:()=>dA,Error:()=>fA,GenerativeUI:()=>py,GroupedParts:()=>My,If:()=>cO,PartByIndex:()=>xy,Parts:()=>dA,Quote:()=>Ny,Root:()=>aA,Unstable_PartsGrouped:()=>CA,Unstable_PartsGroupedByParentId:()=>wA}),AA=e=>{let t=W(2),n=Cb(e),r;return t[0]===n?r=t[1]:(r=e=>{let t=new ResizeObserver(()=>{n()}),r=new MutationObserver(e=>{e.some(jA)&&n()});return t.observe(e),r.observe(e,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{t.disconnect(),r.disconnect()}},t[0]=n,t[1]=r),Kk(r)};function jA(e){return e.type!==`attributes`||e.attributeName!==`style`}var MA=({autoScroll:e,scrollToBottomOnRunStart:t=!0,scrollToBottomOnInitialize:n=!0,scrollToBottomOnThreadSwitch:r=!0})=>{let i=Eh(null),a=G(e=>e.thread.messages.length>0),o=Eh(!1),s=Eh(null),c=$y();e===void 0&&(e=c.getState().turnAnchor!==`top`);let l=Eh(0),u=Eh(0),d=Eh(0),f=Eh(0),p=Eh(null),m=Oh(e=>{let t=i.current;t&&(p.current=e,t.scrollTo({top:t.scrollHeight,behavior:e}))},[]),h=Oh(e=>{p.current=e,s.current!==null&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{s.current=null,m(e)})},[m]);Ah(()=>()=>{s.current!==null&&cancelAnimationFrame(s.current)},[]);let g=Oh(()=>{let e=c.getState();return e.turnAnchor===`top`&&e.element.viewport===i.current&&e.element.anchor!==null},[c]),_=()=>{let e=i.current;if(!e)return;let t=c.getState().isAtBottom,n=Math.abs(e.scrollHeight-e.scrollTop-e.clientHeight)<=1||e.scrollHeight<=e.clientHeight;!n&&l.current<e.scrollTop||(n?e.scrollHeight>e.clientHeight+1&&(p.current=null):l.current>e.scrollTop&&u.current===e.scrollHeight&&(p.current=null),(n||p.current===null)&&n!==t&&tb(c).setState({isAtBottom:n})),l.current=e.scrollTop,u.current=e.scrollHeight},v=AA(()=>{let t=i.current;if(!t)return;let{scrollHeight:n,clientHeight:r}=t;if(n===d.current&&r===f.current)return;d.current=n,f.current=r;let a=p.current;a&&g()?p.current=null:a?m(a):e&&c.getState().isAtBottom&&m(`instant`),_()}),y=Kk(e=>{let t=()=>{p.current=null};return e.addEventListener(`scroll`,_),e.addEventListener(`pointerdown`,t),()=>{e.removeEventListener(`scroll`,_),e.removeEventListener(`pointerdown`,t)}});return Ah(()=>{if(n){if(!a){o.current=!1;return}o.current||(o.current=!0,p.current===null&&h(`instant`))}},[a,h,n]),AO(({behavior:e})=>{m(e)}),$g(`thread.runStart`,()=>{t&&c.getState().turnAnchor!==`top`&&h(`auto`)}),$g(`threadListItem.switchedTo`,()=>{r&&h(`instant`)}),cb(v,y,i)},NA=(0,U.forwardRef)((e,t)=>{let n=W(3),r;return n[0]!==e||n[1]!==t?(r=(0,z.jsx)(yb.div,{...e,ref:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});NA.displayName=`ThreadPrimitive.Root`;var PA=e=>{let{children:t}=e;return G(FA)?t:null};PA.displayName=`ThreadPrimitive.Empty`;function FA(e){return e.thread.isEmpty}var IA=e=>{let t=W(4),n;return t[0]!==e.disabled||t[1]!==e.empty||t[2]!==e.running?(n=t=>!(e.empty===!0&&!t.thread.isEmpty||e.empty===!1&&t.thread.isEmpty||e.running===!0&&!t.thread.isRunning||e.running===!1&&t.thread.isRunning||e.disabled===!0&&!t.thread.isDisabled||e.disabled===!1&&t.thread.isDisabled),t[0]=e.disabled,t[1]=e.empty,t[2]=e.running,t[3]=n):n=t[3],G(n)},LA=e=>{let t=W(3),n,r;return t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),IA(r)?n:null};LA.displayName=`ThreadPrimitive.If`;var RA=(e,t)=>{let n=W(3),r;return n[0]!==t||n[1]!==e?(r=n=>{if(!e)return;let r=e(),i=()=>{let e=t?t(n):n.offsetHeight;r.setHeight(e)},a=new ResizeObserver(i);return a.observe(n),i(),()=>{a.disconnect(),r.unregister()}},n[0]=t,n[1]=e,n[2]=r):r=n[2],Kk(r)},zA=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},BA=(e,t)=>{let n=0,r=e;for(;r&&r!==t;)n+=r.offsetTop,r=r.offsetParent;return r===t?n:zA(e)-zA(t)},VA=({viewport:e,anchor:t,tallerThan:n,visibleHeight:r})=>{let i=BA(t,e),a=t.offsetHeight;return i+Math.max(0,a-(a<=n?a:r))},HA=({scrollHeight:e,...t})=>{let{viewport:n}=t,r=VA(t)+n.clientHeight;return Math.max(0,r-e)},UA=({viewport:e,reserve:t,...n})=>HA({viewport:e,...n,scrollHeight:e.scrollHeight-t.offsetHeight}),WA=e=>{let t=new ResizeObserver(e),n=new MutationObserver(e),r=null,i=null,a=null,o=()=>{t.disconnect(),n.disconnect(),r=null,i=null,a=null};return{target:(e,s,c)=>{r===e&&i===s&&a===c||(o(),t.observe(e),t.observe(s),t.observe(c),n.observe(c,{childList:!0,subtree:!0,characterData:!0}),r=e,i=s,a=c)},disconnect:o}},GA=e=>{let t=null;return{schedule:()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))},cancel:()=>{t!==null&&(cancelAnimationFrame(t),t=null)}}},KA=e=>{let t=null,n;function r(){let r=e.getState(),{viewport:o,anchor:s,target:c}=r.element,l=r.targetConfig;if(r.turnAnchor!==`top`||!o||!s||!c||!l){a.disconnect(),t&&(Xk(t,0),t.remove());return}if(t??=Yk(),(t.parentElement!==c.parentElement||t.previousElementSibling!==c)&&c.after(t),a.target(o,s,c),Xk(t,UA({viewport:o,anchor:s,reserve:t,...l}))){i.schedule();return}let u=Jk(s);if(u!==void 0&&n===u)return;let d=Zk(VA({viewport:o,anchor:s,...l}));Math.abs(o.scrollTop-d)>1&&o.scrollTo({top:d,behavior:`smooth`}),u!==void 0&&(n=u)}let i=GA(r),a=WA(i.schedule);i.schedule();let o=e.subscribe(i.schedule);return()=>{i.cancel(),o(),a.disconnect(),t?.remove()}},qA=e=>{let t=W(4),n=$y(),r,i;t[0]!==e||t[1]!==n?(r=()=>{if(e)return KA(n)},i=[e,n],t[0]=e,t[1]=n,t[2]=r,t[3]=i):(r=t[2],i=t[3]),Ah(r,i)},JA=({isRunning:e,messages:t})=>{if(!e)return null;let n=t.at(-1),r=t.at(-2);return r?.role!==`user`||n?.role!==`assistant`?null:{anchorId:r.id,targetId:n.id}},YA=e=>JA(e)?.anchorId,XA=e=>JA(e)?.targetId,ZA=()=>RA(Qy(nj),rj),QA=()=>Kk(Qy(ij)),$A=e=>{let t=W(13),n=$y(),r;t[0]===e?r=t[1]:(r=t=>{if(e)return YA(t.thread)},t[0]=e,t[1]=r);let i=G(r),a;t[2]===e?a=t[3]:(a=t=>{if(e)return XA(t.thread)},t[2]=e,t[3]=a);let o=G(a),s;bb0:{if(!i||!o){s=null;break bb0}let e;t[4]!==i||t[5]!==o?(e={anchorId:i,targetId:o},t[4]=i,t[5]=o,t[6]=e):e=t[6],s=e}let c=s,l,u;t[7]!==c||t[8]!==n?(l=()=>{if(!c)return;let e=n.getState(),t=e.topAnchorTurn;t?.anchorId===c.anchorId&&t.targetId===c.targetId||e.setTopAnchorTurn(c)},u=[c,n],t[7]=c,t[8]=n,t[9]=l,t[10]=u):(l=t[9],u=t[10]),Ah(l,u);let d;t[11]===n?d=t[12]:(d=()=>{n.getState().setTopAnchorTurn(null)},t[11]=n,t[12]=d);let f=d;$g(`thread.initialize`,f),$g(`threadListItem.switchedTo`,f)},ej=(0,U.forwardRef)((e,t)=>{let n=W(18),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({autoScroll:r,scrollToBottomOnRunStart:s,scrollToBottomOnInitialize:o,scrollToBottomOnThreadSwitch:c,children:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l;n[7]!==r||n[8]!==o||n[9]!==s||n[10]!==c?(l={autoScroll:r,scrollToBottomOnRunStart:s,scrollToBottomOnInitialize:o,scrollToBottomOnThreadSwitch:c},n[7]=r,n[8]=o,n[9]=s,n[10]=c,n[11]=l):l=n[11];let u=MA(l),d=ZA(),f=QA(),p=$y(),m;n[12]===p?m=n[13]:(m=p.getState(),n[12]=p,n[13]=m);let h=m.turnAnchor===`top`;$A(h),qA(h);let g=cb(t,u,d,f),_;return n[14]!==i||n[15]!==g||n[16]!==a?(_=(0,z.jsx)(yb.div,{...a,ref:g,children:i}),n[14]=i,n[15]=g,n[16]=a,n[17]=_):_=n[17],_});ej.displayName=`ThreadPrimitive.ViewportScrollable`;var tj=(0,U.forwardRef)((e,t)=>{let n=W(13),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({turnAnchor:a,topAnchorMessageClamp:i,...r}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]!==i||n[5]!==a?(o={turnAnchor:a,topAnchorMessageClamp:i},n[4]=i,n[5]=a,n[6]=o):o=n[6];let s;n[7]!==r||n[8]!==t?(s=(0,z.jsx)(ej,{...r,ref:t}),n[7]=r,n[8]=t,n[9]=s):s=n[9];let c;return n[10]!==o||n[11]!==s?(c=(0,z.jsx)(nb,{options:o,children:s}),n[10]=o,n[11]=s,n[12]=c):c=n[12],c});tj.displayName=`ThreadPrimitive.Viewport`;function nj(e){return e.registerViewport}function rj(e){return e.clientHeight}function ij(e){return e.registerViewportElement}var aj=(0,U.forwardRef)((e,t)=>{let n=W(3),r=cb(t,RA(Qy(oj),sj)),i;return n[0]!==e||n[1]!==r?(i=(0,z.jsx)(yb.div,{...e,ref:r}),n[0]=e,n[1]=r,n[2]=i):i=n[2],i});aj.displayName=`ThreadPrimitive.ViewportFooter`;function oj(e){return e.registerContentInset}function sj(e){let t=parseFloat(getComputedStyle(e).marginTop)||0;return e.offsetHeight+t}var cj=Sb(`ThreadPrimitive.ScrollToBottom`,e=>{let t=W(5),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{behavior:r}=n,i=Qy(lj),a=$y(),o;return t[2]!==r||t[3]!==a?(o=()=>{a.getState().scrollToBottom({behavior:r})},t[2]=r,t[3]=a,t[4]=o):o=t[4],i?null:o},[`behavior`]);function lj(e){return e.isAtBottom}var uj=Sb(`ThreadPrimitive.Suggestion`,e=>{let t=W(4),{prompt:n,send:r,clearComposer:i,autoSend:a}=e,o=r??a??!1,s;t[0]!==i||t[1]!==n||t[2]!==o?(s={prompt:n,send:o,clearComposer:i},t[0]=i,t[1]=n,t[2]=o,t[3]=s):s=t[3];let{disabled:c,trigger:l}=Iie(s);return c?null:l},[`prompt`,`send`,`clearComposer`,`autoSend`,`method`]),dj=ub({Empty:()=>PA,If:()=>LA,MessageByIndex:()=>sy,Messages:()=>dre,Root:()=>NA,ScrollToBottom:()=>cj,Suggestion:()=>uj,SuggestionByIndex:()=>Gy,Suggestions:()=>aie,Viewport:()=>tj,ViewportFooter:()=>aj,ViewportProvider:()=>nb}),fj=ub({AssistantRuntimeImpl:()=>Mv,BaseAssistantRuntimeCore:()=>Nv,CompositeContextProvider:()=>fg,DefaultThreadComposerRuntimeCore:()=>Yv,MessageRepository:()=>Wv,ThreadRuntimeImpl:()=>Ov,fromThreadMessageLike:()=>Vv,generateId:()=>Lv,getAutoStatus:()=>zv,splitLocalRuntimeOptions:()=>Bie,useComposerInputPluginRegistryOptional:()=>uO,useSmooth:()=>Vk,useSmoothStatus:()=>Pk,withSmoothContextProvider:()=>Mk}),pj={},mj=[`fr`,`en`],hj=`PARAGLIDE_LOCALE`,gj=[`localStorage`,`baseLocale`],_j=[],vj,yj;function bj(e){if(_j.length===0)return;let t=typeof e==`string`?e:e.href;if(vj===t)return yj;let n=new URL(t,`http://dummy.com`),r;for(let e of _j)if(new pj(e.match,n.href).exec(n.href)){r=e;break}return vj=t,yj=r,r}function xj(e){let t=bj(e);return t&&t.exclude!==!0&&Array.isArray(t.strategy)?t.strategy:gj}var Sj=void 0;globalThis.__paraglide=globalThis.__paraglide??{},globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};var Cj=!1,q=()=>{if(Sj){let e=Sj?.getStore()?.locale;if(e)return e}let e=gj;typeof window<`u`&&window.location?.href&&(e=xj(window.location.href));let t=wj(e,typeof window<`u`?window.location?.href:void 0);if(t)return Cj||(Cj=!0,Ej(t,{reload:!1})),t;throw Error(`No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found`)};function wj(e,t){let n;for(let t of e){if(t===`baseLocale`)n=`fr`;else if(t===`localStorage`)n=localStorage.getItem(`PARAGLIDE_LOCALE`)??void 0;else if(Aj(t)&&kj.has(t)){let e=kj.get(t);if(e){let t=e.getLocale();if(t instanceof Promise)continue;if(t!==void 0)return Oj(t)}}let e=Dj(n);if(e)return e}}var Tj=e=>{e?window.location.href=e:window.location.reload()},Ej=(e,t)=>{let n={reload:!0,...t},r;try{r=q()}catch{}let i=[],a=gj;typeof window<`u`&&window.location?.href&&(a=xj(window.location.href));for(let t of a)if(t===`baseLocale`)continue;else if(t===`localStorage`&&typeof window<`u`)localStorage.setItem(hj,e);else if(Aj(t)&&kj.has(t)){let n=kj.get(t);if(n){let r=n.setLocale(e);r instanceof Promise&&(r=r.catch(e=>{throw Error(`Custom strategy "${t}" setLocale failed.`,{cause:e})}),i.push(r))}}let o=()=>{n.reload&&window.location&&e!==r&&Tj(void 0)};if(i.length)return Promise.all(i).then(()=>{o()});o()};function Dj(e){if(typeof e!=`string`)return;let t=e.toLowerCase();for(let e of mj)if(e.toLowerCase()===t)return e}function Oj(e){let t=Dj(e);if(t)return t;throw Error(`Invalid locale: ${e}. Expected one of: ${mj.join(`, `)}`)}var kj=new Map;function Aj(e){return typeof e==`string`&&/^custom-[A-Za-z0-9_-]+$/.test(e)}var jj=()=>`Chargement…`,Mj=()=>`Loading…`,Nj=((e={},t={})=>(t.locale??q())===`fr`?jj(e):Mj(e)),Pj=()=>`Thème`,Fj=()=>`Theme`,Ij=((e={},t={})=>(t.locale??q())===`fr`?Pj(e):Fj(e)),Lj=()=>`Clair`,Rj=()=>`Light`,zj=((e={},t={})=>(t.locale??q())===`fr`?Lj(e):Rj(e)),Bj=()=>`Sombre`,Vj=()=>`Dark`,Hj=((e={},t={})=>(t.locale??q())===`fr`?Bj(e):Vj(e)),Uj=()=>`Système`,Wj=()=>`System`,Gj=((e={},t={})=>(t.locale??q())===`fr`?Uj(e):Wj(e)),Kj=()=>`Défaut de l’app`,qj=()=>`App default`,Jj=((e={},t={})=>(t.locale??q())===`fr`?Kj(e):qj(e)),Yj=()=>`Se déconnecter`,Xj=()=>`Sign out`,Zj=((e={},t={})=>(t.locale??q())===`fr`?Yj(e):Xj(e)),Qj=()=>`Préférences`,$j=()=>`Preferences`,eM=((e={},t={})=>(t.locale??q())===`fr`?Qj(e):$j(e)),tM=()=>`Nom affiché`,nM=()=>`Display name`,rM=((e={},t={})=>(t.locale??q())===`fr`?tM(e):nM(e)),iM=()=>`Le nom et prénom affichés dans la liste des utilisateurs et le menu de compte. Vous pouvez le modifier à tout moment.`,aM=()=>`The name shown in the user list and the account menu. You can change it at any time.`,oM=((e={},t={})=>(t.locale??q())===`fr`?iM(e):aM(e)),sM=()=>`Votre nom et prénom`,cM=()=>`Your name`,lM=((e={},t={})=>(t.locale??q())===`fr`?sM(e):cM(e)),uM=()=>`Laissez vide pour n’afficher que votre email.`,dM=()=>`Leave empty to show only your email.`,fM=((e={},t={})=>(t.locale??q())===`fr`?uM(e):dM(e)),pM=()=>`Nom affiché mis à jour.`,mM=()=>`Display name updated.`,hM=((e={},t={})=>(t.locale??q())===`fr`?pM(e):mM(e)),gM=()=>`Échec de la mise à jour du nom`,_M=()=>`Failed to update the name`,vM=((e={},t={})=>(t.locale??q())===`fr`?gM(e):_M(e)),yM=()=>`Langue`,bM=()=>`Language`,xM=((e={},t={})=>(t.locale??q())===`fr`?yM(e):bM(e)),SM=()=>`Choisissez la langue de l’interface. « Défaut de l’app » suit le réglage de l’administrateur.`,CM=()=>`Choose the interface language. “App default” follows the administrator setting.`,wM=((e={},t={})=>(t.locale??q())===`fr`?SM(e):CM(e)),TM=()=>`Le changement de langue recharge la page une fois.`,EM=()=>`Changing the language reloads the page once.`,DM=((e={},t={})=>(t.locale??q())===`fr`?TM(e):EM(e)),OM=()=>`Interface`,kM=()=>`Interface`,AM=((e={},t={})=>(t.locale??q())===`fr`?OM(e):kM(e)),jM=()=>`Activez ou masquez des éléments d’interface. Les options grisées sont verrouillées par l’administrateur.`,MM=()=>`Enable or hide interface elements. Greyed options are locked by the administrator.`,NM=((e={},t={})=>(t.locale??q())===`fr`?jM(e):MM(e)),PM=()=>`Français`,FM=()=>`French`,IM=((e={},t={})=>(t.locale??q())===`fr`?PM(e):FM(e)),LM=()=>`Anglais`,RM=()=>`English`,zM=((e={},t={})=>(t.locale??q())===`fr`?LM(e):RM(e)),BM=()=>`Fichiers`,VM=()=>`Files`,HM=((e={},t={})=>(t.locale??q())===`fr`?BM(e):VM(e)),UM=()=>`Tous les fichiers échangés dans vos conversations (envoyés et reçus).`,WM=()=>`Every file exchanged across your conversations (sent and received).`,GM=((e={},t={})=>(t.locale??q())===`fr`?UM(e):WM(e)),KM=()=>`Sens`,qM=()=>`Direction`,JM=((e={},t={})=>(t.locale??q())===`fr`?KM(e):qM(e)),YM=()=>`Tous les sens`,XM=()=>`All directions`,ZM=((e={},t={})=>(t.locale??q())===`fr`?YM(e):XM(e)),QM=()=>`Envoyé`,$M=()=>`Sent`,eN=((e={},t={})=>(t.locale??q())===`fr`?QM(e):$M(e)),tN=()=>`Reçu`,nN=()=>`Received`,rN=((e={},t={})=>(t.locale??q())===`fr`?tN(e):nN(e)),iN=()=>`Conversation`,aN=()=>`Conversation`,oN=((e={},t={})=>(t.locale??q())===`fr`?iN(e):aN(e)),sN=()=>`Toutes les conversations`,cN=()=>`All conversations`,lN=((e={},t={})=>(t.locale??q())===`fr`?sN(e):cN(e)),uN=()=>`Bridge`,dN=()=>`Bridge`,fN=((e={},t={})=>(t.locale??q())===`fr`?uN(e):dN(e)),pN=()=>`Tous les bridges`,mN=()=>`All bridges`,hN=((e={},t={})=>(t.locale??q())===`fr`?pN(e):mN(e)),gN=()=>`Type`,_N=()=>`Type`,vN=((e={},t={})=>(t.locale??q())===`fr`?gN(e):_N(e)),yN=()=>`Tous les types`,bN=()=>`All types`,xN=((e={},t={})=>(t.locale??q())===`fr`?yN(e):bN(e)),SN=()=>`Image`,CN=()=>`Image`,wN=((e={},t={})=>(t.locale??q())===`fr`?SN(e):CN(e)),TN=()=>`Audio`,EN=()=>`Audio`,DN=((e={},t={})=>(t.locale??q())===`fr`?TN(e):EN(e)),ON=()=>`Vidéo`,kN=()=>`Video`,AN=((e={},t={})=>(t.locale??q())===`fr`?ON(e):kN(e)),jN=()=>`PDF`,MN=()=>`PDF`,NN=((e={},t={})=>(t.locale??q())===`fr`?jN(e):MN(e)),PN=()=>`Document`,FN=()=>`Document`,IN=((e={},t={})=>(t.locale??q())===`fr`?PN(e):FN(e)),LN=()=>`Archive`,RN=()=>`Archive`,zN=((e={},t={})=>(t.locale??q())===`fr`?LN(e):RN(e)),BN=()=>`Autre`,VN=()=>`Other`,HN=((e={},t={})=>(t.locale??q())===`fr`?BN(e):VN(e)),UN=()=>`Nom`,WN=()=>`Name`,GN=((e={},t={})=>(t.locale??q())===`fr`?UN(e):WN(e)),KN=()=>`Type`,qN=()=>`Type`,JN=((e={},t={})=>(t.locale??q())===`fr`?KN(e):qN(e)),YN=()=>`Sens`,XN=()=>`Direction`,ZN=((e={},t={})=>(t.locale??q())===`fr`?YN(e):XN(e)),QN=()=>`Conversation`,$N=()=>`Conversation`,eP=((e={},t={})=>(t.locale??q())===`fr`?QN(e):$N(e)),tP=()=>`Date`,nP=()=>`Date`,rP=((e={},t={})=>(t.locale??q())===`fr`?tP(e):nP(e)),iP=()=>`Action`,aP=()=>`Action`,oP=((e={},t={})=>(t.locale??q())===`fr`?iP(e):aP(e)),sP=()=>`Télécharger`,cP=()=>`Download`,lP=((e={},t={})=>(t.locale??q())===`fr`?sP(e):cP(e)),uP=()=>`Indisponible`,dP=()=>`Unavailable`,fP=((e={},t={})=>(t.locale??q())===`fr`?uP(e):dP(e)),pP=()=>`Aucun fichier pour le moment.`,mP=()=>`No files yet.`,hP=((e={},t={})=>(t.locale??q())===`fr`?pP(e):mP(e)),gP=()=>`Aucun fichier ne correspond aux filtres.`,_P=()=>`No files match the filters.`,vP=((e={},t={})=>(t.locale??q())===`fr`?gP(e):_P(e)),yP=e=>`Affichage des ${e?.cap} fichiers les plus récents.`,bP=e=>`Showing the ${e?.cap} most recent files.`,xP=((e,t={})=>(t.locale??q())===`fr`?yP(e):bP(e)),SP=()=>`Apparence`,CP=()=>`Appearance`,wP=((e={},t={})=>(t.locale??q())===`fr`?SP(e):CP(e)),TP=()=>`Thème par défaut de l’application`,EP=()=>`Default app theme`,DP=((e={},t={})=>(t.locale??q())===`fr`?TP(e):EP(e)),OP=()=>`Appliqué aux utilisateurs sans préférence personnelle.`,kP=()=>`Applied to users without a personal preference.`,AP=((e={},t={})=>(t.locale??q())===`fr`?OP(e):kP(e)),jP=()=>`Langue par défaut de l’application`,MP=()=>`Default app language`,NP=((e={},t={})=>(t.locale??q())===`fr`?jP(e):MP(e)),PP=()=>`Langue des nouveaux utilisateurs qui n’ont pas encore choisi la leur.`,FP=()=>`Language for new users who haven’t picked their own yet.`,IP=((e={},t={})=>(t.locale??q())===`fr`?PP(e):FP(e)),LP=()=>`Si vous n’avez pas défini votre propre langue, changer ce défaut rechargera votre vue.`,RP=()=>`If you haven’t set your own language, changing this default will reload your view.`,zP=((e={},t={})=>(t.locale??q())===`fr`?LP(e):RP(e)),BP=()=>`Référence des composants (design)`,VP=()=>`Component reference (design)`,HP=((e={},t={})=>(t.locale??q())===`fr`?BP(e):VP(e)),UP=()=>`Administration de l’apparence`,WP=()=>`Appearance administration`,GP=((e={},t={})=>(t.locale??q())===`fr`?UP(e):WP(e)),KP=()=>`Réservé aux administrateurs. S’applique à toute l’organisation.`,qP=()=>`Admins only. Applies to the whole organization.`,JP=((e={},t={})=>(t.locale??q())===`fr`?KP(e):qP(e)),YP=()=>`Ma charte graphique`,XP=()=>`My graphic chart`,ZP=((e={},t={})=>(t.locale??q())===`fr`?YP(e):XP(e)),QP=()=>`Choisissez la palette appliquée à votre interface, en clair comme en sombre.`,$P=()=>`Pick the palette applied to your interface, in light and dark.`,eF=((e={},t={})=>(t.locale??q())===`fr`?QP(e):$P(e)),tF=()=>`Défaut de l’application`,nF=()=>`Application default`,rF=((e={},t={})=>(t.locale??q())===`fr`?tF(e):nF(e)),iF=()=>`Suit le défaut de l’application.`,aF=()=>`Follows the application default.`,oF=((e={},t={})=>(t.locale??q())===`fr`?iF(e):aF(e)),sF=()=>`Commune`,cF=()=>`Common`,lF=((e={},t={})=>(t.locale??q())===`fr`?sF(e):cF(e)),uF=()=>`La vôtre`,dF=()=>`Yours`,fF=((e={},t={})=>(t.locale??q())===`fr`?uF(e):dF(e)),pF=e=>`Via le groupe ${e?.group}`,mF=e=>`Via group ${e?.group}`,hF=((e,t={})=>(t.locale??q())===`fr`?pF(e):mF(e)),gF=()=>`Aucune charte disponible pour le moment.`,_F=()=>`No chart available yet.`,vF=((e={},t={})=>(t.locale??q())===`fr`?gF(e):_F(e)),yF=()=>`Charte par défaut de l’application`,bF=()=>`Application default chart`,xF=((e={},t={})=>(t.locale??q())===`fr`?yF(e):bF(e)),SF=()=>`Appliquée aux utilisateurs sans charte personnelle.`,CF=()=>`Applied to users without a personal chart.`,wF=((e={},t={})=>(t.locale??q())===`fr`?SF(e):CF(e)),TF=()=>`Disponibilité des chartes`,EF=()=>`Chart availability`,DF=((e={},t={})=>(t.locale??q())===`fr`?TF(e):EF(e)),OF=()=>`Une charte est commune (offerte à tous) tant qu’aucun groupe ne lui est associé ; sinon elle est réservée aux membres de ces groupes.`,kF=()=>`A chart is common (offered to everyone) until a group is attached to it; otherwise it is restricted to members of those groups.`,AF=((e={},t={})=>(t.locale??q())===`fr`?OF(e):kF(e)),jF=()=>`Commune`,MF=()=>`Common`,NF=((e={},t={})=>(t.locale??q())===`fr`?jF(e):MF(e)),PF=()=>`Restreinte`,FF=()=>`Restricted`,IF=((e={},t={})=>(t.locale??q())===`fr`?PF(e):FF(e)),LF=()=>`Défaut`,RF=()=>`Default`,zF=((e={},t={})=>(t.locale??q())===`fr`?LF(e):RF(e)),BF=()=>`Restreindre à un groupe…`,VF=()=>`Restrict to a group…`,HF=((e={},t={})=>(t.locale??q())===`fr`?BF(e):VF(e)),UF=()=>`Aucun groupe à associer.`,WF=()=>`No group to attach.`,GF=((e={},t={})=>(t.locale??q())===`fr`?UF(e):WF(e)),KF=e=>`Retirer le groupe ${e?.group}`,qF=e=>`Remove group ${e?.group}`,JF=((e,t={})=>(t.locale??q())===`fr`?KF(e):qF(e)),YF=()=>`Importer une charte`,XF=()=>`Import a chart`,ZF=((e={},t={})=>(t.locale??q())===`fr`?YF(e):XF(e)),QF=()=>`Collez le JSON d’une charte (ou choisissez un fichier .json) pour créer votre charte personnelle. Les couleurs doivent être au format oklch ; les valeurs sont validées et nettoyées côté serveur.`,$F=()=>`Paste a chart's JSON (or pick a .json file) to create your personal chart. Colors must be in oklch format; values are validated and sanitized server-side.`,eI=((e={},t={})=>(t.locale??q())===`fr`?QF(e):$F(e)),tI=()=>`Nom de la charte`,nI=()=>`Chart name`,rI=((e={},t={})=>(t.locale??q())===`fr`?tI(e):nI(e)),iI=()=>`Ma charte`,aI=()=>`My chart`,oI=((e={},t={})=>(t.locale??q())===`fr`?iI(e):aI(e)),sI=()=>`JSON des tokens`,cI=()=>`Tokens JSON`,lI=((e={},t={})=>(t.locale??q())===`fr`?sI(e):cI(e)),uI=()=>`Collez ici le JSON des tokens (colors.light / colors.dark en oklch, radius, fontSans, fontMono)…`,dI=()=>`Paste the tokens JSON here (colors.light / colors.dark in oklch, radius, fontSans, fontMono)…`,fI=((e={},t={})=>(t.locale??q())===`fr`?uI(e):dI(e)),pI=()=>`Charger un fichier .json`,mI=()=>`Load a .json file`,hI=((e={},t={})=>(t.locale??q())===`fr`?pI(e):mI(e)),gI=()=>`Importer`,_I=()=>`Import`,vI=((e={},t={})=>(t.locale??q())===`fr`?gI(e):_I(e)),yI=()=>`JSON invalide : impossible d’analyser le contenu.`,bI=()=>`Invalid JSON: could not parse the content.`,xI=((e={},t={})=>(t.locale??q())===`fr`?yI(e):bI(e)),SI=()=>`Charte importée.`,CI=()=>`Chart imported.`,wI=((e={},t={})=>(t.locale??q())===`fr`?SI(e):CI(e)),TI=()=>`Indiquez un nom de charte.`,EI=()=>`Please provide a chart name.`,DI=((e={},t={})=>(t.locale??q())===`fr`?TI(e):EI(e)),OI=()=>`Mes chartes`,kI=()=>`My charts`,AI=((e={},t={})=>(t.locale??q())===`fr`?OI(e):kI(e)),jI=()=>`Les chartes que vous avez importées. Vous pouvez les renommer, modifier leurs tokens, les associer à vos groupes ou les supprimer.`,MI=()=>`The charts you have imported. You can rename them, edit their tokens, associate them with your groups, or delete them.`,NI=((e={},t={})=>(t.locale??q())===`fr`?jI(e):MI(e)),PI=()=>`Vous n’avez pas encore importé de charte.`,FI=()=>`You haven't imported any chart yet.`,II=((e={},t={})=>(t.locale??q())===`fr`?PI(e):FI(e)),LI=()=>`Modifier`,RI=()=>`Edit`,zI=((e={},t={})=>(t.locale??q())===`fr`?LI(e):RI(e)),BI=()=>`Supprimer`,VI=()=>`Delete`,HI=((e={},t={})=>(t.locale??q())===`fr`?BI(e):VI(e)),UI=()=>`Enregistrer`,WI=()=>`Save`,GI=((e={},t={})=>(t.locale??q())===`fr`?UI(e):WI(e)),KI=()=>`Annuler`,qI=()=>`Cancel`,JI=((e={},t={})=>(t.locale??q())===`fr`?KI(e):qI(e)),YI=()=>`Nom`,XI=()=>`Name`,ZI=((e={},t={})=>(t.locale??q())===`fr`?YI(e):XI(e)),QI=()=>`Tokens (JSON)`,$I=()=>`Tokens (JSON)`,eL=((e={},t={})=>(t.locale??q())===`fr`?QI(e):$I(e)),tL=()=>`Groupes associés`,nL=()=>`Associated groups`,rL=((e={},t={})=>(t.locale??q())===`fr`?tL(e):nL(e)),iL=()=>`Vous n’êtes membre d’aucun groupe.`,aL=()=>`You are not a member of any group.`,oL=((e={},t={})=>(t.locale??q())===`fr`?iL(e):aL(e)),sL=()=>`Associer à un groupe…`,cL=()=>`Associate with a group…`,lL=((e={},t={})=>(t.locale??q())===`fr`?sL(e):cL(e)),uL=e=>`Retirer le groupe ${e?.group}`,dL=e=>`Remove group ${e?.group}`,fL=((e,t={})=>(t.locale??q())===`fr`?uL(e):dL(e)),pL=()=>`Supprimer définitivement cette charte ?`,mL=()=>`Permanently delete this chart?`,hL=((e={},t={})=>(t.locale??q())===`fr`?pL(e):mL(e)),gL=()=>`Chartes personnalisées`,_L=()=>`Custom charts`,vL=((e={},t={})=>(t.locale??q())===`fr`?gL(e):_L(e)),yL=()=>`Gérez les chartes importées par les utilisateurs : promouvoir en commune (offerte à tous) ou supprimer.`,bL=()=>`Manage charts imported by users: promote to common (offered to everyone) or delete.`,xL=((e={},t={})=>(t.locale??q())===`fr`?yL(e):bL(e)),SL=e=>`Propriétaire : ${e?.owner}`,CL=e=>`Owner: ${e?.owner}`,wL=((e,t={})=>(t.locale??q())===`fr`?SL(e):CL(e)),TL=()=>`Personnelle`,EL=()=>`Personal`,DL=((e={},t={})=>(t.locale??q())===`fr`?TL(e):EL(e)),OL=()=>`Commune`,kL=()=>`Common`,AL=((e={},t={})=>(t.locale??q())===`fr`?OL(e):kL(e)),jL=()=>`Promouvoir en commune`,ML=()=>`Promote to common`,NL=((e={},t={})=>(t.locale??q())===`fr`?jL(e):ML(e)),PL=()=>`Supprimer`,FL=()=>`Delete`,IL=((e={},t={})=>(t.locale??q())===`fr`?PL(e):FL(e)),LL=()=>`Aucune charte personnalisée pour le moment.`,RL=()=>`No custom chart yet.`,zL=((e={},t={})=>(t.locale??q())===`fr`?LL(e):RL(e)),BL=()=>`Messages`,VL=()=>`Messages`,HL=((e={},t={})=>(t.locale??q())===`fr`?BL(e):VL(e)),UL=()=>`Composeur`,WL=()=>`Composer`,GL=((e={},t={})=>(t.locale??q())===`fr`?UL(e):WL(e)),KL=()=>`Barre latérale`,qL=()=>`Sidebar`,JL=((e={},t={})=>(t.locale??q())===`fr`?KL(e):qL(e)),YL=()=>`Autre`,XL=()=>`Other`,ZL=((e={},t={})=>(t.locale??q())===`fr`?YL(e):XL(e)),QL=()=>`Vue source des messages`,$L=()=>`Message source view`,eR=((e={},t={})=>(t.locale??q())===`fr`?QL(e):$L(e)),tR=()=>`Le bouton </> qui montre le texte brut exact d’un message.`,nR=()=>`The </> button that shows a message’s exact raw text.`,rR=((e={},t={})=>(t.locale??q())===`fr`?tR(e):nR(e)),iR=()=>`Signaler un problème`,aR=()=>`Report a problem`,oR=((e={},t={})=>(t.locale??q())===`fr`?iR(e):aR(e)),sR=()=>`Le drapeau qui envoie un signalement (feedback) sur un message.`,cR=()=>`The flag that sends feedback about a message.`,lR=((e={},t={})=>(t.locale??q())===`fr`?sR(e):cR(e)),uR=()=>`Copier les réponses de l’IA`,dR=()=>`Copy AI replies`,fR=((e={},t={})=>(t.locale??q())===`fr`?uR(e):dR(e)),pR=()=>`Copier vos messages`,mR=()=>`Copy your messages`,hR=((e={},t={})=>(t.locale??q())===`fr`?pR(e):mR(e)),gR=()=>`Supprimer un message`,_R=()=>`Delete a message`,vR=((e={},t={})=>(t.locale??q())===`fr`?gR(e):_R(e)),yR=()=>`Cartes d’outils`,bR=()=>`Tool cards`,xR=((e={},t={})=>(t.locale??q())===`fr`?yR(e):bR(e)),SR=()=>`Déplier par défaut le détail des outils exécutés par l’agent (le résumé d’activité reste toujours visible).`,CR=()=>`Expand the details of the agent’s tool runs by default (the activity summary always stays visible).`,wR=((e={},t={})=>(t.locale??q())===`fr`?SR(e):CR(e)),TR=()=>`Saisie vocale (micro)`,ER=()=>`Voice input (mic)`,DR=((e={},t={})=>(t.locale??q())===`fr`?TR(e):ER(e)),OR=()=>`Le bouton micro dans le composeur.`,kR=()=>`The mic button in the composer.`,AR=((e={},t={})=>(t.locale??q())===`fr`?OR(e):kR(e)),jR=()=>`Âge des conversations`,MR=()=>`Conversation age`,NR=((e={},t={})=>(t.locale??q())===`fr`?jR(e):MR(e)),PR=()=>`Afficher l’ancienneté de chaque conversation (ex. « 3j », « 2sem ») dans la liste à gauche.`,FR=()=>`Show each conversation’s age (e.g. “3d”, “2w”) in the left list.`,IR=((e={},t={})=>(t.locale??q())===`fr`?PR(e):FR(e)),LR=()=>`Bridge des conversations`,RR=()=>`Conversation bridge`,zR=((e={},t={})=>(t.locale??q())===`fr`?LR(e):RR(e)),BR=()=>`Marquer le bridge (OpenClaw / Hermes) de chaque conversation dans la liste à gauche. Apparaît uniquement si vos conversations utilisent plusieurs bridges.`,VR=()=>`Tag each conversation’s bridge (OpenClaw / Hermes) in the left list. Shown only if your conversations use more than one bridge.`,HR=((e={},t={})=>(t.locale??q())===`fr`?BR(e):VR(e)),UR=()=>`Filtrer les préférences…`,WR=()=>`Filter preferences…`,GR=((e={},t={})=>(t.locale??q())===`fr`?UR(e):WR(e)),KR=()=>`Aucune préférence ne correspond.`,qR=()=>`No preference matches.`,JR=((e={},t={})=>(t.locale??q())===`fr`?KR(e):qR(e)),YR=()=>`Non activé`,XR=()=>`Not enabled`,ZR=((e={},t={})=>(t.locale??q())===`fr`?YR(e):XR(e)),QR=()=>`défaut`,$R=()=>`default`,ez=((e={},t={})=>(t.locale??q())===`fr`?QR(e):$R(e)),tz=()=>`Réinitialiser`,nz=()=>`Reset`,rz=((e={},t={})=>(t.locale??q())===`fr`?tz(e):nz(e)),iz=()=>`Gérer les défauts et verrous`,az=()=>`Manage defaults and locks`,oz=((e={},t={})=>(t.locale??q())===`fr`?iz(e):az(e)),sz=()=>`Défaut admin`,cz=()=>`Admin default`,lz=((e={},t={})=>(t.locale??q())===`fr`?sz(e):cz(e)),uz=()=>`Fonctionnalité activée (système)`,dz=()=>`Feature enabled (system)`,fz=((e={},t={})=>(t.locale??q())===`fr`?uz(e):dz(e)),pz=()=>`Configurez l’interface : activez les fonctionnalités système et définissez les valeurs par défaut héritées par les utilisateurs (chacun peut ensuite les redéfinir dans ses propres préférences).`,mz=()=>`Configure the interface: enable system features and set the defaults users inherit (each can then override them in their own preferences).`,hz=((e={},t={})=>(t.locale??q())===`fr`?pz(e):mz(e)),gz=()=>`Une fonctionnalité non activée ici ne peut pas être activée par les utilisateurs (option grisée).`,_z=()=>`A feature not enabled here cannot be turned on by users (greyed out).`,vz=((e={},t={})=>(t.locale??q())===`fr`?gz(e):_z(e)),yz=()=>`Active le pipeline vocal. Tant que c’est désactivé, l’option reste grisée et non activable par les utilisateurs.`,bz=()=>`Enables the voice pipeline. While off, the option stays greyed and users can’t turn it on.`,xz=((e={},t={})=>(t.locale??q())===`fr`?yz(e):bz(e)),Sz=()=>`« Hérité » = la valeur intégrée par défaut de l’application.`,Cz=()=>`“Inherited” = the app’s built-in default value.`,wz=((e={},t={})=>(t.locale??q())===`fr`?Sz(e):Cz(e)),Tz=()=>`Activé`,Ez=()=>`On`,Dz=((e={},t={})=>(t.locale??q())===`fr`?Tz(e):Ez(e)),Oz=()=>`Désactivé`,kz=()=>`Off`,Az=((e={},t={})=>(t.locale??q())===`fr`?Oz(e):kz(e)),jz=()=>`Hérité`,Mz=()=>`Inherited`,Nz=((e={},t={})=>(t.locale??q())===`fr`?jz(e):Mz(e)),Pz=()=>`Comptes de service pour les agents OpenClaw (auth par clé API). Le texte en clair d’une clé n’est affiché qu’une seule fois à sa création — il n’est jamais stocké ni récupérable ensuite.`,Fz=()=>`Service accounts for OpenClaw agents (API key auth). A key's plaintext is shown only once at creation — it is never stored nor retrievable afterwards.`,Iz=((e={},t={})=>(t.locale??q())===`fr`?Pz(e):Fz(e)),Lz=()=>`Rechercher un compte`,Rz=()=>`Search an account`,zz=((e={},t={})=>(t.locale??q())===`fr`?Lz(e):Rz(e)),Bz=()=>`Rôle`,Vz=()=>`Role`,Hz=((e={},t={})=>(t.locale??q())===`fr`?Bz(e):Vz(e)),Uz=()=>`Tous les rôles`,Wz=()=>`All roles`,Gz=((e={},t={})=>(t.locale??q())===`fr`?Uz(e):Wz(e)),Kz=()=>`Tous les statuts`,qz=()=>`All statuses`,Jz=((e={},t={})=>(t.locale??q())===`fr`?Kz(e):qz(e)),Yz=()=>`actif`,Xz=()=>`active`,Zz=((e={},t={})=>(t.locale??q())===`fr`?Yz(e):Xz(e)),Qz=()=>`désactivé`,$z=()=>`disabled`,eB=((e={},t={})=>(t.locale??q())===`fr`?Qz(e):$z(e)),tB=()=>`Comptes de service`,nB=()=>`Service accounts`,rB=((e={},t={})=>(t.locale??q())===`fr`?tB(e):nB(e)),iB=()=>`Ajouter un compte`,aB=()=>`Add an account`,oB=((e={},t={})=>(t.locale??q())===`fr`?iB(e):aB(e)),sB=()=>`Aucun compte de service.`,cB=()=>`No service account.`,lB=((e={},t={})=>(t.locale??q())===`fr`?sB(e):cB(e)),uB=()=>`Générer une clé API`,dB=()=>`Generate an API key`,fB=((e={},t={})=>(t.locale??q())===`fr`?uB(e):dB(e)),pB=()=>`Masquer les clés`,mB=()=>`Hide keys`,hB=((e={},t={})=>(t.locale??q())===`fr`?pB(e):mB(e)),gB=()=>`Afficher les clés`,_B=()=>`Show keys`,vB=((e={},t={})=>(t.locale??q())===`fr`?gB(e):_B(e)),yB=()=>`Modifier`,bB=()=>`Edit`,xB=((e={},t={})=>(t.locale??q())===`fr`?yB(e):bB(e)),SB=()=>`Supprimer le compte`,CB=()=>`Delete account`,wB=((e={},t={})=>(t.locale??q())===`fr`?SB(e):CB(e)),TB=()=>`Replier`,EB=()=>`Collapse`,DB=((e={},t={})=>(t.locale??q())===`fr`?TB(e):EB(e)),OB=()=>`Déplier`,kB=()=>`Expand`,AB=((e={},t={})=>(t.locale??q())===`fr`?OB(e):kB(e)),jB=()=>`Nom`,MB=()=>`Name`,NB=((e={},t={})=>(t.locale??q())===`fr`?jB(e):MB(e)),PB=()=>`Rôle`,FB=()=>`Role`,IB=((e={},t={})=>(t.locale??q())===`fr`?PB(e):FB(e)),LB=()=>`Statut`,RB=()=>`Status`,zB=((e={},t={})=>(t.locale??q())===`fr`?LB(e):RB(e)),BB=()=>`Expiration de la prochaine clé`,VB=()=>`Next key expiry`,HB=((e={},t={})=>(t.locale??q())===`fr`?BB(e):VB(e)),UB=()=>`Clés`,WB=()=>`Keys`,GB=((e={},t={})=>(t.locale??q())===`fr`?UB(e):WB(e)),KB=()=>`génération…`,qB=()=>`generating…`,JB=((e={},t={})=>(t.locale??q())===`fr`?KB(e):qB(e)),YB=e=>`${e?.count} active(s)`,XB=e=>`${e?.count} active`,ZB=((e,t={})=>(t.locale??q())===`fr`?YB(e):XB(e)),QB=()=>`Modifier le compte de service`,$B=()=>`Edit service account`,eV=((e={},t={})=>(t.locale??q())===`fr`?QB(e):$B(e)),tV=()=>`Modifier le nom, le rôle et la description.`,nV=()=>`Update the name, role and description.`,rV=((e={},t={})=>(t.locale??q())===`fr`?tV(e):nV(e)),iV=()=>`Enregistrer`,aV=()=>`Save`,oV=((e={},t={})=>(t.locale??q())===`fr`?iV(e):aV(e)),sV=()=>`Nouveau compte de service`,cV=()=>`New service account`,lV=((e={},t={})=>(t.locale??q())===`fr`?sV(e):cV(e)),uV=()=>`Principal authentifié par clé API (jamais un humain).`,dV=()=>`Principal authenticated by API key (never a human).`,fV=((e={},t={})=>(t.locale??q())===`fr`?uV(e):dV(e)),pV=()=>`Ajouter`,mV=()=>`Add`,hV=((e={},t={})=>(t.locale??q())===`fr`?pV(e):mV(e)),gV=()=>`Nom`,_V=()=>`Name`,vV=((e={},t={})=>(t.locale??q())===`fr`?gV(e):_V(e)),yV=()=>`Rôle`,bV=()=>`Role`,xV=((e={},t={})=>(t.locale??q())===`fr`?yV(e):bV(e)),SV=()=>`Choisir un rôle`,CV=()=>`Choose a role`,wV=((e={},t={})=>(t.locale??q())===`fr`?SV(e):CV(e)),TV=()=>`Description (optionnel)`,EV=()=>`Description (optional)`,DV=((e={},t={})=>(t.locale??q())===`fr`?TV(e):EV(e)),OV=()=>`Échec de la création du compte`,kV=()=>`Failed to create the account`,AV=((e={},t={})=>(t.locale??q())===`fr`?OV(e):kV(e)),jV=()=>`Échec de la modification du compte`,MV=()=>`Failed to update the account`,NV=((e={},t={})=>(t.locale??q())===`fr`?jV(e):MV(e)),PV=()=>`Compte de service mis à jour.`,FV=()=>`Service account updated.`,IV=((e={},t={})=>(t.locale??q())===`fr`?PV(e):FV(e)),LV=()=>`Échec de la génération de la clé`,RV=()=>`Failed to generate the key`,zV=((e={},t={})=>(t.locale??q())===`fr`?LV(e):RV(e)),BV=()=>`Supprimer ce compte de service ?`,VV=()=>`Delete this service account?`,HV=((e={},t={})=>(t.locale??q())===`fr`?BV(e):VV(e)),UV=()=>`Le compte`,WV=()=>`The account`,GV=((e={},t={})=>(t.locale??q())===`fr`?UV(e):WV(e)),KV=()=>`et`,qV=()=>`and`,JV=((e={},t={})=>(t.locale??q())===`fr`?KV(e):qV(e)),YV=()=>`toutes ses clés API`,XV=()=>`all its API keys`,ZV=((e={},t={})=>(t.locale??q())===`fr`?YV(e):XV(e)),QV=()=>`seront supprimés définitivement. Cette action est irréversible. Tapez le nom du compte pour confirmer.`,$V=()=>`will be permanently deleted. This action is irreversible. Type the account name to confirm.`,eH=((e={},t={})=>(t.locale??q())===`fr`?QV(e):$V(e)),tH=()=>`Supprimer`,nH=()=>`Delete`,rH=((e={},t={})=>(t.locale??q())===`fr`?tH(e):nH(e)),iH=()=>`Compte de service supprimé`,aH=()=>`Service account deleted`,oH=((e={},t={})=>(t.locale??q())===`fr`?iH(e):aH(e)),sH=()=>`Échec de la suppression du compte`,cH=()=>`Failed to delete the account`,lH=((e={},t={})=>(t.locale??q())===`fr`?sH(e):cH(e)),uH=()=>`Révoquer cette clé API ?`,dH=()=>`Revoke this API key?`,fH=((e={},t={})=>(t.locale??q())===`fr`?uH(e):dH(e)),pH=()=>`La clé`,mH=()=>`The key`,hH=((e={},t={})=>(t.locale??q())===`fr`?pH(e):mH(e)),gH=()=>`sera désactivée immédiatement et ne pourra plus authentifier de requêtes. Cette action est irréversible.`,_H=()=>`will be disabled immediately and will no longer be able to authenticate requests. This action is irreversible.`,vH=((e={},t={})=>(t.locale??q())===`fr`?gH(e):_H(e)),yH=()=>`Révoquer`,bH=()=>`Revoke`,xH=((e={},t={})=>(t.locale??q())===`fr`?yH(e):bH(e)),SH=()=>`Échec de la révocation`,CH=()=>`Failed to revoke`,wH=((e={},t={})=>(t.locale??q())===`fr`?SH(e):CH(e)),TH=()=>`Clés de`,EH=()=>`Keys of`,DH=((e={},t={})=>(t.locale??q())===`fr`?TH(e):EH(e)),OH=()=>`Aucune clé pour ce compte.`,kH=()=>`No key for this account.`,AH=((e={},t={})=>(t.locale??q())===`fr`?OH(e):kH(e)),jH=()=>`Clé`,MH=()=>`Key`,NH=((e={},t={})=>(t.locale??q())===`fr`?jH(e):MH(e)),PH=()=>`Rôle`,FH=()=>`Role`,IH=((e={},t={})=>(t.locale??q())===`fr`?PH(e):FH(e)),LH=()=>`Créée`,RH=()=>`Created`,zH=((e={},t={})=>(t.locale??q())===`fr`?LH(e):RH(e)),BH=()=>`Dernier usage`,VH=()=>`Last used`,HH=((e={},t={})=>(t.locale??q())===`fr`?BH(e):VH(e)),UH=()=>`Expiration`,WH=()=>`Expiry`,GH=((e={},t={})=>(t.locale??q())===`fr`?UH(e):WH(e)),KH=()=>`Statut`,qH=()=>`Status`,JH=((e={},t={})=>(t.locale??q())===`fr`?KH(e):qH(e)),YH=()=>`Révocation…`,XH=()=>`Revoking…`,ZH=((e={},t={})=>(t.locale??q())===`fr`?YH(e):XH(e)),QH=()=>`Révoquer`,$H=()=>`Revoke`,eU=((e={},t={})=>(t.locale??q())===`fr`?QH(e):$H(e)),tU=()=>`Clé API créée`,nU=()=>`API key created`,rU=((e={},t={})=>(t.locale??q())===`fr`?tU(e):nU(e)),iU=e=>`Pour le compte « ${e?.name} ». Copiez-la maintenant.`,aU=e=>`For the account « ${e?.name} ». Copy it now.`,oU=((e,t={})=>(t.locale??q())===`fr`?iU(e):aU(e)),sU=()=>`Stockez cette clé en lieu sûr. Vous ne la reverrez plus jamais. Pour la remplacer, il faudra la révoquer et en générer une nouvelle.`,cU=()=>`Store this key in a safe place. You will never see it again. To replace it, you will have to revoke it and generate a new one.`,lU=((e={},t={})=>(t.locale??q())===`fr`?sU(e):cU(e)),uU=()=>`Copier la clé`,dU=()=>`Copy the key`,fU=((e={},t={})=>(t.locale??q())===`fr`?uU(e):dU(e)),pU=()=>`Copié`,mU=()=>`Copied`,hU=((e={},t={})=>(t.locale??q())===`fr`?pU(e):mU(e)),gU=()=>`Copier`,_U=()=>`Copy`,vU=((e={},t={})=>(t.locale??q())===`fr`?gU(e):_U(e)),yU=()=>`J’ai copié la clé`,bU=()=>`I have copied the key`,xU=((e={},t={})=>(t.locale??q())===`fr`?yU(e):bU(e)),SU=()=>`Jamais`,CU=()=>`Never`,wU=((e={},t={})=>(t.locale??q())===`fr`?SU(e):CU(e)),TU=()=>`30 jours`,EU=()=>`30 days`,DU=((e={},t={})=>(t.locale??q())===`fr`?TU(e):EU(e)),OU=()=>`90 jours`,kU=()=>`90 days`,AU=((e={},t={})=>(t.locale??q())===`fr`?OU(e):kU(e)),jU=()=>`Jamais`,MU=()=>`Never`,NU=((e={},t={})=>(t.locale??q())===`fr`?jU(e):MU(e)),PU=()=>`révoquée`,FU=()=>`revoked`,IU=((e={},t={})=>(t.locale??q())===`fr`?PU(e):FU(e)),LU=()=>`expirée`,RU=()=>`expired`,zU=((e={},t={})=>(t.locale??q())===`fr`?LU(e):RU(e)),BU=()=>`active`,VU=()=>`active`,HU=((e={},t={})=>(t.locale??q())===`fr`?BU(e):VU(e)),UU=()=>`Sélectionnez ou créez une conversation pour commencer.`,WU=()=>`Select or create a chat to begin.`,GU=((e={},t={})=>(t.locale??q())===`fr`?UU(e):WU(e)),KU=()=>`Conversation introuvable`,qU=()=>`Conversation not found`,JU=((e={},t={})=>(t.locale??q())===`fr`?KU(e):qU(e)),YU=()=>`Ce lien ne correspond à aucune conversation. Elle a peut-être été supprimée, ou l’adresse est incomplète.`,XU=()=>`This link does not match any conversation. It may have been deleted, or the address is incomplete.`,ZU=((e={},t={})=>(t.locale??q())===`fr`?YU(e):XU(e)),QU=()=>`Nouvelle conversation`,$U=()=>`New conversation`,eW=((e={},t={})=>(t.locale??q())===`fr`?QU(e):$U(e)),tW=()=>`Derniers messages`,nW=()=>`Latest messages`,rW=((e={},t={})=>(t.locale??q())===`fr`?tW(e):nW(e)),iW=()=>`Le service de chat est momentanément indisponible. L’envoi de message est suspendu — réessayez dans un instant. Si cela persiste, contactez votre administrateur.`,aW=()=>`The chat service is temporarily unavailable. Sending messages is suspended — try again in a moment. If this persists, contact your administrator.`,oW=((e={},t={})=>(t.locale??q())===`fr`?iW(e):aW(e)),sW=()=>`Réponse reçue.`,cW=()=>`Reply received.`,lW=((e={},t={})=>(t.locale??q())===`fr`?sW(e):cW(e)),uW=()=>`Comment puis-je aider ?`,dW=()=>`How can I help?`,fW=((e={},t={})=>(t.locale??q())===`fr`?uW(e):dW(e)),pW=()=>`Conversation`,mW=()=>`Conversation`,hW=((e={},t={})=>(t.locale??q())===`fr`?pW(e):mW(e)),gW=e=>`Agent de cette conversation : ${e?.name}`,_W=e=>`Agent for this conversation: ${e?.name}`,vW=((e,t={})=>(t.locale??q())===`fr`?gW(e):_W(e)),yW=()=>` (agent par défaut)`,bW=()=>` (default agent)`,xW=((e={},t={})=>(t.locale??q())===`fr`?yW(e):bW(e)),SW=()=>` — cet agent n’existe plus sur la gateway`,CW=()=>` — this agent no longer exists on the gateway`,wW=((e={},t={})=>(t.locale??q())===`fr`?SW(e):CW(e)),TW=()=>` — état non confirmé (gateway injoignable)`,EW=()=>` — state not confirmed (gateway unreachable)`,DW=((e={},t={})=>(t.locale??q())===`fr`?TW(e):EW(e)),OW=()=>`Modèle`,kW=()=>`Model`,AW=((e={},t={})=>(t.locale??q())===`fr`?OW(e):kW(e)),jW=e=>`Modèle · ${e?.provider}`,MW=e=>`Model · ${e?.provider}`,NW=((e,t={})=>(t.locale??q())===`fr`?jW(e):MW(e)),PW=()=>`Niveau de réflexion hérité de l’agent`,FW=()=>`Thinking level inherited from the agent`,IW=((e={},t={})=>(t.locale??q())===`fr`?PW(e):FW(e)),LW=()=>`Niveau de réflexion (spécifique à ce chat)`,RW=()=>`Thinking level (specific to this chat)`,zW=((e={},t={})=>(t.locale??q())===`fr`?LW(e):RW(e)),BW=()=>`Réflexion`,VW=()=>`Thinking`,HW=((e={},t={})=>(t.locale??q())===`fr`?BW(e):VW(e)),UW=()=>`héritée`,WW=()=>`inherited`,GW=((e={},t={})=>(t.locale??q())===`fr`?UW(e):WW(e)),KW=e=>`Contexte utilisé : ${e?.pct}% (${e?.used} / ${e?.total} tokens)`,qW=e=>`Context used: ${e?.pct}% (${e?.used} / ${e?.total} tokens)`,JW=((e,t={})=>(t.locale??q())===`fr`?KW(e):qW(e)),YW=()=>`Exporter la conversation`,XW=()=>`Export the conversation`,ZW=((e={},t={})=>(t.locale??q())===`fr`?YW(e):XW(e)),QW=()=>`Exporter`,$W=()=>`Export`,eG=((e={},t={})=>(t.locale??q())===`fr`?QW(e):$W(e)),tG=()=>`Markdown (.md)`,nG=()=>`Markdown (.md)`,rG=((e={},t={})=>(t.locale??q())===`fr`?tG(e):nG(e)),iG=()=>`JSON (.json)`,aG=()=>`JSON (.json)`,oG=((e={},t={})=>(t.locale??q())===`fr`?iG(e):aG(e)),sG=()=>`Réglages avancés (réflexion, modèle)`,cG=()=>`Advanced settings (thinking, model)`,lG=((e={},t={})=>(t.locale??q())===`fr`?sG(e):cG(e)),uG=()=>`Avancé`,dG=()=>`Advanced`,fG=((e={},t={})=>(t.locale??q())===`fr`?uG(e):dG(e)),pG=()=>`Supprimer et régénérer cette réponse ?`,mG=()=>`Delete and regenerate this reply?`,hG=((e={},t={})=>(t.locale??q())===`fr`?pG(e):mG(e)),gG=()=>`Cette réponse sera supprimée, puis régénérée à partir de votre dernier message.`,_G=()=>`This reply will be deleted, then regenerated from your last message.`,vG=((e={},t={})=>(t.locale??q())===`fr`?gG(e):_G(e)),yG=()=>`Régénérer`,bG=()=>`Regenerate`,xG=((e={},t={})=>(t.locale??q())===`fr`?yG(e):bG(e)),SG=()=>`Annuler`,CG=()=>`Cancel`,wG=((e={},t={})=>(t.locale??q())===`fr`?SG(e):CG(e)),TG=()=>`Supprimer ce message et les suivants ?`,EG=()=>`Delete this message and the following ones?`,DG=((e={},t={})=>(t.locale??q())===`fr`?TG(e):EG(e)),OG=()=>`Ce message et tous les messages qui le suivent seront supprimés de la conversation. Cette action est irréversible.`,kG=()=>`This message and all messages following it will be deleted from the conversation. This action is irreversible.`,AG=((e={},t={})=>(t.locale??q())===`fr`?OG(e):kG(e)),jG=()=>`Supprimer`,MG=()=>`Delete`,NG=((e={},t={})=>(t.locale??q())===`fr`?jG(e):MG(e)),PG=()=>`Supprimer et régénérer la réponse`,FG=()=>`Delete and regenerate the reply`,IG=((e={},t={})=>(t.locale??q())===`fr`?PG(e):FG(e)),LG=()=>`Supprimer ce message et les suivants`,RG=()=>`Delete this message and the following ones`,zG=((e={},t={})=>(t.locale??q())===`fr`?LG(e):RG(e)),BG=()=>`Supprimer le message`,VG=()=>`Delete the message`,HG=((e={},t={})=>(t.locale??q())===`fr`?BG(e):VG(e)),UG=()=>`La suppression a échoué`,WG=()=>`Delete failed`,GG=((e={},t={})=>(t.locale??q())===`fr`?UG(e):WG(e)),KG=()=>`Sources`,qG=()=>`Sources`,JG=((e={},t={})=>(t.locale??q())===`fr`?KG(e):qG(e)),YG=()=>`1 souvenir`,XG=()=>`1 memory`,ZG=((e={},t={})=>(t.locale??q())===`fr`?YG(e):XG(e)),QG=e=>`${e?.count} souvenirs`,$G=e=>`${e?.count} memories`,eK=((e,t={})=>(t.locale??q())===`fr`?QG(e):$G(e)),tK=()=>`1 document`,nK=()=>`1 document`,rK=((e={},t={})=>(t.locale??q())===`fr`?tK(e):nK(e)),iK=e=>`${e?.count} documents`,aK=e=>`${e?.count} documents`,oK=((e,t={})=>(t.locale??q())===`fr`?iK(e):aK(e)),sK=()=>`Mémoire conversationnelle`,cK=()=>`Conversational memory`,lK=((e={},t={})=>(t.locale??q())===`fr`?sK(e):cK(e)),uK=()=>`Documents`,dK=()=>`Documents`,fK=((e={},t={})=>(t.locale??q())===`fr`?uK(e):dK(e)),pK=e=>`score ${e?.score}`,mK=e=>`score ${e?.score}`,hK=((e,t={})=>(t.locale??q())===`fr`?pK(e):mK(e)),gK=()=>`(sans titre)`,_K=()=>`(untitled)`,vK=((e={},t={})=>(t.locale??q())===`fr`?gK(e):_K(e)),yK=e=>`Source · texte brut exact · ${e?.count} caractère`,bK=e=>`Source · exact raw text · ${e?.count} character`,xK=((e,t={})=>(t.locale??q())===`fr`?yK(e):bK(e)),SK=e=>`Source · texte brut exact · ${e?.count} caractères`,CK=e=>`Source · exact raw text · ${e?.count} characters`,wK=((e,t={})=>(t.locale??q())===`fr`?SK(e):CK(e)),TK=()=>`Copier la source exacte`,EK=()=>`Copy the exact source`,DK=((e={},t={})=>(t.locale??q())===`fr`?TK(e):EK(e)),OK=()=>`(aucun texte)`,kK=()=>`(no text)`,AK=((e={},t={})=>(t.locale??q())===`fr`?OK(e):kK(e)),jK=()=>`Afficher le message rendu`,MK=()=>`Show the rendered message`,NK=((e={},t={})=>(t.locale??q())===`fr`?jK(e):MK(e)),PK=()=>`Afficher la source (texte brut exact)`,FK=()=>`Show the source (exact raw text)`,IK=((e={},t={})=>(t.locale??q())===`fr`?PK(e):FK(e)),LK=()=>`Afficher la source du message`,RK=()=>`Show the message source`,zK=((e={},t={})=>(t.locale??q())===`fr`?LK(e):RK(e)),BK=()=>`Copier le message`,VK=()=>`Copy the message`,HK=((e={},t={})=>(t.locale??q())===`fr`?BK(e):VK(e)),UK=()=>`Copier la réponse`,WK=()=>`Copy the reply`,GK=((e={},t={})=>(t.locale??q())===`fr`?UK(e):WK(e)),KK=()=>`Chat indisponible…`,qK=()=>`Chat unavailable…`,JK=((e={},t={})=>(t.locale??q())===`fr`?KK(e):qK(e)),YK=()=>`Message OpenClaw…`,XK=()=>`Message OpenClaw…`,ZK=((e={},t={})=>(t.locale??q())===`fr`?YK(e):XK(e)),QK=()=>`Joindre un fichier`,$K=()=>`Attach a file`,eq=((e={},t={})=>(t.locale??q())===`fr`?QK(e):$K(e)),tq=()=>`échec`,nq=()=>`failed`,rq=((e={},t={})=>(t.locale??q())===`fr`?tq(e):nq(e)),iq=()=>`Retirer la pièce jointe`,aq=()=>`Remove attachment`,oq=((e={},t={})=>(t.locale??q())===`fr`?iq(e):aq(e)),sq=()=>`Replier par défaut le détail des outils exécutés par OpenClaw`,cq=()=>`Collapse the details of tools run by OpenClaw by default`,lq=((e={},t={})=>(t.locale??q())===`fr`?sq(e):cq(e)),uq=()=>`Déplier par défaut le détail des outils exécutés par OpenClaw`,dq=()=>`Expand the details of tools run by OpenClaw by default`,fq=((e={},t={})=>(t.locale??q())===`fr`?uq(e):dq(e)),pq=()=>`Outils`,mq=()=>`Tools`,hq=((e={},t={})=>(t.locale??q())===`fr`?pq(e):mq(e)),gq=e=>`${e?.count} appel d'outil`,_q=e=>`${e?.count} tool call`,vq=((e,t={})=>(t.locale??q())===`fr`?gq(e):_q(e)),yq=e=>`${e?.count} appels d'outils`,bq=e=>`${e?.count} tool calls`,xq=((e,t={})=>(t.locale??q())===`fr`?yq(e):bq(e)),Sq=()=>`en cours`,Cq=()=>`running`,wq=((e={},t={})=>(t.locale??q())===`fr`?Sq(e):Cq(e)),Tq=()=>`terminé`,Eq=()=>`done`,Dq=((e={},t={})=>(t.locale??q())===`fr`?Tq(e):Eq(e)),Oq=()=>`Afficher le détail des appels d'outils`,kq=()=>`Show tool call details`,Aq=((e={},t={})=>(t.locale??q())===`fr`?Oq(e):kq(e)),jq=()=>`Masquer le détail des appels d'outils`,Mq=()=>`Hide tool call details`,Nq=((e={},t={})=>(t.locale??q())===`fr`?jq(e):Mq(e)),Pq=()=>`Dictée vocale — bientôt disponible`,Fq=()=>`Voice dictation — coming soon`,Iq=((e={},t={})=>(t.locale??q())===`fr`?Pq(e):Fq(e)),Lq=()=>`Dictée vocale (bientôt disponible)`,Rq=()=>`Voice dictation (coming soon)`,zq=((e={},t={})=>(t.locale??q())===`fr`?Lq(e):Rq(e)),Bq=()=>`Envoi indisponible (service de chat hors ligne)`,Vq=()=>`Sending unavailable (chat service offline)`,Hq=((e={},t={})=>(t.locale??q())===`fr`?Bq(e):Vq(e)),Uq=()=>`Envoyer`,Wq=()=>`Send`,Gq=((e={},t={})=>(t.locale??q())===`fr`?Uq(e):Wq(e)),Kq=()=>`Réponse en cours…`,qq=()=>`Response in progress…`,Jq=((e={},t={})=>(t.locale??q())===`fr`?Kq(e):qq(e)),Yq=()=>`Chargement…`,Xq=()=>`Loading…`,Zq=((e={},t={})=>(t.locale??q())===`fr`?Yq(e):Xq(e)),Qq=()=>`Configuration des intégrations.`,$q=()=>`Integrations configuration.`,eJ=((e={},t={})=>(t.locale??q())===`fr`?Qq(e):$q(e)),tJ=()=>`Aucune clé API ici`,nJ=()=>`No API key here`,rJ=((e={},t={})=>(t.locale??q())===`fr`?tJ(e):nJ(e)),iJ=()=>`— elles vivent dans l'environnement du déploiement ; un champ vide retombe sur la variable d'environnement puis le défaut. L'indicateur « configuré » reflète la présence de la clé côté serveur.`,aJ=()=>`— they live in the deployment environment; an empty field falls back to the environment variable then the default. The "configured" indicator reflects the presence of the key on the server side.`,oJ=((e={},t={})=>(t.locale??q())===`fr`?iJ(e):aJ(e)),sJ=()=>`actif`,cJ=()=>`active`,lJ=((e={},t={})=>(t.locale??q())===`fr`?sJ(e):cJ(e)),uJ=()=>`en pause`,dJ=()=>`paused`,fJ=((e={},t={})=>(t.locale??q())===`fr`?uJ(e):dJ(e)),pJ=()=>`clé manquante (env)`,mJ=()=>`key missing (env)`,hJ=((e={},t={})=>(t.locale??q())===`fr`?pJ(e):mJ(e)),gJ=()=>`appliqué par le bridge (à venir)`,_J=()=>`applied by the bridge (coming soon)`,vJ=((e={},t={})=>(t.locale??q())===`fr`?gJ(e):_J(e)),yJ=()=>`Export des traces. Clés : LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY (env).`,bJ=()=>`Trace export. Keys: LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY (env).`,xJ=((e={},t={})=>(t.locale??q())===`fr`?yJ(e):bJ(e)),SJ=()=>`Export des traces. Clé : OPIK_API_KEY (env).`,CJ=()=>`Trace export. Key: OPIK_API_KEY (env).`,wJ=((e={},t={})=>(t.locale??q())===`fr`?SJ(e):CJ(e)),TJ=()=>`Host`,EJ=()=>`Host`,DJ=((e={},t={})=>(t.locale??q())===`fr`?TJ(e):EJ(e)),OJ=()=>`Base URL`,kJ=()=>`Base URL`,AJ=((e={},t={})=>(t.locale??q())===`fr`?OJ(e):kJ(e)),jJ=()=>`Workspace`,MJ=()=>`Workspace`,NJ=((e={},t={})=>(t.locale??q())===`fr`?jJ(e):MJ(e)),PJ=()=>`(défaut serveur)`,FJ=()=>`(server default)`,IJ=((e={},t={})=>(t.locale??q())===`fr`?PJ(e):FJ(e)),LJ=()=>`Activé (expédition des traces)`,RJ=()=>`Enabled (trace shipping)`,zJ=((e={},t={})=>(t.locale??q())===`fr`?LJ(e):RJ(e)),BJ=()=>`Synthèse vocale (TTS)`,VJ=()=>`Text-to-speech (TTS)`,HJ=((e={},t={})=>(t.locale??q())===`fr`?BJ(e):VJ(e)),UJ=()=>`Lecture audio des réponses. Clé du provider via env (ex. OPENAI_API_KEY, ELEVENLABS_API_KEY).`,WJ=()=>`Audio playback of replies. Provider key via env (e.g. OPENAI_API_KEY, ELEVENLABS_API_KEY).`,GJ=((e={},t={})=>(t.locale??q())===`fr`?UJ(e):WJ(e)),KJ=()=>`Mode auto`,qJ=()=>`Auto mode`,JJ=((e={},t={})=>(t.locale??q())===`fr`?KJ(e):qJ(e)),YJ=()=>`Désactivé`,XJ=()=>`Disabled`,ZJ=((e={},t={})=>(t.locale??q())===`fr`?YJ(e):XJ(e)),QJ=()=>`Toujours`,$J=()=>`Always`,eY=((e={},t={})=>(t.locale??q())===`fr`?QJ(e):$J(e)),tY=()=>`Après un message vocal`,nY=()=>`After a voice message`,rY=((e={},t={})=>(t.locale??q())===`fr`?tY(e):nY(e)),iY=()=>`Sur directive [[tts:…]]`,aY=()=>`On [[tts:…]] directive`,oY=((e={},t={})=>(t.locale??q())===`fr`?iY(e):aY(e)),sY=()=>`Provider`,cY=()=>`Provider`,lY=((e={},t={})=>(t.locale??q())===`fr`?sY(e):cY(e)),uY=()=>`Microsoft (sans clé)`,dY=()=>`Microsoft (no key)`,fY=((e={},t={})=>(t.locale??q())===`fr`?uY(e):dY(e)),pY=()=>`Modèle`,mY=()=>`Model`,hY=((e={},t={})=>(t.locale??q())===`fr`?pY(e):mY(e)),gY=()=>`Voix`,_Y=()=>`Voice`,vY=((e={},t={})=>(t.locale??q())===`fr`?gY(e):_Y(e)),yY=()=>`speakerVoiceId / nom de voix`,bY=()=>`speakerVoiceId / voice name`,xY=((e={},t={})=>(t.locale??q())===`fr`?yY(e):bY(e)),SY=()=>`Mode conversation (Talk / STS)`,CY=()=>`Conversation mode (Talk / STS)`,wY=((e={},t={})=>(t.locale??q())===`fr`?SY(e):CY(e)),TY=()=>`OpenAI realtime : OPENAI_API_KEY présent (env). Le navigateur recevra un jeton éphémère minté côté serveur — jamais la clé brute.`,EY=()=>`OpenAI realtime: OPENAI_API_KEY present (env). The browser will receive an ephemeral token minted server-side — never the raw key.`,DY=((e={},t={})=>(t.locale??q())===`fr`?TY(e):EY(e)),OY=()=>`OpenAI realtime : OPENAI_API_KEY ABSENT (env). À définir côté déploiement pour activer gpt-realtime.`,kY=()=>`OpenAI realtime: OPENAI_API_KEY ABSENT (env). To be set on the deployment side to enable gpt-realtime.`,AY=((e={},t={})=>(t.locale??q())===`fr`?OY(e):kY(e)),jY=()=>`Activer le mode conversation`,MY=()=>`Enable conversation mode`,NY=((e={},t={})=>(t.locale??q())===`fr`?jY(e):MY(e)),PY=()=>`Provider realtime`,FY=()=>`Realtime provider`,IY=((e={},t={})=>(t.locale??q())===`fr`?PY(e):FY(e)),LY=()=>`Modèle realtime`,RY=()=>`Realtime model`,zY=((e={},t={})=>(t.locale??q())===`fr`?LY(e):RY(e)),BY=()=>`Transport`,VY=()=>`Transport`,HY=((e={},t={})=>(t.locale??q())===`fr`?BY(e):VY(e)),UY=()=>`WebRTC (navigateur)`,WY=()=>`WebRTC (browser)`,GY=((e={},t={})=>(t.locale??q())===`fr`?UY(e):WY(e)),KY=()=>`Locale`,qY=()=>`Locale`,JY=((e={},t={})=>(t.locale??q())===`fr`?KY(e):qY(e)),YY=()=>`Interrompre la lecture quand l'utilisateur parle`,XY=()=>`Interrupt playback when the user speaks`,ZY=((e={},t={})=>(t.locale??q())===`fr`?YY(e):XY(e)),QY=()=>`Voice wake (mot d'activation)`,$Y=()=>`Voice wake (wake word)`,eX=((e={},t={})=>(t.locale??q())===`fr`?QY(e):$Y(e)),tX=()=>`non câblable dans le navigateur`,nX=()=>`not wireable in the browser`,rX=((e={},t={})=>(t.locale??q())===`fr`?tX(e):nX(e)),iX=()=>`OpenClaw gère le voice-wake côté Gateway avec détection native macOS/iOS (Android = micro manuel) ; le navigateur n'est pas une plateforme supportée. Le câbler dans ce webchat nécessiterait un moteur wake-word côté client (type Porcupine) que nous bâtirions — hors de OpenClaw. Configuration des déclencheurs : RPC gateway`,aX=()=>`OpenClaw handles voice-wake on the Gateway side with native macOS/iOS detection (Android = manual mic); the browser is not a supported platform. Wiring it into this webchat would require a client-side wake-word engine (Porcupine-style) that we would build — outside OpenClaw. Trigger configuration: gateway RPC`,oX=((e={},t={})=>(t.locale??q())===`fr`?iX(e):aX(e)),sX=()=>`Curseurs d'expédition`,cX=()=>`Shipping cursors`,lX=((e={},t={})=>(t.locale??q())===`fr`?sX(e):cX(e)),uX=()=>`Aucun curseur — aucune trace n'a encore été expédiée.`,dX=()=>`No cursor — no trace has been shipped yet.`,fX=((e={},t={})=>(t.locale??q())===`fr`?uX(e):dX(e)),pX=()=>`Vendeur`,mX=()=>`Vendor`,hX=((e={},t={})=>(t.locale??q())===`fr`?pX(e):mX(e)),gX=()=>`Dernier envoi`,_X=()=>`Last send`,vX=((e={},t={})=>(t.locale??q())===`fr`?gX(e):_X(e)),yX=()=>`Échecs consécutifs`,bX=()=>`Consecutive failures`,xX=((e={},t={})=>(t.locale??q())===`fr`?yX(e):bX(e)),SX=()=>`Dernier statut HTTP`,CX=()=>`Last HTTP status`,wX=((e={},t={})=>(t.locale??q())===`fr`?SX(e):CX(e)),TX=()=>`Dernière erreur`,EX=()=>`Last error`,DX=((e={},t={})=>(t.locale??q())===`fr`?TX(e):EX(e)),OX=()=>`Mots modifiés / altérés`,kX=()=>`Modified / altered words`,AX=((e={},t={})=>(t.locale??q())===`fr`?OX(e):kX(e)),jX=()=>`Réponse incorrecte`,MX=()=>`Incorrect answer`,NX=((e={},t={})=>(t.locale??q())===`fr`?jX(e):MX(e)),PX=()=>`Incohérence`,FX=()=>`Inconsistency`,IX=((e={},t={})=>(t.locale??q())===`fr`?PX(e):FX(e)),LX=()=>`Formatage`,RX=()=>`Formatting`,zX=((e={},t={})=>(t.locale??q())===`fr`?LX(e):RX(e)),BX=()=>`Latence`,VX=()=>`Latency`,HX=((e={},t={})=>(t.locale??q())===`fr`?BX(e):VX(e)),UX=()=>`Erreur API`,WX=()=>`API error`,GX=((e={},t={})=>(t.locale??q())===`fr`?UX(e):WX(e)),KX=()=>`Autre`,qX=()=>`Other`,JX=((e={},t={})=>(t.locale??q())===`fr`?KX(e):qX(e)),YX=()=>`reçu = stocké`,XX=()=>`received = stored`,ZX=((e={},t={})=>(t.locale??q())===`fr`?YX(e):XX(e)),QX=()=>`affichage fidèle ✓`,$X=()=>`faithful display ✓`,eZ=((e={},t={})=>(t.locale??q())===`fr`?QX(e):$X(e)),tZ=()=>`écart ⚠`,nZ=()=>`mismatch ⚠`,rZ=((e={},t={})=>(t.locale??q())===`fr`?tZ(e):nZ(e)),iZ=()=>`régénération`,aZ=()=>`regeneration`,oZ=((e={},t={})=>(t.locale??q())===`fr`?iZ(e):aZ(e)),sZ=()=>`Commentaire du rapporteur`,cZ=()=>`Reporter's comment`,lZ=((e={},t={})=>(t.locale??q())===`fr`?sZ(e):cZ(e)),uZ=()=>`Échange avec l'utilisateur`,dZ=()=>`Exchange with the user`,fZ=((e={},t={})=>(t.locale??q())===`fr`?uZ(e):dZ(e)),pZ=()=>`Administrateur`,mZ=()=>`Administrator`,hZ=((e={},t={})=>(t.locale??q())===`fr`?pZ(e):mZ(e)),gZ=()=>`Utilisateur`,_Z=()=>`User`,vZ=((e={},t={})=>(t.locale??q())===`fr`?gZ(e):_Z(e)),yZ=()=>`Aucune réponse envoyée.`,bZ=()=>`No reply sent.`,xZ=((e={},t={})=>(t.locale??q())===`fr`?yZ(e):bZ(e)),SZ=()=>`Répondre à l'utilisateur (visible dans sa zone de notification)…`,CZ=()=>`Reply to the user (visible in their notification area)…`,wZ=((e={},t={})=>(t.locale??q())===`fr`?SZ(e):CZ(e)),TZ=()=>`Envoi…`,EZ=()=>`Sending…`,DZ=((e={},t={})=>(t.locale??q())===`fr`?TZ(e):EZ(e)),OZ=()=>`Répondre`,kZ=()=>`Reply`,AZ=((e={},t={})=>(t.locale??q())===`fr`?OZ(e):kZ(e)),jZ=()=>`Texte stocké (serveur, autoritatif)`,MZ=()=>`Stored text (server, authoritative)`,NZ=((e={},t={})=>(t.locale??q())===`fr`?jZ(e):MZ(e)),PZ=()=>`(vide)`,FZ=()=>`(empty)`,IZ=((e={},t={})=>(t.locale??q())===`fr`?PZ(e):FZ(e)),LZ=()=>`Texte affiché (navigateur, au signalement)`,RZ=()=>`Displayed text (browser, at report time)`,zZ=((e={},t={})=>(t.locale??q())===`fr`?LZ(e):RZ(e)),BZ=()=>`Prompt générateur`,VZ=()=>`Generator prompt`,HZ=((e={},t={})=>(t.locale??q())===`fr`?BZ(e):VZ(e)),UZ=e=>`Contexte figé (${e?.count} tours${e?.truncated})`,WZ=e=>`Frozen context (${e?.count} turns${e?.truncated})`,GZ=((e,t={})=>(t.locale??q())===`fr`?UZ(e):WZ(e)),KZ=()=>`, tronqué`,qZ=()=>`, truncated`,JZ=((e={},t={})=>(t.locale??q())===`fr`?KZ(e):qZ(e)),YZ=()=>`Payload dispatché (outbox)`,XZ=()=>`Dispatched payload (outbox)`,ZZ=((e={},t={})=>(t.locale??q())===`fr`?YZ(e):XZ(e)),QZ=()=>`Extensions de correction détectées (peuvent altérer le texte)`,$Z=()=>`Correction extensions detected (may alter the text)`,eQ=((e={},t={})=>(t.locale??q())===`fr`?QZ(e):$Z(e)),tQ=()=>`Environnement client`,nQ=()=>`Client environment`,rQ=((e={},t={})=>(t.locale??q())===`fr`?tQ(e):nQ(e)),iQ=e=>`thème ${e?.theme}`,aQ=e=>`theme ${e?.theme}`,oQ=((e,t={})=>(t.locale??q())===`fr`?iQ(e):aQ(e)),sQ=()=>`Plugins :`,cQ=()=>`Plugins:`,lQ=((e={},t={})=>(t.locale??q())===`fr`?sQ(e):cQ(e)),uQ=()=>`(navigator.plugins — neutralisé/partiel dans les navigateurs modernes)`,dQ=()=>`(navigator.plugins — neutralized/partial in modern browsers)`,fQ=((e={},t={})=>(t.locale??q())===`fr`?uQ(e):dQ(e)),pQ=()=>`Signalements « Report Feedback » enregistrés. La liste est en métadonnées ; ouvrir le détail lit le contenu figé et`,mQ=()=>`Recorded "Report Feedback" reports. The list shows metadata; opening the detail reads the frozen content and`,hQ=((e={},t={})=>(t.locale??q())===`fr`?pQ(e):mQ(e)),gQ=()=>`trace cet accès dans l'Audit`,_Q=()=>`traces this access in the Audit`,vQ=((e={},t={})=>(t.locale??q())===`fr`?gQ(e):_Q(e)),yQ=()=>`(lecture de contenu d'un autre utilisateur). Fenêtre récente bornée.`,bQ=()=>`(reading another user's content). Bounded recent window.`,xQ=((e={},t={})=>(t.locale??q())===`fr`?yQ(e):bQ(e)),SQ=()=>`Signalements`,CQ=()=>`Reports`,wQ=((e={},t={})=>(t.locale??q())===`fr`?SQ(e):CQ(e)),TQ=()=>`Aucun signalement pour l'instant.`,EQ=()=>`No reports yet.`,DQ=((e={},t={})=>(t.locale??q())===`fr`?TQ(e):EQ(e)),OQ=()=>`Quand`,kQ=()=>`When`,AQ=((e={},t={})=>(t.locale??q())===`fr`?OQ(e):kQ(e)),jQ=()=>`Catégorie`,MQ=()=>`Category`,NQ=((e={},t={})=>(t.locale??q())===`fr`?jQ(e):MQ(e)),PQ=()=>`Type`,FQ=()=>`Type`,IQ=((e={},t={})=>(t.locale??q())===`fr`?PQ(e):FQ(e)),LQ=()=>`user`,RQ=()=>`user`,zQ=((e={},t={})=>(t.locale??q())===`fr`?LQ(e):RQ(e)),BQ=()=>`AI`,VQ=()=>`AI`,HQ=((e={},t={})=>(t.locale??q())===`fr`?BQ(e):VQ(e)),UQ=()=>`Rapporteur`,WQ=()=>`Reporter`,GQ=((e={},t={})=>(t.locale??q())===`fr`?UQ(e):WQ(e)),KQ=e=>`(via ${e?.operator})`,qQ=e=>`(via ${e?.operator})`,JQ=((e,t={})=>(t.locale??q())===`fr`?KQ(e):qQ(e)),YQ=()=>`Fidélité`,XQ=()=>`Fidelity`,ZQ=((e={},t={})=>(t.locale??q())===`fr`?YQ(e):XQ(e)),QQ=()=>`Note`,$Q=()=>`Note`,e$=((e={},t={})=>(t.locale??q())===`fr`?QQ(e):$Q(e)),t$=()=>`Statut`,n$=()=>`Status`,r$=((e={},t={})=>(t.locale??q())===`fr`?t$(e):n$(e)),i$=()=>`Répondu`,a$=()=>`Answered`,o$=((e={},t={})=>(t.locale??q())===`fr`?i$(e):a$(e)),s$=()=>`En attente`,c$=()=>`Pending`,l$=((e={},t={})=>(t.locale??q())===`fr`?s$(e):c$(e)),u$=()=>`Masquer`,d$=()=>`Hide`,f$=((e={},t={})=>(t.locale??q())===`fr`?u$(e):d$(e)),p$=()=>`Voir le détail`,m$=()=>`View detail`,h$=((e={},t={})=>(t.locale??q())===`fr`?p$(e):m$(e)),g$=()=>`Supprimer`,_$=()=>`Delete`,Uue=((e={},t={})=>(t.locale??q())===`fr`?g$(e):_$(e)),Wue=()=>`Supprimer ce signalement ?`,Gue=()=>`Delete this report?`,Kue=((e={},t={})=>(t.locale??q())===`fr`?Wue(e):Gue(e)),que=()=>`L'instantané forensique figé sera définitivement supprimé. Cette action est irréversible.`,Jue=()=>`The frozen forensic snapshot will be permanently deleted. This action is irreversible.`,Yue=((e={},t={})=>(t.locale??q())===`fr`?que(e):Jue(e)),Xue=()=>`Supprimer`,Zue=()=>`Delete`,Que=((e={},t={})=>(t.locale??q())===`fr`?Xue(e):Zue(e)),$ue=()=>`Aucun onglet`,ede=()=>`No tabs`,tde=((e={},t={})=>(t.locale??q())===`fr`?$ue(e):ede(e)),nde=e=>`${e?.count} onglets`,rde=e=>`${e?.count} tabs`,ide=((e,t={})=>(t.locale??q())===`fr`?nde(e):rde(e)),ade=()=>`Onglets Settings autorisés`,ode=()=>`Allowed Settings tabs`,sde=((e={},t={})=>(t.locale??q())===`fr`?ade(e):ode(e)),cde=()=>`Changement de rôle refusé`,lde=()=>`Role change refused`,ude=((e={},t={})=>(t.locale??q())===`fr`?cde(e):lde(e)),dde=()=>`Mise à jour des permissions refusée`,fde=()=>`Permission update refused`,pde=((e={},t={})=>(t.locale??q())===`fr`?dde(e):fde(e)),mde=()=>`Rechercher (email, nom)`,hde=()=>`Search (email, name)`,gde=((e={},t={})=>(t.locale??q())===`fr`?mde(e):hde(e)),_de=()=>`Tous les rôles`,vde=()=>`All roles`,yde=((e={},t={})=>(t.locale??q())===`fr`?_de(e):vde(e)),bde=()=>`Utilisateurs`,xde=()=>`Users`,Sde=((e={},t={})=>(t.locale??q())===`fr`?bde(e):xde(e)),Cde=()=>`Aucun utilisateur.`,wde=()=>`No users.`,Tde=((e={},t={})=>(t.locale??q())===`fr`?Cde(e):wde(e)),Ede=()=>`Voir comme cet utilisateur`,Dde=()=>`View as this user`,Ode=((e={},t={})=>(t.locale??q())===`fr`?Ede(e):Dde(e)),kde=()=>`Supprimer l’utilisateur`,Ade=()=>`Delete user`,jde=((e={},t={})=>(t.locale??q())===`fr`?kde(e):Ade(e)),Mde=()=>`Supprimer cet utilisateur ?`,Nde=()=>`Delete this user?`,Pde=((e={},t={})=>(t.locale??q())===`fr`?Mde(e):Nde(e)),Fde=e=>`« ${e?.user} » et toutes ses données (conversations, fichiers, accès) seront définitivement supprimés. Cette action est irréversible.`,Ide=e=>`“${e?.user}” and all their data (conversations, files, access) will be permanently deleted. This action cannot be undone.`,Lde=((e,t={})=>(t.locale??q())===`fr`?Fde(e):Ide(e)),Rde=()=>`SUPPRIMER`,zde=()=>`DELETE`,Bde=((e={},t={})=>(t.locale??q())===`fr`?Rde(e):zde(e)),Vde=()=>`Supprimer définitivement`,Hde=()=>`Delete permanently`,Ude=((e={},t={})=>(t.locale??q())===`fr`?Vde(e):Hde(e)),Wde=()=>`Suppression de l’utilisateur refusée`,Gde=()=>`User deletion refused`,Kde=((e={},t={})=>(t.locale??q())===`fr`?Wde(e):Gde(e)),qde=e=>`Utilisateur « ${e?.user} » supprimé.`,Jde=e=>`User “${e?.user}” deleted.`,Yde=((e,t={})=>(t.locale??q())===`fr`?qde(e):Jde(e)),Xde=()=>`Renommer`,Zde=()=>`Rename`,Qde=((e={},t={})=>(t.locale??q())===`fr`?Xde(e):Zde(e)),$de=()=>`Renommer l’utilisateur`,efe=()=>`Rename user`,tfe=((e={},t={})=>(t.locale??q())===`fr`?$de(e):efe(e)),nfe=e=>`Nom affiché pour « ${e?.user} »`,rfe=e=>`Display name for “${e?.user}”`,ife=((e,t={})=>(t.locale??q())===`fr`?nfe(e):rfe(e)),afe=()=>`Nom et prénom`,ofe=()=>`Name`,sfe=((e={},t={})=>(t.locale??q())===`fr`?afe(e):ofe(e)),cfe=()=>`Nom mis à jour.`,lfe=()=>`Name updated.`,ufe=((e={},t={})=>(t.locale??q())===`fr`?cfe(e):lfe(e)),dfe=()=>`Renommage refusé`,ffe=()=>`Rename refused`,pfe=((e={},t={})=>(t.locale??q())===`fr`?dfe(e):ffe(e)),mfe=()=>`Utilisateur`,hfe=()=>`User`,gfe=((e={},t={})=>(t.locale??q())===`fr`?mfe(e):hfe(e)),_fe=()=>`Rôle`,vfe=()=>`Role`,yfe=((e={},t={})=>(t.locale??q())===`fr`?_fe(e):vfe(e)),bfe=()=>`Accès Settings`,xfe=()=>`Settings access`,Sfe=((e={},t={})=>(t.locale??q())===`fr`?bfe(e):xfe(e)),Cfe=()=>`Tous (admin)`,wfe=()=>`All (admin)`,Tfe=((e={},t={})=>(t.locale??q())===`fr`?Cfe(e):wfe(e)),Efe=()=>`Agents`,Dfe=()=>`Agents`,v$=((e={},t={})=>(t.locale??q())===`fr`?Efe(e):Dfe(e)),Ofe=()=>`Gérer les agents`,kfe=()=>`Manage agents`,Afe=((e={},t={})=>(t.locale??q())===`fr`?Ofe(e):kfe(e)),jfe=()=>`Échec de l’enregistrement de l’instance`,Mfe=()=>`Failed to save instance`,Nfe=((e={},t={})=>(t.locale??q())===`fr`?jfe(e):Mfe(e)),Pfe=()=>`Métadonnées non-secrètes uniquement. Les agents sont `,Ffe=()=>`Non-secret metadata only. Agents are `,Ife=((e={},t={})=>(t.locale??q())===`fr`?Pfe(e):Ffe(e)),Lfe=()=>`découverts par le bridge`,Rfe=()=>`discovered by the bridge`,zfe=((e={},t={})=>(t.locale??q())===`fr`?Lfe(e):Rfe(e)),Bfe=()=>` (jamais saisis à la main) ; les tokens gateway et device identities vivent dans l’environnement du bridge, jamais ici.`,Vfe=()=>` (never entered by hand); gateway tokens and device identities live in the bridge environment, never here.`,Hfe=((e={},t={})=>(t.locale??q())===`fr`?Bfe(e):Vfe(e)),Ufe=()=>`Instances`,Wfe=()=>`Instances`,Gfe=((e={},t={})=>(t.locale??q())===`fr`?Ufe(e):Wfe(e)),Kfe=()=>`Ajouter une instance`,qfe=()=>`Add instance`,Jfe=((e={},t={})=>(t.locale??q())===`fr`?Kfe(e):qfe(e)),Yfe=()=>`Aucune instance.`,Xfe=()=>`No instances.`,Zfe=((e={},t={})=>(t.locale??q())===`fr`?Yfe(e):Xfe(e)),Qfe=()=>`Nom`,$fe=()=>`Name`,epe=((e={},t={})=>(t.locale??q())===`fr`?Qfe(e):$fe(e)),tpe=()=>`Bridge`,npe=()=>`Bridge`,rpe=((e={},t={})=>(t.locale??q())===`fr`?tpe(e):npe(e)),ipe=()=>`Gateway URL`,ape=()=>`Gateway URL`,ope=((e={},t={})=>(t.locale??q())===`fr`?ipe(e):ape(e)),spe=()=>`Affichage`,cpe=()=>`Display`,lpe=((e={},t={})=>(t.locale??q())===`fr`?spe(e):cpe(e)),upe=()=>`Voir les agents`,dpe=()=>`View agents`,fpe=((e={},t={})=>(t.locale??q())===`fr`?upe(e):dpe(e)),ppe=()=>`Supprimer`,mpe=()=>`Delete`,y$=((e={},t={})=>(t.locale??q())===`fr`?ppe(e):mpe(e)),hpe=()=>`Nouvelle instance`,gpe=()=>`New instance`,_pe=((e={},t={})=>(t.locale??q())===`fr`?hpe(e):gpe(e)),vpe=()=>`Métadonnées non-secrètes.`,ype=()=>`Non-secret metadata.`,bpe=((e={},t={})=>(t.locale??q())===`fr`?vpe(e):ype(e)),xpe=()=>`Enregistrer`,Spe=()=>`Save`,b$=((e={},t={})=>(t.locale??q())===`fr`?xpe(e):Spe(e)),Cpe=()=>`Nom de l’instance (ex. main)`,wpe=()=>`Instance name (e.g. main)`,Tpe=((e={},t={})=>(t.locale??q())===`fr`?Cpe(e):wpe(e)),Epe=()=>`Technologie (bridge)`,Dpe=()=>`Technology (bridge)`,Ope=((e={},t={})=>(t.locale??q())===`fr`?Epe(e):Dpe(e)),kpe=()=>`Gateway URL (ws(s)://)`,Ape=()=>`Gateway URL (ws(s)://)`,jpe=((e={},t={})=>(t.locale??q())===`fr`?kpe(e):Ape(e)),Mpe=()=>`Nom affiché (optionnel)`,Npe=()=>`Display name (optional)`,Ppe=((e={},t={})=>(t.locale??q())===`fr`?Mpe(e):Npe(e)),Fpe=e=>`Agents découverts — ${e?.name}`,Ipe=e=>`Discovered agents — ${e?.name}`,Lpe=((e,t={})=>(t.locale??q())===`fr`?Fpe(e):Ipe(e)),Rpe=()=>`Liste fournie par le bridge (OpenClaw `,zpe=()=>`List provided by the bridge (OpenClaw `,Bpe=((e={},t={})=>(t.locale??q())===`fr`?Rpe(e):zpe(e)),Vpe=()=>` / Hermes). Lecture seule.`,Hpe=()=>` / Hermes). Read-only.`,Upe=((e={},t={})=>(t.locale??q())===`fr`?Vpe(e):Hpe(e)),Wpe=()=>`Chargement…`,Gpe=()=>`Loading…`,Kpe=((e={},t={})=>(t.locale??q())===`fr`?Wpe(e):Gpe(e)),qpe=()=>`Jamais sondé.`,Jpe=()=>`Never polled.`,Ype=((e={},t={})=>(t.locale??q())===`fr`?qpe(e):Jpe(e)),Xpe=()=>`Découverte OK.`,Zpe=()=>`Discovery OK.`,Qpe=((e={},t={})=>(t.locale??q())===`fr`?Xpe(e):Zpe(e)),$pe=e=>`Hors-ligne (${e?.error}) — dernier bon résultat servi.`,eme=e=>`Offline (${e?.error}) — last good result served.`,tme=((e,t={})=>(t.locale??q())===`fr`?$pe(e):eme(e)),nme=()=>`Aucun agent découvert.`,rme=()=>`No agent discovered.`,ime=((e={},t={})=>(t.locale??q())===`fr`?nme(e):rme(e)),ame=()=>`défaut`,ome=()=>`default`,sme=((e={},t={})=>(t.locale??q())===`fr`?ame(e):ome(e)),cme=()=>`supprimé`,lme=()=>`removed`,ume=((e={},t={})=>(t.locale??q())===`fr`?cme(e):lme(e)),dme=()=>`Trace des actions effectuées sous usurpation d’identité : qui a réellement agi (acteur réel) et au nom de quel utilisateur. Le contenu des messages n’est jamais enregistré.`,fme=()=>`Trace of actions performed under impersonation: who really acted (real actor) and on behalf of which user. Message content is never recorded.`,pme=((e={},t={})=>(t.locale??q())===`fr`?dme(e):fme(e)),mme=()=>`Fenêtre récente bornée — une plage antérieure peut être partielle.`,hme=()=>`Bounded recent window — an earlier range may be partial.`,gme=((e={},t={})=>(t.locale??q())===`fr`?mme(e):hme(e)),_me=()=>`Rechercher (action, acteur, ressource)`,vme=()=>`Search (action, actor, resource)`,yme=((e={},t={})=>(t.locale??q())===`fr`?_me(e):vme(e)),bme=()=>`Action`,xme=()=>`Action`,x$=((e={},t={})=>(t.locale??q())===`fr`?bme(e):xme(e)),Sme=()=>`Toutes les actions`,Cme=()=>`All actions`,wme=((e={},t={})=>(t.locale??q())===`fr`?Sme(e):Cme(e)),Tme=()=>`Usurpation : toutes`,Eme=()=>`Impersonation: all`,Dme=((e={},t={})=>(t.locale??q())===`fr`?Tme(e):Eme(e)),Ome=()=>`Sous usurpation`,kme=()=>`Under impersonation`,Ame=((e={},t={})=>(t.locale??q())===`fr`?Ome(e):kme(e)),jme=()=>`Sans usurpation`,Mme=()=>`Without impersonation`,Nme=((e={},t={})=>(t.locale??q())===`fr`?jme(e):Mme(e)),Pme=()=>`Ressource`,Fme=()=>`Resource`,S$=((e={},t={})=>(t.locale??q())===`fr`?Pme(e):Fme(e)),Ime=()=>`Toutes les ressources`,Lme=()=>`All resources`,Rme=((e={},t={})=>(t.locale??q())===`fr`?Ime(e):Lme(e)),zme=()=>`Audit`,Bme=()=>`Audit`,Vme=((e={},t={})=>(t.locale??q())===`fr`?zme(e):Bme(e)),Hme=()=>`Aucune action tracée pour l’instant.`,Ume=()=>`No action traced yet.`,Wme=((e={},t={})=>(t.locale??q())===`fr`?Hme(e):Ume(e)),Gme=()=>`Quand`,Kme=()=>`When`,qme=((e={},t={})=>(t.locale??q())===`fr`?Gme(e):Kme(e)),Jme=()=>`Acteur réel`,Yme=()=>`Real actor`,Xme=((e={},t={})=>(t.locale??q())===`fr`?Jme(e):Yme(e)),Zme=()=>`Au nom de`,Qme=()=>`On behalf of`,$me=((e={},t={})=>(t.locale??q())===`fr`?Zme(e):Qme(e)),ehe=()=>`Traces`,the=()=>`Traces`,nhe=((e={},t={})=>(t.locale??q())===`fr`?ehe(e):the(e)),rhe=()=>`KPI`,ihe=()=>`KPI`,ahe=((e={},t={})=>(t.locale??q())===`fr`?rhe(e):ihe(e)),ohe=()=>`OpenClaw / Anomalies`,she=()=>`OpenClaw / Anomalies`,che=((e={},t={})=>(t.locale??q())===`fr`?ohe(e):she(e)),lhe=()=>`Chats`,uhe=()=>`Chats`,dhe=((e={},t={})=>(t.locale??q())===`fr`?lhe(e):uhe(e)),fhe=()=>`Admin`,phe=()=>`Admin`,mhe=((e={},t={})=>(t.locale??q())===`fr`?fhe(e):phe(e)),hhe=()=>`Lire`,ghe=()=>`Read`,C$=((e={},t={})=>(t.locale??q())===`fr`?hhe(e):ghe(e)),_he=()=>`Contenu`,vhe=()=>`Content`,yhe=((e={},t={})=>(t.locale??q())===`fr`?_he(e):vhe(e)),bhe=()=>`Écrire`,xhe=()=>`Write`,w$=((e={},t={})=>(t.locale??q())===`fr`?bhe(e):xhe(e)),She=()=>`Requête`,Che=()=>`Query`,whe=((e={},t={})=>(t.locale??q())===`fr`?She(e):Che(e)),The=()=>`Anomalies`,Ehe=()=>`Anomalies`,Dhe=((e={},t={})=>(t.locale??q())===`fr`?The(e):Ehe(e)),Ohe=()=>`Signaler`,khe=()=>`Report`,Ahe=((e={},t={})=>(t.locale??q())===`fr`?Ohe(e):khe(e)),jhe=()=>`Gérer`,Mhe=()=>`Manage`,Nhe=((e={},t={})=>(t.locale??q())===`fr`?jhe(e):Mhe(e)),Phe=e=>`${e?.key} — accès au contenu brut (PHI), à accorder avec prudence`,Fhe=e=>`${e?.key} — access to raw content (PHI), grant with caution`,Ihe=((e,t={})=>(t.locale??q())===`fr`?Phe(e):Fhe(e)),Lhe=()=>`Échec de l’initialisation des rôles`,Rhe=()=>`Failed to initialize roles`,zhe=((e={},t={})=>(t.locale??q())===`fr`?Lhe(e):Rhe(e)),Bhe=e=>`Modifier le rôle intégré « ${e?.name} » ?`,Vhe=e=>`Edit the built-in role “${e?.name}”?`,Hhe=((e,t={})=>(t.locale??q())===`fr`?Bhe(e):Vhe(e)),Uhe=()=>`Les rôles intégrés sont la base du modèle de permissions. Les modifier peut affecter les comptes existants. Continuer ?`,Whe=()=>`Built-in roles are the foundation of the permission model. Editing them may affect existing accounts. Continue?`,Ghe=((e={},t={})=>(t.locale??q())===`fr`?Uhe(e):Whe(e)),Khe=()=>`Modifier`,qhe=()=>`Edit`,Jhe=((e={},t={})=>(t.locale??q())===`fr`?Khe(e):qhe(e)),Yhe=()=>`Échec de la mise à jour des permissions`,Xhe=()=>`Failed to update permissions`,Zhe=((e={},t={})=>(t.locale??q())===`fr`?Yhe(e):Xhe(e)),Qhe=()=>`Échec de la création du rôle`,$he=()=>`Failed to create role`,ege=((e={},t={})=>(t.locale??q())===`fr`?Qhe(e):$he(e)),tge=()=>`Matrice de permissions. Lignes = rôles (intégrés + personnalisés), colonnes = clés de permission. Le rôle`,nge=()=>`Permission matrix. Rows = roles (built-in + custom), columns = permission keys. The`,rge=((e={},t={})=>(t.locale??q())===`fr`?tge(e):nge(e)),ige=()=>`détient le joker « * » (toutes les permissions) et est verrouillé. La colonne`,age=()=>`role holds the “*” wildcard (all permissions) and is locked. The`,oge=((e={},t={})=>(t.locale??q())===`fr`?ige(e):age(e)),sge=()=>`donne accès au contenu brut (PHI) — à n’accorder qu’à bon escient.`,cge=()=>`column grants access to raw content (PHI) — grant only when justified.`,lge=((e={},t={})=>(t.locale??q())===`fr`?sge(e):cge(e)),uge=()=>`Rôles`,dge=()=>`Roles`,fge=((e={},t={})=>(t.locale??q())===`fr`?uge(e):dge(e)),pge=()=>`Ajouter un rôle`,mge=()=>`Add a role`,hge=((e={},t={})=>(t.locale??q())===`fr`?pge(e):mge(e)),gge=()=>`Chargement…`,_ge=()=>`Loading…`,vge=((e={},t={})=>(t.locale??q())===`fr`?gge(e):_ge(e)),yge=()=>`Initialisation des rôles…`,bge=()=>`Initializing roles…`,xge=((e={},t={})=>(t.locale??q())===`fr`?yge(e):bge(e)),Sge=()=>`Rôle`,Cge=()=>`Role`,wge=((e={},t={})=>(t.locale??q())===`fr`?Sge(e):Cge(e)),Tge=()=>`intégré`,Ege=()=>`built-in`,Dge=((e={},t={})=>(t.locale??q())===`fr`?Tge(e):Ege(e)),Oge=()=>`personnalisé`,kge=()=>`custom`,Age=((e={},t={})=>(t.locale??q())===`fr`?Oge(e):kge(e)),jge=()=>`Authentifié mais pas encore approuvé — l’accès est bloqué tant qu’un administrateur n’a pas validé le compte.`,Mge=()=>`Authenticated but not yet approved — access is blocked until an admin approves the account.`,Nge=((e={},t={})=>(t.locale??q())===`fr`?jge(e):Mge(e)),Pge=()=>`Personne approuvée, avec accès au chat.`,Fge=()=>`Approved person with chat access.`,Ige=((e={},t={})=>(t.locale??q())===`fr`?Pge(e):Fge(e)),Lge=()=>`Accès total (superset) : gère les utilisateurs, rôles, agents, instances et l’observabilité.`,Rge=()=>`Full access (superset): manages users, roles, agents, instances and observability.`,zge=((e={},t={})=>(t.locale??q())===`fr`?Lge(e):Rge(e)),Bge=()=>`Compte de service en LECTURE SEULE pour superviser : voit les traces, KPI, anomalies et l’état du bridge/version via l’API. Ne peut rien écrire ni déclencher.`,Vge=()=>`READ-ONLY service account for monitoring: views traces, KPIs, anomalies and bridge/version status through the API. Cannot write or trigger anything.`,Hge=((e={},t={})=>(t.locale??q())===`fr`?Bge(e):Vge(e)),Uge=()=>`Compte de service pour un agent OpenClaw lui-même : tout ce que voit l’observateur, PLUS interroger OpenClaw et SIGNALER des anomalies (écriture — ex. heartbeat / auto-réparation). À utiliser pour un agent automatisé, pas pour un humain qui consulte les tableaux de bord.`,Wge=()=>`Service account for an OpenClaw agent itself: the observer's read access PLUS querying OpenClaw and REPORTING anomalies (write — e.g. heartbeat / self-repair). Use it for an automated agent, not a human watching dashboards.`,Gge=((e={},t={})=>(t.locale??q())===`fr`?Uge(e):Wge(e)),Kge=()=>`Accordé via « * » (toutes les permissions)`,qge=()=>`Granted via “*” (all permissions)`,Jge=((e={},t={})=>(t.locale??q())===`fr`?Kge(e):qge(e)),Yge=()=>`Écriture en cours…`,Xge=()=>`Writing…`,Zge=((e={},t={})=>(t.locale??q())===`fr`?Yge(e):Xge(e)),Qge=()=>`Nouveau rôle`,$ge=()=>`New role`,e_e=((e={},t={})=>(t.locale??q())===`fr`?Qge(e):$ge(e)),t_e=()=>`Rôle personnalisé. Ajustez les permissions dans la matrice après création.`,n_e=()=>`Custom role. Adjust the permissions in the matrix after creation.`,r_e=((e={},t={})=>(t.locale??q())===`fr`?t_e(e):n_e(e)),i_e=()=>`Créer`,a_e=()=>`Create`,o_e=((e={},t={})=>(t.locale??q())===`fr`?i_e(e):a_e(e)),s_e=()=>`Clé (identifiant stable)`,c_e=()=>`Key (stable identifier)`,l_e=((e={},t={})=>(t.locale??q())===`fr`?s_e(e):c_e(e)),u_e=()=>`ex. analyst`,d_e=()=>`e.g. analyst`,f_e=((e={},t={})=>(t.locale??q())===`fr`?u_e(e):d_e(e)),p_e=()=>`Nom affiché`,m_e=()=>`Display name`,h_e=((e={},t={})=>(t.locale??q())===`fr`?p_e(e):m_e(e)),g_e=()=>`Description (optionnel)`,__e=()=>`Description (optional)`,v_e=((e={},t={})=>(t.locale??q())===`fr`?g_e(e):__e(e)),y_e=()=>`Ouvertes`,b_e=()=>`Open`,x_e=((e={},t={})=>(t.locale??q())===`fr`?y_e(e):b_e(e)),S_e=()=>`En sourdine`,C_e=()=>`Muted`,w_e=((e={},t={})=>(t.locale??q())===`fr`?S_e(e):C_e(e)),T_e=()=>`Résolues`,E_e=()=>`Resolved`,D_e=((e={},t={})=>(t.locale??q())===`fr`?T_e(e):E_e(e)),O_e=()=>`Résoudre cette anomalie ?`,k_e=()=>`Resolve this anomaly?`,A_e=((e={},t={})=>(t.locale??q())===`fr`?O_e(e):k_e(e)),j_e=()=>`L’anomalie`,M_e=()=>`The anomaly`,N_e=((e={},t={})=>(t.locale??q())===`fr`?j_e(e):M_e(e)),P_e=()=>`sera marquée comme`,F_e=()=>`will be marked as`,I_e=((e={},t={})=>(t.locale??q())===`fr`?P_e(e):F_e(e)),L_e=()=>`résolue`,R_e=()=>`resolved`,z_e=((e={},t={})=>(t.locale??q())===`fr`?L_e(e):R_e(e)),B_e=()=>`Elle sortira du décompte des anomalies ouvertes (signal de self-repair OpenClaw).`,V_e=()=>`It will be removed from the open anomalies count (OpenClaw self-repair signal).`,H_e=((e={},t={})=>(t.locale??q())===`fr`?B_e(e):V_e(e)),U_e=()=>`Résoudre`,W_e=()=>`Resolve`,G_e=((e={},t={})=>(t.locale??q())===`fr`?U_e(e):W_e(e)),K_e=()=>`Anomalie résolue`,q_e=()=>`Anomaly resolved`,J_e=((e={},t={})=>(t.locale??q())===`fr`?K_e(e):q_e(e)),Y_e=()=>`Échec de la résolution`,X_e=()=>`Resolution failed`,Z_e=((e={},t={})=>(t.locale??q())===`fr`?Y_e(e):X_e(e)),Q_e=()=>`Anomalie acquittée`,$_e=()=>`Anomaly acknowledged`,eve=((e={},t={})=>(t.locale??q())===`fr`?Q_e(e):$_e(e)),tve=()=>`Échec de l’acquittement`,nve=()=>`Acknowledgement failed`,rve=((e={},t={})=>(t.locale??q())===`fr`?tve(e):nve(e)),ive=()=>`Anomalies détectées (cron) ou signalées par les agents OpenClaw. Données non-PHI uniquement (type, sévérité, message, corrélation).`,ave=()=>`Anomalies detected (cron) or reported by OpenClaw agents. Non-PHI data only (type, severity, message, correlation).`,ove=((e={},t={})=>(t.locale??q())===`fr`?ive(e):ave(e)),sve=()=>`Ouverte`,cve=()=>`Open`,lve=((e={},t={})=>(t.locale??q())===`fr`?sve(e):cve(e)),uve=()=>`= active, elle alerte et compte dans le heartbeat.`,dve=()=>`= active, it alerts and counts in the heartbeat.`,fve=((e={},t={})=>(t.locale??q())===`fr`?uve(e):dve(e)),pve=()=>`En sourdine`,mve=()=>`Muted`,hve=((e={},t={})=>(t.locale??q())===`fr`?pve(e):mve(e)),gve=()=>`= vue, plus d'alerte, mais pas forcément corrigée (les admins sont notifiés des nouvelles anomalies).`,_ve=()=>`= seen, no more alerts, but not necessarily fixed (admins are notified of new anomalies).`,vve=((e={},t={})=>(t.locale??q())===`fr`?gve(e):_ve(e)),yve=()=>`Résolue`,bve=()=>`Resolved`,xve=((e={},t={})=>(t.locale??q())===`fr`?yve(e):bve(e)),Sve=()=>`= le problème est réglé (le détecteur résout automatiquement quand la condition cesse). Les deux la sortent du décompte heartbeat.`,Cve=()=>`= the problem is fixed (the detector resolves automatically when the condition clears). Both remove it from the heartbeat count.`,wve=((e={},t={})=>(t.locale??q())===`fr`?Sve(e):Cve(e)),Tve=()=>`La plage temporelle filtre la fenêtre récente — une plage antérieure peut être partielle.`,Eve=()=>`The time range filters the recent window — an earlier range may be partial.`,Dve=((e={},t={})=>(t.locale??q())===`fr`?Tve(e):Eve(e)),Ove=()=>`Rechercher (message, type, corrélation)`,kve=()=>`Search (message, type, correlation)`,Ave=((e={},t={})=>(t.locale??q())===`fr`?Ove(e):kve(e)),jve=()=>`Tous les statuts`,Mve=()=>`All statuses`,Nve=((e={},t={})=>(t.locale??q())===`fr`?jve(e):Mve(e)),Pve=()=>`Sévérité`,Fve=()=>`Severity`,T$=((e={},t={})=>(t.locale??q())===`fr`?Pve(e):Fve(e)),Ive=()=>`Toutes sévérités`,Lve=()=>`All severities`,Rve=((e={},t={})=>(t.locale??q())===`fr`?Ive(e):Lve(e)),zve=()=>`Source`,Bve=()=>`Source`,E$=((e={},t={})=>(t.locale??q())===`fr`?zve(e):Bve(e)),Vve=()=>`Toutes sources`,Hve=()=>`All sources`,Uve=((e={},t={})=>(t.locale??q())===`fr`?Vve(e):Hve(e)),Wve=()=>`Type`,Gve=()=>`Type`,D$=((e={},t={})=>(t.locale??q())===`fr`?Wve(e):Gve(e)),Kve=()=>`Tous les types`,qve=()=>`All types`,Jve=((e={},t={})=>(t.locale??q())===`fr`?Kve(e):qve(e)),Yve=()=>`Anomalies`,Xve=()=>`Anomalies`,Zve=((e={},t={})=>(t.locale??q())===`fr`?Yve(e):Xve(e)),Qve=()=>`Aucune anomalie ouverte. 🎉`,$ve=()=>`No open anomalies. 🎉`,eye=((e={},t={})=>(t.locale??q())===`fr`?Qve(e):$ve(e)),tye=()=>`Aucune anomalie enregistrée.`,nye=()=>`No anomalies recorded.`,rye=((e={},t={})=>(t.locale??q())===`fr`?tye(e):nye(e)),iye=()=>`Résoudre (corrigé)`,aye=()=>`Resolve (fixed)`,oye=((e={},t={})=>(t.locale??q())===`fr`?iye(e):aye(e)),sye=()=>`Marquer comme vue (sourdine)`,cye=()=>`Mark as seen (mute)`,lye=((e={},t={})=>(t.locale??q())===`fr`?sye(e):cye(e)),uye=()=>`Quand`,dye=()=>`When`,fye=((e={},t={})=>(t.locale??q())===`fr`?uye(e):dye(e)),pye=()=>`Statut`,mye=()=>`Status`,hye=((e={},t={})=>(t.locale??q())===`fr`?pye(e):mye(e)),gye=()=>`Message`,_ye=()=>`Message`,vye=((e={},t={})=>(t.locale??q())===`fr`?gye(e):_ye(e)),yye=()=>`Cause & correctif`,bye=()=>`Cause & fix`,xye=((e={},t={})=>(t.locale??q())===`fr`?yye(e):bye(e)),Sye=()=>`Corrélation`,Cye=()=>`Correlation`,wye=((e={},t={})=>(t.locale??q())===`fr`?Sye(e):Cye(e)),Tye=()=>`Voir la trace`,Eye=()=>`View trace`,Dye=((e={},t={})=>(t.locale??q())===`fr`?Tye(e):Eye(e)),Oye=()=>`ouverte`,kye=()=>`open`,Aye=((e={},t={})=>(t.locale??q())===`fr`?Oye(e):kye(e)),jye=()=>`en sourdine`,Mye=()=>`muted`,Nye=((e={},t={})=>(t.locale??q())===`fr`?jye(e):Mye(e)),Pye=()=>`résolue`,Fye=()=>`resolved`,Iye=((e={},t={})=>(t.locale??q())===`fr`?Pye(e):Fye(e)),Lye=()=>`Réponse incorrecte`,Rye=()=>`Incorrect response`,zye=((e={},t={})=>(t.locale??q())===`fr`?Lye(e):Rye(e)),Bye=()=>`Incohérence`,Vye=()=>`Inconsistency`,Hye=((e={},t={})=>(t.locale??q())===`fr`?Bye(e):Vye(e)),Uye=()=>`Mots / orthographe erronés`,Wye=()=>`Wrong words / spelling`,Gye=((e={},t={})=>(t.locale??q())===`fr`?Uye(e):Wye(e)),Kye=()=>`Formatage`,qye=()=>`Formatting`,Jye=((e={},t={})=>(t.locale??q())===`fr`?Kye(e):qye(e)),Yye=()=>`Latence`,Xye=()=>`Latency`,Zye=((e={},t={})=>(t.locale??q())===`fr`?Yye(e):Xye(e)),Qye=()=>`Erreur API`,$ye=()=>`API error`,ebe=((e={},t={})=>(t.locale??q())===`fr`?Qye(e):$ye(e)),tbe=()=>`Autre`,nbe=()=>`Other`,O$=((e={},t={})=>(t.locale??q())===`fr`?tbe(e):nbe(e)),rbe=()=>`Mots modifiés à l'envoi`,ibe=()=>`Words altered on send`,abe=((e={},t={})=>(t.locale??q())===`fr`?rbe(e):ibe(e)),obe=()=>`Caractères / mise en forme altérés`,sbe=()=>`Characters / formatting altered`,cbe=((e={},t={})=>(t.locale??q())===`fr`?obe(e):sbe(e)),lbe=()=>`Signaler un problème`,ube=()=>`Report an issue`,dbe=((e={},t={})=>(t.locale??q())===`fr`?lbe(e):ube(e)),fbe=()=>`Merci. Un instantané complet de ce message a été figé pour analyse.`,pbe=()=>`Thank you. A complete snapshot of this message has been frozen for analysis.`,mbe=((e={},t={})=>(t.locale??q())===`fr`?fbe(e):pbe(e)),hbe=()=>`Signalez un problème avec votre message tel qu'il a été envoyé. Un instantané forensique exact est enregistré.`,gbe=()=>`Report an issue with your message as it was sent. An exact forensic snapshot is recorded.`,_be=((e={},t={})=>(t.locale??q())===`fr`?hbe(e):gbe(e)),vbe=()=>`Signalez un problème avec cette réponse. Un instantané forensique exact est enregistré au moment de l'envoi.`,ybe=()=>`Report an issue with this response. An exact forensic snapshot is recorded at send time.`,bbe=((e={},t={})=>(t.locale??q())===`fr`?vbe(e):ybe(e)),xbe=()=>`✓ Le texte affiché (vue source) correspond exactement, caractère pour caractère, au texte stocké côté serveur. La comparaison est figée comme preuve.`,Sbe=()=>`✓ The displayed text (source view) matches exactly, character for character, the text stored on the server. The comparison is frozen as evidence.`,Cbe=((e={},t={})=>(t.locale??q())===`fr`?xbe(e):Sbe(e)),wbe=()=>`⚠ Écart détecté entre le texte affiché (vue source) et le texte stocké. L'instantané a figé les deux versions.`,Tbe=()=>`⚠ Discrepancy detected between the displayed text (source view) and the stored text. The snapshot has frozen both versions.`,Ebe=((e={},t={})=>(t.locale??q())===`fr`?wbe(e):Tbe(e)),Dbe=()=>`Instantané enregistré. Pour vérifier que l'affichage n'altère aucun caractère, ouvrez la vue source (</>) sur ce message puis signalez à nouveau : la comparaison portera alors sur le texte réellement affiché par le navigateur.`,Obe=()=>`Snapshot recorded. To verify that the display does not alter any character, open the source view (</>) on this message then report again: the comparison will then be on the text actually rendered by the browser.`,kbe=((e={},t={})=>(t.locale??q())===`fr`?Dbe(e):Obe(e)),Abe=()=>`Catégorie`,jbe=()=>`Category`,Mbe=((e={},t={})=>(t.locale??q())===`fr`?Abe(e):jbe(e)),Nbe=()=>`Choisir une catégorie`,Pbe=()=>`Choose a category`,Fbe=((e={},t={})=>(t.locale??q())===`fr`?Nbe(e):Pbe(e)),Ibe=()=>`Commentaire`,Lbe=()=>`Comment`,Rbe=((e={},t={})=>(t.locale??q())===`fr`?Ibe(e):Lbe(e)),zbe=()=>`Décrivez le problème…`,Bbe=()=>`Describe the issue…`,Vbe=((e={},t={})=>(t.locale??q())===`fr`?zbe(e):Bbe(e)),Hbe=()=>`Fermer`,Ube=()=>`Close`,Wbe=((e={},t={})=>(t.locale??q())===`fr`?Hbe(e):Ube(e)),Gbe=()=>`Annuler`,Kbe=()=>`Cancel`,qbe=((e={},t={})=>(t.locale??q())===`fr`?Gbe(e):Kbe(e)),Jbe=()=>`Envoi…`,Ybe=()=>`Sending…`,Xbe=((e={},t={})=>(t.locale??q())===`fr`?Jbe(e):Ybe(e)),Zbe=()=>`Envoyer`,Qbe=()=>`Send`,$be=((e={},t={})=>(t.locale??q())===`fr`?Zbe(e):Qbe(e)),exe=()=>`Problème signalé`,txe=()=>`Issue reported`,nxe=((e={},t={})=>(t.locale??q())===`fr`?exe(e):txe(e)),rxe=()=>`Signaler un problème`,ixe=()=>`Report an issue`,axe=((e={},t={})=>(t.locale??q())===`fr`?rxe(e):ixe(e)),oxe=()=>`Signaler un problème avec ce message`,sxe=()=>`Report an issue with this message`,cxe=((e={},t={})=>(t.locale??q())===`fr`?oxe(e):sxe(e)),lxe=()=>`Événements récents (fenêtre bornée, plus récents d’abord). Toutes les traces sont des métadonnées `,uxe=()=>`Recent events (bounded window, newest first). All traces are redacted metadata `,dxe=((e={},t={})=>(t.locale??q())===`fr`?lxe(e):uxe(e)),fxe=()=>`expurgées`,pxe=()=>`redacted`,mxe=((e={},t={})=>(t.locale??q())===`fr`?fxe(e):pxe(e)),hxe=()=>` : aucun contenu de message, pièce jointe ou jeton n’est stocké — uniquement des longueurs, codes et indicateurs.`,gxe=()=>`: no message content, attachment or token is stored — only lengths, codes and flags.`,_xe=((e={},t={})=>(t.locale??q())===`fr`?hxe(e):gxe(e)),vxe=()=>`La plage temporelle filtre la fenêtre récente — une plage antérieure peut être partielle.`,yxe=()=>`The time range filters the recent window — an older range may be partial.`,bxe=((e={},t={})=>(t.locale??q())===`fr`?vxe(e):yxe(e)),xxe=()=>`Rechercher (kind, principal, rôle, route, correlationId)`,Sxe=()=>`Search (kind, principal, role, route, correlationId)`,Cxe=((e={},t={})=>(t.locale??q())===`fr`?xxe(e):Sxe(e)),wxe=()=>`Statut`,Txe=()=>`Status`,Exe=((e={},t={})=>(t.locale??q())===`fr`?wxe(e):Txe(e)),Dxe=()=>`Tous statuts`,Oxe=()=>`All statuses`,kxe=((e={},t={})=>(t.locale??q())===`fr`?Dxe(e):Oxe(e)),Axe=()=>`Principal`,jxe=()=>`Principal`,Mxe=((e={},t={})=>(t.locale??q())===`fr`?Axe(e):jxe(e)),Nxe=()=>`Tous principaux`,Pxe=()=>`All principals`,Fxe=((e={},t={})=>(t.locale??q())===`fr`?Nxe(e):Pxe(e)),Ixe=()=>`Direction`,Lxe=()=>`Direction`,Rxe=((e={},t={})=>(t.locale??q())===`fr`?Ixe(e):Lxe(e)),zxe=()=>`Toutes directions`,Bxe=()=>`All directions`,Vxe=((e={},t={})=>(t.locale??q())===`fr`?zxe(e):Bxe(e)),Hxe=()=>`Rôle`,Uxe=()=>`Role`,Wxe=((e={},t={})=>(t.locale??q())===`fr`?Hxe(e):Uxe(e)),Gxe=()=>`Tous les rôles`,Kxe=()=>`All roles`,qxe=((e={},t={})=>(t.locale??q())===`fr`?Gxe(e):Kxe(e)),Jxe=()=>`Tous les kinds`,Yxe=()=>`All kinds`,Xxe=((e={},t={})=>(t.locale??q())===`fr`?Jxe(e):Yxe(e)),Zxe=()=>`tous les kinds`,Qxe=()=>`all kinds`,$xe=((e={},t={})=>(t.locale??q())===`fr`?Zxe(e):Qxe(e)),eSe=e=>`${e?.count} lignes`,tSe=e=>`${e?.count} rows`,nSe=((e,t={})=>(t.locale??q())===`fr`?eSe(e):tSe(e)),rSe=()=>`Effacer le filtre de corrélation`,iSe=()=>`Clear correlation filter`,aSe=((e={},t={})=>(t.locale??q())===`fr`?rSe(e):iSe(e)),oSe=()=>`filtre: correlationId=`,sSe=()=>`filter: correlationId=`,cSe=((e={},t={})=>(t.locale??q())===`fr`?oSe(e):sSe(e)),lSe=()=>`Effacer`,uSe=()=>`Clear`,dSe=((e={},t={})=>(t.locale??q())===`fr`?lSe(e):uSe(e)),fSe=()=>`Traces`,pSe=()=>`Traces`,mSe=((e={},t={})=>(t.locale??q())===`fr`?fSe(e):pSe(e)),hSe=()=>`Aucun événement pour cette corrélation dans la fenêtre.`,gSe=()=>`No event for this correlation in the window.`,_Se=((e={},t={})=>(t.locale??q())===`fr`?hSe(e):gSe(e)),vSe=()=>`Aucun événement tracé pour l’instant.`,ySe=()=>`No traced event yet.`,bSe=((e={},t={})=>(t.locale??q())===`fr`?vSe(e):ySe(e)),xSe=()=>`Quand`,SSe=()=>`When`,CSe=((e={},t={})=>(t.locale??q())===`fr`?xSe(e):SSe(e)),wSe=()=>`Kind`,TSe=()=>`Kind`,ESe=((e={},t={})=>(t.locale??q())===`fr`?wSe(e):TSe(e)),DSe=()=>`Résultat`,OSe=()=>`Result`,kSe=((e={},t={})=>(t.locale??q())===`fr`?DSe(e):OSe(e)),ASe=()=>`ok`,jSe=()=>`ok`,MSe=((e={},t={})=>(t.locale??q())===`fr`?ASe(e):jSe(e)),NSe=()=>`Direction`,PSe=()=>`Direction`,FSe=((e={},t={})=>(t.locale??q())===`fr`?NSe(e):PSe(e)),ISe=()=>`Principal`,LSe=()=>`Principal`,RSe=((e={},t={})=>(t.locale??q())===`fr`?ISe(e):LSe(e)),zSe=()=>`Rôle`,BSe=()=>`Role`,VSe=((e={},t={})=>(t.locale??q())===`fr`?zSe(e):BSe(e)),HSe=()=>`Route`,USe=()=>`Route`,WSe=((e={},t={})=>(t.locale??q())===`fr`?HSe(e):USe(e)),GSe=()=>`Statut`,KSe=()=>`Status`,qSe=((e={},t={})=>(t.locale??q())===`fr`?GSe(e):KSe(e)),JSe=()=>`Latence`,YSe=()=>`Latency`,XSe=((e={},t={})=>(t.locale??q())===`fr`?JSe(e):YSe(e)),ZSe=()=>`Corrélation`,QSe=()=>`Correlation`,$Se=((e={},t={})=>(t.locale??q())===`fr`?ZSe(e):QSe(e)),eCe=()=>`Suivre ce tour (filtrer par correlationId)`,tCe=()=>`Follow this turn (filter by correlationId)`,nCe=((e={},t={})=>(t.locale??q())===`fr`?eCe(e):tCe(e)),rCe=()=>`Meta`,iCe=()=>`Meta`,aCe=((e={},t={})=>(t.locale??q())===`fr`?rCe(e):iCe(e)),oCe=()=>`Voir`,sCe=()=>`View`,cCe=((e={},t={})=>(t.locale??q())===`fr`?oCe(e):sCe(e)),lCe=()=>`Meta ·`,uCe=()=>`Meta ·`,dCe=((e={},t={})=>(t.locale??q())===`fr`?lCe(e):uCe(e)),fCe=()=>`expurgé`,pCe=()=>`redacted`,mCe=((e={},t={})=>(t.locale??q())===`fr`?fCe(e):pCe(e)),hCe=()=>`Métadonnées non-PHI uniquement (longueurs, codes, indicateurs). Aucun contenu de message n’est stocké.`,gCe=()=>`Non-PHI metadata only (lengths, codes, flags). No message content is stored.`,_Ce=((e={},t={})=>(t.locale??q())===`fr`?hCe(e):gCe(e)),vCe=()=>`Chargement…`,yCe=()=>`Loading…`,k$=((e={},t={})=>(t.locale??q())===`fr`?vCe(e):yCe(e)),bCe=()=>`Connexion refusée. Le domaine de ce compte n’est pas autorisé.`,xCe=()=>`Sign-in refused. This account’s email domain is not allowed.`,SCe=((e={},t={})=>(t.locale??q())===`fr`?bCe(e):xCe(e)),CCe=()=>`Se connecter avec Google`,wCe=()=>`Sign in with Google`,TCe=((e={},t={})=>(t.locale??q())===`fr`?CCe(e):wCe(e)),ECe=()=>`Se connecter avec Microsoft`,DCe=()=>`Sign in with Microsoft`,OCe=((e={},t={})=>(t.locale??q())===`fr`?ECe(e):DCe(e)),kCe=()=>`Aucun mode de connexion configuré.`,ACe=()=>`No sign-in method configured.`,jCe=((e={},t={})=>(t.locale??q())===`fr`?kCe(e):ACe(e)),MCe=()=>`Continuer (dev, sans compte)`,NCe=()=>`Continue (dev, no account)`,PCe=((e={},t={})=>(t.locale??q())===`fr`?MCe(e):NCe(e)),FCe=()=>`Compte`,ICe=()=>`Account`,LCe=((e={},t={})=>(t.locale??q())===`fr`?FCe(e):ICe(e)),RCe=()=>`En attente d’approbation`,zCe=()=>`Awaiting approval`,BCe=((e={},t={})=>(t.locale??q())===`fr`?RCe(e):zCe(e)),VCe=()=>`Ton compte est créé mais doit être approuvé par un administrateur avant d’accéder au chat.`,HCe=()=>`Your account has been created but must be approved by an administrator before you can access the chat.`,UCe=((e={},t={})=>(t.locale??q())===`fr`?VCe(e):HCe(e)),WCe=()=>`Vous explorez l’application en tant que`,GCe=()=>`You are exploring the application as`,KCe=((e={},t={})=>(t.locale??q())===`fr`?WCe(e):GCe(e)),qCe=()=>`. Toute action est exécutée et tracée en votre nom (`,JCe=()=>`. Every action is executed and traced in your name (`,YCe=((e={},t={})=>(t.locale??q())===`fr`?qCe(e):JCe(e)),XCe=()=>`).`,ZCe=()=>`).`,QCe=((e={},t={})=>(t.locale??q())===`fr`?XCe(e):ZCe(e)),$Ce=()=>`Quitter`,ewe=()=>`Exit`,twe=((e={},t={})=>(t.locale??q())===`fr`?$Ce(e):ewe(e)),nwe=()=>`Afficher la barre latérale`,rwe=()=>`Show sidebar`,iwe=((e={},t={})=>(t.locale??q())===`fr`?nwe(e):rwe(e)),awe=()=>`Réduire la barre latérale`,owe=()=>`Collapse sidebar`,swe=((e={},t={})=>(t.locale??q())===`fr`?awe(e):owe(e)),cwe=()=>`Paramètres`,lwe=()=>`Settings`,uwe=((e={},t={})=>(t.locale??q())===`fr`?cwe(e):lwe(e)),dwe=()=>`Redimensionner la barre latérale`,fwe=()=>`Resize sidebar`,pwe=((e={},t={})=>(t.locale??q())===`fr`?dwe(e):fwe(e)),mwe=()=>`Accès non autorisé`,hwe=()=>`Access denied`,gwe=((e={},t={})=>(t.locale??q())===`fr`?mwe(e):hwe(e)),_we=()=>`Vous n’avez pas la permission de consulter cet onglet. Choisissez un onglet disponible dans le menu, ou contactez votre administrateur.`,vwe=()=>`You do not have permission to view this tab. Choose an available tab from the menu, or contact your administrator.`,ywe=((e={},t={})=>(t.locale??q())===`fr`?_we(e):vwe(e)),bwe=()=>`Une erreur est survenue`,xwe=()=>`Something went wrong`,Swe=((e={},t={})=>(t.locale??q())===`fr`?bwe(e):xwe(e)),Cwe=()=>`Cette page n’a pas pu être affichée. Réessayez, ou revenez à l’accueil. Si le problème persiste, contactez votre administrateur.`,wwe=()=>`This page could not be displayed. Try again, or return home. If the problem persists, contact your administrator.`,Twe=((e={},t={})=>(t.locale??q())===`fr`?Cwe(e):wwe(e)),Ewe=()=>`Réessayer`,Dwe=()=>`Retry`,Owe=((e={},t={})=>(t.locale??q())===`fr`?Ewe(e):Dwe(e)),kwe=()=>`Accueil`,Awe=()=>`Home`,A$=((e={},t={})=>(t.locale??q())===`fr`?kwe(e):Awe(e)),jwe=()=>`Page introuvable`,Mwe=()=>`Page not found`,Nwe=((e={},t={})=>(t.locale??q())===`fr`?jwe(e):Mwe(e)),Pwe=()=>`Cette adresse ne correspond à aucune page de l’application.`,Fwe=()=>`This address does not match any page in the application.`,Iwe=((e={},t={})=>(t.locale??q())===`fr`?Pwe(e):Fwe(e)),Lwe=e=>`Agents de ${e?.user}`,Rwe=e=>`${e?.user}'s agents`,zwe=((e,t={})=>(t.locale??q())===`fr`?Lwe(e):Rwe(e)),Bwe=()=>`Associez les agents découverts (par instance) et désignez l'agent par défaut. Au moins un agent est requis pour créer des conversations.`,Vwe=()=>`Assign the discovered agents (per instance) and designate the default agent. At least one agent is required to create conversations.`,Hwe=((e={},t={})=>(t.locale??q())===`fr`?Bwe(e):Vwe(e)),Uwe=()=>`Chargement…`,Wwe=()=>`Loading…`,Gwe=((e={},t={})=>(t.locale??q())===`fr`?Uwe(e):Wwe(e)),Kwe=()=>`Aucune instance configurée. Ajoutez-en une dans l'onglet Instances.`,qwe=()=>`No instance configured. Add one in the Instances tab.`,Jwe=((e={},t={})=>(t.locale??q())===`fr`?Kwe(e):qwe(e)),Ywe=()=>`Mise à jour de l'accès refusée`,Xwe=()=>`Access update denied`,Zwe=((e={},t={})=>(t.locale??q())===`fr`?Ywe(e):Xwe(e)),Qwe=()=>`Définition de l'agent par défaut refusée`,$we=()=>`Setting the default agent was denied`,eTe=((e={},t={})=>(t.locale??q())===`fr`?Qwe(e):$we(e)),tTe=()=>`hors-ligne`,nTe=()=>`offline`,rTe=((e={},t={})=>(t.locale??q())===`fr`?tTe(e):nTe(e)),iTe=()=>`Chargement des agents…`,aTe=()=>`Loading agents…`,oTe=((e={},t={})=>(t.locale??q())===`fr`?iTe(e):aTe(e)),sTe=()=>`Aucun agent découvert.`,cTe=()=>`No agent discovered.`,lTe=((e={},t={})=>(t.locale??q())===`fr`?sTe(e):cTe(e)),uTe=()=>`Aucun agent découvert (instance hors-ligne).`,dTe=()=>`No agent discovered (instance offline).`,fTe=((e={},t={})=>(t.locale??q())===`fr`?uTe(e):dTe(e)),pTe=e=>`Assigner ${e?.name}`,mTe=e=>`Assign ${e?.name}`,hTe=((e,t={})=>(t.locale??q())===`fr`?pTe(e):mTe(e)),gTe=()=>`supprimé`,_Te=()=>`removed`,vTe=((e={},t={})=>(t.locale??q())===`fr`?gTe(e):_Te(e)),yTe=()=>`Agent par défaut`,bTe=()=>`Default agent`,j$=((e={},t={})=>(t.locale??q())===`fr`?yTe(e):bTe(e)),xTe=()=>`Définir comme agent par défaut`,STe=()=>`Set as default agent`,M$=((e={},t={})=>(t.locale??q())===`fr`?xTe(e):STe(e)),CTe=()=>`Santé du bridge — sondage actif toutes les minutes. Données non-secrètes uniquement : joignabilité, état des connexions, dernière cause d’échec. Les secrets (tokens, device identity) vivent dans l’environnement du bridge, jamais ici.`,wTe=()=>`Bridge health — active poll every minute. Non-secret data only: reachability, connection states, last failure cause. Secrets (tokens, device identity) live in the bridge environment, never here.`,TTe=((e={},t={})=>(t.locale??q())===`fr`?CTe(e):wTe(e)),ETe=()=>`Chargement…`,DTe=()=>`Loading…`,N$=((e={},t={})=>(t.locale??q())===`fr`?ETe(e):DTe(e)),OTe=()=>`Aucun relevé pour l’instant — le sondage tourne chaque minute. Reviens dans un moment.`,kTe=()=>`No reading yet — the poll runs every minute. Check back in a moment.`,ATe=((e={},t={})=>(t.locale??q())===`fr`?OTe(e):kTe(e)),jTe=()=>`Bridge opérationnel`,MTe=()=>`Bridge operational`,NTe=((e={},t={})=>(t.locale??q())===`fr`?jTe(e):MTe(e)),PTe=()=>`Bridge injoignable`,FTe=()=>`Bridge unreachable`,ITe=((e={},t={})=>(t.locale??q())===`fr`?PTe(e):FTe(e)),LTe=e=>`Bridge : ${e?.count} connexion(s) en erreur`,RTe=e=>`Bridge: ${e?.count} connection(s) in error`,zTe=((e,t={})=>(t.locale??q())===`fr`?LTe(e):RTe(e)),BTe=e=>`Vérifié à ${e?.time}`,VTe=e=>`Checked at ${e?.time}`,P$=((e,t={})=>(t.locale??q())===`fr`?BTe(e):VTe(e)),HTe=e=>`· Bridge démarré le ${e?.time}`,UTe=e=>`· Bridge started on ${e?.time}`,WTe=((e,t={})=>(t.locale??q())===`fr`?HTe(e):UTe(e)),GTe=()=>`↗ Anomalies`,KTe=()=>`↗ Anomalies`,qTe=((e={},t={})=>(t.locale??q())===`fr`?GTe(e):KTe(e)),JTe=e=>`Connexions (${e?.count})`,YTe=e=>`Connections (${e?.count})`,XTe=((e,t={})=>(t.locale??q())===`fr`?JTe(e):YTe(e)),ZTe=()=>`Aucune connexion encore éprouvée. L’état d’une connexion apparaît dès qu’un message la sollicite (le bridge se connecte à la demande).`,QTe=()=>`No connection tested yet. A connection's state appears as soon as a message exercises it (the bridge connects on demand).`,$Te=((e={},t={})=>(t.locale??q())===`fr`?ZTe(e):QTe(e)),eEe=e=>`${e?.ok} OK · ${e?.errors} échec(s) · ${e?.attempts} tentative(s)`,tEe=e=>`${e?.ok} OK · ${e?.errors} failure(s) · ${e?.attempts} attempt(s)`,nEe=((e,t={})=>(t.locale??q())===`fr`?eEe(e):tEe(e)),rEe=e=>` · dernier OK ${e?.time}`,iEe=e=>` · last OK ${e?.time}`,aEe=((e,t={})=>(t.locale??q())===`fr`?rEe(e):iEe(e)),oEe=()=>`connectée`,sEe=()=>`connected`,cEe=((e={},t={})=>(t.locale??q())===`fr`?oEe(e):sEe(e)),lEe=()=>`erreur`,uEe=()=>`error`,dEe=((e={},t={})=>(t.locale??q())===`fr`?lEe(e):uEe(e)),fEe=()=>`inactive`,pEe=()=>`inactive`,mEe=((e={},t={})=>(t.locale??q())===`fr`?fEe(e):pEe(e)),hEe=()=>`5 dernières minutes`,gEe=()=>`Last 5 minutes`,_Ee=((e={},t={})=>(t.locale??q())===`fr`?hEe(e):gEe(e)),vEe=()=>`15 dernières minutes`,yEe=()=>`Last 15 minutes`,bEe=((e={},t={})=>(t.locale??q())===`fr`?vEe(e):yEe(e)),xEe=()=>`30 dernières minutes`,SEe=()=>`Last 30 minutes`,CEe=((e={},t={})=>(t.locale??q())===`fr`?xEe(e):SEe(e)),wEe=()=>`Dernière heure`,TEe=()=>`Last hour`,EEe=((e={},t={})=>(t.locale??q())===`fr`?wEe(e):TEe(e)),DEe=()=>`3 dernières heures`,OEe=()=>`Last 3 hours`,kEe=((e={},t={})=>(t.locale??q())===`fr`?DEe(e):OEe(e)),AEe=()=>`6 dernières heures`,jEe=()=>`Last 6 hours`,MEe=((e={},t={})=>(t.locale??q())===`fr`?AEe(e):jEe(e)),NEe=()=>`12 dernières heures`,PEe=()=>`Last 12 hours`,FEe=((e={},t={})=>(t.locale??q())===`fr`?NEe(e):PEe(e)),IEe=()=>`Dernières 24 heures`,LEe=()=>`Last 24 hours`,REe=((e={},t={})=>(t.locale??q())===`fr`?IEe(e):LEe(e)),zEe=()=>`2 derniers jours`,BEe=()=>`Last 2 days`,VEe=((e={},t={})=>(t.locale??q())===`fr`?zEe(e):BEe(e)),HEe=()=>`7 derniers jours`,UEe=()=>`Last 7 days`,WEe=((e={},t={})=>(t.locale??q())===`fr`?HEe(e):UEe(e)),GEe=()=>`30 derniers jours`,KEe=()=>`Last 30 days`,qEe=((e={},t={})=>(t.locale??q())===`fr`?GEe(e):KEe(e)),JEe=()=>`90 derniers jours`,YEe=()=>`Last 90 days`,XEe=((e={},t={})=>(t.locale??q())===`fr`?JEe(e):YEe(e)),ZEe=()=>`Appels API`,QEe=()=>`API calls`,$Ee=((e={},t={})=>(t.locale??q())===`fr`?ZEe(e):QEe(e)),eDe=()=>`Erreurs API`,tDe=()=>`API errors`,nDe=((e={},t={})=>(t.locale??q())===`fr`?eDe(e):tDe(e)),rDe=()=>`Latence moyenne`,iDe=()=>`Average latency`,aDe=((e={},t={})=>(t.locale??q())===`fr`?rDe(e):iDe(e)),oDe=()=>`Ingestion OpenClaw`,sDe=()=>`OpenClaw ingest`,cDe=((e={},t={})=>(t.locale??q())===`fr`?oDe(e):sDe(e)),lDe=()=>`Messages envoyés`,uDe=()=>`Messages sent`,dDe=((e={},t={})=>(t.locale??q())===`fr`?lDe(e):uDe(e)),fDe=()=>`Erreurs de stream`,pDe=()=>`Stream errors`,mDe=((e={},t={})=>(t.locale??q())===`fr`?fDe(e):pDe(e)),hDe=()=>`Indicateurs agrégés par heure à partir des traces expurgées (métadonnées non-PHI uniquement). Mise à jour en direct (useQuery) — le rollup tourne chaque heure.`,gDe=()=>`Hourly aggregated indicators from redacted traces (non-PHI metadata only). Live updates (useQuery) — the rollup runs every hour.`,_De=((e={},t={})=>(t.locale??q())===`fr`?hDe(e):gDe(e)),vDe=()=>`La plage filtre l’historique des rollups — une plage antérieure peut être partielle.`,yDe=()=>`The range filters the rollup history — an earlier range may be partial.`,bDe=((e={},t={})=>(t.locale??q())===`fr`?vDe(e):yDe(e)),xDe=()=>`Chargement des KPI…`,SDe=()=>`Loading KPIs…`,CDe=((e={},t={})=>(t.locale??q())===`fr`?xDe(e):SDe(e)),wDe=()=>`Aucune donnée KPI — le rollup tourne chaque heure ; lance-le ou attends.`,TDe=()=>`No KPI data — the rollup runs every hour; run it or wait.`,EDe=((e={},t={})=>(t.locale??q())===`fr`?wDe(e):TDe(e)),DDe=e=>`dernier : ${e?.value}`,ODe=e=>`latest: ${e?.value}`,kDe=((e,t={})=>(t.locale??q())===`fr`?DDe(e):ODe(e)),ADe=()=>`aucune donnée`,jDe=()=>`no data`,MDe=((e={},t={})=>(t.locale??q())===`fr`?ADe(e):jDe(e)),NDe=e=>`${e?.count} h`,PDe=e=>`${e?.count} h`,FDe=((e,t={})=>(t.locale??q())===`fr`?NDe(e):PDe(e)),IDe=e=>`Série horaire (max ${e?.max} ${e?.unit})`,LDe=e=>`Hourly series (max ${e?.max} ${e?.unit})`,RDe=((e,t={})=>(t.locale??q())===`fr`?IDe(e):LDe(e)),zDe=()=>`Mode dev — comptes & rôles`,BDe=()=>`Dev mode — accounts & roles`,VDe=((e={},t={})=>(t.locale??q())===`fr`?zDe(e):BDe(e)),HDe=()=>`Mode dev — comptes & rôles`,UDe=()=>`Dev mode — accounts & roles`,WDe=((e={},t={})=>(t.locale??q())===`fr`?HDe(e):UDe(e)),GDe=()=>`Change de rôle et « agis en tant que » pour tester plusieurs utilisateurs sans CLI. Visible uniquement en dev.`,KDe=()=>`Change roles and “act as” to test multiple users without the CLI. Visible in dev only.`,qDe=((e={},t={})=>(t.locale??q())===`fr`?GDe(e):KDe(e)),JDe=e=>`Moi — ${e?.canonical}`,YDe=e=>`Me — ${e?.canonical}`,XDe=((e,t={})=>(t.locale??q())===`fr`?JDe(e):YDe(e)),ZDe=()=>`Devenir admin`,QDe=()=>`Become admin`,$De=((e={},t={})=>(t.locale??q())===`fr`?ZDe(e):QDe(e)),eOe=()=>`Devenir user`,tOe=()=>`Become user`,nOe=((e={},t={})=>(t.locale??q())===`fr`?eOe(e):tOe(e)),rOe=()=>`Devenir pending`,iOe=()=>`Become pending`,aOe=((e={},t={})=>(t.locale??q())===`fr`?rOe(e):iOe(e)),oOe=()=>`Tu agis en tant que`,sOe=()=>`You are acting as`,cOe=((e={},t={})=>(t.locale??q())===`fr`?oOe(e):sOe(e)),lOe=()=>`Arrêter`,uOe=()=>`Stop`,dOe=((e={},t={})=>(t.locale??q())===`fr`?lOe(e):uOe(e)),fOe=()=>`Aucun autre compte. Déconnecte-toi puis reconnecte-toi (nouvelle identité anonyme) — elle sera active immédiatement.`,pOe=()=>`No other account. Sign out then sign back in (new anonymous identity) — it will be active immediately.`,mOe=((e={},t={})=>(t.locale??q())===`fr`?fOe(e):pOe(e)),hOe=()=>`Deviens admin d'abord`,gOe=()=>`Become admin first`,_Oe=((e={},t={})=>(t.locale??q())===`fr`?hOe(e):gOe(e)),vOe=()=>`Un compte pending ne peut pas être impersonné`,yOe=()=>`A pending account cannot be impersonated`,bOe=((e={},t={})=>(t.locale??q())===`fr`?vOe(e):yOe(e)),xOe=()=>`Agir en tant que cet utilisateur`,SOe=()=>`Act as this user`,COe=((e={},t={})=>(t.locale??q())===`fr`?xOe(e):SOe(e)),wOe=()=>`Agir en tant que`,TOe=()=>`Act as`,EOe=((e={},t={})=>(t.locale??q())===`fr`?wOe(e):TOe(e)),DOe=()=>`Nouveau chat`,OOe=()=>`New chat`,kOe=((e={},t={})=>(t.locale??q())===`fr`?DOe(e):OOe(e)),AOe=()=>`Nouveau projet`,jOe=()=>`New project`,F$=((e={},t={})=>(t.locale??q())===`fr`?AOe(e):jOe(e)),MOe=()=>`Nom du projet`,NOe=()=>`Project name`,POe=((e={},t={})=>(t.locale??q())===`fr`?MOe(e):NOe(e)),FOe=()=>`ex. Travail`,IOe=()=>`e.g. Work`,LOe=((e={},t={})=>(t.locale??q())===`fr`?FOe(e):IOe(e)),ROe=()=>`Créer`,zOe=()=>`Create`,BOe=((e={},t={})=>(t.locale??q())===`fr`?ROe(e):zOe(e)),VOe=()=>`Épinglés`,HOe=()=>`Pinned`,UOe=((e={},t={})=>(t.locale??q())===`fr`?VOe(e):HOe(e)),WOe=()=>`Glissez un chat ici`,GOe=()=>`Drop a chat here`,KOe=((e={},t={})=>(t.locale??q())===`fr`?WOe(e):GOe(e)),qOe=()=>`Chats`,JOe=()=>`Chats`,YOe=((e={},t={})=>(t.locale??q())===`fr`?qOe(e):JOe(e)),XOe=()=>`Sans titre`,ZOe=()=>`Untitled`,I$=((e={},t={})=>(t.locale??q())===`fr`?XOe(e):ZOe(e)),QOe=()=>`Supprimer le projet`,$Oe=()=>`Delete project`,L$=((e={},t={})=>(t.locale??q())===`fr`?QOe(e):$Oe(e)),eke=e=>`Supprimer le projet « ${e?.name} » ?`,tke=e=>`Delete project "${e?.name}"?`,nke=((e,t={})=>(t.locale??q())===`fr`?eke(e):tke(e)),rke=e=>`Cette action est irréversible : elle supprimera aussi définitivement ${e?.count} conversation(s) et tous leurs messages.`,ike=e=>`This action is irreversible: it will also permanently delete ${e?.count} conversation(s) and all their messages.`,ake=((e,t={})=>(t.locale??q())===`fr`?rke(e):ike(e)),oke=()=>`Cette action est irréversible.`,ske=()=>`This action is irreversible.`,cke=((e={},t={})=>(t.locale??q())===`fr`?oke(e):ske(e)),lke=()=>`Supprimer`,uke=()=>`Delete`,R$=((e={},t={})=>(t.locale??q())===`fr`?lke(e):uke(e)),dke=()=>`Déplacer / réordonner`,fke=()=>`Move / reorder`,pke=((e={},t={})=>(t.locale??q())===`fr`?dke(e):fke(e)),mke=()=>`Actions`,hke=()=>`Actions`,gke=((e={},t={})=>(t.locale??q())===`fr`?mke(e):hke(e)),_ke=()=>`Renommer`,vke=()=>`Rename`,yke=((e={},t={})=>(t.locale??q())===`fr`?_ke(e):vke(e)),bke=()=>`Désépingler`,xke=()=>`Unpin`,Ske=((e={},t={})=>(t.locale??q())===`fr`?bke(e):xke(e)),Cke=()=>`Épingler`,wke=()=>`Pin`,Tke=((e={},t={})=>(t.locale??q())===`fr`?Cke(e):wke(e)),Eke=()=>`Couleur`,Dke=()=>`Color`,Oke=((e={},t={})=>(t.locale??q())===`fr`?Eke(e):Dke(e)),kke=()=>`Aucune couleur`,Ake=()=>`No color`,jke=((e={},t={})=>(t.locale??q())===`fr`?kke(e):Ake(e)),Mke=()=>`Supprimer ce chat ?`,Nke=()=>`Delete this chat?`,Pke=((e={},t={})=>(t.locale??q())===`fr`?Mke(e):Nke(e)),Fke=()=>`Cette action est irréversible et supprimera ses messages.`,Ike=()=>`This action is irreversible and will delete its messages.`,Lke=((e={},t={})=>(t.locale??q())===`fr`?Fke(e):Ike(e)),Rke=e=>`Bridge : ${e?.provider}`,zke=e=>`Bridge: ${e?.provider}`,Bke=((e,t={})=>(t.locale??q())===`fr`?Rke(e):zke(e)),Vke=()=>`Renommer le chat`,Hke=()=>`Rename chat`,Uke=((e={},t={})=>(t.locale??q())===`fr`?Vke(e):Hke(e)),Wke=()=>`Titre`,Gke=()=>`Title`,Kke=((e={},t={})=>(t.locale??q())===`fr`?Wke(e):Gke(e)),qke=()=>`Réflexion…`,Jke=()=>`Thinking…`,Yke=((e={},t={})=>(t.locale??q())===`fr`?qke(e):Jke(e)),Xke=()=>`Génération…`,Zke=()=>`Generating…`,Qke=((e={},t={})=>(t.locale??q())===`fr`?Xke(e):Zke(e)),$ke=()=>`Erreur`,eAe=()=>`Error`,tAe=((e={},t={})=>(t.locale??q())===`fr`?$ke(e):eAe(e)),nAe=()=>`La réponse a été générée côté agent mais n’a pas pu être finalisée (connexion au bridge interrompue en cours de route). Vous pouvez supprimer ou régénérer ce message.`,rAe=()=>`The reply was generated on the agent side but could not be finalized (the bridge connection dropped mid-stream). You can delete or regenerate this message.`,iAe=((e={},t={})=>(t.locale??q())===`fr`?nAe(e):rAe(e)),aAe=()=>`Interrompu`,oAe=()=>`Stopped`,sAe=((e={},t={})=>(t.locale??q())===`fr`?aAe(e):oAe(e)),cAe=()=>`contient`,lAe=()=>`contains`,uAe=((e={},t={})=>(t.locale??q())===`fr`?cAe(e):lAe(e)),dAe=()=>`Filtre avancé`,fAe=()=>`Advanced filter`,pAe=((e={},t={})=>(t.locale??q())===`fr`?dAe(e):fAe(e)),mAe=()=>`Aucun critère. Ajoutez une condition (toutes les conditions sont cumulées avec ET).`,hAe=()=>`No criteria. Add a condition (all conditions are combined with AND).`,gAe=((e={},t={})=>(t.locale??q())===`fr`?mAe(e):hAe(e)),_Ae=()=>`Champ`,vAe=()=>`Field`,yAe=((e={},t={})=>(t.locale??q())===`fr`?_Ae(e):vAe(e)),bAe=()=>`Valeur`,xAe=()=>`Value`,SAe=((e={},t={})=>(t.locale??q())===`fr`?bAe(e):xAe(e)),CAe=()=>`Supprimer la condition`,wAe=()=>`Remove condition`,TAe=((e={},t={})=>(t.locale??q())===`fr`?CAe(e):wAe(e)),EAe=()=>`Ajouter une condition`,DAe=()=>`Add condition`,OAe=((e={},t={})=>(t.locale??q())===`fr`?EAe(e):DAe(e)),kAe=()=>`Bridge : pas encore de relevé (sondage chaque minute)`,AAe=()=>`Bridge: no reading yet (polled every minute)`,jAe=((e={},t={})=>(t.locale??q())===`fr`?kAe(e):AAe(e)),MAe=()=>`Bridge opérationnel`,NAe=()=>`Bridge operational`,PAe=((e={},t={})=>(t.locale??q())===`fr`?MAe(e):NAe(e)),FAe=e=>` · vérifié à ${e?.time}`,IAe=e=>` · verified at ${e?.time}`,LAe=((e,t={})=>(t.locale??q())===`fr`?FAe(e):IAe(e)),RAe=e=>`Bridge indisponible (${e?.reason}) — ouvre l’onglet Bridge pour le détail`,zAe=e=>`Bridge unavailable (${e?.reason}) — open the Bridge tab for details`,BAe=((e,t={})=>(t.locale??q())===`fr`?RAe(e):zAe(e)),VAe=()=>`Utilisateur`,HAe=()=>`User`,UAe=((e={},t={})=>(t.locale??q())===`fr`?VAe(e):HAe(e)),WAe=()=>`Système`,GAe=()=>`System`,KAe=((e={},t={})=>(t.locale??q())===`fr`?WAe(e):GAe(e)),qAe=()=>`[Export limité aux 200 messages les plus récents de cette conversation]`,JAe=()=>`[Export limited to the 200 most recent messages of this conversation]`,YAe=((e={},t={})=>(t.locale??q())===`fr`?qAe(e):JAe(e)),XAe=()=>`Conversation`,ZAe=()=>`Conversation`,z$=((e={},t={})=>(t.locale??q())===`fr`?XAe(e):ZAe(e)),QAe=e=>`Exporté le ${e?.date}`,$Ae=e=>`Exported on ${e?.date}`,eje=((e,t={})=>(t.locale??q())===`fr`?QAe(e):$Ae(e)),tje=e=>`[fichier : ${e?.name}]`,nje=e=>`[file: ${e?.name}]`,rje=((e,t={})=>(t.locale??q())===`fr`?tje(e):nje(e)),ije=()=>`Rechercher dans les conversations`,aje=()=>`Search conversations`,oje=((e={},t={})=>(t.locale??q())===`fr`?ije(e):aje(e)),sje=()=>`Rechercher…`,cje=()=>`Search…`,lje=((e={},t={})=>(t.locale??q())===`fr`?sje(e):cje(e)),uje=()=>`Rechercher dans les conversations`,dje=()=>`Search conversations`,fje=((e={},t={})=>(t.locale??q())===`fr`?uje(e):dje(e)),pje=()=>`Rechercher dans toutes les conversations…`,mje=()=>`Search across all conversations…`,hje=((e={},t={})=>(t.locale??q())===`fr`?pje(e):mje(e)),gje=()=>`Recherche`,_je=()=>`Search`,vje=((e={},t={})=>(t.locale??q())===`fr`?gje(e):_je(e)),yje=e=>`Tapez au moins ${e?.count} caractères pour rechercher.`,bje=e=>`Type at least ${e?.count} characters to search.`,xje=((e,t={})=>(t.locale??q())===`fr`?yje(e):bje(e)),Sje=()=>`Recherche…`,Cje=()=>`Searching…`,wje=((e={},t={})=>(t.locale??q())===`fr`?Sje(e):Cje(e)),Tje=e=>`Aucune conversation ne correspond à « ${e?.term} ».`,Eje=e=>`No conversation matches “${e?.term}”.`,Dje=((e,t={})=>(t.locale??q())===`fr`?Tje(e):Eje(e)),Oje=()=>`Nouveau chat`,kje=()=>`New chat`,Aje=((e={},t={})=>(t.locale??q())===`fr`?Oje(e):kje(e)),jje=()=>`Titre`,Mje=()=>`Title`,Nje=((e={},t={})=>(t.locale??q())===`fr`?jje(e):Mje(e)),Pje=()=>`Message`,Fje=()=>`Message`,Ije=((e={},t={})=>(t.locale??q())===`fr`?Pje(e):Fje(e)),Lje=()=>`naviguer`,Rje=()=>`navigate`,zje=((e={},t={})=>(t.locale??q())===`fr`?Lje(e):Rje(e)),Bje=()=>`ouvrir`,Vje=()=>`open`,Hje=((e={},t={})=>(t.locale??q())===`fr`?Bje(e):Vje(e)),Uje=()=>`Échap`,Wje=()=>`Esc`,Gje=((e={},t={})=>(t.locale??q())===`fr`?Uje(e):Wje(e)),Kje=()=>`fermer`,qje=()=>`close`,Jje=((e={},t={})=>(t.locale??q())===`fr`?Kje(e):qje(e)),Yje=()=>`Choisir un agent`,Xje=()=>`Choose an agent`,Zje=((e={},t={})=>(t.locale??q())===`fr`?Yje(e):Xje(e)),Qje=()=>`Sélectionnez l’agent (et l’instance) pour cette conversation.`,$je=()=>`Select the agent (and instance) for this conversation.`,eMe=((e={},t={})=>(t.locale??q())===`fr`?Qje(e):$je(e)),tMe=()=>`Chargement…`,nMe=()=>`Loading…`,rMe=((e={},t={})=>(t.locale??q())===`fr`?tMe(e):nMe(e)),iMe=()=>`Aucun agent ne vous est assigné. Contactez votre administrateur pour qu’il vous en attribue un.`,aMe=()=>`No agent is assigned to you. Contact your administrator to have one assigned.`,oMe=((e={},t={})=>(t.locale??q())===`fr`?iMe(e):aMe(e)),sMe=()=>`Rechercher un agent…`,cMe=()=>`Search for an agent…`,lMe=((e={},t={})=>(t.locale??q())===`fr`?sMe(e):cMe(e)),uMe=()=>`Rechercher un agent`,dMe=()=>`Search for an agent`,fMe=((e={},t={})=>(t.locale??q())===`fr`?uMe(e):dMe(e)),pMe=()=>`Cet agent n’existe plus sur la gateway`,mMe=()=>`This agent no longer exists on the gateway`,hMe=((e={},t={})=>(t.locale??q())===`fr`?pMe(e):mMe(e)),gMe=()=>`Agent par défaut`,_Me=()=>`Default agent`,vMe=((e={},t={})=>(t.locale??q())===`fr`?gMe(e):_Me(e)),yMe=()=>`Rechercher`,bMe=()=>`Search`,xMe=((e={},t={})=>(t.locale??q())===`fr`?yMe(e):bMe(e)),SMe=()=>`Réinitialiser`,CMe=()=>`Reset`,wMe=((e={},t={})=>(t.locale??q())===`fr`?SMe(e):CMe(e)),TMe=()=>`Ajouter`,EMe=()=>`Add`,DMe=((e={},t={})=>(t.locale??q())===`fr`?TMe(e):EMe(e)),OMe=()=>`Aucun élément.`,kMe=()=>`No items.`,AMe=((e={},t={})=>(t.locale??q())===`fr`?OMe(e):kMe(e)),jMe=()=>`Chargement…`,MMe=()=>`Loading…`,NMe=((e={},t={})=>(t.locale??q())===`fr`?jMe(e):MMe(e)),PMe=()=>`Tout sélectionner`,FMe=()=>`Select all`,IMe=((e={},t={})=>(t.locale??q())===`fr`?PMe(e):FMe(e)),LMe=()=>`Sélectionner la ligne`,RMe=()=>`Select row`,zMe=((e={},t={})=>(t.locale??q())===`fr`?LMe(e):RMe(e)),BMe=()=>`Actions`,VMe=()=>`Actions`,HMe=((e={},t={})=>(t.locale??q())===`fr`?BMe(e):VMe(e)),UMe=()=>`Agent introuvable`,WMe=()=>`Agent not found`,GMe=((e={},t={})=>(t.locale??q())===`fr`?UMe(e):WMe(e)),KMe=()=>`L’agent configuré n’existe plus sur la passerelle. Vérifiez OPENCLAW_AGENT_ID dans le .env du bridge (il doit correspondre à un agent réel de la passerelle).`,qMe=()=>`The configured agent no longer exists on the gateway. Check OPENCLAW_AGENT_ID in the bridge .env (it must match a real gateway agent).`,JMe=((e={},t={})=>(t.locale??q())===`fr`?KMe(e):qMe(e)),YMe=()=>`Authentification refusée`,XMe=()=>`Authentication refused`,ZMe=((e={},t={})=>(t.locale??q())===`fr`?YMe(e):XMe(e)),QMe=()=>`Le token opérateur ne correspond pas au device pairé. Re-pairez un device dédié au bridge sur la passerelle et reportez son token + device identity.`,$Me=()=>`The operator token does not match the paired device. Re-pair a dedicated bridge device on the gateway and report its token + device identity.`,eNe=((e={},t={})=>(t.locale??q())===`fr`?QMe(e):$Me(e)),tNe=()=>`Signature device impossible`,nNe=()=>`Device signing failed`,rNe=((e={},t={})=>(t.locale??q())===`fr`?tNe(e):nNe(e)),iNe=()=>`La clé privée du device identity ne se décode pas. Vérifiez OPENCLAW_DEVICE_IDENTITY (format JSON, \\n simples) — voir fix-devid.mjs.`,aNe=()=>`The device identity private key won’t decode. Check OPENCLAW_DEVICE_IDENTITY (JSON format, single \\n) — see fix-devid.mjs.`,oNe=((e={},t={})=>(t.locale??q())===`fr`?iNe(e):aNe(e)),sNe=()=>`Portée insuffisante`,cNe=()=>`Insufficient scope`,lNe=((e={},t={})=>(t.locale??q())===`fr`?sNe(e):cNe(e)),uNe=()=>`Le pairing du device n’a pas la portée requise (operator.admin). Approuvez/élevez la portée du device sur la passerelle.`,dNe=()=>`The device pairing lacks the required scope (operator.admin). Approve/elevate the device scope on the gateway.`,fNe=((e={},t={})=>(t.locale??q())===`fr`?uNe(e):dNe(e)),pNe=()=>`Délai dépassé`,mNe=()=>`Timed out`,hNe=((e={},t={})=>(t.locale??q())===`fr`?pNe(e):mNe(e)),gNe=()=>`La passerelle n’a pas répondu à temps. Vérifiez qu’elle est démarrée et joignable (OPENCLAW_GATEWAY_URL).`,_Ne=()=>`The gateway did not respond in time. Check it’s started and reachable (OPENCLAW_GATEWAY_URL).`,vNe=((e={},t={})=>(t.locale??q())===`fr`?gNe(e):_Ne(e)),yNe=()=>`Passerelle déconnectée`,bNe=()=>`Gateway disconnected`,xNe=((e={},t={})=>(t.locale??q())===`fr`?yNe(e):bNe(e)),SNe=()=>`La connexion à la passerelle a été coupée. Vérifiez l’état du conteneur OpenClaw et l’URL/port de la passerelle.`,CNe=()=>`The connection to the gateway dropped. Check the OpenClaw container state and the gateway URL/port.`,wNe=((e={},t={})=>(t.locale??q())===`fr`?SNe(e):CNe(e)),TNe=()=>`Bridge injoignable`,ENe=()=>`Bridge unreachable`,DNe=((e={},t={})=>(t.locale??q())===`fr`?TNe(e):ENe(e)),ONe=()=>`Convex n’a pas pu joindre le bridge. Vérifiez que le conteneur bridge tourne et BRIDGE_URL (http://<ip-hôte>:8787).`,kNe=()=>`Convex could not reach the bridge. Check the bridge container is running and BRIDGE_URL (http://<host-ip>:8787).`,ANe=((e={},t={})=>(t.locale??q())===`fr`?ONe(e):kNe(e)),jNe=()=>`Requête invalide`,MNe=()=>`Invalid request`,NNe=((e={},t={})=>(t.locale??q())===`fr`?jNe(e):MNe(e)),PNe=()=>`La passerelle a rejeté la requête. Consultez les logs du bridge pour le détail brut.`,FNe=()=>`The gateway rejected the request. Check the bridge logs for the raw detail.`,INe=((e={},t={})=>(t.locale??q())===`fr`?PNe(e):FNe(e)),LNe=()=>`Bridge non configuré`,RNe=()=>`Bridge not configured`,zNe=((e={},t={})=>(t.locale??q())===`fr`?LNe(e):RNe(e)),BNe=()=>`BRIDGE_URL / BRIDGE_SHARED_SECRET ne sont pas définis côté Convex (npx convex env set).`,VNe=()=>`BRIDGE_URL / BRIDGE_SHARED_SECRET are not set on the Convex side (npx convex env set).`,HNe=((e={},t={})=>(t.locale??q())===`fr`?BNe(e):VNe(e)),UNe=()=>`Utilisateur non routé`,WNe=()=>`User not routed`,GNe=((e={},t={})=>(t.locale??q())===`fr`?UNe(e):WNe(e)),KNe=()=>`Ce compte n’est rattaché à aucune instance. Settings → Users → Override instance, ou affectez un groupe.`,qNe=()=>`This account is not attached to any instance. Settings → Users → Override instance, or assign a group.`,JNe=((e={},t={})=>(t.locale??q())===`fr`?KNe(e):qNe(e)),YNe=()=>`Erreur passerelle`,XNe=()=>`Gateway error`,ZNe=((e={},t={})=>(t.locale??q())===`fr`?YNe(e):XNe(e)),QNe=()=>`Cause non catégorisée. Consultez les logs du bridge pour le message brut.`,$Ne=()=>`Uncategorized cause. Check the bridge logs for the raw message.`,ePe=((e={},t={})=>(t.locale??q())===`fr`?QNe(e):$Ne(e)),tPe=()=>`Cause inconnue`,nPe=()=>`Unknown cause`,rPe=((e={},t={})=>(t.locale??q())===`fr`?tPe(e):nPe(e)),iPe=()=>`Aucun code de cause n’a été remonté (bridge antérieur à cette version ?). Consultez les logs du bridge.`,aPe=()=>`No cause code was reported (bridge older than this version?). Check the bridge logs.`,oPe=((e={},t={})=>(t.locale??q())===`fr`?iPe(e):aPe(e)),sPe=()=>`Cause non répertoriée — voir les logs du bridge.`,cPe=()=>`Cause not catalogued — see the bridge logs.`,lPe=((e={},t={})=>(t.locale??q())===`fr`?sPe(e):cPe(e)),uPe=e=>`Notifications (${e?.count} non lues)`,dPe=e=>`Notifications (${e?.count} unread)`,fPe=((e,t={})=>(t.locale??q())===`fr`?uPe(e):dPe(e)),pPe=()=>`Notifications`,mPe=()=>`Notifications`,hPe=((e={},t={})=>(t.locale??q())===`fr`?pPe(e):mPe(e)),gPe=()=>`Notifications`,_Pe=()=>`Notifications`,vPe=((e={},t={})=>(t.locale??q())===`fr`?gPe(e):_Pe(e)),yPe=()=>`Tout lu`,bPe=()=>`Mark all read`,xPe=((e={},t={})=>(t.locale??q())===`fr`?yPe(e):bPe(e)),SPe=()=>`Tout effacer`,CPe=()=>`Clear all`,wPe=((e={},t={})=>(t.locale??q())===`fr`?SPe(e):CPe(e)),TPe=()=>`Aucune notification.`,EPe=()=>`No notifications.`,DPe=((e={},t={})=>(t.locale??q())===`fr`?TPe(e):EPe(e)),OPe=()=>`Marquer comme lue`,kPe=()=>`Mark as read`,B$=((e={},t={})=>(t.locale??q())===`fr`?OPe(e):kPe(e)),APe=()=>`Effacer la notification`,jPe=()=>`Clear notification`,V$=((e={},t={})=>(t.locale??q())===`fr`?APe(e):jPe(e)),MPe=()=>`Mes signalements`,NPe=()=>`My reports`,PPe=((e={},t={})=>(t.locale??q())===`fr`?MPe(e):NPe(e)),FPe=()=>`Répondu`,IPe=()=>`Answered`,LPe=((e={},t={})=>(t.locale??q())===`fr`?FPe(e):IPe(e)),RPe=()=>`En attente`,zPe=()=>`Pending`,BPe=((e={},t={})=>(t.locale??q())===`fr`?RPe(e):zPe(e)),VPe=()=>`Administrateur`,HPe=()=>`Administrator`,UPe=((e={},t={})=>(t.locale??q())===`fr`?VPe(e):HPe(e)),WPe=()=>`Vous`,GPe=()=>`You`,KPe=((e={},t={})=>(t.locale??q())===`fr`?WPe(e):GPe(e)),qPe=()=>`Voir la conversation`,JPe=()=>`View the conversation`,YPe=((e={},t={})=>(t.locale??q())===`fr`?qPe(e):JPe(e)),XPe=()=>`Réponse à votre signalement`,ZPe=()=>`Reply to your report`,QPe=((e={},t={})=>(t.locale??q())===`fr`?XPe(e):ZPe(e)),$Pe=()=>`Un administrateur a répondu à un signalement que vous avez envoyé.`,eFe=()=>`An administrator replied to a report you sent.`,tFe=((e={},t={})=>(t.locale??q())===`fr`?$Pe(e):eFe(e)),nFe=()=>`Mots modifiés / altérés`,rFe=()=>`Modified / altered words`,iFe=((e={},t={})=>(t.locale??q())===`fr`?nFe(e):rFe(e)),aFe=()=>`Réponse incorrecte`,oFe=()=>`Incorrect answer`,sFe=((e={},t={})=>(t.locale??q())===`fr`?aFe(e):oFe(e)),cFe=()=>`Incohérence`,lFe=()=>`Incoherence`,uFe=((e={},t={})=>(t.locale??q())===`fr`?cFe(e):lFe(e)),dFe=()=>`Formatage`,fFe=()=>`Formatting`,pFe=((e={},t={})=>(t.locale??q())===`fr`?dFe(e):fFe(e)),mFe=()=>`Latence`,hFe=()=>`Latency`,gFe=((e={},t={})=>(t.locale??q())===`fr`?mFe(e):hFe(e)),_Fe=()=>`Erreur API`,vFe=()=>`API error`,yFe=((e={},t={})=>(t.locale??q())===`fr`?_Fe(e):vFe(e)),bFe=()=>`Autre`,xFe=()=>`Other`,SFe=((e={},t={})=>(t.locale??q())===`fr`?bFe(e):xFe(e)),CFe=()=>`Utilisateurs`,wFe=()=>`Users`,TFe=((e={},t={})=>(t.locale??q())===`fr`?CFe(e):wFe(e)),EFe=()=>`Instances`,DFe=()=>`Instances`,OFe=((e={},t={})=>(t.locale??q())===`fr`?EFe(e):DFe(e)),kFe=()=>`Bridge`,AFe=()=>`Bridge`,jFe=((e={},t={})=>(t.locale??q())===`fr`?kFe(e):AFe(e)),MFe=()=>`Comptes de service`,NFe=()=>`Service accounts`,PFe=((e={},t={})=>(t.locale??q())===`fr`?MFe(e):NFe(e)),FFe=()=>`Rôles`,IFe=()=>`Roles`,LFe=((e={},t={})=>(t.locale??q())===`fr`?FFe(e):IFe(e)),RFe=()=>`Traces`,zFe=()=>`Traces`,BFe=((e={},t={})=>(t.locale??q())===`fr`?RFe(e):zFe(e)),VFe=()=>`KPI`,HFe=()=>`KPI`,UFe=((e={},t={})=>(t.locale??q())===`fr`?VFe(e):HFe(e)),WFe=()=>`Anomalies`,GFe=()=>`Anomalies`,KFe=((e={},t={})=>(t.locale??q())===`fr`?WFe(e):GFe(e)),qFe=()=>`Intégrations`,JFe=()=>`Integrations`,YFe=((e={},t={})=>(t.locale??q())===`fr`?qFe(e):JFe(e)),XFe=()=>`Audit`,ZFe=()=>`Audit`,QFe=((e={},t={})=>(t.locale??q())===`fr`?XFe(e):ZFe(e)),$Fe=()=>`Feedbacks`,eIe=()=>`Feedbacks`,tIe=((e={},t={})=>(t.locale??q())===`fr`?$Fe(e):eIe(e)),nIe=()=>`Groupes`,rIe=()=>`Groups`,iIe=((e={},t={})=>(t.locale??q())===`fr`?nIe(e):rIe(e)),aIe=()=>`Accès`,oIe=()=>`Access`,sIe=((e={},t={})=>(t.locale??q())===`fr`?aIe(e):oIe(e)),cIe=()=>`Inspectez les accès d’un utilisateur : ses groupes, les agents et chartes qui lui sont disponibles (avec leur provenance) et ses permissions effectives. Lecture seule.`,lIe=()=>`Inspect a user’s access: their groups, the agents and charts available to them (with provenance), and their effective permissions. Read-only.`,uIe=((e={},t={})=>(t.locale??q())===`fr`?cIe(e):lIe(e)),dIe=()=>`Choisir un utilisateur`,fIe=()=>`Pick a user`,H$=((e={},t={})=>(t.locale??q())===`fr`?dIe(e):fIe(e)),pIe=()=>`Sélectionnez un utilisateur pour voir ses accès.`,mIe=()=>`Select a user to see their access.`,hIe=((e={},t={})=>(t.locale??q())===`fr`?pIe(e):mIe(e)),gIe=()=>`Identité`,_Ie=()=>`Identity`,vIe=((e={},t={})=>(t.locale??q())===`fr`?gIe(e):_Ie(e)),yIe=()=>`Groupes`,bIe=()=>`Groups`,xIe=((e={},t={})=>(t.locale??q())===`fr`?yIe(e):bIe(e)),SIe=()=>`Agents disponibles`,CIe=()=>`Available agents`,wIe=((e={},t={})=>(t.locale??q())===`fr`?SIe(e):CIe(e)),TIe=()=>`Chartes disponibles`,EIe=()=>`Available charts`,DIe=((e={},t={})=>(t.locale??q())===`fr`?TIe(e):EIe(e)),OIe=()=>`Permissions effectives`,kIe=()=>`Effective permissions`,AIe=((e={},t={})=>(t.locale??q())===`fr`?OIe(e):kIe(e)),jIe=()=>`Aucun`,MIe=()=>`None`,U$=((e={},t={})=>(t.locale??q())===`fr`?jIe(e):MIe(e)),NIe=()=>`Défaut`,PIe=()=>`Default`,FIe=((e={},t={})=>(t.locale??q())===`fr`?NIe(e):PIe(e)),IIe=()=>`Direct`,LIe=()=>`Direct`,RIe=((e={},t={})=>(t.locale??q())===`fr`?IIe(e):LIe(e)),zIe=e=>`Groupe : ${e?.group}`,BIe=e=>`Group: ${e?.group}`,W$=((e,t={})=>(t.locale??q())===`fr`?zIe(e):BIe(e)),VIe=()=>`Commune`,HIe=()=>`Common`,UIe=((e={},t={})=>(t.locale??q())===`fr`?VIe(e):HIe(e)),WIe=()=>`Perso`,GIe=()=>`Personal`,KIe=((e={},t={})=>(t.locale??q())===`fr`?WIe(e):GIe(e)),qIe=()=>`Groupes`,JIe=()=>`Groups`,YIe=((e={},t={})=>(t.locale??q())===`fr`?qIe(e):JIe(e)),XIe=()=>`Regroupez des utilisateurs et partagez des agents par groupe. Chaque membre hérite des agents du groupe en plus de ses agents directs.`,ZIe=()=>`Group users and share agents by group. Each member inherits the group's agents on top of their direct agents.`,QIe=((e={},t={})=>(t.locale??q())===`fr`?XIe(e):ZIe(e)),$Ie=()=>`Nouveau groupe`,eLe=()=>`New group`,tLe=((e={},t={})=>(t.locale??q())===`fr`?$Ie(e):eLe(e)),nLe=()=>`Aucun groupe pour le moment.`,rLe=()=>`No groups yet.`,iLe=((e={},t={})=>(t.locale??q())===`fr`?nLe(e):rLe(e)),aLe=()=>`Nom`,oLe=()=>`Name`,sLe=((e={},t={})=>(t.locale??q())===`fr`?aLe(e):oLe(e)),cLe=()=>`Membres`,lLe=()=>`Members`,uLe=((e={},t={})=>(t.locale??q())===`fr`?cLe(e):lLe(e)),dLe=()=>`Agents`,fLe=()=>`Agents`,pLe=((e={},t={})=>(t.locale??q())===`fr`?dLe(e):fLe(e)),mLe=()=>`Gérer`,hLe=()=>`Manage`,gLe=((e={},t={})=>(t.locale??q())===`fr`?mLe(e):hLe(e)),_Le=()=>`Gérer`,vLe=()=>`Manage`,yLe=((e={},t={})=>(t.locale??q())===`fr`?_Le(e):vLe(e)),bLe=()=>`Renommer`,xLe=()=>`Rename`,SLe=((e={},t={})=>(t.locale??q())===`fr`?bLe(e):xLe(e)),CLe=()=>`Supprimer`,wLe=()=>`Delete`,TLe=((e={},t={})=>(t.locale??q())===`fr`?CLe(e):wLe(e)),ELe=()=>`Enregistrer`,DLe=()=>`Save`,OLe=((e={},t={})=>(t.locale??q())===`fr`?ELe(e):DLe(e)),kLe=()=>`Annuler`,ALe=()=>`Cancel`,jLe=((e={},t={})=>(t.locale??q())===`fr`?kLe(e):ALe(e)),MLe=()=>`Nouveau groupe`,NLe=()=>`New group`,PLe=((e={},t={})=>(t.locale??q())===`fr`?MLe(e):NLe(e)),FLe=()=>`Renommer le groupe`,ILe=()=>`Rename group`,LLe=((e={},t={})=>(t.locale??q())===`fr`?FLe(e):ILe(e)),RLe=()=>`Le nom est libre ; un identifiant stable est généré automatiquement.`,zLe=()=>`The name is free-form; a stable identifier is generated automatically.`,BLe=((e={},t={})=>(t.locale??q())===`fr`?RLe(e):zLe(e)),VLe=()=>`Nom`,HLe=()=>`Name`,ULe=((e={},t={})=>(t.locale??q())===`fr`?VLe(e):HLe(e)),WLe=()=>`Description`,GLe=()=>`Description`,KLe=((e={},t={})=>(t.locale??q())===`fr`?WLe(e):GLe(e)),qLe=e=>`Supprimer le groupe « ${e?.name} » ?`,JLe=e=>`Delete group "${e?.name}"?`,YLe=((e,t={})=>(t.locale??q())===`fr`?qLe(e):JLe(e)),XLe=()=>`Cette action supprime le groupe, ses adhésions et les agents partagés. Elle est irréversible.`,ZLe=()=>`This deletes the group, its memberships and shared agents. It cannot be undone.`,QLe=((e={},t={})=>(t.locale??q())===`fr`?XLe(e):ZLe(e)),$Le=()=>`Supprimer le groupe`,eRe=()=>`Delete group`,tRe=((e={},t={})=>(t.locale??q())===`fr`?$Le(e):eRe(e)),nRe=e=>`Gérer « ${e?.name} »`,rRe=e=>`Manage "${e?.name}"`,iRe=((e,t={})=>(t.locale??q())===`fr`?nRe(e):rRe(e)),aRe=()=>`Ajoutez ou retirez des membres et partagez des agents découverts avec ce groupe.`,oRe=()=>`Add or remove members and share discovered agents with this group.`,sRe=((e={},t={})=>(t.locale??q())===`fr`?aRe(e):oRe(e)),cRe=()=>`Membres`,lRe=()=>`Members`,uRe=((e={},t={})=>(t.locale??q())===`fr`?cRe(e):lRe(e)),dRe=e=>`Basculer l'adhésion de ${e?.user}`,fRe=e=>`Toggle membership of ${e?.user}`,pRe=((e,t={})=>(t.locale??q())===`fr`?dRe(e):fRe(e)),mRe=e=>`Partager l'agent ${e?.name}`,hRe=e=>`Share agent ${e?.name}`,gRe=((e,t={})=>(t.locale??q())===`fr`?mRe(e):hRe(e)),_Re=()=>`Chargement…`,vRe=()=>`Loading…`,G$=((e={},t={})=>(t.locale??q())===`fr`?_Re(e):vRe(e)),yRe=()=>`Chargement des agents…`,bRe=()=>`Loading agents…`,xRe=((e={},t={})=>(t.locale??q())===`fr`?yRe(e):bRe(e)),SRe=()=>`Aucun utilisateur.`,CRe=()=>`No users.`,wRe=((e={},t={})=>(t.locale??q())===`fr`?SRe(e):CRe(e)),TRe=()=>`Aucune instance configurée.`,ERe=()=>`No instances configured.`,DRe=((e={},t={})=>(t.locale??q())===`fr`?TRe(e):ERe(e)),ORe=()=>`Aucun agent découvert.`,kRe=()=>`No discovered agents.`,ARe=((e={},t={})=>(t.locale??q())===`fr`?ORe(e):kRe(e)),jRe=()=>`Instance hors ligne ; agents indisponibles.`,MRe=()=>`Instance offline; agents unavailable.`,NRe=((e={},t={})=>(t.locale??q())===`fr`?jRe(e):MRe(e)),PRe=()=>`hors ligne`,FRe=()=>`offline`,IRe=((e={},t={})=>(t.locale??q())===`fr`?PRe(e):FRe(e)),LRe=()=>`retiré`,RRe=()=>`removed`,zRe=((e={},t={})=>(t.locale??q())===`fr`?LRe(e):RRe(e)),BRe=()=>`Agent par défaut de l'instance`,VRe=()=>`Instance default agent`,K$=((e={},t={})=>(t.locale??q())===`fr`?BRe(e):VRe(e)),HRe=()=>`Enregistrement du groupe refusé`,URe=()=>`Group save rejected`,WRe=((e={},t={})=>(t.locale??q())===`fr`?HRe(e):URe(e)),GRe=()=>`Suppression du groupe refusée`,KRe=()=>`Group deletion rejected`,qRe=((e={},t={})=>(t.locale??q())===`fr`?GRe(e):KRe(e)),JRe=()=>`Mise à jour de l'adhésion refusée`,YRe=()=>`Membership update rejected`,XRe=((e={},t={})=>(t.locale??q())===`fr`?JRe(e):YRe(e)),ZRe=()=>`Partage de l'agent refusé`,QRe=()=>`Agent sharing rejected`,$Re=((e={},t={})=>(t.locale??q())===`fr`?ZRe(e):QRe(e)),eze=()=>`Réordonner cet onglet`,tze=()=>`Reorder this tab`,nze=((e={},t={})=>(t.locale??q())===`fr`?eze(e):tze(e)),rze=()=>`Réglages`,ize=()=>`Settings`,aze=((e={},t={})=>(t.locale??q())===`fr`?rze(e):ize(e)),oze=()=>`← Retour au chat`,sze=()=>`← Back to chat`,cze=((e={},t={})=>(t.locale??q())===`fr`?oze(e):sze(e)),lze=()=>`Réglages`,uze=()=>`Settings`,dze=((e={},t={})=>(t.locale??q())===`fr`?lze(e):uze(e)),fze=()=>`Personnel`,pze=()=>`Personal`,mze=((e={},t={})=>(t.locale??q())===`fr`?fze(e):pze(e)),hze=()=>`Agents`,gze=()=>`Agents`,_ze=((e={},t={})=>(t.locale??q())===`fr`?hze(e):gze(e)),vze=()=>`Accès & utilisateurs`,yze=()=>`Access & users`,bze=((e={},t={})=>(t.locale??q())===`fr`?vze(e):yze(e)),xze=()=>`Observabilité`,Sze=()=>`Observability`,Cze=((e={},t={})=>(t.locale??q())===`fr`?xze(e):Sze(e)),wze=()=>`Fermer`,Tze=()=>`Close`,q$=((e={},t={})=>(t.locale??q())===`fr`?wze(e):Tze(e)),Eze=()=>`héritée`,Dze=()=>`inherited`,Oze=((e={},t={})=>(t.locale??q())===`fr`?Eze(e):Dze(e)),kze=()=>`Revenir à la valeur héritée`,Aze=()=>`Back to the inherited value`,J$=((e={},t={})=>(t.locale??q())===`fr`?kze(e):Aze(e)),jze=()=>`Application…`,Mze=()=>`Applying…`,Y$=((e={},t={})=>(t.locale??q())===`fr`?jze(e):Mze(e)),Nze=()=>`Échec de l’application.`,Pze=()=>`Failed to apply.`,Fze=((e={},t={})=>(t.locale??q())===`fr`?Nze(e):Pze(e)),Ize=()=>`Réessayer`,Lze=()=>`Retry`,X$=((e={},t={})=>(t.locale??q())===`fr`?Ize(e):Lze(e)),Rze=()=>`Réflexion`,zze=()=>`Reasoning`,Bze=((e={},t={})=>(t.locale??q())===`fr`?Rze(e):zze(e)),Vze=()=>`Vitesse`,Hze=()=>`Speed`,Uze=((e={},t={})=>(t.locale??q())===`fr`?Vze(e):Hze(e)),Wze=()=>`Hérité`,Gze=()=>`Inherited`,Kze=((e={},t={})=>(t.locale??q())===`fr`?Wze(e):Gze(e)),qze=()=>`Rapide`,Jze=()=>`Fast`,Z$=((e={},t={})=>(t.locale??q())===`fr`?qze(e):Jze(e)),Yze=()=>`Standard`,Xze=()=>`Standard`,Q$=((e={},t={})=>(t.locale??q())===`fr`?Yze(e):Xze(e)),Zze=()=>`Tous les réglages de session`,Qze=()=>`All session settings`,$ze=((e={},t={})=>(t.locale??q())===`fr`?Zze(e):Qze(e)),eBe=()=>`Réglages de session`,tBe=()=>`Session settings`,nBe=((e={},t={})=>(t.locale??q())===`fr`?eBe(e):tBe(e)),rBe=()=>`Réglages appliqués à cette conversation.`,iBe=()=>`Settings applied to this conversation.`,aBe=((e={},t={})=>(t.locale??q())===`fr`?rBe(e):iBe(e)),oBe=()=>`Génération`,sBe=()=>`Generation`,cBe=((e={},t={})=>(t.locale??q())===`fr`?oBe(e):sBe(e)),lBe=()=>`Session`,uBe=()=>`Session`,dBe=((e={},t={})=>(t.locale??q())===`fr`?lBe(e):uBe(e)),fBe=()=>`Agent`,pBe=()=>`Agent`,mBe=((e={},t={})=>(t.locale??q())===`fr`?fBe(e):pBe(e)),hBe=()=>`Actions`,gBe=()=>`Actions`,_Be=((e={},t={})=>(t.locale??q())===`fr`?hBe(e):gBe(e)),vBe=()=>`Contexte`,yBe=()=>`Context`,bBe=((e={},t={})=>(t.locale??q())===`fr`?vBe(e):yBe(e)),xBe=e=>`${e?.pct} % · ${e?.used} / ${e?.total} jetons`,SBe=e=>`${e?.pct}% · ${e?.used} / ${e?.total} tokens`,CBe=((e,t={})=>(t.locale??q())===`fr`?xBe(e):SBe(e)),wBe=()=>`Verbosité`,TBe=()=>`Verbosity`,EBe=((e={},t={})=>(t.locale??q())===`fr`?wBe(e):TBe(e)),DBe=e=>`${e?.level} · fixée`,OBe=e=>`${e?.level} · pinned`,kBe=((e,t={})=>(t.locale??q())===`fr`?DBe(e):OBe(e)),ABe=()=>`Fixée par la passerelle pour un streaming complet.`,jBe=()=>`Pinned by the bridge for complete streaming.`,MBe=((e={},t={})=>(t.locale??q())===`fr`?ABe(e):jBe(e)),NBe=()=>`Coût / jetons`,PBe=()=>`Cost / tokens`,FBe=((e={},t={})=>(t.locale??q())===`fr`?NBe(e):PBe(e)),IBe=e=>`~${e?.cost} $ · ${e?.tokens} jetons`,LBe=e=>`~$${e?.cost} · ${e?.tokens} tokens`,RBe=((e,t={})=>(t.locale??q())===`fr`?IBe(e):LBe(e)),zBe=e=>`~${e?.cost} $`,BBe=e=>`~$${e?.cost}`,VBe=((e,t={})=>(t.locale??q())===`fr`?zBe(e):BBe(e)),HBe=e=>`${e?.tokens} jetons`,UBe=e=>`${e?.tokens} tokens`,WBe=((e,t={})=>(t.locale??q())===`fr`?HBe(e):UBe(e)),GBe=()=>`Compacter le contexte`,KBe=()=>`Compact the context`,qBe=((e={},t={})=>(t.locale??q())===`fr`?GBe(e):KBe(e)),JBe=()=>`Compacter le contexte ?`,YBe=()=>`Compact the context?`,XBe=((e={},t={})=>(t.locale??q())===`fr`?JBe(e):YBe(e)),ZBe=()=>`L’agent résume la conversation pour libérer de l’espace dans la fenêtre de contexte. Les messages restent visibles ici.`,QBe=()=>`The agent summarizes the conversation to free space in the context window. Messages stay visible here.`,$Be=((e={},t={})=>(t.locale??q())===`fr`?ZBe(e):QBe(e)),eVe=()=>`Compacter`,tVe=()=>`Compact`,nVe=((e={},t={})=>(t.locale??q())===`fr`?eVe(e):tVe(e)),rVe=()=>`Réinitialiser la session`,iVe=()=>`Reset the session`,aVe=((e={},t={})=>(t.locale??q())===`fr`?rVe(e):iVe(e)),oVe=()=>`Réinitialiser la session ?`,sVe=()=>`Reset the session?`,cVe=((e={},t={})=>(t.locale??q())===`fr`?oVe(e):sVe(e)),lVe=()=>`La session de l’agent repart à zéro et se réhydrate depuis la conversation au prochain message. Aucun message n’est supprimé.`,uVe=()=>`The agent session starts fresh and re-hydrates from the conversation on the next message. No message is deleted.`,dVe=((e={},t={})=>(t.locale??q())===`fr`?lVe(e):uVe(e)),fVe=()=>`Réinitialiser`,pVe=()=>`Reset`,mVe=((e={},t={})=>(t.locale??q())===`fr`?fVe(e):pVe(e)),hVe=()=>`Demande envoyée à l’agent.`,gVe=()=>`Request sent to the agent.`,_Ve=((e={},t={})=>(t.locale??q())===`fr`?hVe(e):gVe(e)),vVe=()=>`Échec de l’action.`,yVe=()=>`Action failed.`,bVe=((e={},t={})=>(t.locale??q())===`fr`?vVe(e):yVe(e)),xVe=()=>`Fichiers d’agent`,SVe=()=>`Agent files`,CVe=((e={},t={})=>(t.locale??q())===`fr`?xVe(e):SVe(e)),wVe=()=>`Fichiers de l’espace de travail de l’agent (règles, identité, outils). La jauge mesure l’usage du budget bootstrap par fichier ; l’écriture est réservée aux administrateurs et chaque écriture est auditée.`,TVe=()=>`The agent’s workspace files (rules, identity, tools). The gauge tracks each file’s bootstrap budget usage; writing is admin-only and every write is audited.`,EVe=((e={},t={})=>(t.locale??q())===`fr`?wVe(e):TVe(e)),DVe=()=>`Instance`,OVe=()=>`Instance`,kVe=((e={},t={})=>(t.locale??q())===`fr`?DVe(e):OVe(e)),AVe=()=>`Agent`,jVe=()=>`Agent`,MVe=((e={},t={})=>(t.locale??q())===`fr`?AVe(e):jVe(e)),NVe=()=>`Aucun agent disponible.`,PVe=()=>`No agent available.`,FVe=((e={},t={})=>(t.locale??q())===`fr`?NVe(e):PVe(e)),IVe=()=>`Aucun fichier.`,LVe=()=>`No files.`,RVe=((e={},t={})=>(t.locale??q())===`fr`?IVe(e):LVe(e)),zVe=()=>`Bridge injoignable — impossible de lister les fichiers.`,BVe=()=>`Bridge unreachable — cannot list the files.`,VVe=((e={},t={})=>(t.locale??q())===`fr`?zVe(e):BVe(e)),HVe=()=>`absent`,UVe=()=>`missing`,WVe=((e={},t={})=>(t.locale??q())===`fr`?HVe(e):UVe(e)),GVe=e=>`${e?.size} ko`,KVe=e=>`${e?.size} kB`,qVe=((e,t={})=>(t.locale??q())===`fr`?GVe(e):KVe(e)),JVe=e=>`${e?.pct} %`,YVe=e=>`${e?.pct}%`,XVe=((e,t={})=>(t.locale??q())===`fr`?JVe(e):YVe(e)),ZVe=()=>`Proche de la limite bootstrap`,QVe=()=>`Near the bootstrap limit`,$Ve=((e={},t={})=>(t.locale??q())===`fr`?ZVe(e):QVe(e)),eHe=e=>`Budget total : ${e?.used} ko / ${e?.total} ko (${e?.pct} %)`,tHe=e=>`Total budget: ${e?.used} kB / ${e?.total} kB (${e?.pct}%)`,nHe=((e,t={})=>(t.locale??q())===`fr`?eHe(e):tHe(e)),rHe=()=>`Éditer`,iHe=()=>`Edit`,aHe=((e={},t={})=>(t.locale??q())===`fr`?rHe(e):iHe(e)),oHe=()=>`Consulter`,sHe=()=>`View`,cHe=((e={},t={})=>(t.locale??q())===`fr`?oHe(e):sHe(e)),lHe=e=>`${e?.name}`,uHe=e=>`${e?.name}`,$$=((e,t={})=>(t.locale??q())===`fr`?lHe(e):uHe(e)),dHe=e=>`Agent ${e?.agent} · instance ${e?.instance}`,fHe=e=>`Agent ${e?.agent} · instance ${e?.instance}`,pHe=((e,t={})=>(t.locale??q())===`fr`?dHe(e):fHe(e)),mHe=()=>`lecture seule`,hHe=()=>`read-only`,gHe=((e={},t={})=>(t.locale??q())===`fr`?mHe(e):hHe(e)),_He=()=>`Source markdown brute — l’aperçu rendu n’est pas disponible ici.`,vHe=()=>`Raw markdown source — a rendered preview is not available here.`,yHe=((e={},t={})=>(t.locale??q())===`fr`?_He(e):vHe(e)),bHe=e=>`${e?.count} / ${e?.max} caractères`,xHe=e=>`${e?.count} / ${e?.max} characters`,SHe=((e,t={})=>(t.locale??q())===`fr`?bHe(e):xHe(e)),CHe=()=>`Enregistrer`,wHe=()=>`Save`,THe=((e={},t={})=>(t.locale??q())===`fr`?CHe(e):wHe(e)),EHe=e=>`${e?.name} enregistré.`,DHe=e=>`${e?.name} saved.`,OHe=((e,t={})=>(t.locale??q())===`fr`?EHe(e):DHe(e)),kHe=()=>`Échec de l’enregistrement.`,AHe=()=>`Save failed.`,jHe=((e={},t={})=>(t.locale??q())===`fr`?kHe(e):AHe(e)),MHe=()=>`Impossible de charger le fichier.`,NHe=()=>`Could not load the file.`,PHe=((e={},t={})=>(t.locale??q())===`fr`?MHe(e):NHe(e)),FHe=()=>`Le fichier a changé depuis le chargement. Rechargez avant d’enregistrer (vos modifications sont conservées).`,IHe=()=>`The file changed since it was loaded. Reload before saving (your edits are kept).`,LHe=((e={},t={})=>(t.locale??q())===`fr`?FHe(e):IHe(e)),RHe=()=>`Recharger`,zHe=()=>`Reload`,BHe=((e={},t={})=>(t.locale??q())===`fr`?RHe(e):zHe(e)),VHe=e=>`Écrire ${e?.name} ?`,HHe=e=>`Write ${e?.name}?`,UHe=((e,t={})=>(t.locale??q())===`fr`?VHe(e):HHe(e)),WHe=e=>`Le fichier sera écrit sur l’agent ${e?.agent}. Une révision complète avant/après est conservée.`,GHe=e=>`The file will be written to agent ${e?.agent}. A full before/after revision is kept.`,KHe=((e,t={})=>(t.locale??q())===`fr`?WHe(e):GHe(e)),qHe=e=>`${e?.added} ligne(s) ajoutée(s) · ${e?.removed} ligne(s) retirée(s)`,JHe=e=>`${e?.added} line(s) added · ${e?.removed} line(s) removed`,YHe=((e,t={})=>(t.locale??q())===`fr`?qHe(e):JHe(e)),XHe=()=>`Ajoutées (extrait) :`,ZHe=()=>`Added (sample):`,QHe=((e={},t={})=>(t.locale??q())===`fr`?XHe(e):ZHe(e)),$He=()=>`Retirées (extrait) :`,eUe=()=>`Removed (sample):`,tUe=((e={},t={})=>(t.locale??q())===`fr`?$He(e):eUe(e)),nUe=()=>`Écrire le fichier`,rUe=()=>`Write the file`,iUe=((e={},t={})=>(t.locale??q())===`fr`?nUe(e):rUe(e)),aUe=()=>`Défauts de chat`,oUe=()=>`Chat defaults`,sUe=((e={},t={})=>(t.locale??q())===`fr`?aUe(e):oUe(e)),cUe=()=>`Réglages par défaut des nouvelles sessions de chat, lus depuis la configuration globale du gateway. Les réglages par chat et par agent restent prioritaires.`,lUe=()=>`Default settings for new chat sessions, read from the gateway’s global configuration. Per-chat and per-agent settings keep precedence.`,uUe=((e={},t={})=>(t.locale??q())===`fr`?cUe(e):lUe(e)),dUe=()=>`Réflexion par défaut`,fUe=()=>`Default thinking`,pUe=((e={},t={})=>(t.locale??q())===`fr`?dUe(e):fUe(e)),mUe=()=>`Niveau de raisonnement appliqué quand un chat ne définit pas le sien.`,hUe=()=>`Reasoning level applied when a chat does not set its own.`,gUe=((e={},t={})=>(t.locale??q())===`fr`?mUe(e):hUe(e)),_Ue=()=>`Vitesse par défaut`,vUe=()=>`Default speed`,yUe=((e={},t={})=>(t.locale??q())===`fr`?_Ue(e):vUe(e)),bUe=()=>`Mode rapide ou standard appliqué quand un chat ne définit pas le sien.`,xUe=()=>`Fast or standard mode applied when a chat does not set its own.`,SUe=((e={},t={})=>(t.locale??q())===`fr`?bUe(e):xUe(e)),CUe=()=>`Bridge injoignable — impossible de lire les défauts globaux.`,wUe=()=>`Bridge unreachable — cannot read the global defaults.`,TUe=((e={},t={})=>(t.locale??q())===`fr`?CUe(e):wUe(e)),EUe=()=>`Enregistrer`,DUe=()=>`Save`,OUe=((e={},t={})=>(t.locale??q())===`fr`?EUe(e):DUe(e)),kUe=()=>`Défauts globaux enregistrés.`,AUe=()=>`Global defaults saved.`,jUe=((e={},t={})=>(t.locale??q())===`fr`?kUe(e):AUe(e)),MUe=()=>`Échec de l’écriture des défauts globaux.`,NUe=()=>`Failed to write the global defaults.`,PUe=((e={},t={})=>(t.locale??q())===`fr`?MUe(e):NUe(e)),FUe=()=>`Ces valeurs sont écrites dans openclaw.json, la configuration globale de l’instance — elles s’appliquent à tous les utilisateurs.`,IUe=()=>`These values are written to openclaw.json, the instance’s global configuration — they apply to every user.`,LUe=((e={},t={})=>(t.locale??q())===`fr`?FUe(e):IUe(e)),RUe=()=>`Modifier les défauts globaux ?`,zUe=()=>`Change the global defaults?`,BUe=((e={},t={})=>(t.locale??q())===`fr`?RUe(e):zUe(e)),VUe=()=>`Cette écriture modifie openclaw.json pour toute l’instance : tous les chats qui héritent du défaut changeront de comportement.`,HUe=()=>`This write changes openclaw.json for the whole instance: every chat inheriting the default will change behavior.`,UUe=((e={},t={})=>(t.locale??q())===`fr`?VUe(e):HUe(e)),WUe=()=>`Modifier`,GUe=()=>`Change`,KUe=((e={},t={})=>(t.locale??q())===`fr`?WUe(e):GUe(e)),qUe=()=>`Compatibilité`,JUe=()=>`Compatibility`,YUe=((e={},t={})=>(t.locale??q())===`fr`?qUe(e):JUe(e)),XUe=()=>`Aucun relevé de compatibilité pour l’instant — le sondage tourne toutes les 5 minutes.`,ZUe=()=>`No compatibility reading yet — the poll runs every 5 minutes.`,QUe=((e={},t={})=>(t.locale??q())===`fr`?XUe(e):ZUe(e)),$Ue=()=>`Version du bridge :`,eWe=()=>`Bridge version:`,tWe=((e={},t={})=>(t.locale??q())===`fr`?$Ue(e):eWe(e)),nWe=()=>`Protocole :`,rWe=()=>`Protocol:`,iWe=((e={},t={})=>(t.locale??q())===`fr`?nWe(e):rWe(e)),aWe=()=>`inconnue`,oWe=()=>`unknown`,e1=((e={},t={})=>(t.locale??q())===`fr`?aWe(e):oWe(e)),sWe=()=>`Dernier sondage en échec — affichage du dernier relevé valide.`,cWe=()=>`Last poll failed — showing the last good reading.`,lWe=((e={},t={})=>(t.locale??q())===`fr`?sWe(e):cWe(e)),uWe=()=>`Ce bridge ne publie pas de manifeste de compatibilité (version antérieure) — politique héritée : seuls le modèle et la réflexion sont proposés.`,dWe=()=>`This bridge does not publish a compatibility manifest (older version) — legacy policy: only model and reasoning are offered.`,fWe=((e={},t={})=>(t.locale??q())===`fr`?uWe(e):dWe(e)),pWe=()=>`OpenClaw supporté :`,mWe=()=>`OpenClaw supported:`,hWe=((e={},t={})=>(t.locale??q())===`fr`?pWe(e):mWe(e)),gWe=e=>`de ${e?.min} à ${e?.max} (validé)`,_We=e=>`from ${e?.min} to ${e?.max} (validated)`,vWe=((e,t={})=>(t.locale??q())===`fr`?gWe(e):_We(e)),yWe=()=>`1 version validée`,bWe=()=>`1 validated version`,xWe=((e={},t={})=>(t.locale??q())===`fr`?yWe(e):bWe(e)),SWe=e=>`${e?.count} versions validées`,CWe=e=>`${e?.count} validated versions`,wWe=((e,t={})=>(t.locale??q())===`fr`?SWe(e):CWe(e)),TWe=()=>`Validées au banc`,EWe=()=>`Bench-validated`,DWe=((e={},t={})=>(t.locale??q())===`fr`?TWe(e):EWe(e)),OWe=()=>`Aucune connexion connue du relevé de compatibilité.`,kWe=()=>`No connection known to the compatibility reading.`,AWe=((e={},t={})=>(t.locale??q())===`fr`?OWe(e):kWe(e)),jWe=()=>`✓ dans le support`,MWe=()=>`✓ within support`,NWe=((e={},t={})=>(t.locale??q())===`fr`?jWe(e):MWe(e)),PWe=()=>`⚠ au-delà du validé`,FWe=()=>`⚠ beyond validated`,IWe=((e={},t={})=>(t.locale??q())===`fr`?PWe(e):FWe(e)),LWe=()=>`? inconnue`,RWe=()=>`? unknown`,zWe=((e={},t={})=>(t.locale??q())===`fr`?LWe(e):RWe(e)),BWe=()=>`Hermes : adaptateur à venir.`,VWe=()=>`Hermes: adapter coming.`,HWe=((e={},t={})=>(t.locale??q())===`fr`?BWe(e):VWe(e)),UWe=e=>`Non supporté par cette instance (version gateway ${e?.version}).`,WWe=e=>`Not supported by this instance (gateway version ${e?.version}).`,GWe=((e,t={})=>(t.locale??q())===`fr`?UWe(e):WWe(e)),KWe=()=>`Non supporté par cette instance (version gateway inconnue).`,qWe=()=>`Not supported by this instance (unknown gateway version).`,JWe=((e={},t={})=>(t.locale??q())===`fr`?KWe(e):qWe(e)),YWe={user:UAe(),assistant:`OpenClaw`,system:KAe()},XWe=YAe();function t1(e){return new Date(e).toISOString().slice(0,16).replace(`T`,` `)+` UTC`}function n1(e){return e?e.filter(e=>e.kind===`file`||e.kind===`media`).map(e=>e.filename).filter(e=>typeof e==`string`&&e.length>0):[]}function ZWe(e,t={}){let n=[];n.push(`# ${t.title?.trim()||z$()}`),t.exportedAt!=null&&(n.push(``),n.push(`_${eje({date:t1(t.exportedAt)})}_`)),t.truncated&&(n.push(``),n.push(XWe));for(let t of e){n.push(``),n.push(`## ${YWe[t.role]} · ${t1(t.createdAt)}`);let e=t.text.trim();e.length>0&&(n.push(``),n.push(e));for(let e of n1(t.parts))n.push(``),n.push(rje({name:e}))}return n.join(`
|
|
130
|
-
`)+`
|
|
131
|
-
`}function QWe(e,t={}){let n={title:t.title?.trim()||z$(),exportedAt:t.exportedAt??null,truncated:!!t.truncated,messageCount:e.length,messages:e.map(e=>({role:e.role,createdAt:e.createdAt,text:e.text,attachments:n1(e.parts)}))};return JSON.stringify(n,null,2)+`
|
|
132
|
-
`}function $We(e){return((e??``).trim()||`conversation`).toLowerCase().normalize(`NFD`).replace(/[̀-ͯ]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,60)||`conversation`}function r1(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=r1(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function i1(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=r1(e))&&(r&&(r+=` `),r+=t);return r}var eGe=(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},tGe=(e,t)=>({classGroupId:e,validator:t}),a1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),o1=`-`,s1=[],nGe=`arbitrary..`,rGe=e=>{let t=aGe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return iGe(e);let n=e.split(o1);return c1(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?eGe(i,t):t:i||s1}return n[e]||s1}}},c1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=c1(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(o1):e.slice(t).join(o1),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},iGe=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?nGe+r:void 0})(),aGe=e=>{let{theme:t,classGroups:n}=e;return oGe(n,t)},oGe=(e,t)=>{let n=a1();for(let r in e){let i=e[r];l1(i,n,r,t)}return n},l1=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];sGe(i,t,n,r)}},sGe=(e,t,n,r)=>{if(typeof e==`string`){cGe(e,t,n);return}if(typeof e==`function`){lGe(e,t,n,r);return}uGe(e,t,n,r)},cGe=(e,t,n)=>{let r=e===``?t:u1(t,e);r.classGroupId=n},lGe=(e,t,n,r)=>{if(dGe(e)){l1(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(tGe(n,e))},uGe=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];l1(o,u1(t,a),n,r)}},u1=(e,t)=>{let n=e,r=t.split(o1),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=a1(),n.nextPart.set(t,i)),n=i}return n},dGe=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,fGe=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)}}},d1=`!`,f1=`:`,pGe=[],p1=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),mGe=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===f1){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(d1)?(c=s.slice(0,-1),l=!0):s.startsWith(d1)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return p1(t,l,c,u)};if(t){let e=t+f1,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):p1(pGe,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},hGe=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}},gGe=e=>({cache:fGe(e.cacheSize),parseClassName:mGe(e),sortModifiers:hGe(e),postfixLookupClassGroupIds:_Ge(e),...rGe(e)}),_Ge=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},vGe=/\s+/,yGe=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(vGe),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?_+d1:_,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},bGe=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=m1(n))&&(i&&(i+=` `),i+=r);return i},m1=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=m1(e[r]))&&(n&&(n+=` `),n+=t);return n},xGe=(e,...t)=>{let n,r,i,a,o=o=>(n=gGe(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=yGe(e,n);return i(e,a),a};return a=o,(...e)=>a(bGe(...e))},SGe=[],h1=e=>{let t=t=>t[e]||SGe;return t.isThemeGetter=!0,t},g1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,CGe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wGe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TGe=/\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$/,EGe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,DGe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OGe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,v1=e=>CGe.test(e),y1=e=>!!e&&!Number.isNaN(Number(e)),b1=e=>!!e&&Number.isInteger(Number(e)),x1=e=>e.endsWith(`%`)&&y1(e.slice(0,-1)),S1=e=>wGe.test(e),C1=()=>!0,kGe=e=>TGe.test(e)&&!EGe.test(e),w1=()=>!1,AGe=e=>DGe.test(e),jGe=e=>OGe.test(e),MGe=e=>!J(e)&&!Y(e),NGe=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)),PGe=e=>M1(e,I1,w1),J=e=>g1.test(e),T1=e=>M1(e,L1,kGe),E1=e=>M1(e,HGe,y1),FGe=e=>M1(e,z1,C1),IGe=e=>M1(e,R1,w1),D1=e=>M1(e,P1,w1),LGe=e=>M1(e,F1,jGe),O1=e=>M1(e,B1,AGe),Y=e=>_1.test(e),k1=e=>N1(e,L1),RGe=e=>N1(e,R1),A1=e=>N1(e,P1),zGe=e=>N1(e,I1),BGe=e=>N1(e,F1),j1=e=>N1(e,B1,!0),VGe=e=>N1(e,z1,!0),M1=(e,t,n)=>{let r=g1.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},N1=(e,t,n=!1)=>{let r=_1.exec(e);return r?r[1]?t(r[1]):n:!1},P1=e=>e===`position`||e===`percentage`,F1=e=>e===`image`||e===`url`,I1=e=>e===`length`||e===`size`||e===`bg-size`,L1=e=>e===`length`,HGe=e=>e===`number`,R1=e=>e===`family-name`,z1=e=>e===`number`||e===`weight`,B1=e=>e===`shadow`,UGe=xGe(()=>{let e=h1(`color`),t=h1(`font`),n=h1(`text`),r=h1(`font-weight`),i=h1(`tracking`),a=h1(`leading`),o=h1(`breakpoint`),s=h1(`container`),c=h1(`spacing`),l=h1(`radius`),u=h1(`shadow`),d=h1(`inset-shadow`),f=h1(`text-shadow`),p=h1(`drop-shadow`),m=h1(`blur`),h=h1(`perspective`),g=h1(`aspect`),_=h1(`ease`),v=h1(`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(),Y,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,J,c],T=()=>[v1,`full`,`auto`,...w()],E=()=>[b1,`none`,`subgrid`,Y,J],D=()=>[`auto`,{span:[`full`,b1,Y,J]},b1,Y,J],O=()=>[b1,`auto`,Y,J],k=()=>[`auto`,`min`,`max`,`fr`,Y,J],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=()=>[v1,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[v1,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[v1,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,Y,J],F=()=>[...b(),A1,D1,{position:[Y,J]}],ne=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],re=()=>[`auto`,`cover`,`contain`,zGe,PGe,{size:[Y,J]}],ie=()=>[x1,k1,T1],ae=()=>[``,`none`,`full`,l,Y,J],oe=()=>[``,y1,k1,T1],se=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],le=()=>[y1,x1,A1,D1],ue=()=>[``,`none`,m,Y,J],de=()=>[`none`,y1,Y,J],fe=()=>[`none`,y1,Y,J],pe=()=>[y1,Y,J],me=()=>[v1,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[S1],breakpoint:[S1],color:[C1],container:[S1],"drop-shadow":[S1],ease:[`in`,`out`,`in-out`],font:[MGe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[S1],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[S1],shadow:[S1],spacing:[`px`,y1],text:[S1],"text-shadow":[S1],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,v1,J,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,J]}],"container-named":[NGe],columns:[{columns:[y1,J,Y,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:[b1,`auto`,Y,J]}],basis:[{basis:[v1,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[y1,v1,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,y1,Y,J]}],shrink:[{shrink:[``,y1,Y,J]}],order:[{order:[b1,`first`,`last`,`none`,Y,J]}],"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`,...N()]}],"font-size":[{text:[`base`,n,k1,T1]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,VGe,FGe]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,x1,J]}],"font-family":[{font:[RGe,IGe,t]}],"font-features":[{"font-features":[J]}],"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,Y,J]}],"line-clamp":[{"line-clamp":[y1,`none`,Y,E1]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Y,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,J]}],"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:[...se(),`wavy`]}],"text-decoration-thickness":[{decoration:[y1,`from-font`,`auto`,Y,T1]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[y1,`auto`,Y,J]}],"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:[b1,Y,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,J]}],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`,Y,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:re()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},b1,Y,J],radial:[``,Y,J],conic:[b1,Y,J]},BGe,LGe]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...se(),`hidden`,`none`]}],"divide-style":[{divide:[...se(),`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:[...se(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[y1,Y,J]}],"outline-w":[{outline:[``,y1,k1,T1]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,j1,O1]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,j1,O1]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:oe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[y1,T1]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,j1,O1]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[y1,Y,J]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"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":[y1]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"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":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"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":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"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":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"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":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"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":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"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":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"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":[y1]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"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:F()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:ue()}],brightness:[{brightness:[y1,Y,J]}],contrast:[{contrast:[y1,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,j1,O1]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,y1,Y,J]}],"hue-rotate":[{"hue-rotate":[y1,Y,J]}],invert:[{invert:[``,y1,Y,J]}],saturate:[{saturate:[y1,Y,J]}],sepia:[{sepia:[``,y1,Y,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,J]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[y1,Y,J]}],"backdrop-contrast":[{"backdrop-contrast":[y1,Y,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,y1,Y,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[y1,Y,J]}],"backdrop-invert":[{"backdrop-invert":[``,y1,Y,J]}],"backdrop-opacity":[{"backdrop-opacity":[y1,Y,J]}],"backdrop-saturate":[{"backdrop-saturate":[y1,Y,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,y1,Y,J]}],"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`,Y,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[y1,`initial`,Y,J]}],ease:[{ease:[`linear`,`initial`,_,Y,J]}],delay:[{delay:[y1,Y,J]}],animate:[{animate:[`none`,v,Y,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,J]}],"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:[Y,J,``,`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:[b1,Y,J]}],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`,Y,J]}],"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`,Y,J]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[y1,k1,T1,E1]}],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":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`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-r`,`border-w-l`],"border-w-y":[`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-r`,`border-color-l`],"border-color-y":[`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-mr`,`scroll-ml`],"scroll-my":[`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-pr`,`scroll-pl`],"scroll-py":[`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 V1(...e){return UGe(i1(e))}function H1(e){return(0,z.jsx)(ale,{"data-slot":`dropdown-menu`,...e})}function U1(e){return(0,z.jsx)(ole,{"data-slot":`dropdown-menu-trigger`,...e})}function W1({className:e,sideOffset:t=4,...n}){return(0,z.jsx)(sle,{children:(0,z.jsx)(cle,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:V1(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md`,e),...n})})}function G1({className:e,inset:t,variant:n=`default`,...r}){return(0,z.jsx)(ule,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:V1(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r})}function K1({className:e,inset:t,...n}){return(0,z.jsx)(lle,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:V1(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function q1({className:e,...t}){return(0,z.jsx)(mle,{"data-slot":`dropdown-menu-separator`,className:V1(`bg-border -mx-1 my-1 h-px`,e),...t})}function WGe(e){return(0,z.jsx)(dle,{"data-slot":`dropdown-menu-radio-group`,...e})}function J1({className:e,children:t,...n}){return(0,z.jsxs)(fle,{"data-slot":`dropdown-menu-radio-item`,className:V1(`focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,z.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,z.jsx)(ple,{children:(0,z.jsx)(aee,{className:`size-2 fill-current`})})}),t]})}function Y1({...e}){return(0,z.jsx)(UE,{"data-slot":`popover`,...e})}function X1({...e}){return(0,z.jsx)(WE,{"data-slot":`popover-trigger`,...e})}function Z1({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,z.jsx)(GE,{children:(0,z.jsx)(KE,{"data-slot":`popover-content`,align:t,sideOffset:n,className:V1(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...r})})}var Q1=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,$1=i1,e0=(e,t)=>n=>{if(t?.variants==null)return $1(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=Q1(t)||Q1(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 $1(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)},t0=e0(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function X({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,z.jsx)(r?fb:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:V1(t0({variant:t,size:n,className:e})),...i})}function n0({className:e,type:t,...n}){return(0,z.jsx)(`input`,{type:t,"data-slot":`input`,className:V1(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base 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 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),...n})}function r0({...e}){return(0,z.jsx)(hoe,{"data-slot":`alert-dialog`,...e})}function GGe({...e}){return(0,z.jsx)(goe,{"data-slot":`alert-dialog-portal`,...e})}function KGe({className:e,...t}){return(0,z.jsx)(_oe,{"data-slot":`alert-dialog-overlay`,className:V1(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function i0({className:e,...t}){return(0,z.jsxs)(GGe,{children:[(0,z.jsx)(KGe,{}),(0,z.jsx)(voe,{"data-slot":`alert-dialog-content`,className:V1(`fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover bg-clip-padding p-5 text-sm text-popover-foreground shadow-lg duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})]})}function a0({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:V1(`flex flex-col gap-1.5`,e),...t})}function o0({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:V1(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function s0({className:e,...t}){return(0,z.jsx)(xoe,{"data-slot":`alert-dialog-title`,className:V1(`text-base font-medium text-foreground`,e),...t})}function c0({className:e,...t}){return(0,z.jsx)(Soe,{"data-slot":`alert-dialog-description`,className:V1(`text-sm text-muted-foreground`,e),...t})}function l0({className:e,...t}){return(0,z.jsx)(yoe,{className:V1(t0(),e),...t})}function u0({className:e,...t}){return(0,z.jsx)(boe,{className:V1(t0({variant:`outline`}),e),...t})}function d0({...e}){return(0,z.jsx)(iC,{"data-slot":`dialog`,...e})}function qGe({...e}){return(0,z.jsx)(aC,{"data-slot":`dialog-portal`,...e})}function JGe({className:e,...t}){return(0,z.jsx)(oC,{"data-slot":`dialog-overlay`,className:V1(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function f0({className:e,children:t,showCloseButton:n=!0,...r}){return(0,z.jsxs)(qGe,{children:[(0,z.jsx)(JGe,{}),(0,z.jsxs)(sC,{"data-slot":`dialog-content`,className:V1(`fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover bg-clip-padding p-5 text-sm text-popover-foreground shadow-lg duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,z.jsx)(uC,{"data-slot":`dialog-close`,asChild:!0,children:(0,z.jsxs)(X,{variant:`ghost`,size:`icon-sm`,className:`absolute top-3 right-3`,children:[(0,z.jsx)(jm,{}),(0,z.jsx)(`span`,{className:`sr-only`,children:q$()})]})})]})]})}function p0({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`dialog-header`,className:V1(`flex flex-col gap-1.5 pr-6`,e),...t})}function m0({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`dialog-footer`,className:V1(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function h0({className:e,...t}){return(0,z.jsx)(cC,{"data-slot":`dialog-title`,className:V1(`text-base font-medium text-foreground`,e),...t})}function g0({className:e,...t}){return(0,z.jsx)(lC,{"data-slot":`dialog-description`,className:V1(`text-sm text-muted-foreground`,e),...t})}var _0=I.createContext(null);function YGe({children:e}){let[t,n]=I.useState(null),r=I.useRef(null),i=I.useRef(null),[a,o]=I.useState(``),s=I.useCallback(e=>{let t=r.current;r.current=null,n(null),t&&t(e)},[]),c=I.useMemo(()=>({confirm:e=>new Promise(t=>{r.current=t,o(``),n({kind:`confirm`,opts:e})}),prompt:e=>new Promise(t=>{r.current=t,o(e.defaultValue??``),n({kind:`prompt`,opts:e})})}),[]),l=t?.kind===`confirm`,u=t?.kind===`prompt`,d=t?.kind===`confirm`?t.opts.confirmWord:void 0,f=!d||a.trim().toLowerCase()===d.trim().toLowerCase(),p=a.trim().length>0,m=e=>{e.preventDefault(),requestAnimationFrame(()=>i.current?.focus())};return(0,z.jsxs)(_0.Provider,{value:c,children:[e,(0,z.jsx)(r0,{open:l,onOpenChange:e=>{e||s(!1)},children:l?(0,z.jsxs)(i0,{onOpenAutoFocus:d?m:void 0,...t.opts.description?{}:{"aria-describedby":void 0},children:[(0,z.jsxs)(a0,{children:[(0,z.jsx)(s0,{children:t.opts.title}),t.opts.description?(0,z.jsx)(c0,{children:t.opts.description}):null]}),d?(0,z.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[`Pour confirmer, saisissez`,` `,(0,z.jsxs)(`span`,{className:`font-medium text-foreground`,children:[`« `,d,` »`]}),` `,`ci-dessous.`]}),(0,z.jsx)(n0,{ref:i,value:a,placeholder:d,autoComplete:`off`,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f&&(e.preventDefault(),s(!0))}})]}):null,(0,z.jsxs)(o0,{children:[(0,z.jsx)(u0,{onClick:()=>s(!1),children:t.opts.cancelLabel??`Annuler`}),(0,z.jsx)(X,{variant:t.opts.destructive?`destructive`:`default`,disabled:!f,onClick:()=>s(!0),children:t.opts.confirmLabel??`Supprimer`})]})]}):null}),(0,z.jsx)(d0,{open:u,onOpenChange:e=>{e||s(null)},children:u?(0,z.jsxs)(f0,{onOpenAutoFocus:m,...t.opts.description?{}:{"aria-describedby":void 0},children:[(0,z.jsxs)(p0,{children:[(0,z.jsx)(h0,{children:t.opts.title}),t.opts.description?(0,z.jsx)(g0,{children:t.opts.description}):null]}),(0,z.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[t.opts.label?(0,z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t.opts.label}):null,(0,z.jsx)(n0,{ref:i,value:a,placeholder:t.opts.placeholder,autoComplete:`off`,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&p&&(e.preventDefault(),s(a.trim()))}})]}),(0,z.jsxs)(m0,{children:[(0,z.jsx)(X,{variant:`outline`,onClick:()=>s(null),children:t.opts.cancelLabel??`Annuler`}),(0,z.jsx)(X,{disabled:!p,onClick:()=>s(a.trim()),children:t.opts.confirmLabel??`Valider`})]})]}):null})]})}function v0(){let e=I.useContext(_0);if(!e)throw Error(`useConfirm/usePrompt must be used within <DialogsProvider>`);return e}function y0(){return v0().confirm}function b0(){return v0().prompt}var x0=I.createContext(null),XGe=6e3;function ZGe(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return String(e)}catch{return`Erreur inconnue`}}function QGe({children:e}){let[t,n]=I.useState([]),r=I.useRef(0),i=I.useRef(new Map),a=I.useCallback(e=>{n(t=>t.filter(t=>t.id!==e));let t=i.current.get(e);t!==void 0&&(window.clearTimeout(t),i.current.delete(e))},[]),o=I.useCallback(e=>{let t=r.current++,o={id:t,variant:e.variant??`info`,title:e.title,description:e.description};n(e=>[...e,o]);let s=window.setTimeout(()=>a(t),XGe);i.current.set(t,s)},[a]);I.useEffect(()=>{let e=i.current;return()=>{for(let t of e.values())window.clearTimeout(t);e.clear()}},[]);let s=I.useMemo(()=>({toast:o,error:(e,t)=>o({variant:`error`,title:e,description:t===void 0?void 0:ZGe(t)}),success:(e,t)=>o({variant:`success`,title:e,description:t})}),[o]);return(0,z.jsxs)(x0.Provider,{value:s,children:[e,(0,z.jsx)(`div`,{className:`oc-toast__viewport`,role:`region`,"aria-label":`Notifications`,children:t.map(e=>(0,z.jsxs)(`div`,{className:V1(`oc-toast`,`oc-toast--${e.variant}`),role:e.variant===`error`?`alert`:`status`,children:[(0,z.jsxs)(`div`,{className:`oc-toast__body`,children:[(0,z.jsx)(`div`,{className:`oc-toast__title`,children:e.title}),e.description?(0,z.jsx)(`div`,{className:`oc-toast__desc`,children:e.description}):null]}),(0,z.jsx)(`button`,{type:`button`,className:`oc-toast__close`,"aria-label":`Fermer`,onClick:()=>a(e.id),children:(0,z.jsx)(jm,{"aria-hidden":!0})})]},e.id))})]})}function S0(){let e=I.useContext(x0);if(!e)throw Error(`useToast must be used within <ToastProvider>`);return e}function $Ge(e){return e.kind===`tool`}function eKe(e){return e.kind===`media`}function tKe(e){return e.kind===`file`}function nKe(e){return e.kind===`reasoning`}function rKe(e,t){let n=e.runId??`norun`;return`${e._id}:${n}:${t}`}function iKe(e,t,n){return{toolCallId:rKe(e,t),toolName:n.name,args:n.input??{},result:n.output,argsText:n.input===void 0?void 0:cKe(n.input),phase:typeof n.phase==`string`?n.phase:void 0}}var aKe=/---[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?=\.[^.]+$|$)/i;function oKe(e){return e&&e.replace(aKe,``)}function sKe(e){return e.url?{type:`file`,mimeType:e.mimeType,data:e.url,filename:oKe(e.filename)}:null}function cKe(e){try{return typeof e==`string`?e:JSON.stringify(e,null,2)}catch{return String(e)}}function lKe(e){let t=[],n=[],r=[];return e.parts.forEach((i,a)=>{nKe(i)?t.push({type:`reasoning`,text:i.text}):$Ge(i)?n.push(iKe(e,a,i)):i.kind===`provenance`&&r.push(i)}),e.text&&e.text.length>0&&t.push({type:`text`,text:e.text}),e.parts.forEach(e=>{if(eKe(e)||tKe(e)){let n=sKe(e);n&&t.push(n)}}),t.length===0&&t.push({type:`text`,text:``}),{id:e._id,role:e.role,createdAt:new Date(e.updatedAt??e._creationTime),content:t,metadata:{custom:{messageId:e._id,chatId:e.chatId,status:e.status,runId:e.runId??null,error:e.error??null,toolParts:n,provenanceParts:r,rawText:e.text}}}}var C0=25*1024*1024;function uKe(){return`att_${Math.random().toString(36).slice(2)}_${Date.now()}`}function dKe(e){if(!e)return[];let t=[];for(let n of e){let e=n.convex;e?.storageId&&t.push({storageId:e.storageId,filename:e.filename,mimeType:e.mimeType})}return t}function fKe(e){return{accept:`*`,async add({file:e}){if(console.info(`[attach] add: name=${e.name} size=${e.size} type=${e.type||`?`}`),e.size>C0)throw console.warn(`[attach] add: REJECTED — too large (${e.size} > ${C0})`),Error(`File too large (${Math.round(e.size/1024/1024)} MB, max 25 MB).`);let t={id:uKe(),type:pKe(e.type),name:e.name,contentType:e.type||`application/octet-stream`,file:e,status:{type:`running`,reason:`uploading`,progress:0}};return console.info(`[attach] add: PENDING created id=${t.id} type=${t.type}`),t},async send(t){let n=t.file;console.info(`[attach] send: START upload name=${n.name} size=${n.size}`);let r;try{r=await e.mutation(H.chats.generateUploadUrl,{}),console.info(`[attach] send: generateUploadUrl OK -> ${r.slice(0,60)}…`)}catch(e){throw console.error(`[attach] send: generateUploadUrl FAILED:`,e),e}let i;try{i=await fetch(r,{method:`POST`,headers:{"Content-Type":n.type||`application/octet-stream`},body:n})}catch(e){throw console.error(`[attach] send: POST to storage THREW (network/CORS/CSP):`,e),e}if(console.info(`[attach] send: POST status=${i.status}`),!i.ok)throw Error(`Upload failed (${i.status})`);let{storageId:a}=await i.json();return await e.mutation(H.uploads.registerUpload,{storageId:a}),console.info(`[attach] send: DONE storageId=${a}`),{id:t.id,type:t.type,name:t.name,contentType:t.contentType,status:{type:`complete`},content:[{type:`text`,text:n.name}],convex:{storageId:a,filename:n.name,mimeType:n.type||`application/octet-stream`}}},async remove(){}}}function pKe(e){return e.startsWith(`image/`)?`image`:`document`}function mKe({chatId:e}){let t=On(),n=R(H.send.sendMessage).withOptimisticUpdate((e,t)=>{let n={chatId:t.chatId},r=e.getQuery(H.messages.listByChat,n);if(r===void 0)return;let i=`optimistic-${t.clientMessageId}`;if(r.some(e=>e._id===i))return;let a=Date.now(),o={_id:i,chatId:t.chatId,_creationTime:a,role:`user`,status:`complete`,runId:void 0,error:void 0,text:t.text,updatedAt:a,parts:[]};e.setQuery(H.messages.listByChat,n,[...r,o])}),r=L(H.messages.listByChat,e?{chatId:e}:`skip`),i=(0,I.useMemo)(()=>fKe(t),[t]),a=(0,I.useMemo)(()=>r??[],[r]),o=a.length>0?a[a.length-1].role:null,s=a.some(e=>e.status===`streaming`),[c,l]=(0,I.useState)(null);(0,I.useEffect)(()=>{l(null)},[e]),(0,I.useEffect)(()=>{o===`assistant`&&l(null)},[o,a]),(0,I.useEffect)(()=>{if(c===null)return;let e=window.setTimeout(()=>l(null),12e4);return()=>window.clearTimeout(e)},[c]);let u=c!==null||s,d=(0,I.useMemo)(()=>({messages:a,isRunning:u,convertMessage:lKe,onNew:async t=>{if(!e)throw Error(`No chat selected`);let r=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(``),i=dKe(t.attachments).map(e=>({storageId:e.storageId,filename:e.filename,mimeType:e.mimeType}));console.info(`[attach] onNew: text.len=${r.length} attachments=${i.length} (raw=${t.attachments?.length??0})`),l(Date.now());try{await n({chatId:e,text:r,clientMessageId:crypto.randomUUID(),attachments:i})}catch(e){throw l(null),e}},adapters:{attachments:i}}),[a,u,e,n,i]),f=(0,I.useMemo)(()=>({begin:()=>l(Date.now()),cancel:()=>l(null)}),[]);return{runtime:cre(d),turnGate:f}}function w0(e,{key:t,value:n}){let r=e.getQuery(H.me.getMe,{});if(!r?.ui)return;let i={...r.ui.effective},a={...r.ui.userOverrides},o=t,s=t;n===null?delete a[s]:(i[o]=n,a[s]=n),e.setQuery(H.me.getMe,{},{...r,ui:{...r.ui,effective:i,userOverrides:a}})}function hKe(e,{messageId:t}){for(let{args:n,value:r}of e.getAllQueries(H.messages.listByChat)){if(r===void 0)continue;let i=r.find(e=>e._id===t);if(i===void 0)continue;let a=i._creationTime;e.setQuery(H.messages.listByChat,n,r.filter(e=>e._creationTime<a))}}function gKe(e,t){if(e===void 0)return`thinking`;switch(e){case`streaming`:return t?`generating`:`thinking`;case`error`:return`error`;case`aborted`:return`aborted`;default:return null}}function _Ke(e){return e?e.some(e=>e?.type===`text`&&typeof e.text==`string`&&e.text.trim().length>0):!1}var vKe={thinking:Yke,generating:Qke,error:tAe,aborted:sAe};function yKe(e,t){let n=gKe(e,t);return n===null?null:{kind:n,label:vKe[n]()}}var bKe=_Ke;function xKe(e){return e===`stream_orphaned`?iAe():e}function SKe(){let e=ab(e=>e.metadata?.custom?.status),t=ab(e=>e.metadata?.custom?.runId),n=ab(e=>e.metadata?.custom?.error),r=yKe(e,ab(e=>bKe(e.content)));return r?r.kind===`error`?(0,z.jsxs)(`div`,{className:`oc-error-card`,role:`alert`,title:t?`run ${t}`:void 0,children:[(0,z.jsx)(cm,{size:18,className:`oc-error-card__icon`,"aria-hidden":!0}),(0,z.jsxs)(`div`,{className:`oc-error-card__body`,children:[(0,z.jsx)(`span`,{className:`oc-error-card__title`,children:r.label}),n?(0,z.jsx)(`span`,{className:`oc-error-card__msg`,children:xKe(n)}):null]})]}):(0,z.jsxs)(`div`,{className:`oc-run-status oc-run-status--${r.kind}`,role:`status`,title:t?`run ${t}`:void 0,children:[r.kind===`thinking`?(0,z.jsxs)(`span`,{className:`oc-dots`,"aria-hidden":!0,children:[(0,z.jsx)(`span`,{}),(0,z.jsx)(`span`,{}),(0,z.jsx)(`span`,{})]}):r.kind===`generating`?(0,z.jsx)(`span`,{className:`oc-run-status__pulse`,"aria-hidden":!0}):(0,z.jsx)(Cee,{size:13,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`oc-run-status__label`,children:r.label})]}):null}var CKe=new Set([`complete`,`error`,`aborted`]),wKe=new Set([`completed`,`error`]);function TKe(e,t){if(e.length===0)return!1;if(t===`streaming`)return!0;if(t!==void 0&&CKe.has(t))return!1;let n=e[e.length-1];return n.phase!==void 0&&wKe.has(n.phase)?!1:n.result===void 0||n.result===null}var EKe=[`command`,`query`,`url`,`path`,`pattern`,`file`,`cmd`,`prompt`];function DKe(e,t){let n=``;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e;for(let e of EKe){let r=t[e];if(typeof r==`string`&&r.trim()){n=r;break}}}return n||=t??(typeof e==`string`?e:``),n.replace(/\s+/g,` `).trim()}function OKe(e,t){let n=e.length,r=n===1?vq({count:n}):xq({count:n});return{count:n,running:TKe(e,t),label:r}}function T0({text:e}){let[t,n]=(0,I.useState)(!1);return(0,z.jsx)(`button`,{type:`button`,className:`oc-copybtn`,title:`Copier`,"aria-label":`Copier le contenu`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)})},children:t?(0,z.jsx)(am,{size:13,"aria-hidden":!0}):(0,z.jsx)(dm,{size:13,"aria-hidden":!0})})}function kKe(e,t){let n=typeof e==`string`?e:void 0;return n===`error`?`error`:t||n===`completed`?`completed`:`running`}function E0(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function AKe({toolName:e,args:t,argsText:n,result:r,status:i}){let a=r!=null,o=kKe(i?.type,a),s=n??E0(t),c=DKe(t,n),l=o===`running`?hm:o===`error`?cm:um;return(0,z.jsxs)(`details`,{className:`oc-tool oc-tool--${o}`,children:[(0,z.jsxs)(`summary`,{className:`oc-tool__header`,children:[(0,z.jsx)(l,{className:`oc-tool__status${o===`running`?` oc-tool__status--spin`:``}`,size:14,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`oc-tool__name`,children:e}),c?(0,z.jsx)(`span`,{className:`oc-tool__preview`,title:c,children:c}):null,(0,z.jsx)(`span`,{className:`oc-tool__phase`,children:o}),(0,z.jsx)(sm,{size:15,className:`oc-tool__chevron`,"aria-hidden":!0})]}),(0,z.jsxs)(`div`,{className:`oc-tool__body`,children:[s?(0,z.jsxs)(`details`,{className:`oc-tool__io`,children:[(0,z.jsx)(`summary`,{children:`input`}),(0,z.jsxs)(`div`,{className:`oc-tool__prewrap`,children:[(0,z.jsx)(`pre`,{className:`oc-tool__pre`,children:s}),(0,z.jsx)(T0,{text:s})]})]}):null,a?(0,z.jsxs)(`details`,{className:`oc-tool__io`,open:!0,children:[(0,z.jsx)(`summary`,{children:`output`}),(0,z.jsxs)(`div`,{className:`oc-tool__prewrap`,children:[(0,z.jsx)(`pre`,{className:`oc-tool__pre`,children:E0(r)}),(0,z.jsx)(T0,{text:E0(r)})]})]}):null]})]})}function jKe({defaultExpanded:e}){let t=ab(e=>e.metadata?.custom?.toolParts),n=ab(e=>e.metadata?.custom?.status),[r,i]=(0,I.useState)(null);if(!t||t.length===0)return null;let a=r??e,o=OKe(t,n);return(0,z.jsxs)(`div`,{className:`oc-toolact${a?` is-open`:``}`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`oc-toolact__summary`,"aria-expanded":a,title:a?Nq():Aq(),onClick:()=>i(!a),children:[(0,z.jsx)(Am,{size:13,className:`oc-toolact__icon`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`oc-toolact__label`,children:o.label}),o.running?(0,z.jsxs)(`span`,{className:`oc-toolact__state`,children:[(0,z.jsx)(hm,{size:12,className:`oc-toolact__spin`,"aria-hidden":!0}),wq()]}):(0,z.jsxs)(`span`,{className:`oc-toolact__state oc-toolact__state--done`,children:[(0,z.jsx)(am,{size:12,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`oc-sr-only`,children:Dq()})]}),(0,z.jsx)(sm,{size:14,className:`oc-toolact__chevron`,"aria-hidden":!0})]}),a?(0,z.jsx)(`div`,{className:`oc-toolact__detail`,children:t.map(e=>(0,z.jsx)(AKe,{toolName:e.toolName,args:e.args,argsText:e.argsText,result:e.result,status:e.phase?{type:e.phase}:void 0},e.toolCallId))}):null]})}function MKe(e){let t={memory:0,documents:0};for(let n of e)n.group===`memory`?t.memory+=n.items.length:t.documents+=n.items.length;return t}function NKe(e){let t=[];return e.memory>0&&t.push(e.memory===1?ZG():eK({count:e.memory})),e.documents>0&&t.push(e.documents===1?rK():oK({count:e.documents})),t.join(` · `)}function D0(e){return e.file_name??e.id??e.type??vK()}function PKe(e){let t=[];return e.type&&D0(e)!==e.type&&t.push(e.type),e.date&&t.push(e.date),e.collection&&t.push(e.collection),typeof e.score==`number`&&t.push(hK({score:e.score.toFixed(2)})),t}function FKe(e){return[...e].sort((e,t)=>e.group===t.group?0:e.group===`memory`?-1:1)}function IKe(e){return e===`memory`?lK():fK()}var LKe=[];function RKe(){let e=ab(e=>e.metadata?.custom?.provenanceParts??LKe),t=ab(e=>e.metadata?.custom?.messageId),[n,r]=(0,I.useState)(!1),i=n&&t!==void 0&&e.some(e=>e.hasExcerpts===!0),a=L(H.messages.getProvenanceParts,i?{messageId:t}:`skip`),o=a!==void 0&&a.length>0?a:e;if(e.length===0)return null;let s=MKe(e);return s.memory+s.documents===0?null:(0,z.jsxs)(`div`,{className:`oc-sources`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`oc-sources__summary`,"aria-expanded":n,onClick:()=>r(e=>!e),children:[n?(0,z.jsx)(om,{size:13,"aria-hidden":!0}):(0,z.jsx)(sm,{size:13,"aria-hidden":!0}),(0,z.jsx)(ree,{size:13,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`oc-sources__label`,children:JG()}),(0,z.jsx)(`span`,{className:`oc-sources__counts`,children:NKe(s)})]}),n?(0,z.jsx)(`div`,{className:`oc-sources__detail`,children:FKe(o).map((e,t)=>(0,z.jsxs)(`section`,{className:`oc-sources__group`,children:[(0,z.jsxs)(`h4`,{className:`oc-sources__group-title`,children:[IKe(e.group),(0,z.jsx)(`span`,{className:`oc-sources__plugin`,title:e.pluginId,children:e.source})]}),(0,z.jsx)(`ul`,{className:`oc-sources__items`,children:e.items.map((e,t)=>(0,z.jsxs)(`li`,{className:`oc-sources__item`,children:[(0,z.jsxs)(`div`,{className:`oc-sources__item-head`,children:[(0,z.jsx)(`span`,{className:`oc-sources__item-title`,children:D0(e)}),PKe(e).map(e=>(0,z.jsx)(`span`,{className:`oc-sources__chip`,children:e},e))]}),e.text?(0,z.jsx)(`blockquote`,{className:`oc-sources__excerpt`,children:e.text}):null]},t))})]},`${e.pluginId}-${e.group}-${t}`))}):null]})}function zKe({mimeType:e,data:t,filename:n}){let r=e??``,i=t??``,a=n??`attachment`;return i?r.startsWith(`audio/`)?(0,z.jsxs)(`div`,{className:`oc-media oc-media--audio`,children:[(0,z.jsx)(`audio`,{controls:!0,preload:`metadata`,src:i,className:`oc-media__audio`,children:(0,z.jsx)(`a`,{href:i,download:a,children:`Download audio`})}),(0,z.jsx)(`span`,{className:`oc-media__name`,children:a})]}):r.startsWith(`image/`)?(0,z.jsxs)(`figure`,{className:`oc-media oc-media--image`,children:[(0,z.jsx)(`img`,{src:i,alt:a,className:`oc-media__img`,loading:`lazy`}),(0,z.jsx)(`figcaption`,{className:`oc-media__name`,children:a})]}):r.startsWith(`video/`)?(0,z.jsxs)(`div`,{className:`oc-media oc-media--video`,children:[(0,z.jsx)(`video`,{controls:!0,preload:`metadata`,src:i,className:`oc-media__video`}),(0,z.jsx)(`span`,{className:`oc-media__name`,children:a})]}):(0,z.jsxs)(`a`,{className:`oc-media oc-media--file`,href:i,download:a,children:[(0,z.jsx)(`span`,{className:`oc-media__icon`,"aria-hidden":!0,children:`⬇`}),(0,z.jsx)(`span`,{className:`oc-media__name`,children:a})]}):null}var BKe=(e,t)=>typeof e==`string`?e===t:JSON.stringify(e)===JSON.stringify(t),VKe=(e,t)=>{if(!e||!t)return!1;let n=e=>{let{position:t,data:n,...r}=e||{};return r};return JSON.stringify(n(e.properties))===JSON.stringify(n(t.properties))&&BKe(e.children,t.children)},O0=(e,t)=>VKe(e.node,t.node),k0=(0,I.createContext)(null),HKe=()=>(0,I.useContext)(k0)!==null,UKe=(0,I.memo)(({children:e,...t})=>(0,z.jsx)(k0.Provider,{value:t,children:e}),O0),WKe=({node:e,...t})=>(0,z.jsx)(`pre`,{...t}),GKe=({node:e,...t})=>(0,z.jsx)(`code`,{...t}),A0=({node:e,components:{Pre:t,Code:n},code:r})=>(0,z.jsx)(t,{children:(0,z.jsx)(n,{node:e,children:r})}),KKe=()=>null,qKe=({node:e,components:{Pre:t,Code:n,SyntaxHighlighter:r,CodeHeader:i},language:a,code:o})=>{let s=(0,I.useMemo)(()=>({Pre:t,Code:n}),[t,n]);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(i,{node:e,language:a,code:o}),(0,z.jsx)(a?r:A0,{node:e,components:s,language:a??`unknown`,code:o})]})},j0=u(o(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))(),1),M0=({className:e,...t})=>({className:n,...r})=>({className:(0,j0.default)(e,n),...t,...r}),JKe=({node:e,components:{Pre:t,Code:n,SyntaxHighlighter:r,CodeHeader:i},componentsByLanguage:a={},children:o,...s})=>{let c=M0((0,I.useContext)(k0)),l=Cb(e=>(0,z.jsx)(t,{...c(e)})),u=M0(s),d=Cb(e=>(0,z.jsx)(n,{...u(e)})),f=/language-(\w+)/.exec(s.className||``)?.[1]??``;return typeof o==`string`?(0,z.jsx)(qKe,{node:e,components:{Pre:l,Code:d,SyntaxHighlighter:a[f]?.SyntaxHighlighter??r,CodeHeader:a[f]?.CodeHeader??i},language:f||`unknown`,code:o}):(0,z.jsx)(A0,{node:e,components:{Pre:l,Code:d},code:o})},YKe=(0,I.memo)(({node:e,components:t,componentsByLanguage:n,...r})=>HKe()?(0,z.jsx)(JKe,{node:e,components:t,componentsByLanguage:n,...r}):(0,z.jsx)(t.Code,{...r}),(e,t)=>e.components===t.components&&e.componentsByLanguage===t.componentsByLanguage&&O0(e,t));function XKe(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var ZKe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QKe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$Ke={};function N0(e,t){return((t||$Ke).jsx?QKe:ZKe).test(e)}var eqe=/[ \t\n\f\r]/g;function tqe(e){return typeof e==`object`?e.type===`text`?P0(e.value):!1:P0(e)}function P0(e){return e.replace(eqe,``)===``}var F0=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};F0.prototype.normal={},F0.prototype.property={},F0.prototype.space=void 0;function I0(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new F0(n,r,t)}function L0(e){return e.toLowerCase()}var R0=class{constructor(e,t){this.attribute=t,this.property=e}};R0.prototype.attribute=``,R0.prototype.booleanish=!1,R0.prototype.boolean=!1,R0.prototype.commaOrSpaceSeparated=!1,R0.prototype.commaSeparated=!1,R0.prototype.defined=!1,R0.prototype.mustUseProperty=!1,R0.prototype.number=!1,R0.prototype.overloadedBoolean=!1,R0.prototype.property=``,R0.prototype.spaceSeparated=!1,R0.prototype.space=void 0;var z0=s({boolean:()=>B0,booleanish:()=>V0,commaOrSpaceSeparated:()=>G0,commaSeparated:()=>W0,number:()=>Z,overloadedBoolean:()=>H0,spaceSeparated:()=>U0}),nqe=0,B0=K0(),V0=K0(),H0=K0(),Z=K0(),U0=K0(),W0=K0(),G0=K0();function K0(){return 2**++nqe}var q0=Object.keys(z0),J0=class extends R0{constructor(e,t,n,r){let i=-1;if(super(e,t),Y0(this,`space`,r),typeof n==`number`)for(;++i<q0.length;){let e=q0[i];Y0(this,q0[i],(n&z0[e])===z0[e])}}};J0.prototype.defined=!0;function Y0(e,t,n){n&&(e[t]=n)}function X0(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new J0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[L0(r)]=r,n[L0(a.attribute)]=r}return new F0(t,n,e.space)}var Z0=X0({properties:{ariaActiveDescendant:null,ariaAtomic:V0,ariaAutoComplete:null,ariaBusy:V0,ariaChecked:V0,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:U0,ariaCurrent:null,ariaDescribedBy:U0,ariaDetails:null,ariaDisabled:V0,ariaDropEffect:U0,ariaErrorMessage:null,ariaExpanded:V0,ariaFlowTo:U0,ariaGrabbed:V0,ariaHasPopup:null,ariaHidden:V0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U0,ariaLevel:Z,ariaLive:null,ariaModal:V0,ariaMultiLine:V0,ariaMultiSelectable:V0,ariaOrientation:null,ariaOwns:U0,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:V0,ariaReadOnly:V0,ariaRelevant:null,ariaRequired:V0,ariaRoleDescription:U0,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:V0,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Q0(e,t){return t in e?e[t]:t}function $0(e,t){return Q0(e,t.toLowerCase())}var rqe=X0({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:W0,acceptCharset:U0,accessKey:U0,action:null,allow:null,allowFullScreen:B0,allowPaymentRequest:B0,allowUserMedia:B0,alpha:B0,alt:null,as:null,async:B0,autoCapitalize:null,autoComplete:U0,autoFocus:B0,autoPlay:B0,blocking:U0,capture:null,charSet:null,checked:B0,cite:null,className:U0,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:V0,controls:B0,controlsList:U0,coords:Z|W0,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B0,defer:B0,dir:null,dirName:null,disabled:B0,download:H0,draggable:V0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B0,formTarget:null,headers:U0,height:Z,hidden:H0,high:Z,href:null,hrefLang:null,htmlFor:U0,httpEquiv:U0,id:null,imageSizes:null,imageSrcSet:null,inert:B0,inputMode:null,integrity:null,is:null,isMap:B0,itemId:null,itemProp:U0,itemRef:U0,itemScope:B0,itemType:U0,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B0,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:B0,muted:B0,name:null,nonce:null,noModule:B0,noValidate:B0,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:B0,optimum:Z,pattern:null,ping:U0,placeholder:null,playsInline:B0,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B0,referrerPolicy:null,rel:U0,required:B0,reversed:B0,rows:Z,rowSpan:Z,sandbox:U0,scope:null,scoped:B0,seamless:B0,selected:B0,shadowRootClonable:B0,shadowRootCustomElementRegistry:B0,shadowRootDelegatesFocus:B0,shadowRootMode:null,shadowRootSerializable:B0,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:V0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:B0,useMap:null,value:V0,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U0,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B0,declare:B0,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:B0,noHref:B0,noShade:B0,noWrap:B0,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:V0,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:B0,disablePictureInPicture:B0,disableRemotePlayback:B0,exportParts:W0,part:U0,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:$0}),iqe=X0({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:G0,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:U0,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:B0,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:W0,g2:W0,glyphName:W0,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:G0,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U0,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:G0,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:G0,rev:G0,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:G0,requiredFeatures:G0,requiredFonts:G0,requiredFormats:G0,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:G0,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:G0,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:G0,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Q0}),e2=X0({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),t2=X0({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:$0}),n2=X0({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),aqe={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},oqe=/[A-Z]/g,r2=/-[a-z]/g,sqe=/^data[-\w.:]+$/i;function cqe(e,t){let n=L0(t),r=t,i=R0;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&sqe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(r2,uqe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!r2.test(e)){let n=e.replace(oqe,lqe);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=J0}return new i(r,t)}function lqe(e){return`-`+e.toLowerCase()}function uqe(e){return e.charAt(1).toUpperCase()}var dqe=I0([Z0,rqe,e2,t2,n2],`html`),i2=I0([Z0,iqe,e2,t2,n2],`svg`);function fqe(e){return e.join(` `).trim()}var pqe=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
133
|
-
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),mqe=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(pqe());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),hqe=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),gqe=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(mqe()),r=hqe();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),a2=s2(`end`),o2=s2(`start`);function s2(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function _qe(e){let t=o2(e),n=a2(e);if(t&&n)return{start:t,end:n}}function c2(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?u2(e.position):`start`in e||`end`in e?u2(e):`line`in e||`column`in e?l2(e):``}function l2(e){return d2(e&&e.line)+`:`+d2(e&&e.column)}function u2(e){return l2(e&&e.start)+`-`+l2(e&&e.end)}function d2(e){return e&&typeof e==`number`?e:1}var f2=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=c2(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};f2.prototype.file=``,f2.prototype.name=``,f2.prototype.reason=``,f2.prototype.message=``,f2.prototype.stack=``,f2.prototype.column=void 0,f2.prototype.line=void 0,f2.prototype.ancestors=void 0,f2.prototype.cause=void 0,f2.prototype.fatal=void 0,f2.prototype.place=void 0,f2.prototype.ruleId=void 0,f2.prototype.source=void 0;var vqe=u(gqe(),1),p2={}.hasOwnProperty,yqe=new Map,bqe=/[A-Z]/g,xqe=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Sqe=new Set([`td`,`th`]);function Cqe(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=jqe(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Aqe(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?i2:dqe,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=m2(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function m2(e,t,n){if(t.type===`element`)return wqe(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Tqe(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Dqe(e,t,n);if(t.type===`mdxjsEsm`)return Eqe(e,t);if(t.type===`root`)return Oqe(e,t,n);if(t.type===`text`)return kqe(e,t)}function wqe(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=i2,e.schema=i),e.ancestors.push(t);let a=v2(e,t.tagName,!1),o=Mqe(e,t),s=_2(e,t);return xqe.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!tqe(e):!0})),h2(e,o,a,t),g2(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Tqe(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}y2(e,t.position)}function Eqe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);y2(e,t.position)}function Dqe(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=i2,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:v2(e,t.name,!0),o=Nqe(e,t),s=_2(e,t);return h2(e,o,a,t),g2(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Oqe(e,t,n){let r={};return g2(r,_2(e,t)),e.create(t,e.Fragment,r,n)}function kqe(e,t){return t.value}function h2(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function g2(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Aqe(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function jqe(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=o2(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Mqe(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&p2.call(t.properties,i)){let a=Pqe(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Sqe.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Nqe(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else y2(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else y2(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function _2(e,t){let n=[],r=-1,i=e.passKeys?new Map:yqe;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=m2(e,a,o);s!==void 0&&n.push(s)}return n}function Pqe(e,t,n){let r=cqe(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?XKe(n):fqe(n)),r.property===`style`){let t=typeof n==`object`?n:Fqe(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Iqe(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?aqe[r.property]||r.property:r.attribute,n]}}function Fqe(e,t){try{return(0,vqe.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new f2("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function v2(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=N0(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=N0(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return p2.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);y2(e)}function y2(e,t){let n=new f2("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function Iqe(e){let t={},n;for(n in e)p2.call(e,n)&&(t[Lqe(n)]=e[n]);return t}function Lqe(e){let t=e.replace(bqe,Rqe);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Rqe(e){return`-`+e.toLowerCase()}var b2={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},zqe={};function x2(e,t){let n=t||zqe;return S2(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function S2(e,t,n){if(Bqe(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return C2(e.children,t,n)}return Array.isArray(e)?C2(e,t,n):``}function C2(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=S2(e[i],t,n);return r.join(``)}function Bqe(e){return!!(e&&typeof e==`object`)}var w2=document.createElement(`i`);function T2(e){let t=`&`+e+`;`;w2.innerHTML=t;let n=w2.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function E2(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function D2(e,t){return e.length>0?(E2(e,e.length,0,t),e):t}var O2={}.hasOwnProperty;function k2(e){let t={},n=-1;for(;++n<e.length;)Vqe(t,e[n]);return t}function Vqe(e,t){let n;for(n in t){let r=(O2.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){O2.call(r,a)||(r[a]=[]);let e=i[a];Hqe(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Hqe(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);E2(e,0,0,r)}function A2(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function j2(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var M2=V2(/[A-Za-z]/),N2=V2(/[\dA-Za-z]/),Uqe=V2(/[#-'*+\--9=?A-Z^-~]/);function P2(e){return e!==null&&(e<32||e===127)}var F2=V2(/\d/),Wqe=V2(/[\dA-Fa-f]/),Gqe=V2(/[!-/:-@[-`{-~]/);function I2(e){return e!==null&&e<-2}function L2(e){return e!==null&&(e<0||e===32)}function R2(e){return e===-2||e===-1||e===32}var z2=V2(/\p{P}|\p{S}/u),B2=V2(/\s/);function V2(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function H2(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&N2(e.charCodeAt(n+1))&&N2(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function U2(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return R2(r)?(e.enter(n),s(r)):t(r)}function s(r){return R2(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Kqe={tokenize:qqe};function qqe(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U2(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return I2(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Jqe={tokenize:Yqe},W2={tokenize:Xqe};function Yqe(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return E2(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(W2,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(W2,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return I2(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;E2(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Xqe(e,t,n){return U2(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function G2(e){if(e===null||L2(e)||B2(e))return 1;if(z2(e))return 2}function K2(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var q2={name:`attention`,resolveAll:Zqe,tokenize:Qqe};function Zqe(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};J2(d,-c),J2(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=D2(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=D2(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=D2(l,K2(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=D2(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=D2(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,E2(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Qqe(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=G2(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=G2(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function J2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var $qe={name:`autolink`,tokenize:eJe};function eJe(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return M2(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||N2(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||N2(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||P2(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Uqe(t)?(e.consume(t),l):n(t)}function u(e){return N2(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||N2(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Y2={partial:!0,tokenize:tJe};function tJe(e,t,n){return r;function r(t){return R2(t)?U2(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||I2(e)?t(e):n(e)}}var X2={continuation:{tokenize:rJe},exit:iJe,name:`blockQuote`,tokenize:nJe};function nJe(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return R2(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function rJe(e,t,n){let r=this;return i;function i(t){return R2(t)?U2(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(X2,t,n)(r)}}function iJe(e){e.exit(`blockQuote`)}var Z2={name:`characterEscape`,tokenize:aJe};function aJe(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Gqe(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Q2={name:`characterReference`,tokenize:oJe};function oJe(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=N2,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Wqe,u):(e.enter(`characterReferenceValue`),a=7,o=F2,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===N2&&!T2(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var $2={partial:!0,tokenize:cJe},e4={concrete:!0,name:`codeFenced`,tokenize:sJe};function sJe(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),R2(t)?U2(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||I2(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check($2,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||I2(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):R2(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),U2(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||I2(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||I2(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&R2(t)?U2(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||I2(t)?e.check($2,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||I2(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),R2(t)?U2(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),R2(t)?U2(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||I2(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function cJe(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var t4={name:`codeIndented`,tokenize:uJe},lJe={partial:!0,tokenize:dJe};function uJe(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),U2(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):I2(t)?e.attempt(lJe,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||I2(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function dJe(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):I2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):U2(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):I2(e)?i(e):n(e)}}var fJe={name:`codeText`,previous:mJe,resolve:pJe,tokenize:hJe};function pJe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function mJe(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function hJe(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):I2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||I2(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var gJe=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&n4(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),n4(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),n4(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);n4(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);n4(this.left,t.reverse())}}};function n4(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function r4(e){let t={},n=-1,r,i,a,o,s,c,l,u=new gJe(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,_Je(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return E2(e,0,1/0,u.slice(0)),!l}function _Je(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var vJe={resolve:bJe,tokenize:xJe},yJe={partial:!0,tokenize:SJe};function bJe(e){return r4(e),e}function xJe(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):I2(t)?e.check(yJe,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function SJe(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U2(e,a,`linePrefix`)}function a(i){if(i===null||I2(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function i4(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||P2(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||I2(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||L2(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||P2(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function a4(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):I2(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||I2(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!R2(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function o4(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):I2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U2(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||I2(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function s4(e,t){let n;return r;function r(i){return I2(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):R2(i)?U2(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var CJe={name:`definition`,tokenize:TJe},wJe={partial:!0,tokenize:EJe};function TJe(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return a4.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=j2(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return L2(t)?s4(e,l)(t):l(t)}function l(t){return i4(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(wJe,d,d)(t)}function d(t){return R2(t)?U2(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||I2(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function EJe(e,t,n){return r;function r(t){return L2(t)?s4(e,i)(t):n(t)}function i(t){return o4(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return R2(t)?U2(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||I2(e)?t(e):n(e)}}var DJe={name:`hardBreakEscape`,tokenize:OJe};function OJe(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return I2(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var kJe={name:`headingAtx`,resolve:AJe,tokenize:jJe};function AJe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},E2(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function jJe(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||L2(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||I2(n)?(e.exit(`atxHeading`),t(n)):R2(n)?U2(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||L2(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var MJe=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),c4=[`pre`,`script`,`style`,`textarea`],NJe={concrete:!0,name:`htmlFlow`,resolveTo:IJe,tokenize:LJe},PJe={partial:!0,tokenize:zJe},FJe={partial:!0,tokenize:RJe};function IJe(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function LJe(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):M2(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):M2(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return M2(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||L2(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&c4.includes(l)?(i=1,r.interrupt?t(s):O(s)):MJe.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||N2(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return R2(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||M2(t)?(e.consume(t),b):R2(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||N2(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):R2(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):R2(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||I2(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||L2(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||R2(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||I2(t)?O(t):R2(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),F):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):I2(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(PJe,ne,k)(t)):t===null||I2(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(FJe,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||I2(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return c4.includes(n)?(e.consume(t),F):O(t)}return M2(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),F):t===45&&i===2?(e.consume(t),P):O(t)}function F(t){return t===null||I2(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),F)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function RJe(e,t,n){let r=this;return i;function i(t){return I2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function zJe(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Y2,t,n)}}var BJe={name:`htmlText`,tokenize:VJe};function VJe(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):M2(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):M2(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):I2(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):I2(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):I2(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):I2(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return M2(t)?(e.consume(t),S):n(t)}function S(t){return t===45||N2(t)?(e.consume(t),S):C(t)}function C(t){return I2(t)?(o=C,N(t)):R2(t)?(e.consume(t),C):M(t)}function w(t){return t===45||N2(t)?(e.consume(t),w):t===47||t===62||L2(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||M2(t)?(e.consume(t),E):I2(t)?(o=T,N(t)):R2(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||N2(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):I2(t)?(o=D,N(t)):R2(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):I2(t)?(o=O,N(t)):R2(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):I2(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||L2(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||L2(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return R2(t)?U2(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var l4={name:`labelEnd`,resolveAll:GJe,resolveTo:KJe,tokenize:qJe},HJe={tokenize:JJe},UJe={tokenize:YJe},WJe={tokenize:XJe};function GJe(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&E2(e,0,e.length,n),e}function KJe(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=D2(s,e.slice(a+1,a+r+3)),s=D2(s,[[`enter`,u,t]]),s=D2(s,K2(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=D2(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=D2(s,e.slice(o+1)),s=D2(s,[[`exit`,c,t]]),E2(e,a,e.length,s),e}function qJe(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(j2(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(HJe,u,o?u:d)(t):t===91?e.attempt(UJe,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(WJe,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function JJe(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return L2(t)?s4(e,a)(t):a(t)}function a(t){return t===41?u(t):i4(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return L2(t)?s4(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?o4(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return L2(t)?s4(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function YJe(e,t,n){let r=this;return i;function i(t){return a4.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(j2(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function XJe(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var ZJe={name:`labelStartImage`,resolveAll:l4.resolveAll,tokenize:QJe};function QJe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var $Je={name:`labelStartLink`,resolveAll:l4.resolveAll,tokenize:eYe};function eYe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var u4={name:`lineEnding`,tokenize:tYe};function tYe(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U2(e,t,`linePrefix`)}}var d4={name:`thematicBreak`,tokenize:nYe};function nYe(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||I2(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),R2(t)?U2(e,s,`whitespace`)(t):s(t))}}var f4={continuation:{tokenize:oYe},exit:cYe,name:`list`,tokenize:aYe},rYe={partial:!0,tokenize:lYe},iYe={partial:!0,tokenize:sYe};function aYe(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:F2(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(d4,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return F2(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Y2,r.interrupt?n:u,e.attempt(rYe,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return R2(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function oYe(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Y2,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,U2(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!R2(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(iYe,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,U2(e,e.attempt(f4,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function sYe(e,t,n){let r=this;return U2(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function cYe(e){e.exit(this.containerState.type)}function lYe(e,t,n){let r=this;return U2(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!R2(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var p4={name:`setextUnderline`,resolveTo:uYe,tokenize:dYe};function uYe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function dYe(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),R2(t)?U2(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||I2(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var fYe={tokenize:pYe};function pYe(e){let t=this,n=e.attempt(Y2,r,e.attempt(this.parser.constructs.flowInitial,i,U2(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vJe,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var mYe={resolveAll:h4()},hYe=m4(`string`),gYe=m4(`text`);function m4(e){return{resolveAll:h4(e===`text`?_Ye:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function h4(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function _Ye(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var vYe=s({attentionMarkers:()=>EYe,contentInitial:()=>bYe,disable:()=>DYe,document:()=>yYe,flow:()=>SYe,flowInitial:()=>xYe,insideSpan:()=>TYe,string:()=>CYe,text:()=>wYe}),yYe={42:f4,43:f4,45:f4,48:f4,49:f4,50:f4,51:f4,52:f4,53:f4,54:f4,55:f4,56:f4,57:f4,62:X2},bYe={91:CJe},xYe={[-2]:t4,[-1]:t4,32:t4},SYe={35:kJe,42:d4,45:[p4,d4],60:NJe,61:p4,95:d4,96:e4,126:e4},CYe={38:Q2,92:Z2},wYe={[-5]:u4,[-4]:u4,[-3]:u4,33:ZJe,38:Q2,42:q2,60:[$qe,BJe],91:$Je,92:[DJe,Z2],93:l4,95:q2,96:fJe},TYe={null:[q2,mYe]},EYe={null:[42,95]},DYe={null:[]};function OYe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=D2(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=K2(a,l.events,l),l.events):[]}function f(e,t){return AYe(p(e),t)}function p(e){return kYe(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){I2(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&E2(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function kYe(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function AYe(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
134
|
-
`;break;case-3:o=`\r
|
|
135
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function jYe(e){let t={constructs:k2([vYe,...(e||{}).extensions||[]]),content:n(Kqe),defined:[],document:n(Jqe),flow:n(fYe),lazy:{},string:n(hYe),text:n(gYe)};return t;function n(e){return n;function n(n){return OYe(t,e,n)}}}function MYe(e){for(;!r4(e););return e}var g4=/[\0\t\n\r]/g;function NYe(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(g4.lastIndex=u,c=g4.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var PYe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FYe(e){return e.replace(PYe,IYe)}function IYe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return A2(n.slice(t?2:1),t?16:10)}return T2(n)||e}var _4={}.hasOwnProperty;function LYe(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),RYe(n)(MYe(jYe(n).document().write(NYe()(e,t,!0))))}function RYe(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ye),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(he),blockQuote:a(ue),characterEscape:T,characterReference:T,codeFenced:a(de),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(de,o),codeText:a(fe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(pe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(me),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a(_e,o),htmlFlowData:T,htmlText:a(_e,o),htmlTextData:T,image:a(ve),label:o,link:a(ye),listItem:a(xe),listItemValue:f,listOrdered:a(be,d),listUnordered:a(be),paragraph:a(Se),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(he),strong:a(Ce),thematicBreak:a(Te)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:le,autolinkProtocol:ce,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:oe,characterReference:se,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:te,labelText:ee,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:P,resourceTitleString:F,resource:ne,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};y4(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];_4.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||b4).call(a,void 0,e[0])}for(r.position={start:v4(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:v4(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:v4(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||b4).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+c2({start:e.start,end:e.end})+`): it’s not open`);n.position.end=v4(e.end)}function u(){return x2(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=j2(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=we(),n.position={start:v4(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=v4(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=v4(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=FYe(t),n.identifier=j2(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=j2(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ae(e){this.data.characterReferenceType=e.type}function oe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=A2(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=T2(t);let i=this.stack[this.stack.length-1];i.value+=r}function se(e){let t=this.stack.pop();t.position.end=v4(e.end)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function le(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ue(){return{type:`blockquote`,children:[]}}function de(){return{type:`code`,lang:null,meta:null,value:``}}function fe(){return{type:`inlineCode`,value:``}}function pe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function me(){return{type:`emphasis`,children:[]}}function he(){return{type:`heading`,depth:0,children:[]}}function ge(){return{type:`break`}}function _e(){return{type:`html`,value:``}}function ve(){return{type:`image`,title:null,url:``,alt:null}}function ye(){return{type:`link`,title:null,url:``,children:[]}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Se(){return{type:`paragraph`,children:[]}}function Ce(){return{type:`strong`,children:[]}}function we(){return{type:`text`,value:``}}function Te(){return{type:`thematicBreak`}}}function v4(e){return{line:e.line,column:e.column,offset:e.offset}}function y4(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?y4(e,r):zYe(e,r)}}function zYe(e,t){let n;for(n in t)if(_4.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function b4(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+c2({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+c2({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+c2({start:t.start,end:t.end})+`) is still open`)}function BYe(e){let t=this;t.parser=n;function n(n){return LYe(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function VYe(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function HYe(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
136
|
-
`}]}function UYe(e,t){let n=t.value?t.value+`
|
|
137
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function WYe(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GYe(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KYe(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=H2(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function qYe(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JYe(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function x4(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function YYe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return x4(e,t);let i={src:H2(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function XYe(e,t){let n={src:H2(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ZYe(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function QYe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return x4(e,t);let i={href:H2(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function $Ye(e,t){let n={href:H2(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function eXe(e,t,n){let r=e.all(t),i=n?tXe(n):S4(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
138
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
139
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function tXe(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=S4(n[r])}return t}function S4(e){return e.spread??e.children.length>1}function nXe(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function rXe(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iXe(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function aXe(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oXe(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=o2(t.children[1]),o=a2(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function sXe(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function cXe(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var C4=9,w4=32;function lXe(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(T4(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(T4(t.slice(i),i>0,!1)),a.join(``)}function T4(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===C4||t===w4;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===C4||t===w4;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function uXe(e,t){let n={type:`text`,value:lXe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function dXe(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var fXe={blockquote:VYe,break:HYe,code:UYe,delete:WYe,emphasis:GYe,footnoteReference:KYe,heading:qYe,html:JYe,imageReference:YYe,image:XYe,inlineCode:ZYe,linkReference:QYe,link:$Ye,listItem:eXe,list:nXe,paragraph:rXe,root:iXe,strong:aXe,table:oXe,tableCell:cXe,tableRow:sXe,text:uXe,thematicBreak:dXe,toml:E4,yaml:E4,definition:E4,footnoteDefinition:E4};function E4(){}var pXe=typeof self==`object`?self:globalThis,D4=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new pXe[e](t)},mXe=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(D4(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(D4(a,o),i)};return r},O4=e=>mXe(new Map,e)(0),k4=``,{toString:hXe}={},{keys:gXe}=Object,A4=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=hXe.call(e).slice(8,-1);switch(n){case`Array`:return[1,k4];case`Object`:return[2,k4];case`Date`:return[3,k4];case`RegExp`:return[4,k4];case`Map`:return[5,k4];case`Set`:return[6,k4];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},j4=([e,t])=>e===0&&(t===`function`||t===`symbol`),_Xe=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=A4(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of gXe(r))(e||!j4(A4(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(j4(A4(n))||j4(A4(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!j4(A4(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},M4=(e,{json:t,lossy:n}={})=>{let r=[];return _Xe(!(t||n),!!t,new Map,r)(e),r},N4=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?O4(M4(e,t)):structuredClone(e):(e,t)=>O4(M4(e,t));function vXe(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function yXe(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function bXe(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||vXe,r=e.options.footnoteBackLabel||yXe,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=H2(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...N4(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
140
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
141
|
-
`}]}}var P4=(function(e){if(e==null)return wXe;if(typeof e==`function`)return F4(e);if(typeof e==`object`)return Array.isArray(e)?xXe(e):SXe(e);if(typeof e==`string`)return CXe(e);throw Error(`Expected function, string, or object as test`)});function xXe(e){let t=[],n=-1;for(;++n<e.length;)t[n]=P4(e[n]);return F4(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function SXe(e){let t=e;return F4(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function CXe(e){return F4(t);function t(t){return t&&t.type===e}}function F4(e){return t;function t(t,n,r){return!!(TXe(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function wXe(){return!0}function TXe(e){return typeof e==`object`&&!!e&&`type`in e}function EXe(e){return e}var I4=[];function L4(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=P4(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+EXe(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=I4,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=DXe(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function DXe(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?I4:[e]}function R4(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),L4(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var z4={}.hasOwnProperty,OXe={};function kXe(e,t){let n=t||OXe,r=new Map,i=new Map,a={all:s,applyData:jXe,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...fXe,...n.handlers},one:o,options:n,patch:AXe,wrap:NXe};return R4(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(z4.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=N4(n);return r.children=a.all(e),r}return N4(e)}return(a.options.unknownHandler||MXe)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=B4(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=B4(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function AXe(e,t){e.position&&(t.position=_qe(e))}function jXe(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,N4(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function MXe(e,t){let n=t.data||{},r=`value`in t&&!(z4.call(n,`hProperties`)||z4.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function NXe(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
142
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
143
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
144
|
-
`}),n}function B4(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function V4(e,t){let n=kXe(e,t),r=n.one(e,void 0),i=bXe(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
145
|
-
`},i)),a}function PXe(e,t){return e&&`run`in e?async function(n,r){let i=V4(n,{file:r,...t});await e.run(i,r)}:function(n,r){return V4(n,{file:r,...e||t})}}function H4(e){if(e)throw e}var FXe=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function U4(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function IXe(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?LXe(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function LXe(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var W4={basename:RXe,dirname:zXe,extname:BXe,join:VXe,sep:`/`};function RXe(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);G4(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function zXe(e){if(G4(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function BXe(e){G4(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function VXe(...e){let t=-1,n;for(;++t<e.length;)G4(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:HXe(n)}function HXe(e){G4(e);let t=e.codePointAt(0)===47,n=UXe(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function UXe(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function G4(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var WXe={cwd:GXe};function GXe(){return`/`}function K4(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function KXe(e){if(typeof e==`string`)e=new URL(e);else if(!K4(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return qXe(e)}function qXe(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var q4=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],J4=class{constructor(e){let t;t=e?K4(e)?{path:e}:typeof e==`string`||JXe(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:WXe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<q4.length;){let e=q4[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)q4.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?W4.basename(this.path):void 0}set basename(e){X4(e,`basename`),Y4(e,`basename`),this.path=W4.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?W4.dirname(this.path):void 0}set dirname(e){Z4(this.basename,`dirname`),this.path=W4.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?W4.extname(this.path):void 0}set extname(e){if(Y4(e,`extname`),Z4(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=W4.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){K4(e)&&(e=KXe(e)),X4(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?W4.basename(this.path,this.extname):void 0}set stem(e){X4(e,`stem`),Y4(e,`stem`),this.path=W4.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new f2(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Y4(e,t){if(e&&e.includes(W4.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+W4.sep+"`")}function X4(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Z4(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function JXe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var YXe=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Q4=u(FXe(),1),XXe={}.hasOwnProperty,ZXe=new class e extends YXe{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=IXe()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Q4.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(t3(`data`,this.frozen),this.namespace[e]=t,this):XXe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(t3(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=i3(e),n=this.parser||this.Parser;return $4(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),$4(`process`,this.parser||this.Parser),e3(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=i3(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);$Xe(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),$4(`processSync`,this.parser||this.Parser),e3(`processSync`,this.compiler||this.Compiler),this.process(e,r),r3(`processSync`,`process`,t),n;function r(e,r){t=!0,H4(e),n=r}}run(e,t,n){n3(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=i3(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),r3(`runSync`,`run`,n),r;function i(e,t){H4(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=i3(t),r=this.compiler||this.Compiler;return e3(`stringify`,r),n3(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(t3(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Q4.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];U4(o)&&U4(r)&&(r=(0,Q4.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function $4(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function e3(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function t3(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function n3(e){if(!U4(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function r3(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function i3(e){return QXe(e)?e:new J4(e)}function QXe(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function $Xe(e){return typeof e==`string`||eZe(e)}function eZe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var a3=[],o3={allowDangerousHtml:!0},tZe=/^(https?|ircs?|mailto|xmpp)$/i,nZe=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function rZe(e){let t=iZe(e),n=aZe(e);return oZe(t.runSync(t.parse(n),n),e)}function iZe(e){let t=e.rehypePlugins||a3,n=e.remarkPlugins||a3,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...o3}:o3;return ZXe().use(BYe).use(n).use(PXe,r).use(t)}function aZe(e){let t=e.children||``,n=new J4;return typeof t==`string`?n.value=t:``+t,n}function oZe(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||sZe;for(let e of nZe)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return R4(e,l),Cqe(e,{Fragment:z.Fragment,components:i,ignoreInvalidStyle:!0,jsx:z.jsx,jsxs:z.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in b2)if(Object.hasOwn(b2,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=b2[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function sZe(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||tZe.test(e.slice(0,t))?e:``}var{useSmooth:cZe,useSmoothStatus:lZe,withSmoothContextProvider:uZe}=fj,dZe=({components:e,componentsByLanguage:t,smooth:n=!0,defer:r=!1,preprocess:i,...a})=>{let o=Dk(),{text:s}=cZe((0,I.useMemo)(()=>i?{...o,text:i(o.text)}:o,[o,i]),n),c=(0,I.useDeferredValue)(s),l=r?c:s,{pre:u=WKe,code:d=GKe,SyntaxHighlighter:f=A0,CodeHeader:p=KKe}=e??{},m=(0,I.useMemo)(()=>({Pre:u,Code:d,SyntaxHighlighter:f,CodeHeader:p}),[u,d,f,p]),h=Cb(e=>(0,z.jsx)(YKe,{components:m,componentsByLanguage:t,...e}));return(0,z.jsx)(rZe,{components:(0,I.useMemo)(()=>{let{pre:t,code:n,SyntaxHighlighter:r,CodeHeader:i,...a}=e??{};return{...a,pre:UKe,code:h}},[h,e]),...a,children:l})},s3=(0,I.forwardRef)(({className:e,containerProps:t,containerComponent:n=`div`,...r},i)=>(0,z.jsx)(n,{"data-status":lZe().type,...t,className:(0,j0.default)(e,t?.className),ref:i,children:(0,z.jsx)(dZe,{...r})}));s3.displayName=`MarkdownTextPrimitive`;var fZe=uZe(s3);function c3(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function pZe(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function mZe(e,t,n){let r=P4((n||{}).ignore||[]),i=hZe(t),a=-1;for(;++a<i.length;)L4(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function hZe(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([gZe(e[0]),_Ze(e[1])])}return t}function gZe(e){return typeof e==`string`?new RegExp(pZe(e),`g`):e}function _Ze(e){return typeof e==`function`?e:function(){return e}}var l3=`phrasing`,u3=[`autolink`,`link`,`image`,`label`];function vZe(){return{transforms:[TZe],enter:{literalAutolink:bZe,literalAutolinkEmail:d3,literalAutolinkHttp:d3,literalAutolinkWww:d3},exit:{literalAutolink:wZe,literalAutolinkEmail:CZe,literalAutolinkHttp:xZe,literalAutolinkWww:SZe}}}function yZe(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:l3,notInConstruct:u3},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:l3,notInConstruct:u3},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:l3,notInConstruct:u3}]}}function bZe(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function d3(e){this.config.enter.autolinkProtocol.call(this,e)}function xZe(e){this.config.exit.autolinkProtocol.call(this,e)}function SZe(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function CZe(e){this.config.exit.autolinkEmail.call(this,e)}function wZe(e){this.exit(e)}function TZe(e){mZe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,EZe],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,DZe]],{ignore:[`link`,`linkReference`]})}function EZe(e,t,n,r,i){let a=``;if(!f3(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!OZe(n)))return!1;let o=kZe(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function DZe(e,t,n,r){return!f3(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function OZe(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function kZe(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=c3(e,`(`),a=c3(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function f3(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||B2(n)||z2(n))&&(!t||n!==47)}p3.peek=RZe;function AZe(){this.buffer()}function jZe(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function MZe(){this.buffer()}function NZe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function PZe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=j2(this.sliceSerialize(e)).toLowerCase(),n.label=t}function FZe(e){this.exit(e)}function IZe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=j2(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LZe(e){this.exit(e)}function RZe(){return`[`}function p3(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function zZe(){return{enter:{gfmFootnoteCallString:AZe,gfmFootnoteCall:jZe,gfmFootnoteDefinitionLabelString:MZe,gfmFootnoteDefinition:NZe},exit:{gfmFootnoteCallString:PZe,gfmFootnoteCall:FZe,gfmFootnoteDefinitionLabelString:IZe,gfmFootnoteDefinition:LZe}}}function BZe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:p3},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
146
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?m3:VZe))),s(),o}}function VZe(e,t,n){return t===0?e:m3(e,t,n)}function m3(e,t,n){return(n?``:` `)+e}var HZe=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];h3.peek=qZe;function UZe(){return{canContainEols:[`delete`],enter:{strikethrough:GZe},exit:{strikethrough:KZe}}}function WZe(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:HZe}],handlers:{delete:h3}}}function GZe(e){this.enter({type:`delete`,children:[]},e)}function KZe(e){this.exit(e)}function h3(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function qZe(){return`~`}function JZe(e){return e.length}function YZe(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||JZe,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=XZe(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=g3(r[d]);else{let e=g3(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
147
|
-
`)}function XZe(e){return e==null?``:String(e)}function g3(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function ZZe(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),QZe);return i(),o}function QZe(e,t,n){return`>`+(n?``:` `)+e}function $Ze(e,t){return _3(e,t.inConstruct,!0)&&!_3(e,t.notInConstruct,!1)}function _3(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function v3(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
148
|
-
`&&$Ze(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
149
|
-
`}function eQe(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function tQe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function nQe(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function rQe(e,t,n,r){let i=nQe(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(tQe(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,iQe);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(eQe(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
150
|
-
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
151
|
-
`),a&&(u+=s.move(a+`
|
|
152
|
-
`)),u+=s.move(c),l(),u}function iQe(e,t,n){return(n?``:` `)+e}function y3(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function aQe(e,t,n,r){let i=y3(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
153
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function oQe(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function b3(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function x3(e,t,n){let r=G2(e),i=G2(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}S3.peek=sQe;function S3(e,t,n,r){let i=oQe(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=x3(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=b3(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=x3(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+b3(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function sQe(e,t,n){return n.options.emphasis||`*`}function cQe(e,t){let n=!1;return R4(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&x2(e)&&(t.options.setext||n))}function lQe(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(cQe(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
154
|
-
`,after:`
|
|
155
|
-
`});return r(),t(),o+`
|
|
156
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
157
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
158
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=b3(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}C3.peek=uQe;function C3(e){return e.value||``}function uQe(){return`<`}w3.peek=dQe;function w3(e,t,n,r){let i=y3(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function dQe(){return`!`}T3.peek=fQe;function T3(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function fQe(){return`!`}E3.peek=pQe;function E3(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function pQe(){return"`"}function D3(e,t){let n=x2(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}O3.peek=mQe;function O3(e,t,n,r){let i=y3(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(D3(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function mQe(e,t,n){return D3(e,n)?`<`:`[`}k3.peek=hQe;function k3(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function hQe(){return`[`}function A3(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function gQe(e){let t=A3(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function _Qe(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function j3(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vQe(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?_Qe(n):A3(n),s=e.ordered?o===`.`?`)`:`.`:gQe(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),j3(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function yQe(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function bQe(e,t,n,r){let i=yQe(n),a=n.bulletCurrent||A3(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function xQe(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var SQe=P4([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function CQe(e,t,n,r){return(e.children.some(function(e){return SQe(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wQe(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}M3.peek=TQe;function M3(e,t,n,r){let i=wQe(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=x3(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=b3(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=x3(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+b3(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function TQe(e,t,n){return n.options.strong||`*`}function EQe(e,t,n,r){return n.safe(e.value,r)}function DQe(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function OQe(e,t,n){let r=(j3(n)+(n.options.ruleSpaces?` `:``)).repeat(DQe(n));return n.options.ruleSpaces?r.slice(0,-1):r}var N3={blockquote:ZZe,break:v3,code:rQe,definition:aQe,emphasis:S3,hardBreak:v3,heading:lQe,html:C3,image:w3,imageReference:T3,inlineCode:E3,link:O3,linkReference:k3,list:vQe,listItem:bQe,paragraph:xQe,root:CQe,strong:M3,text:EQe,thematicBreak:OQe};function kQe(){return{enter:{table:AQe,tableData:F3,tableHeader:F3,tableRow:MQe},exit:{codeText:NQe,table:jQe,tableData:P3,tableHeader:P3,tableRow:P3}}}function AQe(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function jQe(e){this.exit(e),this.data.inTable=void 0}function MQe(e){this.enter({type:`tableRow`,children:[]},e)}function P3(e){this.exit(e)}function F3(e){this.enter({type:`tableCell`,children:[]},e)}function NQe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,PQe));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function PQe(e,t){return t===`|`?t:e}function FQe(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
159
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
160
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return YZe(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=N3.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function IQe(){return{exit:{taskListCheckValueChecked:I3,taskListCheckValueUnchecked:I3,paragraph:RQe}}}function LQe(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:zQe}}}function I3(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function RQe(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function zQe(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=N3.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function BQe(){return[vZe(),zZe(),UZe(),kQe(),IQe()]}function VQe(e){return{extensions:[yZe(),BZe(e),WZe(),FQe(e),LQe()]}}var HQe={tokenize:JQe,partial:!0},L3={tokenize:YQe,partial:!0},R3={tokenize:XQe,partial:!0},z3={tokenize:ZQe,partial:!0},UQe={tokenize:QQe,partial:!0},B3={name:`wwwAutolink`,tokenize:KQe,previous:G3},V3={name:`protocolAutolink`,tokenize:qQe,previous:K3},H3={name:`emailAutolink`,tokenize:GQe,previous:q3},U3={};function WQe(){return{text:U3}}for(var W3=48;W3<123;)U3[W3]=H3,W3++,W3===58?W3=65:W3===91&&(W3=97);U3[43]=H3,U3[45]=H3,U3[46]=H3,U3[95]=H3,U3[72]=[H3,V3],U3[104]=[H3,V3],U3[87]=[H3,B3],U3[119]=[H3,B3];function GQe(e,t,n){let r=this,i,a;return o;function o(t){return!J3(t)||!q3.call(r,r.previous)||Y3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return J3(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(UQe,u,l)(t):t===45||t===95||N2(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&M2(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function KQe(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!G3.call(r,r.previous)||Y3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(HQe,e.attempt(L3,e.attempt(R3,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function qQe(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&K3.call(r,r.previous)&&!Y3(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(M2(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||P2(t)||L2(t)||B2(t)||z2(t)?n(t):e.attempt(L3,e.attempt(R3,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function JQe(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function YQe(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(z3,c,s)(t):t===null||L2(t)||B2(t)||t!==45&&z2(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function XQe(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(z3,t,a)(o):o===null||L2(o)||B2(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function ZQe(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||L2(o)||B2(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||L2(e)||B2(e)?t(e):r(e)}function a(e){return M2(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):M2(t)?(e.consume(t),o):n(t)}}function QQe(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return N2(e)?n(e):t(e)}}function G3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||L2(e)}function K3(e){return!M2(e)}function q3(e){return!(e===47||J3(e))}function J3(e){return e===43||e===45||e===46||e===95||N2(e)}function Y3(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var $Qe={tokenize:s$e,partial:!0};function e$e(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:i$e,continuation:{tokenize:a$e},exit:o$e}},text:{91:{name:`gfmFootnoteCall`,tokenize:r$e},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:t$e,resolveTo:n$e}}}}function t$e(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=j2(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function n$e(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function r$e(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||L2(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(j2(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return L2(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function i$e(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||L2(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=j2(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return L2(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),U2(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function a$e(e,t,n){return e.check(Y2,t,e.attempt($Qe,t,n))}function o$e(e){e.exit(`gfmFootnoteDefinition`)}function s$e(e,t,n){let r=this;return U2(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function c$e(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&E2(o,o.length,0,K2(s,e.slice(r+1,n),t)),E2(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),E2(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=G2(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=G2(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var l$e=class{constructor(){this.map=[]}add(e,t,n){u$e(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function u$e(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function d$e(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function f$e(){return{flow:{null:{name:`table`,tokenize:p$e,resolveAll:m$e}}}}function p$e(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):I2(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):R2(t)?U2(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||L2(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,R2(t)?U2(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return R2(t)?U2(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||I2(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return R2(t)?U2(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||I2(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||I2(n)?(e.exit(`tableRow`),t(n)):R2(n)?U2(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||L2(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function m$e(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new l$e;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Z3(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=X3(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=X3(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=X3(f,t,o,i,n,d)):(o[0]=o[1],d=X3(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Z3(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=d$e(t.events,n))}return e}function X3(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Q3(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Q3(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Q3(t.events,n[2]),a=Q3(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Q3(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Z3(e,t,n,r,i){let a=[],o=Q3(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Q3(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var h$e={name:`tasklistCheck`,tokenize:_$e};function g$e(){return{text:{91:h$e}}}function _$e(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return L2(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return I2(r)?t(r):R2(r)?e.check({tokenize:v$e},t,n)(r):n(r)}}function v$e(e,t,n){return U2(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function y$e(e){return k2([WQe(),e$e(),c$e(e),f$e(),g$e()])}var b$e={};function x$e(e){let t=this,n=e||b$e,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(y$e(n)),a.push(BQe()),o.push(VQe(n))}function S$e(e){return(0,z.jsx)(`a`,{...e,target:`_blank`,rel:`noopener noreferrer`})}var C$e=(0,I.memo)(function(){return(0,z.jsx)(fZe,{remarkPlugins:[x$e],className:`oc-md`,components:{a:S$e}})});function $3(e){return(0,z.jsx)(eD,{"data-slot":`select`,...e})}function e6(e){return(0,z.jsx)(iD,{"data-slot":`select-value`,...e})}function t6({className:e,size:t=`default`,children:n,...r}){return(0,z.jsxs)(nD,{"data-slot":`select-trigger`,"data-size":t,className:V1(`flex w-fit items-center justify-between gap-2 rounded-lg border border-input bg-background px-2.5 py-1 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,z.jsx)(aD,{asChild:!0,children:(0,z.jsx)(om,{className:`size-4 opacity-50`})})]})}function n6({className:e,children:t,position:n=`popper`,...r}){return(0,z.jsx)(sD,{children:(0,z.jsxs)(lD,{"data-slot":`select-content`,className:V1(`relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] origin-[--radix-select-content-transform-origin] overflow-y-auto overflow-x-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,z.jsx)(AD,{className:`flex cursor-default items-center justify-center py-1`,children:(0,z.jsx)(iee,{className:`size-4`})}),(0,z.jsx)(yD,{className:V1(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,z.jsx)(MD,{className:`flex cursor-default items-center justify-center py-1`,children:(0,z.jsx)(om,{className:`size-4`})})]})})}function Q({className:e,children:t,...n}){return(0,z.jsxs)(wD,{"data-slot":`select-item`,className:V1(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,z.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,z.jsx)(OD,{children:(0,z.jsx)(am,{className:`size-4`})})}),(0,z.jsx)(ED,{children:t})]})}var r6=1e3;function w$e(){return[{id:`incorrect`,label:zye()},{id:`incoherence`,label:Hye()},{id:`altered_words`,label:Gye()},{id:`formatting`,label:Jye()},{id:`latency`,label:Zye()},{id:`api_error`,label:ebe()},{id:`other`,label:O$()}]}function T$e(){return[{id:`altered_words`,label:abe()},{id:`formatting`,label:cbe()},{id:`other`,label:O$()}]}function E$e(e){return e===`user`?T$e():w$e()}var D$e=[{name:`Grammarly`,selector:`grammarly-desktop-integration, grammarly-extension, [data-grammarly-shadow-root]`},{name:`LanguageTool`,selector:`[data-lt-installed], .lt-toolbar`},{name:`DeepL`,selector:`deepl-inline-translate, .deepl-translator`},{name:`ProWritingAad`,selector:`pwa-shadow-host, .pwa-tag`}];function O$e(){let e=[];try{e=Array.from(navigator.plugins??[]).map(e=>e.name).slice(0,40)}catch{e=[]}let t=[];for(let{name:e,selector:n}of D$e)try{document.querySelector(n)&&t.push(e)}catch{}return{plugins:e,extensionsDetected:t}}var i6=I.createContext(null);function k$e(){let e=I.useContext(i6);if(!e)throw Error(`useFeedback must be used within <FeedbackProvider>`);return e}function A$e({children:e}){let t=R(H.feedback.submitFeedback),[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(!1),[u,d]=(0,I.useState)(null),f=I.useCallback(e=>{a(``),s(``),l(!1),d(null),r(e)},[]);function p(e){e||r(null)}async function m(){if(!(!n||!i||c)){l(!0);try{d((await t({chatId:n.chatId,messageId:n.messageId,category:i,comment:o.trim()||void 0,client:{displayedText:n.displayedText,sourceWasOpen:n.sourceWasOpen,userAgent:navigator.userAgent,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,theme:document.documentElement.classList.contains(`dark`)?`dark`:`light`,...O$e()}})).displayedMatchesStored)}catch{l(!1)}}}let h=u!==null,g=n?.role===`user`;return(0,z.jsxs)(i6.Provider,{value:f,children:[e,(0,z.jsx)(d0,{open:n!==null,onOpenChange:p,children:n?(0,z.jsxs)(f0,{className:`sm:max-w-md`,children:[(0,z.jsxs)(p0,{children:[(0,z.jsx)(h0,{children:dbe()}),(0,z.jsx)(g0,{children:h?mbe():g?_be():bbe()})]}),h?(0,z.jsx)(`div`,{className:`oc-feedback__result`,role:`status`,children:n.sourceWasOpen?u===!0?(0,z.jsx)(`p`,{className:`oc-feedback__fidelity is-ok`,children:Cbe()}):(0,z.jsx)(`p`,{className:`oc-feedback__fidelity is-warn`,children:Ebe()}):(0,z.jsx)(`p`,{className:`oc-feedback__fidelity`,children:kbe()})}):(0,z.jsxs)(`div`,{className:`oc-feedback__form`,children:[(0,z.jsx)(`label`,{className:`oc-feedback__label`,children:Mbe()}),(0,z.jsxs)($3,{value:i,onValueChange:a,children:[(0,z.jsx)(t6,{children:(0,z.jsx)(e6,{placeholder:Fbe()})}),(0,z.jsx)(n6,{children:E$e(n.role).map(e=>(0,z.jsx)(Q,{value:e.id,children:e.label},e.id))})]}),(0,z.jsx)(`label`,{className:`oc-feedback__label`,htmlFor:`oc-feedback-comment`,children:Rbe()}),(0,z.jsx)(`textarea`,{id:`oc-feedback-comment`,className:`oc-feedback__textarea`,placeholder:Vbe(),value:o,maxLength:r6,onChange:e=>s(e.target.value.slice(0,r6)),rows:4}),(0,z.jsxs)(`div`,{className:`oc-feedback__count`,children:[o.length,`/`,r6]})]}),(0,z.jsx)(m0,{children:h?(0,z.jsx)(X,{onClick:()=>p(!1),children:Wbe()}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(X,{variant:`outline`,onClick:()=>p(!1),children:qbe()}),(0,z.jsx)(X,{onClick:()=>void m(),disabled:!i||c,children:c?Xbe():$be()})]})})]}):null})]})}function j$e(e,t){let n=e.closest(`.oc-msg`)?.querySelector(`.oc-msg__source-pre`),r=n?.textContent;return n&&r!=null&&r!==`(aucun texte)`?{displayedText:r,sourceWasOpen:!0}:{displayedText:t,sourceWasOpen:!1}}function a6(){let e=k$e(),t=ab(e=>e.metadata?.custom?.messageId),n=ab(e=>e.metadata?.custom?.chatId),r=ab(e=>e.role),i=ab(e=>e.metadata?.custom?.rawText??``),a=L(H.feedback.myReportedMessageIds,n?{chatId:n}:`skip`);if(!t||!n)return null;let o=(a??[]).includes(t);function s(a){e({chatId:n,messageId:t,role:r,...j$e(a.currentTarget,i)})}return(0,z.jsx)(`button`,{type:`button`,className:`oc-iconbtn${o?` is-on`:``}`,title:o?nxe():axe(),"aria-label":cxe(),onClick:s,children:(0,z.jsx)(uee,{size:15,"aria-hidden":!0})})}function o6(e,t){return e!=null&&e[t]!==void 0}var M$e=[`inherit`,`fast`,`standard`];function N$e(e){return e==null||e.fastMode===void 0?`inherit`:e.fastMode?`fast`:`standard`}function P$e(e){return e===`inherit`?Kze():e===`fast`?Z$():Q$()}function F$e(e){return e===`inherit`?null:e===`fast`}function s6(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function c6(e){return e.length?e[0].toUpperCase()+e.slice(1):e}var I$e={off:`Off`,minimal:`Min`,low:`Low`,medium:`Med`,high:`High`,xhigh:`XHigh`};function L$e(e,t){return I$e[e]??t}function l6(e,t){return e==null||!t||t<=0?null:Math.round(e/t*100)}function R$e(e,t){let n=l6(e,t);return n===null?null:CBe({pct:n,used:s6(e),total:s6(t)})}function z$e(e){return kBe({level:e??`full`})}function B$e(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?RBe({cost:e.toFixed(2),tokens:s6(t)}):n?VBe({cost:e.toFixed(2)}):r?WBe({tokens:s6(t)}):null}function V$e(e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` · `):null}var H$e=new Set([`knobThinkingLevel`,`knobModel`,`knobFastMode`,`knobUnset`,`agentFiles`,`sessionCompact`,`configDefaults`]),U$e=new Set([`knobThinkingLevel`,`knobModel`]);function u6(e,t){return H$e.has(t)?e==null?U$e.has(t):e[t]===!0:!1}function W$e(e,t){return{model:e(`knobModel`)&&t.hasModels,thinking:e(`knobThinkingLevel`)&&t.hasLevels,speed:e(`knobFastMode`),reset:e(`knobUnset`)}}function G$e(e,t){return e===void 0?`loading`:e===null?{blocked:!u6(null,t),gatewayVersion:null}:{blocked:!u6(e.capabilities,t),gatewayVersion:e.gatewayVersion}}function K$e(e,t){if(e===void 0)return`loading`;if(e===null||e.targets.length===0)return{blocked:!u6(null,t),gatewayVersion:null};let n=new Set(e.targets.map(e=>e.instanceName));if(e.configuredInstances.find(e=>!n.has(e))!==void 0)return{blocked:!0,gatewayVersion:null};let r=e.targets.find(e=>!u6(e.capabilities,t));return r===void 0?{blocked:!1,gatewayVersion:null}:{blocked:!0,gatewayVersion:r.gatewayVersion}}function d6(e){let t=L(H.compat.forChat,e===null?`skip`:{chatId:e}),n=t==null?null:t.capabilities;return{can:(0,I.useCallback)(e=>u6(n,e),[n]),loading:t===void 0,gatewayVersion:t?.gatewayVersion??null}}function q$e(e){let t=R(H.chats.setSessionKnob),[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(null);return{apply:(0,I.useCallback)(async(n,i)=>{r(n),a(null);let o={chatId:e};n===`fastMode`?o.fastMode=i:o[n]=i;try{await t(o)}catch{a({field:n,value:i})}finally{r(null)}},[e,t]),pending:n,error:i}}function f6({label:e,overridden:t,onReset:n,pending:r,error:i,onRetry:a,help:o,children:s,resettable:c=!0}){return(0,z.jsxs)(`div`,{className:`oc-spanel__row${t?` is-overridden`:``}`,children:[(0,z.jsxs)(`div`,{className:`oc-spanel__rowhead`,children:[(0,z.jsx)(`span`,{className:`oc-spanel__label`,children:e}),r?(0,z.jsx)(hm,{size:13,className:`oc-spanel__spin`,"aria-label":Y$()}):t?c?(0,z.jsx)(`button`,{type:`button`,className:`oc-spanel__reset`,title:J$(),"aria-label":J$(),onClick:n,children:(0,z.jsx)(Sm,{size:12,"aria-hidden":!0})}):null:(0,z.jsx)(`span`,{className:`oc-spanel__badge`,children:Oze()})]}),(0,z.jsx)(`div`,{className:`oc-spanel__ctl`,children:s}),o?(0,z.jsx)(`p`,{className:`oc-spanel__help`,children:o}):null,i?(0,z.jsxs)(`p`,{className:`oc-spanel__error`,role:`alert`,children:[Fze(),(0,z.jsx)(`button`,{type:`button`,className:`oc-spanel__retry`,onClick:a,children:X$()})]}):null]})}function p6({options:e,value:t,onChange:n,disabled:r}){return(0,z.jsx)(`div`,{className:`oc-spanel__seg`,role:`group`,children:e.map(e=>(0,z.jsx)(`button`,{type:`button`,className:`oc-spanel__seg-btn${t===e.id?` is-active`:``}`,"aria-pressed":t===e.id,title:e.title??e.label,"aria-label":e.title??e.label,disabled:r,onClick:()=>{e.id!==t&&n(e.id)},children:e.label},e.id))})}function J$e({options:e,value:t,onChange:n,disabled:r,ariaLabel:i}){let a=t===null||e.some(e=>e.id===t);return(0,z.jsxs)(`select`,{className:`oc-spanel__select`,value:t??``,disabled:r,"aria-label":i,onChange:e=>{e.target.value&&e.target.value!==t&&n(e.target.value)},children:[t===null?(0,z.jsx)(`option`,{value:``,disabled:!0,hidden:!0}):null,a?null:(0,z.jsx)(`option`,{value:t,children:t}),e.map(e=>(0,z.jsx)(`option`,{value:e.id,children:e.label},e.id))]})}function m6({chatId:e,sm:t,settings:n}){let{apply:r,pending:i,error:a}=q$e(e),{can:o}=d6(e),s=i!==null,c=(0,I.useCallback)(()=>{a&&r(a.field,a.value)},[r,a]),l=t.thinkingLevels??[],u=t.availableModels??[],d=N$e(n),f=W$e(o,{hasModels:u.length>0,hasLevels:l.length>0});return(0,z.jsxs)(z.Fragment,{children:[f.model?(0,z.jsx)(f6,{label:AW(),overridden:o6(n,`model`),onReset:()=>void r(`model`,null),pending:i===`model`,error:a?.field===`model`,onRetry:c,resettable:f.reset,children:u.length<=4?(0,z.jsx)(p6,{options:u,value:t.model??null,onChange:e=>void r(`model`,e),disabled:s}):(0,z.jsx)(J$e,{options:u,value:t.model??null,onChange:e=>void r(`model`,e),disabled:s,ariaLabel:AW()})}):null,f.thinking?(0,z.jsx)(f6,{label:Bze(),overridden:o6(n,`thinkingLevel`),onReset:()=>void r(`thinkingLevel`,null),pending:i===`thinkingLevel`,error:a?.field===`thinkingLevel`,onRetry:c,resettable:f.reset,children:(0,z.jsx)(p6,{options:l.map(e=>({id:e.id,label:L$e(e.id,c6(e.label)),title:c6(e.label)})),value:t.thinkingLevel??null,onChange:e=>void r(`thinkingLevel`,e),disabled:s})}):null,f.speed?(0,z.jsx)(f6,{label:Uze(),overridden:o6(n,`fastMode`),onReset:()=>void r(`fastMode`,null),pending:i===`fastMode`,error:a?.field===`fastMode`,onRetry:c,resettable:f.reset,children:(0,z.jsx)(p6,{options:M$e.map(e=>({id:e,label:P$e(e)})),value:d,onChange:e=>void r(`fastMode`,F$e(e)),disabled:s})}):null]})}function h6({...e}){return(0,z.jsx)(iC,{"data-slot":`sheet`,...e})}function Y$e({...e}){return(0,z.jsx)(aC,{"data-slot":`sheet-portal`,...e})}function X$e({className:e,...t}){return(0,z.jsx)(oC,{"data-slot":`sheet-overlay`,className:V1(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function g6({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,z.jsxs)(Y$e,{children:[(0,z.jsx)(X$e,{}),(0,z.jsxs)(sC,{"data-slot":`sheet-content`,"data-side":n,className:V1(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...i,children:[t,r&&(0,z.jsx)(uC,{"data-slot":`sheet-close`,asChild:!0,children:(0,z.jsxs)(X,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,z.jsx)(jm,{}),(0,z.jsx)(`span`,{className:`sr-only`,children:q$()})]})})]})]})}function _6({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`sheet-header`,className:V1(`flex flex-col gap-0.5 p-4`,e),...t})}function v6({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`sheet-footer`,className:V1(`mt-auto flex flex-col gap-2 p-4`,e),...t})}function y6({className:e,...t}){return(0,z.jsx)(cC,{"data-slot":`sheet-title`,className:V1(`font-heading text-base font-medium text-foreground`,e),...t})}function b6({className:e,...t}){return(0,z.jsx)(lC,{"data-slot":`sheet-description`,className:V1(`text-sm text-muted-foreground`,e),...t})}function x6({label:e,state:t,destructive:n,onClick:r,onRetry:i}){return(0,z.jsxs)(`div`,{className:`oc-spanel__action`,children:[(0,z.jsxs)(X,{variant:n?`destructive`:`outline`,size:`sm`,disabled:t===`pending`,onClick:r,children:[t===`pending`?(0,z.jsx)(hm,{className:`oc-spanel__spin`,"aria-hidden":!0}):null,e]}),t===`done`?(0,z.jsx)(`p`,{className:`oc-spanel__action-note`,role:`status`,children:_Ve()}):null,t===`error`?(0,z.jsxs)(`p`,{className:`oc-spanel__error`,role:`alert`,children:[bVe(),(0,z.jsx)(`button`,{type:`button`,className:`oc-spanel__retry`,onClick:i,children:X$()})]}):null]})}function Z$e({chatId:e,open:t,onOpenChange:n}){let r=L(H.messages.getSessionMeta,t?{chatId:e}:`skip`),i=L(H.agents.getChatAgent,t?{chatId:e}:`skip`),a=r?.sessionMeta??null,o=r?.sessionSettings??null,{can:s}=d6(t?e:null),c=y0(),l=An(H.agentFiles.compactSession),u=R(H.chats.resetSession),[d,f]=(0,I.useState)(`idle`),[p,m]=(0,I.useState)(`idle`);async function h(){f(`pending`);try{await l({chatId:e}),f(`done`)}catch{f(`error`)}}async function g(){m(`pending`);try{await u({chatId:e}),m(`done`)}catch{m(`error`)}}async function _(){await c({title:XBe(),description:$Be(),confirmLabel:nVe(),cancelLabel:wG()})&&await h()}async function v(){await c({title:cVe(),description:dVe(),confirmLabel:mVe(),cancelLabel:wG(),destructive:!0})&&await g()}let y=l6(a?.totalTokens,a?.contextTokens),b=y==null?``:y>=90?`is-critical`:y>=75?`is-warn`:`is-ok`,x=R$e(a?.totalTokens,a?.contextTokens),S=B$e(a?.estimatedCostUsd,a?.totalTokens),C=i?.agent??null,w=V$e([C?C.displayName??C.agentId:null,a?.agentRuntime,a?.model]);return(0,z.jsx)(h6,{open:t,onOpenChange:n,children:(0,z.jsxs)(g6,{side:`right`,className:`oc-spanel`,children:[(0,z.jsxs)(_6,{children:[(0,z.jsx)(y6,{children:nBe()}),(0,z.jsx)(b6,{children:aBe()})]}),(0,z.jsx)(`div`,{className:`oc-spanel__body`,children:r===void 0?(0,z.jsx)(`p`,{className:`oc-spanel__loading`,children:Nj()}):(0,z.jsxs)(z.Fragment,{children:[a?(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{className:`oc-spanel__cat`,children:cBe()}),(0,z.jsx)(m6,{chatId:e,sm:a,settings:o})]}):null,(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{className:`oc-spanel__cat`,children:dBe()}),x!==null&&y!==null?(0,z.jsxs)(`div`,{className:`oc-spanel__static`,children:[(0,z.jsx)(`span`,{className:`oc-spanel__label`,children:bBe()}),(0,z.jsxs)(`span`,{className:`oc-meter oc-spanel__meter ${b}`,children:[(0,z.jsx)(`span`,{className:`oc-meter__track`,children:(0,z.jsx)(`span`,{className:`oc-meter__fill`,style:{width:`${Math.min(y,100)}%`}})}),(0,z.jsx)(`span`,{className:`oc-meter__label`,children:x})]})]}):null,(0,z.jsxs)(`div`,{className:`oc-spanel__static`,children:[(0,z.jsx)(`span`,{className:`oc-spanel__label`,children:EBe()}),(0,z.jsx)(`span`,{className:`oc-spanel__value`,children:z$e(a?.verboseLevel)}),(0,z.jsx)(`p`,{className:`oc-spanel__help`,children:MBe()})]}),S===null?null:(0,z.jsxs)(`div`,{className:`oc-spanel__static`,children:[(0,z.jsx)(`span`,{className:`oc-spanel__label`,children:FBe()}),(0,z.jsx)(`span`,{className:`oc-spanel__value`,children:S})]})]}),w===null?null:(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h3`,{className:`oc-spanel__cat`,children:mBe()}),(0,z.jsx)(`div`,{className:`oc-spanel__static`,children:(0,z.jsx)(`span`,{className:`oc-spanel__value`,children:w})})]})]})}),(0,z.jsxs)(v6,{className:`oc-spanel__actions`,children:[(0,z.jsx)(`h3`,{className:`oc-spanel__cat`,children:_Be()}),s(`sessionCompact`)?(0,z.jsx)(x6,{label:qBe(),state:d,onClick:()=>void _(),onRetry:()=>void h()}):null,(0,z.jsx)(x6,{label:aVe(),state:p,destructive:!0,onClick:()=>void v(),onRetry:()=>void g()})]})]})})}var S6={showSource:!0,showReport:!0,copyAssistant:!0,copyUser:!0,showDelete:!0,showTools:!0,voiceInput:!1},C6=(0,I.createContext)(S6);function w6(){return(0,I.useContext)(C6)}var T6=(0,I.createContext)(null);function E6({chatId:e}){let{runtime:t,turnGate:n}=mKe({chatId:e}),r=L(H.me.getMe)?.ui?.effective??S6,i=r.showTools,a=R(H.me.setUiPref).withOptimisticUpdate(w0),o=L(H.messages.getSessionMeta,e?{chatId:e}:`skip`),s=e!==null&&o===null;return(0,z.jsx)(Kie,{runtime:t,children:(0,z.jsx)(T6.Provider,{value:n,children:(0,z.jsx)(C6.Provider,{value:r,children:(0,z.jsx)(`div`,{className:`oc-chat`,children:e?s?(0,z.jsx)(Q$e,{}):(0,z.jsx)($$e,{chatId:e,showTools:i,onToggleTools:()=>void a({key:`showTools`,value:!i})}):(0,z.jsx)(`div`,{className:`oc-empty`,children:GU()})})})})})}function Q$e(){let e=Ro();return(0,z.jsxs)(`div`,{className:`oc-notfound`,role:`status`,children:[(0,z.jsx)(`div`,{className:`oc-notfound__icon`,"aria-hidden":!0,children:(0,z.jsx)(Cm,{size:28})}),(0,z.jsx)(`h2`,{className:`oc-notfound__title`,children:JU()}),(0,z.jsx)(`p`,{className:`oc-notfound__body`,children:ZU()}),(0,z.jsxs)(`button`,{type:`button`,className:`oc-notfound__cta`,onClick:()=>void e({to:`/`}),children:[(0,z.jsx)(xm,{size:16,"aria-hidden":!0}),eW()]})]})}function $$e({chatId:e,showTools:t,onToggleTools:n}){let r=L(H.bridgeHealth.getBridgeAvailability,{}),i=r&&!r.available?r:null;return(0,z.jsxs)(dj.Root,{className:`oc-thread`,children:[(0,z.jsx)(r1e,{chatId:e}),(0,z.jsx)(t1e,{chatId:e}),(0,z.jsxs)(dj.Viewport,{className:`oc-thread__viewport`,children:[(0,z.jsx)(dj.Empty,{children:(0,z.jsx)(n1e,{})}),(0,z.jsx)(dj.Messages,{components:{UserMessage:u1e,AssistantMessage:d1e,SystemMessage:f1e}})]}),(0,z.jsx)(dj.If,{empty:!1,children:(0,z.jsxs)(dj.ScrollToBottom,{className:`oc-scrolldown`,children:[(0,z.jsx)(c1e,{}),(0,z.jsx)(`span`,{children:rW()})]})}),i?(0,z.jsx)(e1e,{}):null,(0,z.jsx)(m1e,{showTools:t,onToggleTools:n,unavailable:i!==null})]})}function e1e(){return(0,z.jsxs)(`div`,{className:`oc-chat-banner oc-chat-banner--error`,role:`status`,children:[(0,z.jsx)(cm,{size:16,"aria-hidden":!0}),(0,z.jsx)(`span`,{children:oW()})]})}function t1e({chatId:e}){let t=L(H.messages.listByChat,{chatId:e}),[n,r]=(0,I.useState)(``),i=(0,I.useRef)(null);return(0,I.useEffect)(()=>{i.current=null,r(``)},[e]),(0,I.useEffect)(()=>{if(!t)return;let e;for(let n of t)n.role===`assistant`&&(e=n);if(!(!e||e.status!==`complete`)){if(i.current===null){i.current=e._id;return}i.current!==e._id&&(i.current=e._id,r(e=>e===lW()?`${lW()} `:lW()))}},[t]),(0,z.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,className:`oc-sr-only`,children:n})}function n1e(){return(0,z.jsxs)(`div`,{className:`oc-emptystate`,children:[(0,z.jsx)(`div`,{className:`oc-emptystate__avatar`,"aria-hidden":!0,children:`OC`}),(0,z.jsx)(`h2`,{className:`oc-emptystate__title`,children:fW()})]})}function r1e({chatId:e}){let t=L(H.messages.getSessionMeta,{chatId:e}),n=L(H.agents.getChatAgent,{chatId:e}),r=t?.sessionMeta??null,i=t?.sessionSettings??null,a=n?.multiAgent?n.agent:null,[o,s]=(0,I.useState)(!1);if(!r&&!a)return null;let c=r&&r.totalTokens!=null&&r.contextTokens&&r.contextTokens>0?Math.round(r.totalTokens/r.contextTokens*100):null,l=c==null?``:c>=90?`is-critical`:c>=75?`is-warn`:`is-ok`,u=!o6(i,`thinkingLevel`);return(0,z.jsxs)(`header`,{className:`oc-chathead`,children:[(0,z.jsx)(`div`,{className:`oc-chathead__title`,title:t?.title??void 0,children:t?.title||hW()}),(0,z.jsxs)(`div`,{className:`oc-chathead__meta`,children:[a?(0,z.jsxs)(`span`,{className:`oc-chip oc-chip--agent${a.state===`ok`?``:` is-warn`}`,title:vW({name:a.displayName??a.agentId})+(a.inheritedDefault?xW():``)+(a.state===`deleted`?wW():a.state===`stale`?DW():``),children:[a.emoji?(0,z.jsx)(`span`,{className:`oc-chip__emoji`,"aria-hidden":!0,children:a.emoji}):(0,z.jsx)(im,{size:13,"aria-hidden":!0}),a.displayName??a.agentId]}):null,r?.model?(0,z.jsxs)(`span`,{className:`oc-chip`,title:r.modelProvider?NW({provider:r.modelProvider}):AW(),children:[(0,z.jsx)(o1e,{}),r.model]}):null,r?.thinkingLevel?(0,z.jsxs)(`span`,{className:`oc-chip`,title:u?IW():zW(),children:[(0,z.jsx)(s1e,{}),HW(),`\xA0: `,c6(r.thinkingLevel),u?(0,z.jsx)(`span`,{className:`oc-chip__hint`,children:GW()}):null]}):null,r&&c!=null?(0,z.jsxs)(`span`,{className:`oc-meter ${l}`,title:JW({pct:c,used:s6(r.totalTokens),total:s6(r.contextTokens)}),children:[(0,z.jsx)(`span`,{className:`oc-meter__track`,children:(0,z.jsx)(`span`,{className:`oc-meter__fill`,style:{width:`${Math.min(c,100)}%`}})}),(0,z.jsxs)(`span`,{className:`oc-meter__label`,children:[c,`% · `,s6(r.totalTokens),`/`,s6(r.contextTokens)]})]}):null,(0,z.jsx)(i1e,{chatId:e,title:t?.title??null}),r?(0,z.jsx)(a1e,{chatId:e,sm:r,settings:i,onOpenPanel:()=>s(!0)}):null]}),(0,z.jsx)(Z$e,{chatId:e,open:o,onOpenChange:s})]})}function D6(e,t,n){let r=new Blob([e],{type:`${n};charset=utf-8`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}function i1e({chatId:e,title:t}){let n=On();async function r(r){let i=await n.query(H.messages.listByChat,{chatId:e}),a=i.map(e=>({role:e.role,text:e.text,createdAt:e.updatedAt??e._creationTime,parts:e.parts.map(e=>({kind:e.kind,filename:`filename`in e?e.filename:void 0,name:`name`in e?e.name:void 0}))})),o=i.length>=200,s={title:t??void 0,truncated:o,exportedAt:Date.now()},c=$We(t);r===`md`?D6(ZWe(a,s),`${c}.md`,`text/markdown`):D6(QWe(a,s),`${c}.json`,`application/json`)}return(0,z.jsxs)(H1,{children:[(0,z.jsx)(U1,{asChild:!0,children:(0,z.jsxs)(`button`,{type:`button`,className:`oc-chip oc-chip--btn`,title:ZW(),children:[(0,z.jsx)(fm,{size:13,"aria-hidden":!0}),eG(),(0,z.jsx)(om,{size:13,className:`oc-chip__chev`,"aria-hidden":!0})]})}),(0,z.jsxs)(W1,{align:`end`,className:`w-44`,children:[(0,z.jsx)(K1,{children:eG()}),(0,z.jsx)(G1,{onClick:()=>void r(`md`),children:rG()}),(0,z.jsx)(G1,{onClick:()=>void r(`json`),children:oG()})]})]})}function a1e({chatId:e,sm:t,settings:n,onOpenPanel:r}){let[i,a]=(0,I.useState)(!1);return(0,z.jsxs)(Y1,{open:i,onOpenChange:a,children:[(0,z.jsx)(X1,{asChild:!0,children:(0,z.jsxs)(`button`,{type:`button`,className:`oc-chip oc-chip--btn`,title:lG(),children:[(0,z.jsx)(Tm,{size:13,"aria-hidden":!0}),fG(),(0,z.jsx)(om,{size:13,className:`oc-chip__chev`,"aria-hidden":!0})]})}),(0,z.jsxs)(Z1,{align:`end`,className:`oc-spanel-pop w-80 p-2`,children:[(0,z.jsx)(m6,{chatId:e,sm:t,settings:n}),(0,z.jsxs)(`button`,{type:`button`,className:`oc-spanel-pop__all`,onClick:()=>{a(!1),r()},children:[(0,z.jsx)(Tm,{size:13,"aria-hidden":!0}),$ze(),(0,z.jsx)(sm,{size:13,"aria-hidden":!0})]})]})]})}function o1e(){return(0,z.jsxs)(`svg`,{className:`oc-chip__icon`,viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,z.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,z.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`}),(0,z.jsx)(`path`,{d:`M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3`})]})}function s1e(){return(0,z.jsxs)(`svg`,{className:`oc-chip__icon`,viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,z.jsx)(`path`,{d:`M12 5a3 3 0 1 0-5.997.142 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`}),(0,z.jsx)(`path`,{d:`M12 5a3 3 0 1 1 5.997.142 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`})]})}function O6({children:e}){return(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:e})}function c1e(){return(0,z.jsx)(O6,{children:(0,z.jsx)(`path`,{d:`M12 5v14M19 12l-7 7-7-7`})})}function k6(){return(0,z.jsxs)(O6,{children:[(0,z.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,z.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]})}function A6(){return(0,z.jsx)(O6,{children:(0,z.jsx)(`path`,{d:`M20 6 9 17l-5-5`})})}var j6={File:zKe},l1e={...j6,Text:C$e};function M6({kind:e}){let t=ab(e=>e.metadata?.custom?.messageId),n=R(H.messages.deleteMessage).withOptimisticUpdate(hKe),r=y0(),i=S0(),a=(0,I.useContext)(T6),[o,s]=(0,I.useState)(!1);if(!t)return null;async function c(){if(await r(e===`assistant`?{title:hG(),description:vG(),confirmLabel:xG(),cancelLabel:wG(),destructive:!0}:{title:DG(),description:AG(),confirmLabel:NG(),cancelLabel:wG(),destructive:!0})){s(!0),e===`assistant`&&a?.begin();try{await n({messageId:t})}catch(t){e===`assistant`&&a?.cancel(),i.error(GG(),t)}finally{s(!1)}}}return(0,z.jsx)(`button`,{type:`button`,className:`oc-iconbtn oc-iconbtn--danger`,title:e===`assistant`?IG():zG(),"aria-label":HG(),"aria-busy":o,disabled:o,onClick:()=>void c(),children:o?(0,z.jsx)(hm,{size:15,className:`oc-iconbtn__spin`,"aria-hidden":!0}):(0,z.jsx)(Dm,{size:15,"aria-hidden":!0})})}function N6(){let e=ab(e=>e.metadata?.custom?.rawText??``),[t,n]=(0,I.useState)(!1),r=[...e].length;return(0,z.jsxs)(`div`,{className:`oc-msg__source`,children:[(0,z.jsxs)(`div`,{className:`oc-msg__source-head`,children:[(0,z.jsx)(`span`,{className:`oc-msg__source-label`,children:r>1?wK({count:r}):xK({count:r})}),(0,z.jsx)(`button`,{type:`button`,className:`oc-iconbtn`,title:DK(),"aria-label":DK(),onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)})},children:t?(0,z.jsx)(A6,{}):(0,z.jsx)(k6,{})})]}),(0,z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.length>0?e:AK()})]})}function P6({active:e,onToggle:t}){return(0,z.jsx)(`button`,{type:`button`,className:`oc-iconbtn${e?` is-on`:``}`,onClick:t,"aria-pressed":e,title:e?NK():IK(),"aria-label":zK(),children:(0,z.jsx)(see,{size:15,"aria-hidden":!0})})}function u1e(){let[e,t]=(0,I.useState)(!1),n=w6();return(0,z.jsx)(kA.Root,{className:`oc-msg oc-msg--user`,children:(0,z.jsxs)(`div`,{className:`oc-msg__col oc-msg__col--user`,children:[(0,z.jsx)(`div`,{className:`oc-msg__bubble`,children:e?(0,z.jsx)(N6,{}):(0,z.jsx)(kA.Parts,{components:j6})}),(0,z.jsxs)(kb.Root,{className:`oc-msg__actions oc-msg__actions--user`,hideWhenRunning:!0,autohide:`not-last`,children:[n.copyUser?(0,z.jsxs)(kb.Copy,{className:`oc-iconbtn`,title:HK(),children:[(0,z.jsx)(kA.If,{copied:!0,children:(0,z.jsx)(A6,{})}),(0,z.jsx)(kA.If,{copied:!1,children:(0,z.jsx)(k6,{})})]}):null,n.showSource?(0,z.jsx)(P6,{active:e,onToggle:()=>t(e=>!e)}):null,n.showReport?(0,z.jsx)(a6,{}):null,n.showDelete?(0,z.jsx)(M6,{kind:`user`}):null]})]})})}function d1e(){let[e,t]=(0,I.useState)(!1),n=w6();return(0,z.jsxs)(kA.Root,{className:`oc-msg oc-msg--assistant`,children:[(0,z.jsx)(`div`,{className:`oc-msg__avatar`,"aria-hidden":!0,children:`OC`}),(0,z.jsxs)(`div`,{className:`oc-msg__col`,children:[(0,z.jsx)(`div`,{className:`oc-msg__name`,children:`OpenClaw`}),(0,z.jsxs)(`div`,{className:`oc-msg__body`,children:[(0,z.jsx)(jKe,{defaultExpanded:n.showTools}),e?(0,z.jsx)(N6,{}):(0,z.jsx)(kA.Parts,{components:l1e}),(0,z.jsx)(RKe,{}),(0,z.jsx)(SKe,{})]}),(0,z.jsxs)(kb.Root,{className:`oc-msg__actions`,hideWhenRunning:!0,autohide:`not-last`,children:[n.copyAssistant?(0,z.jsxs)(kb.Copy,{className:`oc-iconbtn`,title:GK(),children:[(0,z.jsx)(kA.If,{copied:!0,children:(0,z.jsx)(A6,{})}),(0,z.jsx)(kA.If,{copied:!1,children:(0,z.jsx)(k6,{})})]}):null,n.showSource?(0,z.jsx)(P6,{active:e,onToggle:()=>t(e=>!e)}):null,n.showReport?(0,z.jsx)(a6,{}):null,n.showDelete?(0,z.jsx)(M6,{kind:`assistant`}):null]})]})]})}function f1e(){return(0,z.jsx)(kA.Root,{className:`oc-msg oc-msg--system`,children:(0,z.jsx)(`div`,{className:`oc-msg__body`,children:(0,z.jsx)(kA.Parts,{components:j6})})})}function p1e(){let e=ib(e=>e.status?.type),t=ib(e=>e.type),n=e===`incomplete`;return(0,z.jsxs)(sO.Root,{className:`oc-attach${n?` oc-attach--error`:``}`,"data-status":e,children:[(0,z.jsx)(`span`,{className:`oc-attach__icon`,"aria-hidden":!0,children:n?(0,z.jsx)(cm,{size:14}):t===`image`?(0,z.jsx)(pee,{size:14}):(0,z.jsx)(vee,{size:14})}),(0,z.jsx)(`span`,{className:`oc-attach__name`,children:(0,z.jsx)(sO.Name,{})}),n?(0,z.jsx)(`span`,{className:`oc-attach__state`,children:rq()}):null,(0,z.jsx)(sO.Remove,{className:`oc-attach__remove`,"aria-label":oq(),children:(0,z.jsx)(jm,{size:13,"aria-hidden":!0})})]})}function m1e({showTools:e,onToggleTools:t,unavailable:n=!1}){let r=w6().voiceInput;return(0,z.jsxs)(Ek.Root,{className:`oc-composer${n?` oc-composer--disabled`:``}`,children:[(0,z.jsx)(Ek.Attachments,{components:{Attachment:p1e}}),(0,z.jsx)(Ek.Input,{className:`oc-composer__input`,placeholder:n?JK():ZK(),autoFocus:!0,rows:1,disabled:n,autoCorrect:`off`,autoCapitalize:`off`,autoComplete:`off`,"data-gramm":`false`,"data-gramm_editor":`false`,"data-enable-grammarly":`false`}),(0,z.jsxs)(`div`,{className:`oc-composer__bar`,children:[(0,z.jsxs)(`div`,{className:`oc-composer__group`,children:[(0,z.jsx)(Ek.AddAttachment,{className:`oc-composer__icon`,"aria-label":eq(),children:(0,z.jsx)(xm,{size:18,"aria-hidden":!0})}),(0,z.jsxs)(`button`,{type:`button`,className:`oc-composer__tools${e?` is-on`:``}`,onClick:t,"aria-pressed":e,title:e?lq():fq(),children:[(0,z.jsx)(Tm,{size:15,"aria-hidden":!0}),hq()]})]}),(0,z.jsxs)(`div`,{className:`oc-composer__group`,children:[r?(0,z.jsx)(`button`,{type:`button`,className:`oc-composer__icon`,title:Iq(),"aria-label":zq(),children:(0,z.jsx)(ym,{size:18,"aria-hidden":!0})}):null,n?(0,z.jsx)(`button`,{type:`button`,className:`oc-composer__send`,disabled:!0,"aria-label":Hq(),children:(0,z.jsx)(nm,{size:18,"aria-hidden":!0})}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(dj.If,{running:!1,children:(0,z.jsx)(Ek.Send,{className:`oc-composer__send`,"aria-label":Gq(),children:(0,z.jsx)(nm,{size:18,"aria-hidden":!0})})}),(0,z.jsx)(dj.If,{running:!0,children:(0,z.jsx)(`button`,{type:`button`,className:`oc-composer__send`,disabled:!0,"aria-label":Jq(),title:Jq(),children:(0,z.jsx)(nm,{size:18,"aria-hidden":!0})})})]})]})]})]})}function h1e(){var e=[...arguments];return(0,I.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var F6=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function I6(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function L6(e){return`nodeType`in e}function R6(e){return e?I6(e)?e:L6(e)?e.ownerDocument?.defaultView??window:window:window}function z6(e){let{Document:t}=R6(e);return e instanceof t}function B6(e){return I6(e)?!1:e instanceof R6(e).HTMLElement}function V6(e){return e instanceof R6(e).SVGElement}function H6(e){return e?I6(e)?e.document:L6(e)?z6(e)?e:B6(e)||V6(e)?e.ownerDocument:document:document:document}var U6=F6?I.useLayoutEffect:I.useEffect;function W6(e){let t=(0,I.useRef)(e);return U6(()=>{t.current=e}),(0,I.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function g1e(){let e=(0,I.useRef)(null);return[(0,I.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,I.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function G6(e,t){t===void 0&&(t=[e]);let n=(0,I.useRef)(e);return U6(()=>{n.current!==e&&(n.current=e)},t),n}function K6(e,t){let n=(0,I.useRef)();return(0,I.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function q6(e){let t=W6(e),n=(0,I.useRef)(null);return[n,(0,I.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function J6(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current}var Y6={};function X6(e,t){return(0,I.useMemo)(()=>{if(t)return t;let n=Y6[e]==null?0:Y6[e]+1;return Y6[e]=n,e+`-`+n},[e,t])}function Z6(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Q6=Z6(1),$6=Z6(-1);function _1e(e){return`clientX`in e&&`clientY`in e}function e8(e){if(!e)return!1;let{KeyboardEvent:t}=R6(e.target);return t&&e instanceof t}function v1e(e){if(!e)return!1;let{TouchEvent:t}=R6(e.target);return t&&e instanceof t}function t8(e){if(v1e(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return _1e(e)?{x:e.clientX,y:e.clientY}:null}var n8=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[n8.Translate.toString(e),n8.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),r8=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function y1e(e){return e.matches(r8)?e:e.querySelector(r8)}var b1e={display:`none`};function x1e(e){let{id:t,value:n}=e;return I.createElement(`div`,{id:t,style:b1e},n)}function S1e(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return I.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function C1e(){let[e,t]=(0,I.useState)(``);return{announce:(0,I.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var i8=(0,I.createContext)(null);function w1e(e){let t=(0,I.useContext)(i8);(0,I.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function T1e(){let[e]=(0,I.useState)(()=>new Set),t=(0,I.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,I.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var E1e={draggable:`
|
|
161
|
-
To pick up a draggable item, press the space bar.
|
|
162
|
-
While dragging, use the arrow keys to move the item.
|
|
163
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
164
|
-
`},D1e={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function O1e(e){let{announcements:t=D1e,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=E1e}=e,{announce:a,announcement:o}=C1e(),s=X6(`DndLiveRegion`),[c,l]=(0,I.useState)(!1);if((0,I.useEffect)(()=>{l(!0)},[]),w1e((0,I.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=I.createElement(I.Fragment,null,I.createElement(x1e,{id:r,value:i.draggable}),I.createElement(S1e,{id:s,announcement:o}));return n?(0,Bo.createPortal)(u,n):u}var a8;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(a8||={});function o8(){}function s8(e,t){return(0,I.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function c8(){var e=[...arguments];return(0,I.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var l8=Object.freeze({x:0,y:0});function u8(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function k1e(e,t){let n=t8(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function d8(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function A1e(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function f8(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function p8(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function m8(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var j1e=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=m8(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=u8(m8(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(d8)},h8=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=f8(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=f8(r),o=i.reduce((e,t,r)=>e+u8(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(d8)};function M1e(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var N1e=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=M1e(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(A1e)};function P1e(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function g8(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:l8}function F1e(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var I1e=F1e(1);function _8(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function L1e(e,t,n){let r=_8(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var R1e={ignoreTransform:!1};function v8(e,t){t===void 0&&(t=R1e);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=R6(e).getComputedStyle(e);t&&(n=L1e(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function y8(e){return v8(e,{ignoreTransform:!0})}function z1e(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function B1e(e,t){return t===void 0&&(t=R6(e).getComputedStyle(e)),t.position===`fixed`}function V1e(e,t){t===void 0&&(t=R6(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function b8(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(z6(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!B6(i)||V6(i)||n.includes(i))return n;let a=R6(e).getComputedStyle(i);return i!==e&&V1e(i,a)&&n.push(i),B1e(i,a)?n:r(i.parentNode)}return e?r(e):n}function x8(e){let[t]=b8(e,1);return t??null}function S8(e){return!F6||!e?null:I6(e)?e:L6(e)?z6(e)||e===H6(e).scrollingElement?window:B6(e)?e:null:null}function C8(e){return I6(e)?e.scrollX:e.scrollLeft}function w8(e){return I6(e)?e.scrollY:e.scrollTop}function T8(e){return{x:C8(e),y:w8(e)}}var E8;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(E8||={});function D8(e){return!F6||!e?!1:e===document.scrollingElement}function O8(e){let t={x:0,y:0},n=D8(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var H1e={x:.2,y:.2};function U1e(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=H1e);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=O8(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=E8.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=E8.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=E8.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=E8.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function W1e(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function k8(e){return e.reduce((e,t)=>Q6(e,T8(t)),l8)}function G1e(e){return e.reduce((e,t)=>e+C8(t),0)}function K1e(e){return e.reduce((e,t)=>e+w8(t),0)}function A8(e,t){if(t===void 0&&(t=v8),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);x8(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var q1e=[[`x`,[`left`,`right`],G1e],[`y`,[`top`,`bottom`],K1e]],j8=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=b8(t),r=k8(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of q1e)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},M8=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function J1e(e){let{EventTarget:t}=R6(e);return e instanceof t?e:H6(e)}function N8(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var P8;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(P8||={});function F8(e){e.preventDefault()}function Y1e(e){e.stopPropagation()}var I8;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(I8||={});var L8={start:[I8.Space,I8.Enter],cancel:[I8.Esc],end:[I8.Space,I8.Enter,I8.Tab]},X1e=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case I8.Right:return{...n,x:n.x+25};case I8.Left:return{...n,x:n.x-25};case I8.Down:return{...n,y:n.y+25};case I8.Up:return{...n,y:n.y-25}}},R8=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new M8(H6(t)),this.windowListeners=new M8(R6(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(P8.Resize,this.handleCancel),this.windowListeners.add(P8.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(P8.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&A8(n),t(l8)}handleKeyDown(e){if(e8(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=L8,coordinateGetter:a=X1e,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:l8;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=$6(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=O8(n),p=W1e(n),m={x:Math.min(i===I8.Right?p.right-p.width/2:p.right,Math.max(i===I8.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===I8.Down?p.bottom-p.height/2:p.bottom,Math.max(i===I8.Down?p.top:p.top+p.height/2,u.y))},h=i===I8.Right&&!s||i===I8.Left&&!c,g=i===I8.Down&&!l||i===I8.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===I8.Right&&e<=d.x||i===I8.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===I8.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===I8.Down&&e<=d.y||i===I8.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===I8.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Q6($6(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};R8.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=L8,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function z8(e){return!!(e&&`distance`in e)}function B8(e){return!!(e&&`delay`in e)}var V8=class{constructor(e,t,n){n===void 0&&(n=J1e(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=H6(i),this.documentListeners=new M8(this.document),this.listeners=new M8(n),this.windowListeners=new M8(R6(i)),this.initialCoordinates=t8(r)??l8,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(P8.Resize,this.handleCancel),this.windowListeners.add(P8.DragStart,F8),this.windowListeners.add(P8.VisibilityChange,this.handleCancel),this.windowListeners.add(P8.ContextMenu,F8),this.documentListeners.add(P8.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(B8(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(z8(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(P8.Click,Y1e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(P8.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=t8(e)??l8,s=$6(n,o);if(!t&&a){if(z8(a)){if(a.tolerance!=null&&N8(s,a.tolerance))return this.handleCancel();if(N8(s,a.distance))return this.handleStart()}if(B8(a)&&N8(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===I8.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Z1e={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},H8=class extends V8{constructor(e){let{event:t}=e,n=H6(t.target);super(e,Z1e,n)}};H8.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Q1e={move:{name:`mousemove`},end:{name:`mouseup`}},U8;(function(e){e[e.RightClick=2]=`RightClick`})(U8||={});var $1e=class extends V8{constructor(e){super(e,Q1e,H6(e.event.target))}};$1e.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===U8.RightClick?!1:(r?.({event:n}),!0)}}];var W8={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},e0e=class extends V8{constructor(e){super(e,W8)}static setup(){return window.addEventListener(W8.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(W8.move.name,e)};function e(){}}};e0e.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var G8;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(G8||={});var K8;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(K8||={});function t0e(e){let{acceleration:t,activator:n=G8.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=K8.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=r0e({delta:d,disabled:!a}),[m,h]=g1e(),g=(0,I.useRef)({x:0,y:0}),_=(0,I.useRef)({x:0,y:0}),v=(0,I.useMemo)(()=>{switch(n){case G8.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case G8.DraggableRect:return i}},[n,i,c]),y=(0,I.useRef)(null),b=(0,I.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,I.useMemo)(()=>s===K8.TreeOrder?[...l].reverse():l,[s,l]);(0,I.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=U1e(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var n0e={x:{[E8.Backward]:!1,[E8.Forward]:!1},y:{[E8.Backward]:!1,[E8.Forward]:!1}};function r0e(e){let{delta:t,disabled:n}=e,r=J6(t);return K6(e=>{if(n||!r||!e)return n0e;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[E8.Backward]:e.x[E8.Backward]||i.x===-1,[E8.Forward]:e.x[E8.Forward]||i.x===1},y:{[E8.Backward]:e.y[E8.Backward]||i.y===-1,[E8.Forward]:e.y[E8.Forward]||i.y===1}}},[n,t,r])}function i0e(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return K6(e=>t==null?null:r??e??null,[r,t])}function a0e(e,t){return(0,I.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var q8;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(q8||={});var J8;(function(e){e.Optimized=`optimized`})(J8||={});var Y8=new Map;function o0e(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,I.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,I.useRef)(e),d=g(),f=G6(d),p=(0,I.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,I.useRef)(null),h=K6(t=>{if(d&&!n)return Y8;if(!t||t===Y8||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new j8(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,I.useEffect)(()=>{u.current=e},[e]),(0,I.useEffect)(()=>{d||p()},[n,d]),(0,I.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,I.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case q8.Always:return!1;case q8.BeforeDragging:return n;default:return!n}}}function X8(e,t){return K6(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function s0e(e,t){return X8(e,t)}function c0e(e){let{callback:t,disabled:n}=e,r=W6(t),i=(0,I.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,I.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Z8(e){let{callback:t,disabled:n}=e,r=W6(t),i=(0,I.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,I.useEffect)(()=>()=>i?.disconnect(),[i]),i}function l0e(e){return new j8(v8(e),e)}function Q8(e,t,n){t===void 0&&(t=l0e);let[r,i]=(0,I.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=c0e({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=Z8({callback:a});return U6(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function u0e(e){return g8(e,X8(e))}var $8=[];function d0e(e){let t=(0,I.useRef)(e),n=K6(n=>e?n&&n!==$8&&e&&t.current&&e.parentNode===t.current.parentNode?n:b8(e):$8,[e]);return(0,I.useEffect)(()=>{t.current=e},[e]),n}function f0e(e){let[t,n]=(0,I.useState)(null),r=(0,I.useRef)(e),i=(0,I.useCallback)(e=>{let t=S8(e.target);t&&n(e=>e?(e.set(t,T8(t)),new Map(e)):null)},[]);return(0,I.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=S8(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,T8(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{S8(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,I.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Q6(e,t),l8):k8(e):l8,[e,t])}function e5(e,t){t===void 0&&(t=[]);let n=(0,I.useRef)(null);return(0,I.useEffect)(()=>{n.current=null},t),(0,I.useEffect)(()=>{let t=e!==l8;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?$6(e,n.current):l8}function p0e(e){(0,I.useEffect)(()=>{if(!F6)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function m0e(e,t){return(0,I.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function t5(e){return(0,I.useMemo)(()=>e?z1e(e):null,[e])}var n5=[];function h0e(e,t){t===void 0&&(t=v8);let[n]=e,r=t5(n?R6(n):null),[i,a]=(0,I.useState)(n5);function o(){a(()=>e.length?e.map(e=>D8(e)?r:new j8(t(e),e)):n5)}let s=Z8({callback:o});return U6(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function r5(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return B6(t)?t:e}function g0e(e){let{measure:t}=e,[n,r]=(0,I.useState)(null),i=Z8({callback:(0,I.useCallback)(e=>{for(let{target:n}of e)if(B6(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=q6((0,I.useCallback)(e=>{let n=r5(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,I.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var _0e=[{sensor:H8,options:{}},{sensor:R8,options:{}}],v0e={current:{}},i5={draggable:{measure:y8},droppable:{measure:y8,strategy:q8.WhileDragging,frequency:J8.Optimized},dragOverlay:{measure:v8}},a5=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},y0e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new a5,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:o8},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:i5,measureDroppableContainers:o8,windowRect:null,measuringScheduled:!1},o5={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:o8,draggableNodes:new Map,over:null,measureDroppableContainers:o8},s5=(0,I.createContext)(o5),c5=(0,I.createContext)(y0e);function b0e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new a5}}}function x0e(e,t){switch(t.type){case a8.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case a8.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case a8.DragEnd:case a8.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case a8.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new a5(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case a8.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new a5(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case a8.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new a5(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function S0e(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,I.useContext)(s5),a=J6(r),o=J6(n?.id);return(0,I.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!e8(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=y1e(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function l5(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function C0e(e){return(0,I.useMemo)(()=>({draggable:{...i5.draggable,...e?.draggable},droppable:{...i5.droppable,...e?.droppable},dragOverlay:{...i5.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function w0e(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,I.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;U6(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=g8(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=x8(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var u5=(0,I.createContext)({...l8,scaleX:1,scaleY:1}),d5;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(d5||={});var f5=(0,I.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=_0e,collisionDetection:o=N1e,measuring:s,modifiers:c,...l}=e,[u,d]=(0,I.useReducer)(x0e,void 0,b0e),[f,p]=T1e(),[m,h]=(0,I.useState)(d5.Uninitialized),g=m===d5.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,I.useRef)({initial:null,translated:null}),C=(0,I.useMemo)(()=>_==null?null:{id:_,data:x?.data??v0e,rect:S},[_,x]),w=(0,I.useRef)(null),[T,E]=(0,I.useState)(null),[D,O]=(0,I.useState)(null),k=G6(l,Object.values(l)),A=X6(`DndDescribedBy`,t),j=(0,I.useMemo)(()=>b.getEnabled(),[b]),M=C0e(s),{droppableRects:N,measureDroppableContainers:ee,measuringScheduled:te}=o0e(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),P=i0e(v,_),F=(0,I.useMemo)(()=>D?t8(D):null,[D]),ne=Ne(),re=s0e(P,M.draggable.measure);w0e({activeNode:_==null?null:v.get(_),config:ne.layoutShiftCompensation,initialRect:re,measure:M.draggable.measure});let ie=Q8(P,M.draggable.measure,re),ae=Q8(P?P.parentElement:null),oe=(0,I.useRef)({activatorEvent:null,active:null,activeNode:P,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=b.getNodeFor(oe.current.over?.id),ce=g0e({measure:M.dragOverlay.measure}),le=ce.nodeRef.current??P,ue=g?ce.rect??ie:null,de=!!(ce.nodeRef.current&&ce.rect),fe=u0e(de?null:ie),pe=t5(le?R6(le):null),me=d0e(g?se??P:null),he=h0e(me),ge=l5(c,{transform:{x:y.x-fe.x,y:y.y-fe.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:ie,containerNodeRect:ae,draggingNodeRect:ue,over:oe.current.over,overlayNodeRect:ce.rect,scrollableAncestors:me,scrollableAncestorRects:he,windowRect:pe}),_e=F?Q6(F,y):null,ve=f0e(me),ye=e5(ve),be=e5(ve,[ie]),xe=Q6(ge,ye),Se=ue?I1e(ue,ge):null,Ce=C&&Se?o({active:C,collisionRect:Se,droppableRects:N,droppableContainers:j,pointerCoordinates:_e}):null,we=p8(Ce,`id`),[Te,Ee]=(0,I.useState)(null),De=P1e(de?ge:Q6(ge,be),Te?.rect??null,ie),Oe=(0,I.useRef)(null),ke=(0,I.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent;Oe.current=new n({active:w.current,activeNode:i,event:a,options:r,context:oe,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,Bo.unstable_batchedUpdates)(()=>{r?.(i),h(d5.Initializing),d({type:a8.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(Oe.current),O(a)})},onMove(e){d({type:a8.DragMove,coordinates:e})},onEnd:o(a8.DragEnd),onCancel:o(a8.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=oe.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===a8.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=a8.DragCancel)}w.current=null,(0,Bo.unstable_batchedUpdates)(()=>{d({type:e}),h(d5.Uninitialized),Ee(null),E(null),O(null),Oe.current=null;let t=e===a8.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Ae=a0e(a,(0,I.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,ke(n,t))},[v,ke]));p0e(a),U6(()=>{ie&&m===d5.Initializing&&h(d5.Initialized)},[ie,m]),(0,I.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=oe.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:xe.x,y:xe.y},over:i};(0,Bo.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[xe.x,xe.y]),(0,I.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=oe.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(we),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Bo.unstable_batchedUpdates)(()=>{Ee(s),a?.(c),f({type:`onDragOver`,event:c})})},[we]),U6(()=>{oe.current={activatorEvent:D,active:C,activeNode:P,collisionRect:Se,collisions:Ce,droppableRects:N,draggableNodes:v,draggingNode:le,draggingNodeRect:ue,droppableContainers:b,over:Te,scrollableAncestors:me,scrollAdjustedTranslate:xe},S.current={initial:ue,translated:Se}},[C,P,Ce,Se,v,le,ue,N,b,Te,me,xe]),t0e({...ne,delta:y,draggingRect:Se,pointerCoordinates:_e,scrollableAncestors:me,scrollableAncestorRects:he});let je=(0,I.useMemo)(()=>({active:C,activeNode:P,activeNodeRect:ie,activatorEvent:D,collisions:Ce,containerNodeRect:ae,dragOverlay:ce,draggableNodes:v,droppableContainers:b,droppableRects:N,over:Te,measureDroppableContainers:ee,scrollableAncestors:me,scrollableAncestorRects:he,measuringConfiguration:M,measuringScheduled:te,windowRect:pe}),[C,P,ie,D,Ce,ae,ce,v,b,N,Te,ee,me,he,M,te,pe]),Me=(0,I.useMemo)(()=>({activatorEvent:D,activators:Ae,active:C,activeNodeRect:ie,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:Te,measureDroppableContainers:ee}),[D,Ae,C,ie,d,A,v,Te,ee]);return I.createElement(i8.Provider,{value:p},I.createElement(s5.Provider,{value:Me},I.createElement(c5.Provider,{value:je},I.createElement(u5.Provider,{value:De},i)),I.createElement(S0e,{disabled:n?.restoreFocus===!1})),I.createElement(O1e,{...n,hiddenTextDescribedById:A}));function Ne(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),T0e=(0,I.createContext)(null),p5=`button`,E0e=`Draggable`;function D0e(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=X6(E0e),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,I.useContext)(s5),{role:p=p5,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,I.useContext)(g?u5:T0e),[v,y]=q6(),[b,x]=q6(),S=m0e(o,t),C=G6(n);return U6(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,I.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===p5?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function m5(){return(0,I.useContext)(c5)}var O0e=`Droppable`,k0e={timeout:25};function h5(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=X6(O0e),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,I.useContext)(s5),u=(0,I.useRef)({disabled:n}),d=(0,I.useRef)(!1),f=(0,I.useRef)(null),p=(0,I.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...k0e,...i},_=G6(h??r),v=Z8({callback:(0,I.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=q6((0,I.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=G6(t);return(0,I.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,I.useEffect)(()=>(s({type:a8.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:a8.UnregisterDroppable,key:a,id:r})),[r]),(0,I.useEffect)(()=>{n!==u.current.disabled&&(s({type:a8.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function A0e(e){let{animation:t,children:n}=e,[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(null),s=J6(n);return!n&&!r&&s&&i(s),U6(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),I.createElement(I.Fragment,null,n,r?(0,I.cloneElement)(r,{ref:o}):null)}var j0e={x:0,y:0,scaleX:1,scaleY:1};function M0e(e){let{children:t}=e;return I.createElement(s5.Provider,{value:o5},I.createElement(u5.Provider,{value:j0e},t))}var N0e={position:`fixed`,touchAction:`none`},P0e=e=>e8(e)?`transform 250ms ease`:void 0,F0e=(0,I.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=P0e}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...N0e,width:s.width,height:s.height,top:s.top,left:s.left,transform:n8.Transform.toString(d),transformOrigin:i&&r?k1e(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return I.createElement(n,{className:o,style:f,ref:t},a)}),I0e={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:n8.Transform.toString(t)},{transform:n8.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function L0e(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return W6((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=r5(a);if(!c)return;let{transform:l}=R6(a).getComputedStyle(a),u=_8(l);if(!u)return;let d=typeof t==`function`?t:R0e(t);return A8(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function R0e(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...I0e,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var g5=0;function z0e(e){return(0,I.useMemo)(()=>{if(e!=null)return g5++,g5},[e])}var B0e=I.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=m5(),S=(0,I.useContext)(u5),C=z0e(d?.id),w=l5(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=X8(f),E=L0e({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return I.createElement(M0e,null,I.createElement(A0e,{animation:E},d&&C?I.createElement(F0e,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))}),V0e=e=>{let{transform:t}=e;return{...t,y:0}};function H0e(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}var U0e=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e,i=r[0];return!t||!i?n:H0e(n,t,i)},W0e=e=>{let{transform:t}=e;return{...t,x:0}};function _5(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function G0e(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function v5(e){return e!==null&&e>=0}function K0e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function q0e(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var y5={scaleX:1,scaleY:1},J0e=e=>{let{rects:t,activeNodeRect:n,activeIndex:r,overIndex:i,index:a}=e,o=t[r]??n;if(!o)return null;let s=Y0e(t,a,r);if(a===r){let e=t[i];return e?{x:r<i?e.left+e.width-(o.left+o.width):e.left-o.left,y:0,...y5}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...y5}:a<r&&a>=i?{x:o.width+s,y:0,...y5}:{x:0,y:0,...y5}};function Y0e(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return!r||!i&&!a?0:n<t?i?r.left-(i.left+i.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(i.left+i.width)}var b5=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=_5(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},x5={scaleX:1,scaleY:1},X0e=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...x5}:null}let s=Z0e(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...x5}:r<t&&r>=a?{x:0,y:o.height+s,...x5}:{x:0,y:0,...x5}};function Z0e(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var S5=`Sortable`,C5=I.createContext({activeIndex:-1,containerId:S5,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:b5,disabled:{draggable:!1,droppable:!1}});function w5(e){let{children:t,id:n,items:r,strategy:i=b5,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=m5(),d=X6(S5,n),f=s.rect!==null,p=(0,I.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,I.useRef)(p),v=!K0e(p,_.current),y=g!==-1&&h===-1||v,b=q0e(a);U6(()=>{v&&m&&u(p)},[v,p,m,u]),(0,I.useEffect)(()=>{_.current=p},[p]);let x=(0,I.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:G0e(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return I.createElement(C5.Provider,{value:x},t)}var Q0e=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return _5(n,r,i).indexOf(t)},$0e=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},e2e={duration:200,easing:`ease`},T5=`transform`,t2e=n8.Transition.toString({property:T5,duration:0,easing:`linear`}),n2e={roleDescription:`sortable`};function r2e(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,I.useState)(null),s=(0,I.useRef)(n);return U6(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=v8(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,I.useEffect)(()=>{a&&o(null)},[a]),a}function E5(e){let{animateLayoutChanges:t=$0e,attributes:n,disabled:r,data:i,getNewIndex:a=Q0e,id:o,strategy:s,resizeObserverConfig:c,transition:l=e2e}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,I.useContext)(C5),y=i2e(r,p),b=u.indexOf(o),x=(0,I.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,I.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=h5({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:M,isDragging:N,over:ee,setActivatorNodeRef:te,transform:P}=D0e({id:o,data:x,attributes:{...n2e,...n},disabled:y.draggable}),F=h1e(E,j),ne=!!D,re=ne&&!m&&v5(f)&&v5(g),ie=!_&&N,ae=re?(ie&&re?P:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,oe=v5(f)&&v5(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,se=D?.id,ce=(0,I.useRef)({activeId:se,items:u,newIndex:oe,containerId:d}),le=u!==ce.current.items,ue=t({active:D,containerId:d,isDragging:N,isSorting:ne,id:o,index:b,items:u,newIndex:ce.current.newIndex,previousItems:ce.current.items,previousContainerId:ce.current.containerId,transition:l,wasDragging:ce.current.activeId!=null}),de=r2e({disabled:!ue,index:b,node:w,rect:C});return(0,I.useEffect)(()=>{ne&&ce.current.newIndex!==oe&&(ce.current.newIndex=oe),d!==ce.current.containerId&&(ce.current.containerId=d),u!==ce.current.items&&(ce.current.items=u)},[ne,oe,d,u]),(0,I.useEffect)(()=>{if(se===ce.current.activeId)return;if(se!=null&&ce.current.activeId==null){ce.current.activeId=se;return}let e=setTimeout(()=>{ce.current.activeId=se},50);return()=>clearTimeout(e)},[se]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:oe,items:u,isOver:T,isSorting:ne,isDragging:N,listeners:M,node:w,overIndex:g,over:ee,setNodeRef:F,setActivatorNodeRef:te,setDroppableNodeRef:E,setDraggableNodeRef:j,transform:de??ae,transition:fe()};function fe(){if(de||le&&ce.current.newIndex===b)return t2e;if(!(ie&&!e8(O)||!l)&&(ne||ue))return n8.Transition.toString({...l,property:T5})}}function i2e(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function D5(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var a2e=[I8.Down,I8.Right,I8.Up,I8.Left],O5=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(a2e.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case I8.Down:r.top<a.top&&t.push(n);break;case I8.Up:r.top>a.top&&t.push(n);break;case I8.Left:r.left>a.left&&t.push(n);break;case I8.Right:r.left<a.left&&t.push(n);break}});let c=h8({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=p8(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=b8(c).some((e,t)=>s[t]!==e),i=k5(e,t),a=o2e(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:$6(u,l)}}}};function k5(e,t){return!D5(e)||!D5(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function o2e(e,t){return!D5(e)||!D5(t)||!k5(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function A5({open:e,onOpenChange:t,title:n,description:r,children:i,onSubmit:a,submitLabel:o=`Enregistrer`,submitting:s=!1,canSubmit:c=!0}){return(0,z.jsx)(h6,{open:e,onOpenChange:t,children:(0,z.jsxs)(g6,{side:`right`,className:`w-4/5 sm:max-w-none gap-0 p-0`,children:[(0,z.jsxs)(_6,{className:`border-b px-6 py-4`,children:[(0,z.jsx)(y6,{children:n}),r?(0,z.jsx)(b6,{children:r}):null]}),(0,z.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),c&&!s&&a()},children:[(0,z.jsx)(`div`,{className:`oc-sheet__body flex-1 overflow-y-auto px-6 py-4`,children:i}),(0,z.jsxs)(v6,{className:`border-t px-6 py-4`,children:[(0,z.jsx)(X,{type:`submit`,disabled:!c||s,children:o}),(0,z.jsx)(X,{type:`button`,variant:`ghost`,onClick:()=>t(!1),children:`Annuler`})]})]})]})})}var s2e=e0(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function $({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,z.jsx)(n?fb:`span`,{"data-slot":`badge`,"data-variant":t,className:V1(s2e({variant:t}),e),...r})}function c2e(e){let t=new Map;for(let n of e){let e=t.get(n.instanceName);e||(e={instanceName:n.instanceName,kind:n.kind,agents:[]},t.set(n.instanceName,e)),e.agents.push(n)}let n=e=>(e.displayName??e.agentId).toLowerCase();for(let e of t.values())e.agents.sort((e,t)=>e.isDefault===t.isDefault?n(e).localeCompare(n(t)):e.isDefault?-1:1);let r=[...t.values()],i=e=>e.agents.some(e=>e.isDefault);return r.sort((e,t)=>i(e)===i(t)?e.instanceName.localeCompare(t.instanceName):i(e)?-1:1),r}function l2e(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[e.displayName,e.agentId,e.instanceName,e.model].filter(Boolean).some(e=>e.toLowerCase().includes(n))):e}function u2e({open:e,onOpenChange:t,agents:n,onPick:r}){let[i,a]=(0,I.useState)(``),o=(0,I.useMemo)(()=>c2e(l2e(n??[],i)),[n,i]);return(0,z.jsx)(d0,{open:e,onOpenChange:t,children:(0,z.jsxs)(f0,{className:`oc-agentpicker`,children:[(0,z.jsxs)(p0,{children:[(0,z.jsx)(h0,{children:Zje()}),(0,z.jsx)(g0,{children:eMe()})]}),n===void 0?(0,z.jsx)(`p`,{className:`oc-agentpicker__hint`,children:rMe()}):n.length===0?(0,z.jsx)(`p`,{className:`oc-agentpicker__hint`,children:oMe()}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(n0,{autoFocus:!0,value:i,onChange:e=>a(e.target.value),placeholder:lMe(),className:`oc-agentpicker__search`,"aria-label":fMe()}),(0,z.jsx)(`div`,{className:`oc-agentpicker__list`,role:`listbox`,children:o.map(e=>(0,z.jsxs)(`div`,{className:`oc-agentpicker__group`,children:[(0,z.jsxs)(`div`,{className:`oc-agentpicker__instance`,children:[(0,z.jsx)(wm,{size:13,"aria-hidden":!0}),(0,z.jsx)(`span`,{children:e.instanceName}),(0,z.jsx)($,{variant:`outline`,className:`oc-agentpicker__kind`,children:e.kind})]}),e.agents.map(e=>(0,z.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":!1,className:`oc-agentpicker__item`,onClick:()=>r(e.instanceName,e.agentId),disabled:e.state===`deleted`,title:e.state===`deleted`?hMe():void 0,children:[(0,z.jsx)(im,{size:15,"aria-hidden":!0,className:`oc-agentpicker__icon`}),(0,z.jsxs)(`span`,{className:`oc-agentpicker__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,z.jsx)(`span`,{className:`oc-agentpicker__model`,children:e.model}):null,e.isDefault?(0,z.jsx)(Em,{size:13,"aria-label":vMe(),className:`oc-agentpicker__default`}):null]},`${e.instanceName}/${e.agentId}`))]},e.instanceName))})]})]})})}var j5=6e4,M5=60*j5,N5=24*M5,P5=7*N5,F5=30*N5,I5=365*N5;function d2e(e,t){let n=t-e;if(n<j5)return`maintenant`;if(n<M5)return`${Math.floor(n/j5)}min`;if(n<N5)return`${Math.floor(n/M5)}h`;if(n<P5)return`${Math.floor(n/N5)}j`;if(n<F5)return`${Math.floor(n/P5)}sem`;if(n<I5)return`${Math.floor(n/F5)}mois`;let r=Math.floor(n/I5);return`${r}an${r>1?`s`:``}`}var L5=[{value:`red`,hue:`oklch(0.63 0.21 25)`},{value:`orange`,hue:`oklch(0.7 0.17 50)`},{value:`amber`,hue:`oklch(0.8 0.15 85)`},{value:`green`,hue:`oklch(0.7 0.16 150)`},{value:`teal`,hue:`oklch(0.7 0.12 190)`},{value:`blue`,hue:`oklch(0.62 0.19 250)`},{value:`violet`,hue:`oklch(0.6 0.2 300)`},{value:`pink`,hue:`oklch(0.7 0.2 350)`}],R5=e=>L5.find(t=>t.value===e)?.hue??null,z5=`project:none`,f2e=e=>`project:${e}`,B5=`oc.noproject.collapsed`;function p2e({activeChatId:e,onSelect:t}){let n=L(H.messages.listChats,{}),r=L(H.projects.listProjects,{}),i=L(H.me.getMe)?.ui?.effective,a=i?.showChatProvider??!0,o=i?.showChatAge??!0,s=new Set((n??[]).map(e=>e.providerKind).filter(e=>e!=null)),c=a&&s.size>1,[,l]=(0,I.useState)(0);(0,I.useEffect)(()=>{if(!o)return;let e=window.setInterval(()=>l(e=>e+1),6e4);return()=>window.clearInterval(e)},[o]);let u=R(H.chats.createChat),d=R(H.projects.createProject),f=R(H.projects.setProjectCollapsed),p=R(H.chats.reorderChat),m=R(H.chats.moveChatToProject),h=b0(),g=L(H.agents.listMyAgents),[_,v]=(0,I.useState)(!1);async function y(e,n){t(await u({title:`New chat`,instanceName:e,agentId:n}))}async function b(){let e=g;if(e&&e.length===1&&e[0].state!==`deleted`){await y(e[0].instanceName,e[0].agentId);return}v(!0)}let[x,S]=(0,I.useState)(null),C=(0,I.useRef)(!1);(0,I.useEffect)(()=>{!C.current&&n&&S(n)},[n]);let w=x??n??[],[T,E]=(0,I.useState)(null),[D,O]=(0,I.useState)(()=>localStorage.getItem(B5)===`1`);function k(){O(e=>(localStorage.setItem(B5,e?`0`:`1`),!e))}let A=c8(s8(H8,{activationConstraint:{distance:4}}),s8(R8,{coordinateGetter:O5})),j=w.filter(e=>e.pinned),M=w.filter(e=>!e.pinned),N=e=>M.filter(t=>(t.projectId??null)===e);function ee(e){return w.find(t=>t._id===e)}async function te(e){E(null);let{active:t,over:n}=e;if(!n)return;let r=ee(String(t.id));if(!r)return;let i=String(n.id);if(i.startsWith(`project:`)){let e=i===z5?null:i.slice(8);if((r.projectId??null)===e)return;C.current=!0,S(t=>(t??w).map(t=>t._id===r._id?{...t,projectId:e}:t));try{await m({chatId:r._id,projectId:e})}finally{C.current=!1}return}let a=ee(i);if(!a||t.id===n.id)return;if((a.projectId??null)!==(r.projectId??null)||a.pinned!==r.pinned){if(r.pinned||a.pinned)return;C.current=!0,S(e=>(e??w).map(e=>e._id===r._id?{...e,projectId:a.projectId??null}:e));try{await m({chatId:r._id,projectId:a.projectId??null})}finally{C.current=!1}return}let o=a.pinned?j:N(a.projectId??null),s=o.map(e=>e._id),c=s.indexOf(r._id),l=s.indexOf(a._id);if(c<0||l<0)return;let u=[...o];u.splice(c,1),u.splice(l,0,r);let d=u[l-1]??null,f=u[l+1]??null;C.current=!0,S(e=>[...(e??w).filter(e=>!o.some(t=>t._id===e._id)),...u]);try{await p({chatId:r._id,prevKey:d?d.sortKey:null,nextKey:f?f.sortKey:null})}finally{C.current=!1}}let P=T?ee(T):null;return(0,z.jsxs)(`aside`,{className:`oc-sidebar`,children:[(0,z.jsx)(u2e,{open:_,onOpenChange:v,agents:g,onPick:(e,t)=>{v(!1),y(e,t)}}),(0,z.jsxs)(`div`,{className:`oc-sidebar__top`,children:[(0,z.jsxs)(X,{className:`flex-1 justify-start`,onClick:()=>void b(),children:[(0,z.jsx)(xm,{}),` `,kOe()]}),(0,z.jsx)(X,{variant:`outline`,size:`icon`,"aria-label":F$(),onClick:async()=>{let e=await h({title:F$(),label:POe(),placeholder:LOe(),confirmLabel:BOe()});e&&await d({name:e})},children:(0,z.jsx)(dee,{})})]}),(0,z.jsxs)(f5,{sensors:A,collisionDetection:h8,modifiers:[W0e,U0e],onDragStart:e=>E(e.active.id),onDragCancel:()=>E(null),onDragEnd:te,children:[(0,z.jsxs)(`div`,{className:`oc-sidebar__scroll`,children:[j.length>0?(0,z.jsx)(V5,{label:UOe(),chats:j,children:j.map(n=>(0,z.jsx)(U5,{chat:n,active:n._id===e,projects:r??[],onSelect:t,showProviderBadge:c},n._id))}):null,(r??[]).map(n=>{let i=N(n._id);return(0,z.jsx)(V5,{label:n.name,dropId:f2e(n._id),projectId:n._id,chats:i,collapsible:!0,collapsed:n.collapsed,onToggle:()=>void f({projectId:n._id,collapsed:!n.collapsed}),children:n.collapsed?null:i.length===0?(0,z.jsx)(`div`,{className:`oc-sidebar__empty`,children:KOe()}):i.map(n=>(0,z.jsx)(U5,{chat:n,active:n._id===e,projects:r??[],onSelect:t,showProviderBadge:c},n._id))},n._id)}),(0,z.jsx)(V5,{label:YOe(),dropId:z5,chats:N(null),collapsible:!0,collapsed:D,onToggle:k,children:D?null:N(null).map(n=>(0,z.jsx)(U5,{chat:n,active:n._id===e,projects:r??[],onSelect:t,showProviderBadge:c},n._id))})]}),(0,z.jsx)(B0e,{children:P?(0,z.jsxs)(`div`,{className:`oc-chatitem oc-chatitem--overlay`,children:[(0,z.jsx)(mm,{className:`size-3.5 opacity-60`}),R5(P.color)?(0,z.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:R5(P.color)}}):(0,z.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,z.jsx)(`span`,{className:`oc-chatitem__label`,children:P.title||I$()})]}):null})]})]})}function V5({label:e,dropId:t,projectId:n,chats:r,collapsible:i,collapsed:a,onToggle:o,children:s}){let c=R(H.projects.deleteProject),l=y0(),u=L(H.projects.projectChatCount,n?{projectId:n}:`skip`),{setNodeRef:d,isOver:f}=h5({id:t??`static:${e}`});return(0,z.jsxs)(`div`,{ref:t?d:void 0,className:`oc-sidebar__group`+(f?` oc-sidebar__group--over`:``),children:[(0,z.jsxs)(`div`,{className:`oc-sidebar__group-head`+(i?` oc-sidebar__group-head--btn`:``),...i?{role:`button`,tabIndex:0,onClick:o,onKeyDown:e=>{i&&o&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())}}:{},children:[i?a?(0,z.jsx)(sm,{className:`size-3.5`}):(0,z.jsx)(om,{className:`size-3.5`}):null,(0,z.jsx)(`span`,{className:`oc-sidebar__group-label`,children:e}),n?(0,z.jsx)(`button`,{className:`oc-sidebar__group-del`,"aria-label":L$(),onClick:async t=>{t.stopPropagation();let r=u??0;await l({title:nke({name:e}),description:r>0?ake({count:r}):cke(),confirmWord:R$(),confirmLabel:L$(),destructive:!0})&&await c({projectId:n})},children:(0,z.jsx)(Dm,{className:`size-3.5`})}):null]}),(0,z.jsx)(w5,{items:r.map(e=>e._id),strategy:X0e,children:s})]})}var H5={openclaw:`OpenClaw`,hermes:`Hermes`};function U5({chat:e,active:t,projects:n,onSelect:r,showProviderBadge:i}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=E5({id:e._id}),d=R(H.chats.renameChat),f=R(H.chats.deleteChat),p=R(H.chats.pinChat),m=R(H.chats.setChatColor),h=L(H.me.getMe)?.ui?.effective?.showChatAge??!0,g=y0(),[_,v]=(0,I.useState)(!1),[y,b]=(0,I.useState)(e.title??``),x={transform:n8.Transform.toString(c),transition:l,opacity:+!u},S=R5(e.color);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{ref:s,style:x,className:`oc-chatitem group/row`+(t?` oc-chatitem--active`:``),children:[(0,z.jsx)(`button`,{className:`oc-chatitem__grip`,"aria-label":pke(),...a,...o,children:(0,z.jsx)(mm,{className:`size-3.5`})}),S?(0,z.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:S}}):(0,z.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,z.jsx)(`button`,{className:`oc-chatitem__label`,onClick:()=>r(e._id),children:e.title||I$()}),i&&e.providerKind?(0,z.jsx)(`span`,{className:`oc-chatitem__bridge oc-chatitem__bridge--${e.providerKind} group-hover/row:opacity-0 group-focus-within/row:opacity-0`,title:Bke({provider:H5[e.providerKind]}),children:H5[e.providerKind]}):null,h?(0,z.jsx)(`span`,{className:`oc-chatitem__age group-hover/row:opacity-0 group-focus-within/row:opacity-0`,title:new Date(e.updatedAt).toLocaleString(`fr-FR`),children:d2e(e.updatedAt,Date.now())}):null,(0,z.jsxs)(H1,{children:[(0,z.jsx)(U1,{asChild:!0,children:(0,z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":gke(),className:`opacity-0 group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,z.jsx)(pm,{})})}),(0,z.jsxs)(W1,{align:`end`,className:`w-48`,children:[(0,z.jsxs)(G1,{onSelect:()=>{b(e.title??``),v(!0)},children:[(0,z.jsx)(yee,{}),` `,yke()]}),(0,z.jsxs)(G1,{onSelect:()=>void p({chatId:e._id,pinned:!e.pinned}),children:[e.pinned?(0,z.jsx)(bee,{}):(0,z.jsx)(xee,{}),e.pinned?Ske():Tke()]}),(0,z.jsx)(K1,{children:Oke()}),(0,z.jsxs)(`div`,{className:`oc-colorgrid`,onClick:e=>e.stopPropagation(),children:[(0,z.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void m({chatId:e._id,color:null}),"aria-label":jke(),children:`✕`}),L5.map(t=>(0,z.jsx)(`button`,{className:`oc-colorgrid__dot`+(e.color===t.value?` is-selected`:``),style:{background:t.hue},"aria-label":t.value,onClick:()=>void m({chatId:e._id,color:t.value})},t.value))]}),(0,z.jsx)(q1,{}),(0,z.jsxs)(G1,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{await g({title:Pke(),description:Lke(),confirmLabel:R$(),destructive:!0})&&await f({chatId:e._id})})},children:[(0,z.jsx)(Dm,{}),` `,R$()]})]})]})]}),(0,z.jsx)(A5,{open:_,onOpenChange:v,title:Uke(),canSubmit:y.trim().length>0,onSubmit:async()=>{await d({chatId:e._id,title:y.trim()}),v(!1)},children:(0,z.jsx)(`div`,{className:`oc-form`,children:(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:Kke()}),(0,z.jsx)(n0,{value:y,onChange:e=>b(e.target.value),autoFocus:!0})]})})})]})}var W5=[`admin`,`user`,`pending`];function G5(){let e=L(H.me.authProviders)?.anonymous===!0,[t,n]=(0,I.useState)(!1),r=L(H.dev.listUsersDev,e?{}:`skip`),i=L(H.me.getImpersonation),a=R(H.dev.setMyRole),o=R(H.dev.setRole),s=R(H.admin.startImpersonation),c=R(H.admin.stopImpersonation);if(!e)return null;let l=r?.find(e=>e.isMe),u=l?.role===`admin`,d=i?.impersonating===!0,f=(r??[]).filter(e=>!e.isMe);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`button`,{type:`button`,className:`oc-devfab`,onClick:()=>n(!0),title:VDe(),children:[(0,z.jsx)(Am,{size:13}),`DEV`]}),(0,z.jsx)(d0,{open:t,onOpenChange:n,children:(0,z.jsxs)(f0,{children:[(0,z.jsxs)(p0,{children:[(0,z.jsx)(h0,{children:WDe()}),(0,z.jsx)(g0,{children:qDe()})]}),(0,z.jsxs)(`div`,{className:`oc-devsw__me`,children:[(0,z.jsxs)(`span`,{className:`oc-devsw__melabel`,children:[XDe({canonical:l?.canonical??`…`}),` `,(0,z.jsx)($,{variant:`outline`,children:l?.role??`…`})]}),(0,z.jsx)(`div`,{className:`oc-devsw__roles`,children:W5.map(e=>(0,z.jsx)(X,{type:`button`,size:`xs`,variant:l?.role===e?`secondary`:`ghost`,disabled:l?.role===e,onClick:()=>void a({role:e}),children:e===`admin`?$De():e===`user`?nOe():aOe()},e))})]}),d?(0,z.jsxs)(`div`,{className:`oc-devsw__imp`,children:[cOe(),` `,(0,z.jsx)(`strong`,{children:i.targetLabel}),`.`,(0,z.jsx)(X,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>void c(),children:dOe()})]}):null,(0,z.jsx)(`div`,{className:`oc-devsw__list`,children:f.length===0?(0,z.jsx)(`p`,{className:`oc-devsw__empty`,children:mOe()}):f.map(e=>(0,z.jsxs)(`div`,{className:`oc-devsw__row`,children:[(0,z.jsx)(`span`,{className:`oc-devsw__label`,children:e.name||e.email||e.canonical||e.userId.slice(0,8)}),(0,z.jsx)(`select`,{className:`oc-devsw__select`,value:e.role,disabled:!e.canonical,onChange:t=>e.canonical&&void o({canonical:e.canonical,role:t.target.value}),children:W5.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))}),(0,z.jsx)(X,{type:`button`,size:`xs`,variant:`ghost`,disabled:!u||e.role===`pending`,title:u?e.role===`pending`?bOe():COe():_Oe(),onClick:()=>{s({profileId:e.profileId}),n(!1)},children:EOe()})]},e.profileId))})]})})]})}function K5({label:e,mode:t,minimal:n=!1}){let{signOut:r}=pr(),i=R(H.me.setThemeMode).withOptimisticUpdate((e,{mode:t})=>{let n=e.getQuery(H.me.getMe,{});if(!n)return;let r=t===null?n.defaultThemeMode??`system`:t;e.setQuery(H.me.getMe,{},{...n,themeMode:t,resolvedThemeMode:r})}),a=t??`default`;return(0,z.jsxs)(H1,{children:[(0,z.jsx)(U1,{asChild:!0,children:(0,z.jsxs)(X,{variant:`ghost`,size:`sm`,className:`gap-1.5`,children:[e,(0,z.jsx)(om,{className:`opacity-60`})]})}),(0,z.jsx)(W1,{align:`end`,className:`w-52`,children:n?(0,z.jsxs)(G1,{onClick:()=>void r(),children:[(0,z.jsx)(_m,{}),` `,Zj()]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(K1,{children:Ij()}),(0,z.jsxs)(WGe,{value:a,onValueChange:e=>void i({mode:e==="default"?null:e}),children:[(0,z.jsxs)(J1,{value:`light`,children:[(0,z.jsx)(wee,{}),` `,zj()]}),(0,z.jsxs)(J1,{value:`dark`,children:[(0,z.jsx)(hee,{}),` `,Hj()]}),(0,z.jsxs)(J1,{value:`system`,children:[(0,z.jsx)(mee,{}),` `,Gj()]}),(0,z.jsx)(J1,{value:`default`,children:Jj()})]}),(0,z.jsx)(q1,{}),(0,z.jsxs)(G1,{onClick:()=>void r(),children:[(0,z.jsx)(_m,{}),` `,Zj()]})]})})]})}var m2e={altered_words:()=>iFe(),incorrect:()=>sFe(),incoherence:()=>uFe(),formatting:()=>pFe(),latency:()=>gFe(),api_error:()=>yFe(),other:()=>SFe()},h2e=e=>m2e[e]?.()??e,g2e={anomaly_open:Om,anomaly_resolved:lm,feedback_reply:vm};function _2e(e){return e.kind===`feedback_reply`?{title:QPe(),body:tFe()}:{title:e.title,body:e.body}}function v2e(){let e=L(H.notifications.myUnreadCount)??0,t=L(H.notifications.myNotifications),n=L(H.feedback.myFeedback),r=R(H.notifications.markRead),i=R(H.notifications.markAllRead),a=R(H.notifications.clearOne),o=R(H.notifications.clearAll),s=Ro(),[c,l]=(0,I.useState)(!1),u=e=>{if(e.unread&&r({notificationId:e._id}),!e.href)return;if(l(!1),e.href.startsWith(`/chat/`)){s({to:`/chat/$chatId`,params:{chatId:e.href.slice(6)}});return}let[t,n]=e.href.split(`?`);s({to:t,search:Object.fromEntries(new URLSearchParams(n??``))})};return(0,z.jsxs)(H1,{open:c,onOpenChange:l,children:[(0,z.jsx)(U1,{asChild:!0,children:(0,z.jsxs)(`button`,{type:`button`,className:`oc-bell`,"aria-label":e>0?fPe({count:e}):hPe(),children:[(0,z.jsx)(rm,{size:18,"aria-hidden":!0}),e>0?(0,z.jsx)(`span`,{className:`oc-bell__badge`,"aria-hidden":!0,children:e>9?`9+`:e}):null]})}),(0,z.jsxs)(W1,{align:`end`,className:`oc-notif`,children:[(0,z.jsxs)(`div`,{className:`oc-notif__head`,children:[(0,z.jsx)(`span`,{children:vPe()}),t&&t.length>0?(0,z.jsxs)(`span`,{className:`oc-notif__bulk`,children:[(0,z.jsx)(`button`,{type:`button`,className:`oc-notif__act`,disabled:e===0,onClick:()=>void i({}),children:xPe()}),(0,z.jsx)(`button`,{type:`button`,className:`oc-notif__act`,onClick:()=>void o({}),children:wPe()})]}):null]}),t===void 0?(0,z.jsx)(`div`,{className:`oc-notif__empty`,children:Nj()}):t.length===0?(0,z.jsx)(`div`,{className:`oc-notif__empty`,children:DPe()}):(0,z.jsx)(`div`,{className:`oc-notif__list`,children:t.map(e=>{let t=g2e[e.kind]??rm,{title:n,body:i}=_2e(e);return(0,z.jsxs)(`div`,{className:`oc-notif__item${e.unread?` is-unread`:``}${e.href?` is-link`:``}`,role:e.href?`button`:void 0,tabIndex:e.href?0:void 0,onClick:e.href?()=>u(e):void 0,children:[(0,z.jsxs)(`div`,{className:`oc-notif__item-head`,children:[(0,z.jsx)(t,{size:14,className:`oc-notif__kind oc-notif__kind--${e.kind}`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`oc-notif__title`,children:n}),(0,z.jsxs)(`span`,{className:`oc-notif__row-actions`,children:[e.unread?(0,z.jsx)(`button`,{type:`button`,title:B$(),"aria-label":B$(),onClick:t=>{t.stopPropagation(),r({notificationId:e._id})},children:(0,z.jsx)(am,{size:13})}):null,(0,z.jsx)(`button`,{type:`button`,title:V$(),"aria-label":V$(),onClick:t=>{t.stopPropagation(),a({notificationId:e._id})},children:(0,z.jsx)(jm,{size:13})})]})]}),(0,z.jsx)(`p`,{className:`oc-notif__body`,children:i}),(0,z.jsx)(`div`,{className:`oc-notif__when`,children:new Date(e.createdAt).toLocaleString(q())})]},e._id)})}),n&&n.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`oc-notif__head oc-notif__head--sub`,children:PPe()}),(0,z.jsx)(`div`,{className:`oc-notif__list`,children:n.map(e=>(0,z.jsxs)(`div`,{className:`oc-notif__item`,children:[(0,z.jsxs)(`div`,{className:`oc-notif__item-head`,children:[(0,z.jsx)(`span`,{className:`oc-notif__title`,children:h2e(e.category)}),(0,z.jsx)(`span`,{className:`oc-notif__status${e.answered?` is-answered`:``}`,children:e.answered?LPe():BPe()})]}),e.thread.length>0?(0,z.jsx)(`div`,{className:`oc-notif__thread`,children:e.thread.map((e,t)=>(0,z.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,z.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?UPe():KPe()}),(0,z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):null,(0,z.jsx)(Qo,{to:`/chat/$chatId`,params:{chatId:e.chatId},className:`oc-notif__link`,onClick:()=>l(!1),children:YPe()})]},e._id))})]}):null]})]})}var q5=2,y2e=180;function b2e(){let e=Ro(),t=(0,I.useRef)(null),n=(0,I.useRef)(null),[r,i]=(0,I.useState)(!1),[a,o]=(0,I.useState)(``),[s,c]=(0,I.useState)(``),[l,u]=(0,I.useState)(0);(0,I.useEffect)(()=>{let e=setTimeout(()=>c(a),y2e);return()=>clearTimeout(e)},[a]);let d=s.trim(),f=L(H.search.searchConversations,d.length>=q5?{query:d}:`skip`),p=f??[],m=d.length>=q5&&f===void 0;(0,I.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,I.useEffect)(()=>{r&&(o(``),c(``),u(0))},[r]),(0,I.useEffect)(()=>{u(0)},[f]),(0,I.useEffect)(()=>{(n.current?.querySelector(`[data-index="${l}"]`))?.scrollIntoView({block:`nearest`})},[l]);let h=(0,I.useCallback)(t=>{i(!1),e({to:`/chat/$chatId`,params:{chatId:t}})},[e]);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`button`,{type:`button`,className:`oc-search-trigger`,onClick:()=>i(!0),"aria-label":oje(),children:[(0,z.jsx)(Cm,{className:`oc-search-trigger__icon`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`oc-search-trigger__label`,children:lje()}),(0,z.jsx)(`kbd`,{className:`oc-search-trigger__kbd`,children:`⌘K`})]}),(0,z.jsx)(d0,{open:r,onOpenChange:i,children:(0,z.jsxs)(f0,{showCloseButton:!1,className:`oc-search-palette top-[12vh] translate-y-0 max-w-xl gap-0 overflow-hidden p-0`,onOpenAutoFocus:e=>{e.preventDefault(),t.current?.focus()},children:[(0,z.jsx)(h0,{className:`sr-only`,children:fje()}),(0,z.jsxs)(`div`,{className:`oc-search-palette__head`,children:[(0,z.jsx)(Cm,{className:`oc-search-palette__head-icon`,"aria-hidden":!0}),(0,z.jsx)(`input`,{ref:t,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,p.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=p[l];t&&h(t.chatId)}},placeholder:hje(),className:`oc-search-palette__field`,autoComplete:`off`,spellCheck:!1,"aria-label":vje()})]}),(0,z.jsx)(`div`,{className:`oc-search-palette__results`,ref:n,role:`listbox`,children:d.length<q5?(0,z.jsx)(`div`,{className:`oc-search-palette__hint`,children:xje({count:q5})}):m?(0,z.jsx)(`div`,{className:`oc-search-palette__hint`,children:wje()}):p.length===0?(0,z.jsx)(`div`,{className:`oc-search-palette__hint`,children:Dje({term:d})}):p.map((e,t)=>(0,z.jsxs)(`button`,{type:`button`,"data-index":t,role:`option`,"aria-selected":t===l,className:V1(`oc-search-result`,t===l&&`is-active`),onMouseMove:()=>u(t),onClick:()=>h(e.chatId),children:[(0,z.jsx)(`span`,{className:`oc-search-result__icon`,"aria-hidden":!0,children:e.matchedIn===`title`?(0,z.jsx)(fee,{size:15}):(0,z.jsx)(vm,{size:15})}),(0,z.jsxs)(`span`,{className:`oc-search-result__body`,children:[(0,z.jsx)(`span`,{className:`oc-search-result__title`,children:e.title||Aje()}),e.snippet?(0,z.jsx)(`span`,{className:`oc-search-result__snippet`,children:e.snippet}):null]}),(0,z.jsx)(`span`,{className:`oc-search-result__tag`,children:e.matchedIn===`title`?Nje():Ije()})]},e.chatId))}),(0,z.jsxs)(`div`,{className:`oc-search-palette__footer`,children:[(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`kbd`,{children:`↑`}),(0,z.jsx)(`kbd`,{children:`↓`}),` `,zje()]}),(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`kbd`,{children:`↵`}),` `,Hje()]}),(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`kbd`,{children:Gje()}),` `,Jje()]})]})]})})]})}function J5({className:e,...t}){return(0,z.jsx)(jC,{"data-slot":`checkbox`,className:V1(`peer size-4 shrink-0 rounded-[4px] border border-input bg-background ring-offset-background transition-shadow outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground`,e),...t,children:(0,z.jsx)(NC,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center text-current`,children:t.checked===`indeterminate`?(0,z.jsx)(bm,{className:`size-3.5`}):(0,z.jsx)(am,{className:`size-3.5`})})})}function x2e({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=L(H.admin.listInstances,n?{}:`skip`),a=L(H.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null;return(0,z.jsx)(d0,{open:n,onOpenChange:r,children:(0,z.jsxs)(f0,{className:`oc-access`,children:[(0,z.jsxs)(p0,{children:[(0,z.jsx)(h0,{children:zwe({user:t})}),(0,z.jsx)(g0,{children:Hwe()})]}),(0,z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:Gwe()}):i.length===0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:Jwe()}):i.map(t=>(0,z.jsx)(S2e,{profileId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:o,defaultKey:s?`${s.instanceName}/${s.agentId}`:null},t._id))})]})})}function S2e({profileId:e,instanceName:t,kind:n,assigned:r,defaultKey:i}){let a=L(H.agents.listAgentsForInstance,{instanceName:t}),o=R(H.agents.assignAgent),s=R(H.agents.removeAgent),c=R(H.agents.setDefaultAgent),l=S0();if(!e)return null;let u=(a?.agents??[]).filter(e=>e.source===`discovered`),d=a?.discovery&&!a.discovery.lastPollOk;async function f(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(Zwe(),e)}}async function p(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(eTe(),e)}}return(0,z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,z.jsx)(wm,{size:13,"aria-hidden":!0}),(0,z.jsx)(`span`,{children:t}),(0,z.jsx)($,{variant:`outline`,className:`oc-access__kind`,children:n}),d?(0,z.jsx)($,{variant:`outline`,className:`oc-access__stale`,children:rTe()}):null]}),a===void 0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:oTe()}):u.length===0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:d?fTe():lTe()}):u.map(e=>{let n=`${t}/${e.agentId}`,a=r.has(n),o=i===n,s=e.presentInLastOk===!1;return(0,z.jsxs)(`div`,{className:`oc-access__row`,children:[(0,z.jsx)(J5,{checked:a,disabled:s&&!a,onCheckedChange:()=>void f(e.agentId,a),"aria-label":hTe({name:e.displayName??e.agentId})}),(0,z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,z.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:vTe()}):null,a?o?(0,z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":j$(),title:j$(),children:(0,z.jsx)(Em,{size:14,fill:`currentColor`})}):(0,z.jsx)(X,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":M$(),title:M$(),onClick:()=>void p(e.agentId),children:(0,z.jsx)(Em,{size:14})}):null]},e.agentId)})]})}function Y5({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,z.jsx)(`table`,{"data-slot":`table`,className:V1(`w-full caption-bottom text-sm`,e),...t})})}function X5({className:e,...t}){return(0,z.jsx)(`thead`,{"data-slot":`table-header`,className:V1(`[&_tr]:border-b`,e),...t})}function Z5({className:e,...t}){return(0,z.jsx)(`tbody`,{"data-slot":`table-body`,className:V1(`[&_tr:last-child]:border-0`,e),...t})}function Q5({className:e,...t}){return(0,z.jsx)(`tr`,{"data-slot":`table-row`,className:V1(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function $5({className:e,...t}){return(0,z.jsx)(`th`,{"data-slot":`table-head`,className:V1(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function e7({className:e,...t}){return(0,z.jsx)(`td`,{"data-slot":`table-cell`,className:V1(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}function t7({title:e,rows:t,columns:n,rowActions:r,onAdd:i,addLabel:a=DMe(),bulkActions:o,emptyHint:s=AMe(),isExpanded:c,renderExpanded:l}){let[u,d]=(0,I.useState)(new Set),f=t??[],p=+!!o+n.length+ +!!r,m=f.length>0&&u.size===f.length,h=u.size>0&&!m;function g(){d(m?new Set:new Set(f.map(e=>e._id)))}function _(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,z.jsxs)(`div`,{className:`oc-dt`,children:[(0,z.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,z.jsx)(`h2`,{className:`oc-dt__title`,children:e}),(0,z.jsxs)(`div`,{className:`oc-dt__bar-actions`,children:[u.size>0&&o?o.map(e=>(0,z.jsxs)(X,{size:`sm`,variant:e.variant===`destructive`?`destructive`:`outline`,onClick:()=>{e.onSelect([...u]),d(new Set)},children:[e.variant===`destructive`?(0,z.jsx)(Dm,{}):null,e.label,` (`,u.size,`)`]},e.label)):null,i?(0,z.jsxs)(X,{size:`sm`,onClick:i,children:[(0,z.jsx)(xm,{}),` `,a]}):null]})]}),t===void 0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:NMe()}):f.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:s}):(0,z.jsxs)(Y5,{children:[(0,z.jsx)(X5,{children:(0,z.jsxs)(Q5,{children:[o?(0,z.jsx)($5,{className:`w-8`,children:(0,z.jsx)(J5,{"aria-label":IMe(),checked:m?!0:h?`indeterminate`:!1,onCheckedChange:g})}):null,n.map(e=>(0,z.jsx)($5,{className:e.className,children:e.header},e.header)),r?(0,z.jsx)($5,{className:`w-8`}):null]})}),(0,z.jsx)(Z5,{children:f.map(e=>{let t=r?.(e)??[],i=c?.(e)??!1;return(0,z.jsxs)(I.Fragment,{children:[(0,z.jsxs)(Q5,{className:`group/row`,children:[o?(0,z.jsx)(e7,{children:(0,z.jsx)(J5,{"aria-label":zMe(),checked:u.has(e._id),onCheckedChange:()=>_(e._id)})}):null,n.map(t=>(0,z.jsx)(e7,{className:t.className,children:t.cell(e)},t.header)),r?(0,z.jsx)(e7,{children:t.length>0?(0,z.jsxs)(H1,{children:[(0,z.jsx)(U1,{asChild:!0,children:(0,z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":HMe(),className:`opacity-0 transition-opacity group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,z.jsx)(pm,{})})}),(0,z.jsx)(W1,{align:`end`,children:t.map((t,n)=>(0,z.jsxs)(`div`,{children:[t.variant===`destructive`&&n>0?(0,z.jsx)(q1,{}):null,(0,z.jsx)(G1,{variant:t.variant,onSelect:()=>t.onSelect(e),children:t.label})]},t.label))})]}):null}):null]}),i&&l?(0,z.jsx)(Q5,{className:`oc-dt__expansion`,children:(0,z.jsx)(e7,{colSpan:p,className:`oc-dt__expansion-cell`,children:l(e)})}):null]},e._id)})})]})]})}var n7={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function r7(e,t){let n=e.trim();if(n===`now`)return t;let r=/^now-(\d+)([smhdw])$/.exec(n);if(r===null)return null;let i=Number(r[1]),a=n7[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function i7(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:r7(e.from,t)??t-n7.h,to:r7(e.to,t)??t}}var a7=[{label:_Ee(),from:`now-5m`},{label:bEe(),from:`now-15m`},{label:CEe(),from:`now-30m`},{label:EEe(),from:`now-1h`},{label:kEe(),from:`now-3h`},{label:MEe(),from:`now-6h`},{label:FEe(),from:`now-12h`},{label:REe(),from:`now-24h`},{label:VEe(),from:`now-2d`},{label:WEe(),from:`now-7d`},{label:qEe(),from:`now-30d`},{label:XEe(),from:`now-90d`}];function o7(e){return new Date(e).toLocaleString(`fr-FR`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function C2e(e){if(e.kind===`relative`){let t=a7.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${o7(e.from)} → ${o7(e.to)}`}function s7(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function c7(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function w2e(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}function l7(e){let[t,n]=(0,I.useState)(0);return(0,I.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,I.useMemo)(()=>{let{from:t,to:n}=i7(e);return e.kind===`absolute`?{from:t,to:n}:{from:u7(t),to:u7(n)}},[e,t])}function u7(e){return Math.floor(e/6e4)*6e4}function d7({value:e,onChange:t}){let[n,r]=(0,I.useState)(!1),[i,a]=(0,I.useState)(``),o=i7(e),[s,c]=(0,I.useState)(()=>s7(o.from)),[l,u]=(0,I.useState)(()=>s7(o.to));function d(t){if(t){let t=i7(e);c(s7(t.from)),u(s7(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=c7(s),n=c7(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,I.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?a7:a7.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),h=c7(s)!==null&&c7(l)!==null;return(0,z.jsxs)(UE,{open:n,onOpenChange:d,children:[(0,z.jsx)(WE,{asChild:!0,children:(0,z.jsxs)(X,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,z.jsx)(oee,{}),C2e(e)]})}),(0,z.jsx)(GE,{children:(0,z.jsx)(KE,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,z.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,z.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,z.jsx)(`div`,{className:`oc-timerange__section-title`,children:`Plage absolue`}),(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:`De`}),(0,z.jsx)(n0,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:`À`}),(0,z.jsx)(n0,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,z.jsx)(X,{size:`sm`,className:`oc-timerange__apply`,disabled:!h,onClick:p,children:`Appliquer`})]}),(0,z.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,z.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,z.jsx)(Cm,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,z.jsx)(n0,{value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher une plage`,"aria-label":`Rechercher une plage relative`})]}),(0,z.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,z.jsx)(`li`,{className:`oc-timerange__empty`,children:`Aucune plage.`}):m.map(t=>(0,z.jsx)(`li`,{children:(0,z.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}var T2e=250;function f7({q:e,onQChange:t,searchPlaceholder:n=xMe(),children:r,timeRange:i,onTimeRangeChange:a,onReset:o,canReset:s=!0}){let[c,l]=(0,I.useState)(e);(0,I.useEffect)(()=>{l(e)},[e]);let u=(0,I.useRef)(null);function d(e){l(e),u.current!==null&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>t(e),T2e)}(0,I.useEffect)(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]);function f(){u.current!==null&&window.clearTimeout(u.current),o()}return(0,z.jsxs)(`div`,{className:`oc-filterbar`,children:[(0,z.jsxs)(`div`,{className:`oc-filterbar__search`,children:[(0,z.jsx)(Cm,{className:`oc-filterbar__search-icon`,"aria-hidden":!0}),(0,z.jsx)(n0,{value:c,onChange:e=>d(e.target.value),placeholder:n,"aria-label":n})]}),r?(0,z.jsx)(`div`,{className:`oc-filterbar__quick`,children:r}):null,i&&a?(0,z.jsx)(d7,{value:i,onChange:a}):null,(0,z.jsxs)(X,{variant:`ghost`,size:`sm`,className:`oc-filterbar__reset`,onClick:f,disabled:!s,children:[(0,z.jsx)(Sm,{}),wMe()]})]})}var E2e=[{value:`eq`,label:`=`},{value:`neq`,label:`≠`},{value:`contains`,label:uAe()},{value:`gt`,label:`>`},{value:`gte`,label:`≥`},{value:`lt`,label:`<`},{value:`lte`,label:`≤`}],p7=1;function D2e(){return{id:p7++,field:``,op:`eq`,value:``}}function O2e(e){return e.map(e=>({id:p7++,field:e.field,op:e.op,value:String(e.value)}))}function m7({fields:e,seed:t,onChange:n}){let r=(0,I.useRef)(t),i=!!(r.current&&r.current.length>0),[a,o]=(0,I.useState)(i),[s,c]=(0,I.useState)(()=>i?O2e(r.current):[]);function l(e){n(e.filter(e=>e.field!==``&&e.value!==``).map(e=>({field:e.field,op:e.op,value:w2e(e.value)})))}function u(e,t){let n=s.map(n=>n.id===e?{...n,...t}:n);c(n),l(n)}function d(){c(e=>[...e,D2e()])}function f(e){let t=s.filter(t=>t.id!==e);c(t),l(t)}let p=s.filter(e=>e.field!==``&&e.value!==``).length;return(0,z.jsxs)(`div`,{className:`oc-advfilter`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`oc-advfilter__toggle`,"aria-expanded":a,onClick:()=>o(e=>!e),children:[(0,z.jsx)(om,{className:`oc-advfilter__chevron`+(a?` is-open`:``),"aria-hidden":!0}),pAe(),p>0?(0,z.jsx)(`span`,{className:`oc-advfilter__count`,children:p}):null]}),a?(0,z.jsxs)(`div`,{className:`oc-advfilter__body`,children:[s.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:gAe()}):(0,z.jsx)(`ul`,{className:`oc-advfilter__rows`,children:s.map(t=>(0,z.jsxs)(`li`,{className:`oc-advfilter__row`,children:[(0,z.jsxs)($3,{value:t.field||void 0,onValueChange:e=>u(t.id,{field:e}),children:[(0,z.jsx)(t6,{size:`sm`,className:`w-40`,children:(0,z.jsx)(e6,{placeholder:yAe()})}),(0,z.jsx)(n6,{children:e.map(e=>(0,z.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),(0,z.jsxs)($3,{value:t.op,onValueChange:e=>u(t.id,{op:e}),children:[(0,z.jsx)(t6,{size:`sm`,className:`w-28`,children:(0,z.jsx)(e6,{})}),(0,z.jsx)(n6,{children:E2e.map(e=>(0,z.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),(0,z.jsx)(n0,{className:`oc-advfilter__value`,value:t.value,onChange:e=>u(t.id,{value:e.target.value}),placeholder:SAe()}),(0,z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":TAe(),onClick:()=>f(t.id),children:(0,z.jsx)(jm,{})})]},t.id))}),(0,z.jsxs)(X,{variant:`outline`,size:`sm`,className:`oc-advfilter__add`,onClick:d,children:[(0,z.jsx)(xm,{}),OAe()]})]}):null]})}var k2e=[`eq`,`neq`,`contains`,`gt`,`gte`,`lt`,`lte`],h7=[50,100,200,500],g7=`now-30d`,A2e=`now-24h`;function _7(e,t,n=g7,r=`now`){let i=e??n,a=t??r,o=Number(i),s=Number(a);return i!==``&&a!==``&&Number.isFinite(o)&&Number.isFinite(s)?{kind:`absolute`,from:o,to:s}:{kind:`relative`,from:i,to:a}}function v7(e){return e.kind===`absolute`?{from:String(e.from),to:String(e.to)}:{from:e.from,to:e.to}}function y7(e){if(e.length!==0)return JSON.stringify(e)}function b7(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];let n=[];for(let e of t){if(typeof e!=`object`||!e)continue;let t=e,r=t.field,i=t.op,a=t.value;typeof r!=`string`||r===``||typeof i!=`string`||!k2e.includes(i)||typeof a!=`string`&&typeof a!=`number`&&typeof a!=`boolean`||n.push({field:r,op:i,value:a})}return n}var x7=zf().optional(),S7=zf().optional(),C7=zf().optional(),w7=zf().optional().catch(void 0),j2e=gp({q:x7,kind:zf().default(`all`).catch(`all`),limit:Jp().pipe(vp([wp(h7[0]),wp(h7[1]),wp(h7[2]),wp(h7[3])])).catch(100),statusClass:Sp([`2xx`,`4xx`,`5xx`]).optional().catch(void 0),principalType:Sp([`user`,`service`,`system`]).optional().catch(void 0),direction:Sp([`inbound`,`outbound`,`internal`]).optional().catch(void 0),roleKey:w7,from:S7,to:S7,adv:C7}),M2e=gp({q:x7,action:w7,impersonated:Sp([`yes`,`no`]).optional().catch(void 0),resource:w7,from:S7,to:S7,adv:C7}),N2e=gp({q:x7,status:Sp([`open`,`acknowledged`,`resolved`,`all`]).default(`open`).catch(`open`),severity:Sp([`info`,`warn`,`critical`]).optional().catch(void 0),kind:w7,from:S7,to:S7}),P2e=gp({from:S7,to:S7}),F2e=gp({q:x7,status:Sp([`active`,`disabled`]).optional().catch(void 0)}),I2e=gp({q:x7,role:w7});gp({q:x7,mode:Sp([`per-user`,`shared`]).optional().catch(void 0)});var L2e={kind:`relative`,from:g7,to:`now`},T7=`__all__`,E7=[`users`,`groups`,`instances`,`bridge`,`serviceAccounts`,`roles`,`access`,`traces`,`kpi`,`anomalies`,`files`,`agentFiles`,`preferences`,`integrations`,`theme`,`chatDefaults`,`audit`,`feedbacks`],D7=[`groups`,`access`,`roles`,`integrations`,`instances`,`bridge`,`theme`,`feedbacks`,`files`,`agentFiles`,`preferences`,`chatDefaults`],O7={groups:`Groupes`,access:`Accès`,serviceAccounts:`Comptes de service`,roles:`Rôles`,traces:`Traces`,kpi:`KPI`,anomalies:`Anomalies`,integrations:`Intégrations`,feedbacks:`Feedbacks`,bridge:`Bridge`,files:`Fichiers`,agentFiles:`Fichiers d'agent`,theme:`Apparence`,preferences:`Préférences`},k7={users:`admin.manage`,groups:`groups.manage`,instances:`admin.manage`,bridge:`bridge.read`,serviceAccounts:`admin.manage`,roles:`admin.manage`,access:`admin.manage`,traces:`traces.read`,kpi:`kpi.read`,anomalies:`anomalies.read`,files:`chats.read`,agentFiles:`agents.files.read`,preferences:`chats.read`,integrations:`admin.manage`,theme:`chats.read`,chatDefaults:`admin.manage`,audit:`admin.manage`,feedbacks:`admin.manage`},A7=[`traces`,`kpi`,`anomalies`,`bridge`,`agentFiles`];function j7(e){let t=new Set(e);return E7.filter(e=>t.has(k7[e]))}function M7(e){return`/settings/${e}`}function N7(e){let t=e.split(`/`)[2];return E7.includes(t)?t:void 0}var R2e={uiprefs:`preferences`};function z2e({granted:e,onToggle:t}){let n=new Set(e),r=A7.filter(e=>n.has(k7[e])).length;return(0,z.jsxs)(H1,{children:[(0,z.jsx)(U1,{asChild:!0,children:(0,z.jsx)(X,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?tde():ide({count:r})})}),(0,z.jsxs)(W1,{align:`start`,className:`w-52`,children:[(0,z.jsx)(K1,{children:sde()}),A7.map(e=>{let r=k7[e];return(0,z.jsxs)(G1,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,z.jsx)(J5,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,z.jsx)(`span`,{children:O7[e]??e})]},e)})]})]})}function B2e(){let e=Lo({from:`/settings/users`}),t=Ro({from:`/settings/users`}),n=e.q??``,r=e.role??T7,i=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),a=e=>void t({search:t=>({...t,role:e===T7?void 0:e})}),o=L(H.admin.listUsers,{filter:{q:n||void 0,role:r===T7?void 0:r}}),s=L(H.me.getMe),c=R(H.admin.setRole),l=R(H.admin.setUserPermissions),u=R(H.admin.startImpersonation),d=R(H.admin.deleteUser),f=R(H.admin.setUserName),p=y0(),m=b0(),h=S0(),[g,_]=(0,I.useState)(null),v=(0,I.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of o??[])e.add(t.role);return[...e]},[o]),y=n!==``||r!==T7;function b(){t({search:{},replace:!0})}async function x(e){try{await c(e)}catch(e){h.error(ude(),e)}}async function S(e){try{await l(e)}catch(e){h.error(pde(),e)}}async function C(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await p({title:Pde(),description:Lde({user:t}),confirmWord:Bde(),confirmLabel:Ude(),destructive:!0}))try{await d({profileId:e._id}),h.success(Yde({user:t}))}catch(e){h.error(Kde(),e)}}async function w(e){let t=e.email||e.name||e.userId.slice(0,8),n=await m({title:tfe(),label:ife({user:t}),placeholder:sfe(),defaultValue:e.name??``,confirmLabel:b$()});if(n!==null)try{await f({profileId:e._id,name:n}),h.success(ufe())}catch(e){h.error(pfe(),e)}}return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(f7,{q:n,onQChange:i,searchPlaceholder:gde(),onReset:b,canReset:y,children:(0,z.jsxs)($3,{value:r,onValueChange:a,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-36`,children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:T7,children:yde()}),v.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]})}),(0,z.jsx)(t7,{title:Sde(),rows:o,emptyHint:Tde(),rowActions:e=>{let t=[{label:Qde(),onSelect:()=>void w(e)}];return e.userId!==s?.userId&&t.push({label:Ode(),onSelect:()=>void u({profileId:e._id})},{label:jde(),variant:`destructive`,onSelect:()=>void C(e)}),t},columns:[{header:gfe(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,z.jsx)(`span`,{children:t}),n?(0,z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})}},{header:yfe(),cell:e=>(0,z.jsxs)($3,{value:e.role,onValueChange:t=>void x({profileId:e._id,role:t}),children:[(0,z.jsx)(t6,{size:`sm`,className:`w-28`,children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:`pending`,children:`pending`}),(0,z.jsx)(Q,{value:`user`,children:`user`}),(0,z.jsx)(Q,{value:`admin`,children:`admin`})]})]})},{header:Sfe(),cell:e=>e.role===`admin`?(0,z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:Tfe()}):(0,z.jsx)(z2e,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),S({profileId:e._id,permissions:[...n]})}})},{header:v$(),cell:e=>(0,z.jsx)(X,{variant:`outline`,size:`sm`,className:`h-8 font-normal`,onClick:()=>_({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)}),children:Afe()})}]}),(0,z.jsx)(x2e,{profileId:g?.profileId??null,userLabel:g?.label??``,open:g!==null,onOpenChange:e=>{e||_(null)}})]})}var P7={name:``,gatewayUrl:``,displayName:``,kind:`openclaw`};function V2e(){let e=L(H.admin.listInstances,{}),t=R(H.admin.upsertInstance),n=R(H.admin.deleteInstance),r=S0(),[i,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(P7),[c,l]=(0,I.useState)(null);async function u(){try{await t({name:o.name,gatewayUrl:o.gatewayUrl,displayName:o.displayName||void 0,kind:o.kind}),s(P7),a(!1)}catch(e){r.error(Nfe(),e)}}return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ife(),(0,z.jsx)(`strong`,{children:zfe()}),Hfe()]}),(0,z.jsx)(t7,{title:Gfe(),rows:e,addLabel:Jfe(),onAdd:()=>{s(P7),a(!0)},emptyHint:Zfe(),columns:[{header:epe(),cell:e=>e.name},{header:rpe(),cell:e=>(0,z.jsx)($,{variant:`outline`,children:e.kind??`openclaw`})},{header:ope(),cell:e=>e.gatewayUrl},{header:lpe(),cell:e=>e.displayName??`—`},{header:v$(),cell:e=>(0,z.jsx)(X,{variant:`outline`,size:`sm`,className:`h-8 font-normal`,onClick:()=>l(e.name),children:fpe()})}],rowActions:e=>[{label:y$(),variant:`destructive`,onSelect:()=>void n({instanceId:e._id})}],bulkActions:[{label:y$(),variant:`destructive`,onSelect:e=>e.forEach(e=>void n({instanceId:e}))}]}),(0,z.jsx)(A5,{open:i,onOpenChange:a,title:_pe(),description:bpe(),canSubmit:!!(o.name&&o.gatewayUrl),onSubmit:u,submitLabel:b$(),children:(0,z.jsxs)(`div`,{className:`oc-form`,children:[(0,z.jsx)(F7,{label:Tpe(),children:(0,z.jsx)(n0,{value:o.name,onChange:e=>s({...o,name:e.target.value})})}),(0,z.jsx)(F7,{label:Ope(),children:(0,z.jsxs)($3,{value:o.kind,onValueChange:e=>s({...o,kind:e}),children:[(0,z.jsx)(t6,{size:`sm`,className:`w-40`,children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:`openclaw`,children:`OpenClaw`}),(0,z.jsx)(Q,{value:`hermes`,children:`Hermes`})]})]})}),(0,z.jsx)(F7,{label:jpe(),children:(0,z.jsx)(n0,{value:o.gatewayUrl,onChange:e=>s({...o,gatewayUrl:e.target.value})})}),(0,z.jsx)(F7,{label:Ppe(),children:(0,z.jsx)(n0,{value:o.displayName,onChange:e=>s({...o,displayName:e.target.value})})})]})}),(0,z.jsx)(H2e,{instanceName:c,open:c!==null,onOpenChange:e=>{e||l(null)}})]})}function H2e({instanceName:e,open:t,onOpenChange:n}){let r=L(H.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`);return(0,z.jsx)(d0,{open:t,onOpenChange:n,children:(0,z.jsxs)(f0,{children:[(0,z.jsxs)(p0,{children:[(0,z.jsx)(h0,{children:Lpe({name:e??``})}),(0,z.jsxs)(g0,{children:[Bpe(),(0,z.jsx)(`code`,{children:`agents.list`}),Upe()]})]}),r===void 0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:Kpe()}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?Ype():r.discovery.lastPollOk?Qpe():tme({error:r.discovery.error??`?`})}),r.agents.length===0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:ime()}):(0,z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>(0,z.jsxs)(`div`,{className:`oc-access__row`,children:[(0,z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,z.jsx)($,{variant:`outline`,children:sme()}):null,e.presentInLastOk===!1?(0,z.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:ume()}):null]},e.agentId))})]})]})})}function F7({label:e,children:t}){return(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}var U2e=[{value:`action`,label:`action`},{value:`realLabel`,label:`acteur réel`},{value:`targetLabel`,label:`au nom de`},{value:`impersonated`,label:`usurpation`},{value:`resource`,label:`ressource`},{value:`resourceId`,label:`id ressource`}];function W2e(){let e=Lo({from:`/settings/audit`}),t=Ro({from:`/settings/audit`}),n=e.q??``,r=e.action??T7,i=e.impersonated??T7,a=e.resource??T7,o=_7(e.from,e.to),s=(0,I.useMemo)(()=>b7(e.adv),[e.adv]),{from:c,to:l}=l7(o),u=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),d=e=>void t({search:t=>({...t,action:e===T7?void 0:e})}),f=e=>void t({search:t=>({...t,impersonated:e===T7?void 0:e})}),p=e=>void t({search:t=>({...t,resource:e===T7?void 0:e})}),m=e=>void t({search:t=>({...t,...v7(e)})}),h=e=>void t({search:t=>({...t,adv:y7(e)}),replace:!0}),g=L(H.admin.listAudit,{filter:{q:n||void 0,from:c,to:l,action:r===T7?void 0:r,resource:a===T7?void 0:a,impersonated:i===T7?void 0:i===`yes`,advanced:s.length>0?s:void 0}}),_=(0,I.useMemo)(()=>{let e=new Set;for(let t of g??[])e.add(t.action);return[...e].sort()},[g]),v=(0,I.useMemo)(()=>{let e=new Set;for(let t of g??[])t.resource&&e.add(t.resource);return[...e].sort()},[g]),y=n!==``||r!==T7||i!==T7||a!==T7||s.length>0||o.kind!==`relative`||o.from!==L2e.from;function b(){t({search:{},replace:!0})}return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`oc-admin__hint`,children:[pme(),` `,(0,z.jsx)(`span`,{className:`oc-filter__window`,children:gme()})]}),(0,z.jsxs)(f7,{q:n,onQChange:u,searchPlaceholder:yme(),timeRange:o,onTimeRangeChange:m,onReset:b,canReset:y,children:[(0,z.jsxs)($3,{value:r,onValueChange:d,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-40`,children:(0,z.jsx)(e6,{placeholder:x$()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:T7,children:wme()}),_.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]}),(0,z.jsxs)($3,{value:i,onValueChange:f,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-40`,children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:T7,children:Dme()}),(0,z.jsx)(Q,{value:`yes`,children:Ame()}),(0,z.jsx)(Q,{value:`no`,children:Nme()})]})]}),(0,z.jsxs)($3,{value:a,onValueChange:p,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-40`,children:(0,z.jsx)(e6,{placeholder:S$()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:T7,children:Rme()}),v.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]})]}),(0,z.jsx)(m7,{fields:U2e,seed:s,onChange:h}),(0,z.jsx)(t7,{title:Vme(),rows:g,emptyHint:Wme(),columns:[{header:qme(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`)},{header:x$(),cell:e=>e.action},{header:Xme(),cell:e=>e.realLabel},{header:$me(),cell:e=>e.targetLabel??`—`},{header:S$(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`}]})]})}var G2e={pending:Nge,user:Ige,admin:zge,observer:Hge,agent:Gge};function I7(e){if(e.builtin){let t=G2e[e.key];if(t)return t()}return e.description}var L7=[{value:`never`,label:()=>wU(),days:null},{value:`30`,label:()=>DU(),days:30},{value:`90`,label:()=>AU(),days:90}],K2e=720*60*60*1e3,R7=`__all__`,z7={name:``,roleKey:``,description:``};function q2e(){let e=Lo({from:`/settings/serviceAccounts`}),t=Ro({from:`/settings/serviceAccounts`}),n=e.q??``,r=e.status??R7,[i,a]=(0,I.useState)(R7),o=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),s=e=>void t({search:t=>({...t,status:e===R7?void 0:e})}),c=L(H.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:i===R7?void 0:i,disabled:r===R7?void 0:r===`disabled`}}),l=L(H.apiKeys.listKeys,{}),u=L(H.apiKeys.listRoles,{}),d=R(H.apiKeys.createServiceAccount),f=R(H.apiKeys.updateServiceAccount),p=R(H.apiKeys.deleteServiceAccount),m=An(H.apiKeys.mintApiKey),h=R(H.apiKeys.revokeApiKey),g=y0(),_=S0(),v=n!==``||i!==R7||r!==R7;function y(){a(R7),t({search:{},replace:!0})}let[b,x]=(0,I.useState)(!1),[S,C]=(0,I.useState)(z7),[w,T]=(0,I.useState)(null),[E,D]=(0,I.useState)(new Set),[O,k]=(0,I.useState)(null),A=(0,I.useRef)(!1),[j,M]=(0,I.useState)(new Set),[N,ee]=(0,I.useState)({}),[te,P]=(0,I.useState)(null),F=(0,I.useMemo)(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[l]);function ne(e){D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function re(){try{w?(await f({serviceAccountId:w,name:S.name,roleKey:S.roleKey,description:S.description}),_.success(IV())):await d({name:S.name,roleKey:S.roleKey,description:S.description||void 0}),C(z7),T(null),x(!1)}catch(e){_.error(w?NV():AV(),e)}}function ie(e){C({name:e.name,roleKey:e.roleKey,description:e.description??``}),T(e._id),x(!0)}async function ae(e){if(A.current)return;A.current=!0;let t=N[e._id]??`never`,n=L7.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;k(e._id);try{let t=await m({serviceAccountId:e._id,expiresAt:r});P({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){_.error(zV(),e)}finally{A.current=!1,k(null)}}async function oe(e){if(await g({title:HV(),description:(0,z.jsxs)(z.Fragment,{children:[GV(),` `,(0,z.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,JV(),` `,(0,z.jsx)(`strong`,{children:ZV()}),` `,eH()]}),confirmWord:e.name,confirmLabel:rH(),destructive:!0}))try{await p({serviceAccountId:e._id}),_.success(oH(),e.name)}catch(e){_.error(lH(),e)}}async function se(e){if(await g({title:fH(),description:(0,z.jsxs)(z.Fragment,{children:[hH(),` `,(0,z.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,vH()]}),confirmLabel:xH(),destructive:!0})&&!j.has(e._id)){M(t=>new Set(t).add(e._id));try{await h({keyId:e._id})}catch(e){_.error(wH(),e)}finally{M(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:Iz()}),(0,z.jsxs)(f7,{q:n,onQChange:o,searchPlaceholder:zz(),onReset:y,canReset:v,children:[(0,z.jsxs)($3,{value:i,onValueChange:a,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-40`,children:(0,z.jsx)(e6,{placeholder:Hz()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:R7,children:Gz()}),(u??[]).map(e=>(0,z.jsx)(Q,{value:e.key,children:e.key},e._id))]})]}),(0,z.jsxs)($3,{value:r,onValueChange:s,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-36`,children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:R7,children:Jz()}),(0,z.jsx)(Q,{value:`active`,children:Zz()}),(0,z.jsx)(Q,{value:`disabled`,children:eB()})]})]})]}),(0,z.jsx)(t7,{title:rB(),rows:c,addLabel:oB(),onAdd:()=>{C(z7),T(null),x(!0)},emptyHint:lB(),isExpanded:e=>E.has(e._id),renderExpanded:e=>(0,z.jsx)(J2e,{account:e,keys:F.get(e._id)??[],onRevoke:se,revoking:j}),rowActions:e=>[{label:xB(),onSelect:()=>ie(e)},{label:fB(),onSelect:()=>void ae(e)},{label:E.has(e._id)?hB():vB(),onSelect:()=>ne(e._id)},{label:wB(),variant:`destructive`,onSelect:()=>void oe(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":E.has(e._id)?DB():AB(),onClick:()=>ne(e._id),children:E.has(e._id)?(0,z.jsx)(om,{}):(0,z.jsx)(sm,{})})},{header:NB(),cell:e=>(0,z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,z.jsx)(`span`,{children:e.name}),e.description?(0,z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:IB(),cell:e=>(0,z.jsx)($,{variant:`secondary`,children:e.roleKey})},{header:zB(),cell:e=>e.disabled?(0,z.jsx)($,{variant:`destructive`,children:eB()}):(0,z.jsx)($,{variant:`outline`,children:Zz()})},{header:HB(),cell:e=>(0,z.jsxs)($3,{value:N[e._id]??`never`,onValueChange:t=>ee(n=>({...n,[e._id]:t})),children:[(0,z.jsx)(t6,{size:`sm`,className:`w-32`,children:(0,z.jsx)(e6,{})}),(0,z.jsx)(n6,{children:L7.map(e=>(0,z.jsx)(Q,{value:e.value,children:e.label()},e.value))})]})},{header:GB(),cell:e=>{let t=(F.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,z.jsx)(`span`,{className:`oc-sa__keycount`,children:O===e._id?JB():ZB({count:t})})}}]}),(0,z.jsx)(A5,{open:b,onOpenChange:e=>{x(e),e||T(null)},title:w?eV():lV(),description:w?rV():fV(),canSubmit:!!(S.name&&S.roleKey),onSubmit:re,submitLabel:w?oV():hV(),children:(0,z.jsxs)(`div`,{className:`oc-form`,children:[(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:vV()}),(0,z.jsx)(n0,{value:S.name,onChange:e=>C({...S,name:e.target.value})})]}),(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:xV()}),(0,z.jsxs)($3,{value:S.roleKey||void 0,onValueChange:e=>C({...S,roleKey:e}),children:[(0,z.jsx)(t6,{className:`w-full`,children:(0,z.jsx)(e6,{placeholder:wV()})}),(0,z.jsx)(n6,{children:(u??[]).map(e=>(0,z.jsxs)(Q,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(u??[]).find(e=>e.key===S.roleKey),t=e?I7(e):null;return t?(0,z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:DV()}),(0,z.jsx)(n0,{value:S.description,onChange:e=>C({...S,description:e.target.value})})]})]})}),(0,z.jsx)(Y2e,{minted:te,onClose:()=>P(null)})]})}function J2e({account:e,keys:t,onRevoke:n,revoking:r}){return(0,z.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,z.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[DH(),` `,(0,z.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:AH()}):(0,z.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{children:NH()}),(0,z.jsx)(`th`,{children:IH()}),(0,z.jsx)(`th`,{children:zH()}),(0,z.jsx)(`th`,{children:HH()}),(0,z.jsx)(`th`,{children:GH()}),(0,z.jsx)(`th`,{children:JH()}),(0,z.jsx)(`th`,{})]})}),(0,z.jsx)(`tbody`,{children:t.map(t=>(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`td`,{children:(0,z.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,z.jsx)(`td`,{children:(0,z.jsx)($,{variant:`secondary`,children:e.roleKey})}),(0,z.jsx)(`td`,{children:X2e(t.createdAt)}),(0,z.jsx)(`td`,{className:Z2e(t.lastUsedAt)?`oc-sa__stale`:``,children:Q2e(t.lastUsedAt)}),(0,z.jsx)(`td`,{children:$2e(t.expiresAt)}),(0,z.jsx)(`td`,{children:e4e(t)}),(0,z.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,z.jsx)(X,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?ZH():eU()})})]},t._id))})]})]})}function Y2e({minted:e,onClose:t}){let[n,r]=(0,I.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,z.jsx)(d0,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,z.jsxs)(f0,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,z.jsxs)(p0,{children:[(0,z.jsx)(h0,{children:rU()}),(0,z.jsx)(g0,{children:oU({name:e.accountName})})]}),(0,z.jsx)(`div`,{className:`oc-sa__minted-warning`,children:lU()}),(0,z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,z.jsxs)(X,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":fU(),children:[n?(0,z.jsx)(am,{}):(0,z.jsx)(dm,{}),n?hU():vU()]})]}),(0,z.jsx)(m0,{children:(0,z.jsx)(X,{onClick:()=>{r(!1),t()},children:xU()})})]}):null})}function X2e(e){return new Date(e).toLocaleString(`fr-FR`)}function Z2e(e){return e===null?!1:Date.now()-e>K2e}function Q2e(e){return e===null?NU():new Date(e).toLocaleString(`fr-FR`)}function $2e(e){return e===null?`—`:new Date(e).toLocaleDateString(`fr-FR`)}function e4e(e){return e.disabled?(0,z.jsx)($,{variant:`destructive`,children:IU()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,z.jsx)($,{variant:`outline`,children:zU()}):(0,z.jsx)($,{variant:`outline`,children:HU()})}var B7=[{group:()=>nhe(),keys:[{key:`traces.read`,label:()=>C$()},{key:`traces.read.content`,label:()=>yhe(),phi:!0},{key:`traces.write`,label:()=>w$()}]},{group:()=>ahe(),keys:[{key:`kpi.read`,label:()=>C$()},{key:`kpi.write`,label:()=>w$()}]},{group:()=>che(),keys:[{key:`openclaw.query`,label:()=>whe()},{key:`anomalies.read`,label:()=>Dhe()},{key:`anomalies.report`,label:()=>Ahe()}]},{group:()=>dhe(),keys:[{key:`chats.read`,label:()=>C$()}]},{group:()=>mhe(),keys:[{key:`admin.manage`,label:()=>Nhe()}]}],t4e=B7.flatMap(e=>e.keys.map(e=>e.key));function V7(e){return e.includes(`*`)}var H7={key:``,name:``,description:``};function n4e(){let e=L(H.apiKeys.listRoles,{}),t=R(H.apiKeys.createRole),n=R(H.apiKeys.ensureRolesSeeded),r=R(H.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(H.apiKeys.listRoles,{});r&&e.setQuery(H.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),i=y0(),a=S0(),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(H7),[u,d]=(0,I.useState)(new Set);(0,I.useEffect)(()=>{n({}).catch(e=>{a.error(zhe(),e)})},[n,a]);let f=e??[];async function p(e,t){if(V7(e.permissions)||u.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await i({title:Hhe({name:e.name}),description:Ghe(),confirmLabel:Jhe()}))){d(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){a.error(Zhe(),e)}finally{d(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function m(){try{await t({key:c.key,name:c.name,description:c.description||void 0,permissions:[]}),l(H7),s(!1)}catch(e){a.error(ege(),e)}}let h=e===void 0,g=!h&&f.length===0;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`oc-admin__hint`,children:[rge(),` `,(0,z.jsx)(`code`,{children:`admin`}),` `,oge(),` `,(0,z.jsx)(`code`,{children:`traces.read.content`}),` `,lge()]}),(0,z.jsxs)(`div`,{className:`oc-dt`,children:[(0,z.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,z.jsx)(`h2`,{className:`oc-dt__title`,children:fge()}),(0,z.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,z.jsx)(X,{size:`sm`,onClick:()=>{l(H7),s(!0)},children:hge()})})]}),h?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:vge()}):g?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:xge()}):(0,z.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,z.jsxs)(`table`,{className:`oc-matrix`,children:[(0,z.jsxs)(`thead`,{children:[(0,z.jsxs)(`tr`,{children:[(0,z.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:wge()}),B7.map(e=>(0,z.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,z.jsx)(`tr`,{children:B7.flatMap(e=>e.keys.map(e=>(0,z.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?Ihe({key:e.key}):e.key,children:[e.label(),e.phi?(0,z.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,z.jsx)(`tbody`,{children:f.map(e=>{let t=V7(e.permissions),n=u.has(e._id);return(0,z.jsxs)(`tr`,{children:[(0,z.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,z.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,z.jsx)(`span`,{children:e.name}),(0,z.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,z.jsxs)($,{variant:`outline`,className:`gap-1`,children:[(0,z.jsx)(gm,{}),` `,Dge()]}):(0,z.jsx)($,{variant:`secondary`,children:Age()})]}),I7(e)?(0,z.jsx)(`p`,{className:`oc-matrix__roledesc`,children:I7(e)}):null]}),t4e.map(r=>(0,z.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,z.jsx)(J5,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?Jge():n?Zge():r,onCheckedChange:()=>void p(e,r)})},r))]},e.key)})})]})})]}),(0,z.jsx)(A5,{open:o,onOpenChange:s,title:e_e(),description:r_e(),canSubmit:!!(c.key&&c.name),onSubmit:m,submitLabel:o_e(),children:(0,z.jsxs)(`div`,{className:`oc-form`,children:[(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:l_e()}),(0,z.jsx)(n0,{value:c.key,placeholder:f_e(),onChange:e=>l({...c,key:e.target.value})})]}),(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:h_e()}),(0,z.jsx)(n0,{value:c.name,onChange:e=>l({...c,name:e.target.value})})]}),(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:v_e()}),(0,z.jsx)(n0,{value:c.description,onChange:e=>l({...c,description:e.target.value})})]})]})})]})}var U7={name:``,description:``};function r4e(){let e=L(H.groups.listGroups,{}),t=R(H.groups.createGroup),n=R(H.groups.updateGroup),r=R(H.groups.deleteGroup),i=y0(),a=S0(),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(null),[u,d]=(0,I.useState)(U7),[f,p]=(0,I.useState)(null);function m(){l(null),d(U7),s(!0)}function h(e){l(e),d({name:e.name,description:e.description??``}),s(!0)}async function g(){try{c?await n({groupId:c._id,name:u.name,description:u.description}):await t({name:u.name,description:u.description||void 0}),d(U7),l(null),s(!1)}catch(e){a.error(WRe(),e)}}async function _(e){if(await i({title:YLe({name:e.name}),description:QLe(),confirmWord:e.name,confirmLabel:tRe(),cancelLabel:jLe(),destructive:!0}))try{await r({groupId:e._id})}catch(e){a.error(qRe(),e)}}return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:QIe()}),(0,z.jsx)(t7,{title:YIe(),rows:e,addLabel:tLe(),onAdd:m,emptyHint:iLe(),columns:[{header:sLe(),cell:e=>e.name},{header:uLe(),cell:e=>(0,z.jsxs)($,{variant:`outline`,className:`gap-1`,children:[(0,z.jsx)(km,{size:12,"aria-hidden":!0}),e.memberCount]})},{header:pLe(),cell:e=>(0,z.jsxs)($,{variant:`outline`,className:`gap-1`,children:[(0,z.jsx)(wm,{size:12,"aria-hidden":!0}),e.agentCount]})},{header:gLe(),cell:e=>(0,z.jsx)(X,{variant:`outline`,size:`sm`,className:`h-8 font-normal`,onClick:()=>p({groupId:e._id,name:e.name}),children:yLe()})}],rowActions:e=>[{label:SLe(),onSelect:()=>h(e)},{label:TLe(),variant:`destructive`,onSelect:()=>void _(e)}]}),(0,z.jsx)(A5,{open:o,onOpenChange:s,title:c?LLe():PLe(),description:BLe(),canSubmit:!!u.name.trim(),onSubmit:g,submitLabel:OLe(),children:(0,z.jsxs)(`div`,{className:`oc-form`,children:[(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:ULe()}),(0,z.jsx)(n0,{value:u.name,onChange:e=>d({...u,name:e.target.value})})]}),(0,z.jsxs)(`label`,{className:`oc-field`,children:[(0,z.jsx)(`span`,{className:`oc-field__label`,children:KLe()}),(0,z.jsx)(n0,{value:u.description,onChange:e=>d({...u,description:e.target.value})})]})]})}),(0,z.jsx)(i4e,{groupId:f?.groupId??null,groupName:f?.name??``,open:f!==null,onOpenChange:e=>{e||p(null)}})]})}function i4e({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=L(H.groups.getGroup,n&&e?{groupId:e}:`skip`),a=L(H.admin.listInstances,n?{}:`skip`),o=L(H.admin.listUsers,n?{}:`skip`),s=R(H.groups.addMember),c=R(H.groups.removeMember),l=S0(),u=(0,I.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),d=(0,I.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);async function f(t,n){if(e)try{n?await c({groupId:e,userId:t}):await s({groupId:e,userId:t})}catch(e){l.error(XRe(),e)}}return(0,z.jsx)(d0,{open:n,onOpenChange:r,children:(0,z.jsxs)(f0,{className:`oc-access`,children:[(0,z.jsxs)(p0,{children:[(0,z.jsx)(h0,{children:iRe({name:t})}),(0,z.jsx)(g0,{children:sRe()})]}),(0,z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,z.jsx)(km,{size:13,"aria-hidden":!0}),(0,z.jsx)(`span`,{children:uRe()})]}),o===void 0||i===void 0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:G$()}):o.length===0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:wRe()}):(0,z.jsx)(`div`,{className:`oc-access__list`,children:o.map(e=>{let t=u.has(e.userId),n=e.email||e.name||e.canonical||e.userId.slice(0,8);return(0,z.jsxs)(`div`,{className:`oc-access__row`,children:[(0,z.jsx)(J5,{checked:t,onCheckedChange:()=>void f(e.userId,t),"aria-label":pRe({user:n})}),(0,z.jsx)(`span`,{className:`oc-access__label`,children:n})]},e._id)})})]}),(0,z.jsx)(`div`,{className:`oc-access__list`,children:a===void 0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:G$()}):a.length===0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:DRe()}):a.map(t=>(0,z.jsx)(a4e,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:d},t._id))})]})})}function a4e({groupId:e,instanceName:t,kind:n,assigned:r}){let i=L(H.agents.listAgentsForInstance,{instanceName:t}),a=R(H.groups.assignAgentToGroup),o=R(H.groups.removeAgentFromGroup),s=S0();if(!e)return null;let c=(i?.agents??[]).filter(e=>e.source===`discovered`),l=i?.discovery&&!i.discovery.lastPollOk;async function u(n,r){try{r?await o({groupId:e,instanceName:t,agentId:n}):await a({groupId:e,instanceName:t,agentId:n})}catch(e){s.error($Re(),e)}}return(0,z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,z.jsx)(wm,{size:13,"aria-hidden":!0}),(0,z.jsx)(`span`,{children:t}),(0,z.jsx)($,{variant:`outline`,className:`oc-access__kind`,children:n}),l?(0,z.jsx)($,{variant:`outline`,className:`oc-access__stale`,children:IRe()}):null]}),i===void 0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:xRe()}):c.length===0?(0,z.jsx)(`p`,{className:`oc-access__hint`,children:l?NRe():ARe()}):c.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,z.jsxs)(`div`,{className:`oc-access__row`,children:[(0,z.jsx)(J5,{checked:i,disabled:a&&!i,onCheckedChange:()=>void u(e.agentId,i),"aria-label":gRe({name:e.displayName??e.agentId})}),(0,z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":K$(),title:K$(),children:(0,z.jsx)(Em,{size:14,fill:`currentColor`})}):null,a?(0,z.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:zRe()}):null]},e.agentId)})]})}var o4e=[50,100,200,500],W7=`all`,G7=`__all__`,s4e=[`2xx`,`4xx`,`5xx`],c4e=[`user`,`service`,`system`],l4e=[`inbound`,`outbound`,`internal`],u4e={kind:`relative`,from:`now-30d`,to:`now`},d4e=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:`latence (ms)`},{value:`principalType`,label:`principal`},{value:`direction`,label:`direction`},{value:`roleKey`,label:`rôle`},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function f4e(){let e=Lo({from:`/settings/traces`}),t=Ro({from:`/settings/traces`}),n=e.limit,r=e.kind,i=e.statusClass??G7,a=e.principalType??G7,o=e.direction??G7,s=e.roleKey??G7,c=e.q??``,l=_7(e.from,e.to),u=(0,I.useMemo)(()=>b7(e.adv),[e.adv]),{from:d,to:f}=l7(l),[p,m]=(0,I.useState)(null),[h,g]=(0,I.useState)(null),_=e=>void t({search:t=>({...t,limit:e})}),v=e=>void t({search:t=>({...t,kind:e})}),y=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),b=e=>void t({search:t=>({...t,statusClass:e===G7?void 0:e})}),x=e=>void t({search:t=>({...t,principalType:e===G7?void 0:e})}),S=e=>void t({search:t=>({...t,direction:e===G7?void 0:e})}),C=e=>void t({search:t=>({...t,roleKey:e===G7?void 0:e})}),w=e=>void t({search:t=>({...t,...v7(e)})}),T=e=>void t({search:t=>({...t,adv:y7(e)}),replace:!0}),E=L(H.observability.listEvents,{limit:n}),D=L(H.observability.listEvents,{limit:n,kind:r===W7?void 0:r,filter:{q:c||void 0,from:d,to:f,statusClass:i===G7?void 0:i,principalType:a===G7?void 0:a,direction:o===G7?void 0:o,roleKey:s===G7?void 0:s,advanced:u.length>0?u:void 0}}),O=(0,I.useMemo)(()=>{let e=new Set;for(let t of E??[])e.add(t.kind);return[...e].sort()},[E]),k=(0,I.useMemo)(()=>{let e=new Set;for(let t of E??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[E]),A=c!==``||i!==G7||a!==G7||o!==G7||s!==G7||u.length>0||l.kind!==`relative`||l.from!==u4e.from;function j(){t({search:{limit:100,kind:`all`},replace:!0})}let M=p?E?.filter(e=>e.correlationId===p):D;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`oc-admin__hint`,children:[dxe(),(0,z.jsx)(`strong`,{children:mxe()}),_xe(),` `,(0,z.jsx)(`span`,{className:`oc-filter__window`,children:bxe()})]}),(0,z.jsxs)(f7,{q:c,onQChange:y,searchPlaceholder:Cxe(),timeRange:l,onTimeRangeChange:w,onReset:j,canReset:A,children:[(0,z.jsxs)($3,{value:i,onValueChange:b,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-32`,children:(0,z.jsx)(e6,{placeholder:Exe()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:G7,children:kxe()}),s4e.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]}),(0,z.jsxs)($3,{value:a,onValueChange:x,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-32`,children:(0,z.jsx)(e6,{placeholder:Mxe()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:G7,children:Fxe()}),c4e.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]}),(0,z.jsxs)($3,{value:o,onValueChange:S,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-32`,children:(0,z.jsx)(e6,{placeholder:Rxe()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:G7,children:Vxe()}),l4e.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]}),(0,z.jsxs)($3,{value:s,onValueChange:C,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-36`,children:(0,z.jsx)(e6,{placeholder:Wxe()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:G7,children:qxe()}),k.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]}),(0,z.jsxs)($3,{value:r,onValueChange:v,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-44`,children:(0,z.jsx)(e6,{placeholder:Xxe()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:W7,children:$xe()}),O.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]}),(0,z.jsxs)($3,{value:String(n),onValueChange:e=>_(Number(e)),children:[(0,z.jsx)(t6,{size:`sm`,className:`w-28`,children:(0,z.jsx)(e6,{})}),(0,z.jsx)(n6,{children:o4e.map(e=>(0,z.jsx)(Q,{value:String(e),children:nSe({count:e})},e))})]})]}),(0,z.jsx)(m7,{fields:d4e,seed:u,onChange:T}),p?(0,z.jsx)(`div`,{className:`oc-traces__followline`,children:(0,z.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>m(null),title:aSe(),children:[(0,z.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[cSe(),(0,z.jsx)(`code`,{children:K7(p)})]}),(0,z.jsx)(jm,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`sr-only`,children:dSe()})]})}):null,(0,z.jsx)(t7,{title:mSe(),rows:M,emptyHint:p?_Se():bSe(),columns:[{header:CSe(),cell:e=>(0,z.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:ESe(),cell:e=>(0,z.jsx)($,{variant:`secondary`,children:e.kind})},{header:kSe(),cell:e=>{let t=m4e(e);return t?(0,z.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,z.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":MSe(),children:`✓`})}},{header:FSe(),cell:e=>e.direction?(0,z.jsx)($,{variant:`outline`,children:e.direction}):(0,z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:RSe(),cell:e=>(0,z.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,z.jsx)($,{variant:`outline`,children:e.principalType}),e.principalId?(0,z.jsx)(`code`,{className:`oc-traces__mono`,children:K7(e.principalId)}):null]})},{header:VSe(),cell:e=>e.roleKey?(0,z.jsx)($,{variant:`secondary`,children:e.roleKey}):(0,z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:WSe(),cell:e=>e.route?(0,z.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,z.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,z.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:qSe(),cell:e=>e.status===null?(0,z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,z.jsx)(`span`,{className:`oc-traces__status ${p4e(e.status)}`,children:e.status})},{header:XSe(),cell:e=>e.latencyMs===null?(0,z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,z.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:$Se(),cell:e=>e.correlationId?(0,z.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:nCe(),onClick:()=>m(e.correlationId),children:K7(e.correlationId)}):(0,z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:aCe(),cell:e=>e.meta?(0,z.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>g(e),children:cCe()}):(0,z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,z.jsx)(h4e,{row:h,onClose:()=>g(null)})]})}function p4e(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function K7(e){return e.length>8?e.slice(0,8):e}function m4e(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function h4e({row:e,onClose:t}){let n=(0,I.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,z.jsx)(d0,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,z.jsxs)(f0,{className:`max-w-lg`,children:[(0,z.jsxs)(p0,{children:[(0,z.jsxs)(h0,{className:`oc-traces__meta-title`,children:[dCe(),` `,(0,z.jsx)(`code`,{children:e.kind}),(0,z.jsx)($,{variant:`outline`,children:mCe()})]}),(0,z.jsx)(g0,{children:_Ce()})]}),(0,z.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}function q7({className:e,size:t=`default`,...n}){return(0,z.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:V1(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function J7({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`card-header`,className:V1(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function Y7({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`card-title`,className:V1(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function X7({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`card-description`,className:V1(`text-sm text-muted-foreground`,e),...t})}function Z7({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`card-content`,className:V1(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function g4e({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`card-footer`,className:V1(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}var Q7=[{metric:`api.calls`,label:$Ee(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:nDe(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:aDe(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:cDe(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:dDe(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:mDe(),unit:`/h`,group:`Assistant`,isError:!0}],$7=Q7.length,_4e=[`API`,`OpenClaw`,`Chat`,`Assistant`],v4e=1e3,y4e=36e5;function b4e(e,t){let n=Math.max(1,Math.ceil((t-e)/y4e)),r=Math.min(n*$7,v4e);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/$7))}}function x4e(){let e=Lo({from:`/settings/kpi`}),t=Ro({from:`/settings/kpi`}),n=_7(e.from,e.to,A2e,`now`),r=e=>void t({search:t=>({...t,...v7(e)})}),{from:i,to:a}=l7(n),{rowLimit:o,buckets:s}=b4e(i,a),c=L(H.kpi.listKpis,{limit:o,filter:{from:i,to:a}}),l=(0,I.useMemo)(()=>{let e=new Map;for(let t of c??[]){let n=e.get(t.metric)??[];n.push({bucket:t.bucket,value:t.value}),e.set(t.metric,n)}for(let[t,n]of e)n.sort((e,t)=>e.bucket<t.bucket?-1:+(e.bucket>t.bucket)),n.length>s&&e.set(t,n.slice(n.length-s));return e},[c,s]),u=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`oc-admin__hint`,children:[_De(),` `,(0,z.jsx)(`span`,{className:`oc-filter__window`,children:bDe()})]}),(0,z.jsx)(S4e,{value:n,onChange:r})]});return c===void 0?(0,z.jsxs)(z.Fragment,{children:[u,(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:CDe()})]}):c.length===0?(0,z.jsxs)(z.Fragment,{children:[u,(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:EDe()})]}):(0,z.jsxs)(z.Fragment,{children:[u,_4e.map(e=>{let t=Q7.filter(t=>t.group===e);return t.some(e=>(l.get(e.metric)??[]).length>0)?(0,z.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,z.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,z.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,z.jsx)(C4e,{config:e,series:l.get(e.metric)??[]},e.metric))})]},e):null})]})}function S4e({value:e,onChange:t}){return(0,z.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,z.jsx)(d7,{value:e,onChange:t})})}function C4e({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,r=n?n.value:0;return(0,z.jsxs)(q7,{size:`sm`,className:`oc-kpi__card`,children:[(0,z.jsxs)(J7,{children:[(0,z.jsx)(Y7,{className:`oc-kpi__card-title`,children:e.label}),(0,z.jsx)(X7,{className:`oc-kpi__card-metric`,children:(0,z.jsx)(`code`,{children:e.metric})})]}),(0,z.jsxs)(Z7,{className:`oc-kpi__card-body`,children:[(0,z.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,z.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&r>0?` oc-kpi__value--error`:``),children:n9(r)}),(0,z.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,z.jsx)(T4e,{series:t,isError:e.isError,unit:e.unit}),(0,z.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,z.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:kDe({value:r9(n.bucket)})}):(0,z.jsx)(`span`,{className:`oc-kpi__muted`,children:MDe()}),(0,z.jsx)(`span`,{className:`oc-kpi__muted`,children:FDe({count:t.length})})]})]})]})}var e9=240,t9=48,w4e=1;function T4e({series:e,isError:t,unit:n}){if(e.length===0)return(0,z.jsx)(`div`,{className:`oc-kpi__chart oc-kpi__chart--empty`,"aria-hidden":!0});let r=e.reduce((e,t)=>t.value>e?t.value:e,0),i=e9/e.length,a=Math.max(i-w4e,1);return(0,z.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${e9} ${t9}`,preserveAspectRatio:`none`,role:`img`,"aria-label":RDe({max:n9(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(t9-1):0,c=o*i,l=t9-s;return(0,z.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,z.jsxs)(`title`,{children:[r9(e.bucket),` · `,n9(e.value),` `,n]})},e.bucket)})})}function n9(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function r9(e){let t=new Date(`${e}:00:00Z`);return Number.isNaN(t.getTime())?e:`${String(t.getUTCDate()).padStart(2,`0`)}/${String(t.getUTCMonth()+1).padStart(2,`0`)} ${String(t.getUTCHours()).padStart(2,`0`)}h`}var i9={AGENT_NOT_FOUND:()=>({label:GMe(),hint:JMe()}),AUTH_TOKEN_MISMATCH:()=>({label:ZMe(),hint:eNe()}),DEVICE_SIGNING_FAILED:()=>({label:rNe(),hint:oNe()}),SESSION_SCOPE_DENIED:()=>({label:lNe(),hint:fNe()}),GATEWAY_TIMEOUT:()=>({label:hNe(),hint:vNe()}),GATEWAY_DISCONNECTED:()=>({label:xNe(),hint:wNe()}),BRIDGE_UNREACHABLE:()=>({label:DNe(),hint:ANe()}),INVALID_REQUEST:()=>({label:NNe(),hint:INe()}),NOT_CONFIGURED:()=>({label:zNe(),hint:HNe()}),UNROUTED:()=>({label:GNe(),hint:JNe()}),UPSTREAM_ERROR:()=>({label:ZNe(),hint:ePe()}),UNKNOWN:()=>({label:rPe(),hint:oPe()})};function a9(e){return e?i9[e]?.()??{label:e,hint:lPe()}:i9.UNKNOWN()}var o9=`__all__`,E4e=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function D4e(e){return e===`open`?x_e():e===`acknowledged`?w_e():D_e()}var O4e=[`info`,`warn`,`critical`],k4e=[`detector`,`agent`],A4e={kind:`relative`,from:`now-30d`,to:`now`},j4e=200,s9=`all`;function M4e(){let e=Lo({from:`/settings/anomalies`}),t=Ro({from:`/settings/anomalies`}),n=e.q??``,r=e.status===s9?o9:e.status,i=e.severity??o9,a=e.kind??o9,[o,s]=(0,I.useState)(o9),c=_7(e.from,e.to),{from:l,to:u}=l7(c),d=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),f=e=>void t({search:t=>({...t,status:e===o9?s9:e})}),p=e=>void t({search:t=>({...t,severity:e===o9?void 0:e})}),m=e=>void t({search:t=>({...t,kind:e===o9?void 0:e})}),h=e=>void t({search:t=>({...t,...v7(e)})}),g=y0(),_=S0(),v=R(H.anomalies.resolveAnomaly),y=(L(H.me.getMe)?.permissions??[]).includes(`admin.manage`),b=L(H.anomalies.listAnomalies,{limit:j4e,filter:{q:n||void 0,from:l,to:u,anomalyStatus:r===o9?void 0:r,severity:i===o9?void 0:i,source:o===o9?void 0:o,kind:a===o9?void 0:a}}),x=(0,I.useMemo)(()=>{let e=new Set;for(let t of b??[])e.add(t.kind);return[...e].sort()},[b]),S=n!==``||r!==`open`||i!==o9||o!==o9||a!==o9||c.kind!==`relative`||c.from!==A4e.from;function C(){s(o9),t({search:{status:`open`},replace:!0})}async function w(e){if(await g({title:A_e(),description:(0,z.jsxs)(z.Fragment,{children:[N_e(),` `,(0,z.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,I_e(),` `,(0,z.jsx)(`strong`,{children:z_e()}),`.`,` `,H_e()]}),confirmLabel:G_e()}))try{await v({anomalyId:e._id,status:`resolved`}),_.success(J_e(),e.kind)}catch(e){_.error(Z_e(),e)}}async function T(e){try{await v({anomalyId:e._id,status:`acknowledged`}),_.success(eve(),e.kind)}catch(e){_.error(rve(),e)}}return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`oc-admin__hint`,children:[ove(),` `,(0,z.jsx)(`strong`,{children:lve()}),` `,fve(),` `,(0,z.jsx)(`strong`,{children:hve()}),` `,vve(),` `,(0,z.jsx)(`strong`,{children:xve()}),` `,wve(),` `,(0,z.jsx)(`span`,{className:`oc-filter__window`,children:Dve()})]}),(0,z.jsxs)(f7,{q:n,onQChange:d,searchPlaceholder:Ave(),timeRange:c,onTimeRangeChange:h,onReset:C,canReset:S,children:[(0,z.jsxs)($3,{value:r,onValueChange:f,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-36`,children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:o9,children:Nve()}),E4e.map(e=>(0,z.jsx)(Q,{value:e.value,children:D4e(e.value)},e.value))]})]}),(0,z.jsxs)($3,{value:i,onValueChange:p,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-36`,children:(0,z.jsx)(e6,{placeholder:T$()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:o9,children:Rve()}),O4e.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]}),(0,z.jsxs)($3,{value:o,onValueChange:s,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-32`,children:(0,z.jsx)(e6,{placeholder:E$()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:o9,children:Uve()}),k4e.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]}),(0,z.jsxs)($3,{value:a,onValueChange:m,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-36`,children:(0,z.jsx)(e6,{placeholder:D$()})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:o9,children:Jve()}),x.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]})]}),(0,z.jsx)(t7,{title:Zve(),rows:b,emptyHint:r===`open`?eye():rye(),rowActions:e=>y&&e.status===`open`?[{label:oye(),onSelect:()=>void w(e)},{label:lye(),onSelect:()=>void T(e)}]:[],columns:[{header:fye(),cell:e=>(0,z.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:D$(),cell:e=>(0,z.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind})},{header:T$(),cell:e=>(0,z.jsx)(F4e,{severity:e.severity})},{header:hye(),cell:e=>(0,z.jsx)(I4e,{status:e.status})},{header:E$(),cell:e=>(0,z.jsx)($,{variant:`outline`,children:e.source})},{header:vye(),cell:e=>(0,z.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message})},{header:xye(),cell:e=>(0,z.jsx)(P4e,{row:e})},{header:wye(),cell:e=>e.correlationId?(0,z.jsx)(`code`,{className:`oc-traces__mono`,children:L4e(e.correlationId)}):(0,z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]})]})}function N4e(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function P4e({row:e}){let t=Ro(),n=N4e(e);if(!n.dominantCode)return(0,z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=a9(n.dominantCode),i=n.sampleCorrelationId;return(0,z.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,z.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,z.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,z.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,z.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,z.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,Dye()]}):null]})}function F4e({severity:e}){return(0,z.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function I4e({status:e}){return e===`open`?(0,z.jsx)($,{variant:`destructive`,children:Aye()}):e===`acknowledged`?(0,z.jsx)($,{variant:`secondary`,children:Nye()}):(0,z.jsx)($,{variant:`outline`,children:Iye()})}function L4e(e){return e.length>8?e.slice(0,8):e}function R4e(){let e=L(H.integrations.status.status,{}),t=R(H.admin.setIntegrationConfig),[n,r]=(0,I.useState)(null);if((0,I.useEffect)(()=>{e&&n===null&&r(e.config)},[e,n]),!e||!n)return(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:Zq()});let i=n,a=(e,t,n)=>r({...i,[e]:{...i[e],[t]:n}}),o=(e,n)=>void t({[e]:n});return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`oc-admin__hint`,children:[eJ(),` `,(0,z.jsx)(`strong`,{children:rJ()}),` `,oJ()]}),(0,z.jsxs)(c9,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,z.jsx)($,{variant:`secondary`,children:lJ()}):(0,z.jsx)($,{variant:`outline`,children:fJ()}):(0,z.jsx)($,{variant:`outline`,children:hJ()}),note:xJ(),children:[(0,z.jsx)(l9,{label:DJ(),children:(0,z.jsx)(n0,{value:i.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>a(`langfuse`,`host`,e.target.value),onBlur:()=>o(`langfuse`,{host:i.langfuse.host??``})})}),(0,z.jsx)(u9,{label:zJ(),checked:i.langfuse.enabled??!0,onChange:e=>{a(`langfuse`,`enabled`,e),o(`langfuse`,{enabled:e})}})]}),(0,z.jsxs)(c9,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,z.jsx)($,{variant:`secondary`,children:lJ()}):(0,z.jsx)($,{variant:`outline`,children:fJ()}):(0,z.jsx)($,{variant:`outline`,children:hJ()}),note:wJ(),children:[(0,z.jsx)(l9,{label:AJ(),children:(0,z.jsx)(n0,{value:i.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>a(`opik`,`baseUrl`,e.target.value),onBlur:()=>o(`opik`,{baseUrl:i.opik.baseUrl??``})})}),(0,z.jsx)(l9,{label:NJ(),children:(0,z.jsx)(n0,{value:i.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||IJ(),onChange:e=>a(`opik`,`workspace`,e.target.value),onBlur:()=>o(`opik`,{workspace:i.opik.workspace??``})})}),(0,z.jsx)(u9,{label:zJ(),checked:i.opik.enabled??!0,onChange:e=>{a(`opik`,`enabled`,e),o(`opik`,{enabled:e})}})]}),(0,z.jsxs)(c9,{title:HJ(),status:(0,z.jsx)($,{variant:`outline`,children:vJ()}),note:GJ(),children:[(0,z.jsx)(l9,{label:JJ(),children:(0,z.jsx)(d9,{value:i.tts.auto??`off`,options:[[`off`,ZJ()],[`always`,eY()],[`inbound`,rY()],[`tagged`,oY()]],onChange:e=>{a(`tts`,`auto`,e),o(`tts`,{auto:e})}})}),(0,z.jsx)(l9,{label:lY(),children:(0,z.jsx)(d9,{value:i.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,fY()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{a(`tts`,`provider`,e),o(`tts`,{provider:e})}})}),(0,z.jsx)(l9,{label:hY(),children:(0,z.jsx)(n0,{value:i.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>a(`tts`,`model`,e.target.value),onBlur:()=>o(`tts`,{model:i.tts.model??``})})}),(0,z.jsx)(l9,{label:vY(),children:(0,z.jsx)(n0,{value:i.tts.voice??``,placeholder:xY(),onChange:e=>a(`tts`,`voice`,e.target.value),onBlur:()=>o(`tts`,{voice:i.tts.voice??``})})})]}),(0,z.jsxs)(c9,{title:wY(),status:(0,z.jsx)($,{variant:`outline`,children:vJ()}),note:e.secrets.openai?DY():AY(),children:[(0,z.jsx)(u9,{label:NY(),checked:i.talk.enabled??!1,onChange:e=>{a(`talk`,`enabled`,e),o(`talk`,{enabled:e})}}),(0,z.jsx)(l9,{label:IY(),children:(0,z.jsx)(d9,{value:i.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{a(`talk`,`realtimeProvider`,e),o(`talk`,{realtimeProvider:e})}})}),(0,z.jsx)(l9,{label:zY(),children:(0,z.jsx)(n0,{value:i.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>a(`talk`,`realtimeModel`,e.target.value),onBlur:()=>o(`talk`,{realtimeModel:i.talk.realtimeModel??``})})}),(0,z.jsx)(l9,{label:vY(),children:(0,z.jsx)(n0,{value:i.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>a(`talk`,`voice`,e.target.value),onBlur:()=>o(`talk`,{voice:i.talk.voice??``})})}),(0,z.jsx)(l9,{label:HY(),children:(0,z.jsx)(d9,{value:i.talk.transport??`webrtc`,options:[[`webrtc`,GY()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{a(`talk`,`transport`,e),o(`talk`,{transport:e})}})}),(0,z.jsx)(l9,{label:JY(),children:(0,z.jsx)(n0,{value:i.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>a(`talk`,`speechLocale`,e.target.value),onBlur:()=>o(`talk`,{speechLocale:i.talk.speechLocale??``})})}),(0,z.jsx)(u9,{label:ZY(),checked:i.talk.interruptOnSpeech??!0,onChange:e=>{a(`talk`,`interruptOnSpeech`,e),o(`talk`,{interruptOnSpeech:e})}})]}),(0,z.jsxs)(`section`,{className:`oc-int__section`,children:[(0,z.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,z.jsx)(`h3`,{className:`oc-uipa__h`,children:eX()}),(0,z.jsx)($,{variant:`outline`,children:rX()})]}),(0,z.jsxs)(`p`,{className:`oc-uipa__note`,children:[oX(),(0,z.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,z.jsx)(t7,{title:lX(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:fX(),columns:[{header:hX(),cell:e=>(0,z.jsx)($,{variant:`secondary`,children:e.vendor})},{header:vX(),cell:e=>e.lastAt>0?new Date(e.lastAt).toLocaleString(`fr-FR`):`—`},{header:xX(),cell:e=>String(e.failureCount)},{header:wX(),cell:e=>e.lastErrorStatus??`—`},{header:DX(),cell:e=>e.lastError??`—`}]})]})}function c9({title:e,status:t,note:n,children:r}){return(0,z.jsxs)(`section`,{className:`oc-int__section`,children:[(0,z.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,z.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,z.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,z.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function l9({label:e,children:t}){return(0,z.jsxs)(`label`,{className:`oc-int__field`,children:[(0,z.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function u9({label:e,checked:t,onChange:n}){return(0,z.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,z.jsx)(J5,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,z.jsx)(`span`,{children:e})]})}function d9({value:e,options:t,onChange:n}){return(0,z.jsxs)($3,{value:e,onValueChange:n,children:[(0,z.jsx)(t6,{size:`sm`,className:`w-full`,children:(0,z.jsx)(e6,{})}),(0,z.jsx)(n6,{children:t.map(([e,t])=>(0,z.jsx)(Q,{value:e,children:t},e))})]})}var z4e={altered_words:()=>AX(),incorrect:()=>NX(),incoherence:()=>IX(),formatting:()=>zX(),latency:()=>HX(),api_error:()=>GX(),other:()=>JX()},f9=e=>z4e[e]?.()??e;function p9({matches:e,sourceWasOpen:t}){return t?e===!0?(0,z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:eZ()}):e===!1?(0,z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:rZ()}):(0,z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:ZX()})}function B4e({data:e}){let t=e.snapshot,n=R(H.feedback.respondToFeedback),[r,i]=(0,I.useState)(e.thread),[a,o]=(0,I.useState)(``),[s,c]=(0,I.useState)(!1);async function l(){let t=a.trim();if(!(!t||s)){c(!0);try{await n({feedbackId:e._id,text:t}),i(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),o(``)}finally{c(!1)}}}let u=[];try{u=t.contextJson?JSON.parse(t.contextJson):[]}catch{u=[]}return(0,z.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,z.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,z.jsx)(p9,{matches:t.displayedMatchesStored,sourceWasOpen:t.clientInfo?.sourceWasOpen??!1}),(0,z.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[f9(e.category),` · `,t.messageRole,t.isRegeneration?` · ${oZ()}`:``,t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})]}),e.comment?(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:lZ()}),(0,z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:fZ()}),r.length>0?(0,z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.map((e,t)=>(0,z.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,z.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?hZ():vZ()}),(0,z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:xZ()}),(0,z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:wZ(),value:a,maxLength:2e3,rows:3,onChange:e=>o(e.target.value.slice(0,2e3))}),(0,z.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,z.jsx)(X,{size:`sm`,onClick:()=>void l(),disabled:!a.trim()||s,children:s?DZ():AZ()})})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:NZ()}),(0,z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.messageText||IZ()})]}),t.clientInfo?.sourceWasOpen&&t.displayedText!==void 0?(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:zZ()}),(0,z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.displayedText||IZ()})]}):null,t.promptText?(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:HZ()}),(0,z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.promptText})]}):null,u.length>0?(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:GZ({count:t.contextCount??u.length,truncated:t.contextTruncated?JZ():``})}),(0,z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:u.map((e,t)=>(0,z.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,z.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,z.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,t.outboxAvailable?(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ZZ()}),(0,z.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[t.outboxText??``,t.outboxStatus?`\n[status: ${t.outboxStatus}]`:``]})]}):null,t.clientInfo?.extensionsDetected&&t.clientInfo.extensionsDetected.length>0?(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:eQ()}),(0,z.jsx)(`div`,{className:`oc-fbadmin__row`,children:t.clientInfo.extensionsDetected.map(e=>(0,z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:rQ()}),(0,z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[t.clientInfo?.language,t.clientInfo?.timezone,t.clientInfo?.theme?oQ({theme:t.clientInfo.theme}):null,t.runId?`run ${t.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,t.clientInfo?.plugins&&t.clientInfo.plugins.length>0?(0,z.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[lQ(),` `,t.clientInfo.plugins.join(`, `),(0,z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,fQ()]})]}):null,t.clientInfo?.userAgent?(0,z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:t.clientInfo.userAgent}):null]})]})]})}function V4e(){let e=L(H.feedback.listForAdmin,{}),t=R(H.feedback.readSnapshot),n=R(H.feedback.deleteFeedback),r=y0(),[i,a]=(0,I.useState)(null),[o,s]=(0,I.useState)({});async function c(e){if(i===e._id){a(null);return}if(!o[e._id]){let n=await t({feedbackId:e._id});s(t=>({...t,[e._id]:n}))}a(e._id)}async function l(e){await r({title:Kue(),description:Yue(),confirmLabel:Que(),destructive:!0})&&(await n({feedbackId:e._id}),i===e._id&&a(null))}return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`oc-admin__hint`,children:[hQ(),` `,(0,z.jsx)(`strong`,{children:vQ()}),` `,xQ()]}),(0,z.jsx)(t7,{title:wQ(),rows:e,emptyHint:DQ(),isExpanded:e=>i===e._id&&!!o[e._id],renderExpanded:e=>o[e._id]?(0,z.jsx)(B4e,{data:o[e._id]}):null,columns:[{header:AQ(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`)},{header:NQ(),cell:e=>f9(e.category)},{header:IQ(),cell:e=>e.messageRole===`user`?zQ():HQ()},{header:GQ(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${JQ({operator:e.realOperatorEmail})}`:``)},{header:ZQ(),cell:e=>(0,z.jsx)(p9,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen})},{header:e$(),cell:e=>e.hasComment?`✎`:`—`},{header:r$(),cell:e=>e.answered?(0,z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:o$()}):(0,z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:l$()})}],rowActions:e=>[{label:i===e._id?f$():h$(),onSelect:()=>void c(e)},{label:Uue(),onSelect:()=>void l(e),variant:`destructive`}]})]})}var m9=`all`;function h9(e){switch(e){case`image`:return wN();case`audio`:return DN();case`video`:return AN();case`pdf`:return NN();case`document`:return IN();case`archive`:return zN();default:return HN()}}function H4e(){let[e,t]=(0,I.useState)(m9),[n,r]=(0,I.useState)(m9),[i,a]=(0,I.useState)(m9),[o,s]=(0,I.useState)(m9),c=L(H.files.listMine,{direction:e===m9?void 0:e,chatId:n===m9?void 0:n,instanceName:i===m9?void 0:i,category:o===m9?void 0:o}),l=(0,I.useMemo)(()=>new Intl.DateTimeFormat(q(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(c===void 0)return(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:Nj()});let{files:u,facets:d,truncated:f,cap:p}=c,m=e!==m9||n!==m9||i!==m9||o!==m9;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:GM()}),(0,z.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,z.jsxs)($3,{value:e,onValueChange:t,children:[(0,z.jsx)(t6,{size:`sm`,"aria-label":JM(),children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:m9,children:ZM()}),(0,z.jsx)(Q,{value:`inbound`,children:eN()}),(0,z.jsx)(Q,{value:`outbound`,children:rN()})]})]}),(0,z.jsxs)($3,{value:n,onValueChange:r,children:[(0,z.jsx)(t6,{size:`sm`,"aria-label":oN(),children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:m9,children:lN()}),d.chats.map(e=>(0,z.jsx)(Q,{value:e.id,children:e.title},e.id))]})]}),d.multiProvider?(0,z.jsxs)($3,{value:i,onValueChange:a,children:[(0,z.jsx)(t6,{size:`sm`,"aria-label":fN(),children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:m9,children:hN()}),d.instances.map(e=>(0,z.jsx)(Q,{value:e,children:e},e))]})]}):null,(0,z.jsxs)($3,{value:o,onValueChange:s,children:[(0,z.jsx)(t6,{size:`sm`,"aria-label":vN(),children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:m9,children:xN()}),d.categories.map(e=>(0,z.jsx)(Q,{value:e,children:h9(e)},e))]})]})]}),u.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:m?vP():hP()}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Y5,{children:[(0,z.jsx)(X5,{children:(0,z.jsxs)(Q5,{children:[(0,z.jsx)($5,{children:GN()}),(0,z.jsx)($5,{children:JN()}),(0,z.jsx)($5,{children:ZN()}),(0,z.jsx)($5,{children:eP()}),(0,z.jsx)($5,{children:rP()}),(0,z.jsx)($5,{className:`text-right`,children:oP()})]})}),(0,z.jsx)(Z5,{children:u.map(e=>(0,z.jsxs)(Q5,{children:[(0,z.jsx)(e7,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:e.filename}),(0,z.jsx)(e7,{title:e.mimeType,children:h9(e.category)}),(0,z.jsx)(e7,{children:(0,z.jsx)($,{variant:`secondary`,children:e.direction===`inbound`?eN():rN()})}),(0,z.jsx)(e7,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,z.jsx)(e7,{className:`whitespace-nowrap text-muted-foreground`,children:l.format(e.createdAt)}),(0,z.jsx)(e7,{className:`text-right`,children:e.url?(0,z.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noreferrer`,className:`oc-files__download`,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,z.jsx)(fm,{size:14}),lP()]}):(0,z.jsx)(`span`,{className:`text-muted-foreground`,children:fP()})})]},e._id))})]}),f?(0,z.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:xP({cap:p})}):null]})]})}var g9=2e4,_9=6e4;function U4e(e){return typeof e!=`number`||e<=0?0:Math.round(e/g9*100)}function W4e(e){return e<=0?0:Math.round(e/_9*100)}function v9(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function y9(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var b9=3;function G4e(e,t){let n=new Map;for(let t of e.split(`
|
|
165
|
-
`))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
|
|
166
|
-
`))n.set(e,(n.get(e)??0)-1);let r=0,i=0,a=[],o=[];for(let[e,t]of n)t<0?(r+=-t,a.length<b9&&a.push(e)):t>0&&(i+=t,o.length<b9&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function K4e(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var x9=e=>typeof e==`string`?e:null;function S9(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function q4e(e,t){let n=S9(e),r=S9(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function J4e(e,t){if(e===null||t===null)return!1;let n=q4e(t,e.min);return n!==null&&n>=0}function C9(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,o=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=x9(e.min),n=x9(e.maxValidated);t!==null&&n!==null&&(o={min:t,maxValidated:n})}let s=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:o,validatedVersions:s}}function Y4e(e,t){if(e.gatewayVersion===null)return`unknown`;if(e.versionBeyondValidated)return`beyond`;let{range:n}=C9(t,e.provider);return J4e(n,e.gatewayVersion)?`supported`:`unknown`}function X4e(e){return e===`supported`?NWe():e===`beyond`?IWe():zWe()}function w9(e){return e??e1()}function T9(e){return e===null?JWe():GWe({version:e})}function Z4e(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}var E9=e=>`${e.instanceName}::${e.agentId}`;function Q4e(){let e=L(H.me.getMe),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),r=L(H.admin.listInstances,e!==void 0&&t?{}:`skip`),[i,a]=(0,I.useState)(null);(0,I.useEffect)(()=>{!t||!r||r.length===0||(!i||!r.some(e=>e.name===i))&&a(r[0].name)},[t,r,i]);let o=L(H.agents.listAgentsForInstance,t&&i?{instanceName:i}:`skip`),s=L(H.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),c=(0,I.useMemo)(()=>{if(e!==void 0){if(t)return i===null||o===void 0?r!==void 0&&r.length===0?[]:void 0:o.agents.map(e=>({instanceName:i,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(s!==void 0)return s.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,i,o,r,s]),[l,u]=(0,I.useState)(null);(0,I.useEffect)(()=>{!c||c.length===0||(!l||!c.some(e=>E9(e)===l))&&u(E9(c[0]))},[c,l]);let d=c?.find(e=>E9(e)===l)??null,f=An(H.agentFiles.listAgentFiles),[p,m]=(0,I.useState)({status:`idle`}),h=d?.instanceName??null,g=d?.agentId??null,_=L(H.compat.forInstance,n&&h!==null?{instanceName:h}:`skip`),v=n&&h!==null?G$e(_,`agentFiles`):null,y=v===null?!1:v===`loading`?null:v.blocked,b=(0,I.useCallback)(async()=>{if(!(h===null||g===null)){m({status:`loading`});try{m({status:`done`,files:(await f({instanceName:h,agentId:g})).files})}catch{m({status:`error`})}}},[f,h,g]);(0,I.useEffect)(()=>{y===!1&&b()},[b,y]);let[x,S]=(0,I.useState)(null),C=q(),w=(0,I.useMemo)(()=>new Intl.NumberFormat(C,{maximumFractionDigits:0}),[C]);return e===void 0||c===void 0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:Nj()}):(0,z.jsxs)(`div`,{className:`oc-afiles`,children:[(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:EVe()}),(0,z.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(r?.length??0)>1?(0,z.jsxs)($3,{value:i??``,onValueChange:e=>a(e),children:[(0,z.jsx)(t6,{size:`sm`,"aria-label":kVe(),children:(0,z.jsx)(e6,{})}),(0,z.jsx)(n6,{children:(r??[]).map(e=>(0,z.jsx)(Q,{value:e.name,children:e.name},e.name))})]}):null,c.length>0?(0,z.jsxs)($3,{value:l??``,onValueChange:e=>u(e),children:[(0,z.jsx)(t6,{size:`sm`,"aria-label":MVe(),children:(0,z.jsx)(e6,{})}),(0,z.jsx)(n6,{children:c.map(e=>(0,z.jsx)(Q,{value:E9(e),children:e.label},E9(e)))})]}):(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:FVe()})]}),d===null?null:v===`loading`?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:Nj()}):v!==null&&v.blocked?(0,z.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,z.jsx)(Om,{size:14,"aria-hidden":!0}),` `,T9(v.gatewayVersion)]}):p.status===`loading`||p.status===`idle`?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:Nj()}):p.status===`error`?(0,z.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[VVe(),` `,(0,z.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:X$()})]}):p.files.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:RVe()}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`oc-afiles__list`,children:p.files.map(e=>{let n=U4e(e.size),r=n>=80;return(0,z.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,z.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,z.jsx)($,{variant:`outline`,children:WVe()}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`oc-afiles__size`,children:qVe({size:v9(e.size,C)})}),(0,z.jsx)(`span`,{className:`oc-afiles__gauge${r?` is-warn`:``}`,"aria-hidden":!0,children:(0,z.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,z.jsx)(`span`,{className:`oc-afiles__pct`,children:XVe({pct:w.format(n)})}),r?(0,z.jsx)(Om,{size:14,className:`oc-afiles__warn`,"aria-label":$Ve()}):(0,z.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,z.jsx)(X,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>S(e),children:t?aHe():cHe()})]},e.name)})}),(0,z.jsx)(`p`,{className:`oc-afiles__budget`,children:nHe({used:v9(y9(p.files),C),total:v9(_9,C),pct:w.format(W4e(y9(p.files)))})})]}),x&&d?(0,z.jsx)($4e,{instanceName:d.instanceName,agentId:d.agentId,name:x.name,isAdmin:t,onClose:()=>S(null),onSaved:()=>void b()}):null]})}function $4e({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:a}){let o=An(H.agentFiles.getAgentFile),s=An(H.agentFiles.setAgentFile),c=S0(),[l,u]=(0,I.useState)(null),[d,f]=(0,I.useState)(!1),[p,m]=(0,I.useState)(``),[h,g]=(0,I.useState)(!1),[_,v]=(0,I.useState)(!1),[y,b]=(0,I.useState)(!1),[x,S]=(0,I.useState)(!1),C=(0,I.useCallback)(async r=>{f(!1);try{let i=await o({instanceName:e,agentId:t,name:n});u({content:i.content,updatedAtMs:i.updatedAtMs}),r||m(i.content),b(!1)}catch{f(!0)}},[o,e,t,n]);(0,I.useEffect)(()=>{C(!1)},[C]);async function w(){if(l!==null){v(!0),S(!1);try{await s({instanceName:e,agentId:t,name:n,content:p,baseUpdatedAtMs:l.updatedAtMs??void 0}),c.success(OHe({name:n})),a(),await C(!1)}catch(e){K4e(e)?b(!0):S(!0)}finally{v(!1)}}}let T=l!==null&&p!==l.content,E=(0,I.useMemo)(()=>l===null?null:G4e(l.content,p),[l,p]),D=p.length>g9,O=q(),k=(0,I.useMemo)(()=>new Intl.NumberFormat(O),[O]);return(0,z.jsx)(d0,{open:!0,onOpenChange:e=>!e&&i(),children:(0,z.jsxs)(f0,{className:`oc-afiles__editor`,children:[(0,z.jsxs)(p0,{children:[(0,z.jsx)(h0,{children:$$({name:n})}),(0,z.jsxs)(g0,{children:[pHe({agent:t,instance:e}),r?null:(0,z.jsxs)(z.Fragment,{children:[` · `,gHe()]})]})]}),d?(0,z.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[PHe(),` `,(0,z.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void C(!1),children:X$()})]}):l===null?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:Nj()}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`textarea`,{className:`oc-afiles__source`,value:p,readOnly:!r,spellCheck:!1,onChange:e=>m(e.target.value),"aria-label":$$({name:n})}),(0,z.jsx)(`p`,{className:`oc-afiles__hint`,children:yHe()}),y?(0,z.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[LHe(),` `,(0,z.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void C(!0),children:BHe()})]}):null,x?(0,z.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:jHe()}):null,(0,z.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,z.jsx)(`span`,{className:`oc-afiles__count${D?` is-over`:``}`,children:SHe({count:k.format(p.length),max:k.format(g9)})}),r?(0,z.jsx)(X,{size:`sm`,disabled:!T||_||y,onClick:()=>g(!0),children:_?Y$():THe()}):null]})]}),(0,z.jsx)(r0,{open:h,onOpenChange:g,children:(0,z.jsxs)(i0,{children:[(0,z.jsxs)(a0,{children:[(0,z.jsx)(s0,{children:UHe({name:n})}),(0,z.jsx)(c0,{children:KHe({agent:t})})]}),E?(0,z.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,z.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:YHe({added:E.added,removed:E.removed})}),E.sampleAdded.length>0?(0,z.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,z.jsx)(`span`,{className:`oc-afiles__diff-label`,children:QHe()}),E.sampleAdded.map((e,t)=>(0,z.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,E.sampleRemoved.length>0?(0,z.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,z.jsx)(`span`,{className:`oc-afiles__diff-label`,children:tUe()}),E.sampleRemoved.map((e,t)=>(0,z.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,z.jsxs)(o0,{children:[(0,z.jsx)(u0,{children:wG()}),(0,z.jsx)(l0,{onClick:()=>void w(),children:iUe()})]})]})})]})})}var D9=[{id:`messages`,label:()=>HL()},{id:`composer`,label:()=>GL()},{id:`sidebar`,label:()=>JL()},{id:`other`,label:()=>ZL()}],O9={showSource:{category:`messages`,label:()=>eR(),help:()=>rR()},showReport:{category:`messages`,label:()=>oR(),help:()=>lR()},copyAssistant:{category:`messages`,label:()=>fR()},copyUser:{category:`messages`,label:()=>hR()},showDelete:{category:`messages`,label:()=>vR()},showTools:{category:`messages`,label:()=>xR(),help:()=>wR()},voiceInput:{category:`composer`,label:()=>DR(),help:()=>AR()},showChatAge:{category:`sidebar`,label:()=>NR(),help:()=>IR()},showChatProvider:{category:`sidebar`,label:()=>zR(),help:()=>HR()}};function k9(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function e3e(e,t){let n=k9(t.trim()),r=new Map(D9.map(e=>[e.id,e.label()])),i=new Map(D9.map(e=>[e.id,[]]));for(let t of e){let e=O9[t],a=e?.category??`other`;n&&!k9(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return D9.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var t3e=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`],n3e={voiceInput:`voiceInput`};function r3e(e){return t3e.includes(e)}function A9(e){return e===`admin`}function i3e(e){return e===!0?`on`:e===!1?`off`:`inherit`}function a3e(e){return e===`on`?!0:e===`off`?!1:null}function o3e(e){return r3e(e)?n3e[e]:void 0}var s3e={voiceInput:()=>xz()};function c3e({prefKey:e,ui:t}){let n=R(H.admin.setUiPrefDefault),r=R(H.admin.setFeatureEnabled),i=o3e(e),a=i?s3e[e]?.():void 0;return(0,z.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,z.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,z.jsx)(`span`,{className:`oc-prefs__gov-label`,children:lz()}),(0,z.jsxs)($3,{value:i3e(t.defaults[e]),onValueChange:t=>void n({key:e,value:a3e(t)}),children:[(0,z.jsx)(t6,{size:`sm`,className:`w-36`,children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:`on`,children:Dz()}),(0,z.jsx)(Q,{value:`off`,children:Az()}),(0,z.jsx)(Q,{value:`inherit`,children:Nz()})]})]}),i?(0,z.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,z.jsx)(J5,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":fz()}),fz()]}):null]}),a?(0,z.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function l3e(){let[e,t]=(0,I.useState)(``),[n,r]=(0,I.useState)(!1),i=L(H.me.getMe,{}),a=i?.ui,o=A9(i?.role)&&n,s=R(H.me.setUiPref).withOptimisticUpdate(w0),c=(0,I.useMemo)(()=>a?e3e(Object.keys(a.effective),e):[],[a,e]);return a?(0,z.jsxs)(`div`,{className:`oc-prefs-panel`,children:[A9(i?.role)?(0,z.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,z.jsx)(J5,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":oz()}),oz()]}):null,o?(0,z.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,z.jsx)(`p`,{children:hz()}),(0,z.jsx)(`p`,{children:vz()}),(0,z.jsx)(`p`,{children:wz()})]}):null,(0,z.jsx)(n0,{value:e,onChange:e=>t(e.target.value),placeholder:GR(),"aria-label":GR(),className:`mb-2`}),c.length===0?(0,z.jsx)(`div`,{className:`oc-prefs__empty`,children:JR()}):(0,z.jsx)(`div`,{className:`oc-prefs`,children:c.map(e=>(0,z.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,z.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=O9[e],n=t?t.label():e,r=t?.help?.(),i=a.locked[e],c=a.effective[e],l=a.userOverrides[e]!==void 0;return(0,z.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${l&&!i?` is-overridden`:``}`,children:[(0,z.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,z.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,z.jsx)(`span`,{className:`oc-prefs__lock`,children:ZR()}):l?null:(0,z.jsx)(`span`,{className:`oc-prefs__def`,children:ez()})]}),r?(0,z.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,z.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&l?(0,z.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void s({key:e,value:null}),children:rz()}):null,(0,z.jsx)(J5,{checked:c,disabled:i,onCheckedChange:t=>void s({key:e,value:t===!0}),"aria-label":n})]}),o?(0,z.jsx)(c3e,{prefKey:e,ui:a}):null]},e)})]},e.id))})]}):(0,z.jsx)(`div`,{className:`oc-prefs__empty`,children:Nj()})}function u3e(){let e=L(H.me.getMe,{}),t=R(H.me.setLocale),n=R(H.me.setMyName),r=S0(),i=e?.locale??`default`,a=e?.name??``,[o,s]=(0,I.useState)(null),c=o??a,l=c.trim()!==a.trim();async function u(){try{await n({name:c}),s(null),r.success(hM())}catch(e){r.error(vM(),e)}}return(0,z.jsxs)(`div`,{className:`oc-appearance`,children:[(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h2`,{className:`oc-show__title`,children:rM()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:oM()})]}),(0,z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,z.jsx)(n0,{className:`max-w-xs`,value:c,maxLength:120,placeholder:lM(),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l&&(e.preventDefault(),u())}}),(0,z.jsx)(X,{size:`sm`,disabled:!l,onClick:()=>void u(),children:b$()})]}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:fM()})]}),(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h2`,{className:`oc-show__title`,children:xM()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:wM()})]}),(0,z.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`,`default`].map(e=>(0,z.jsx)(X,{variant:i===e?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e==="default"?null:e}),children:e===`fr`?IM():e===`en`?zM():Jj()},e))}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:DM()})]}),(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h2`,{className:`oc-show__title`,children:AM()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:NM()})]}),(0,z.jsx)(l3e,{})]})]})}var d3e=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function f3e(e){let t=typeof e==`object`&&e?e:{},n=t.defaults!==null&&typeof t.defaults==`object`?t.defaults:{},r=n.thinkingDefault??t.thinkingDefault,i=n.fastModeDefault??t.fastModeDefault;return{thinkingDefault:typeof r==`string`?r:null,fastModeDefault:typeof i==`boolean`?i:null}}function p3e(){let e=An(H.agentFiles.getChatDefaults),t=An(H.agentFiles.setChatDefaults),n=S0(),[r,i]=(0,I.useState)({status:`loading`}),[a,o]=(0,I.useState)({thinkingDefault:null,fastModeDefault:null}),[s,c]=(0,I.useState)(!1),[l,u]=(0,I.useState)(!1),d=K$e(L(H.compat.getBridgeCompat,{}),`configDefaults`),f=d===`loading`?null:d.blocked,p=(0,I.useCallback)(async()=>{i({status:`loading`});try{let t=f3e(await e({}));i({status:`done`,current:t}),o(t)}catch{i({status:`error`})}},[e]);(0,I.useEffect)(()=>{f===!1&&p()},[p,f]);let m=r.status===`done`?r.current:null,h=m!==null&&a.thinkingDefault!==null&&a.thinkingDefault!==m.thinkingDefault,g=m!==null&&a.fastModeDefault!==null&&a.fastModeDefault!==m.fastModeDefault,_=h||g;async function v(){u(!0);try{await t({...h?{thinkingDefault:a.thinkingDefault}:{},...g?{fastModeDefault:a.fastModeDefault}:{}}),n.success(jUe()),await p()}catch(e){n.error(PUe(),e)}finally{u(!1)}}let y=(0,I.useMemo)(()=>d3e.map(e=>({id:e,label:c6(e)})),[]),b=(0,I.useMemo)(()=>[{id:`fast`,label:Z$()},{id:`standard`,label:Q$()}],[]);return(0,z.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:uUe()}),d===`loading`?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:Nj()}):d.blocked?(0,z.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,z.jsx)(Om,{size:14,"aria-hidden":!0}),` `,T9(d.gatewayVersion)]}):r.status===`loading`?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:Nj()}):r.status===`error`?(0,z.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[TUe(),` `,(0,z.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void p(),children:X$()})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,z.jsx)(`span`,{className:`oc-cdefaults__label`,children:pUe()}),(0,z.jsx)(p6,{options:y,value:a.thinkingDefault,onChange:e=>o({...a,thinkingDefault:e}),disabled:l}),(0,z.jsx)(`p`,{className:`oc-cdefaults__help`,children:gUe()})]}),(0,z.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,z.jsx)(`span`,{className:`oc-cdefaults__label`,children:yUe()}),(0,z.jsx)(p6,{options:b,value:a.fastModeDefault===null?null:a.fastModeDefault?`fast`:`standard`,onChange:e=>o({...a,fastModeDefault:e===`fast`}),disabled:l}),(0,z.jsx)(`p`,{className:`oc-cdefaults__help`,children:SUe()})]}),(0,z.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,z.jsx)(X,{size:`sm`,disabled:!_||l,onClick:()=>c(!0),children:l?Y$():OUe()})}),(0,z.jsx)(`p`,{className:`oc-cdefaults__note`,children:LUe()})]}),(0,z.jsx)(r0,{open:s,onOpenChange:c,children:(0,z.jsxs)(i0,{children:[(0,z.jsxs)(a0,{children:[(0,z.jsx)(s0,{children:BUe()}),(0,z.jsx)(c0,{children:UUe()})]}),(0,z.jsxs)(o0,{children:[(0,z.jsx)(u0,{children:wG()}),(0,z.jsx)(l0,{onClick:()=>void v(),children:KUe()})]})]})})]})}function m3e(e){return e===`user`?RIe():W$({group:e.group})}function h3e(e){return e===`common`?UIe():e===`owner`?KIe():W$({group:e.group})}function g3e(e){return e.name||e.email||e.userId.slice(0,8)}function _3e(){let e=L(H.admin.listUsers,{}),[t,n]=(0,I.useState)(``),r=L(H.introspect.introspectUser,t?{userId:t}:`skip`);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:uIe()}),(0,z.jsxs)($3,{value:t,onValueChange:n,children:[(0,z.jsx)(t6,{size:`sm`,"aria-label":H$(),children:(0,z.jsx)(e6,{placeholder:H$()})}),(0,z.jsx)(n6,{children:(e??[]).map(e=>(0,z.jsx)(Q,{value:e.userId,children:g3e(e)},e._id))})]}),t===``?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:hIe()}):r===void 0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:Nj()}):(0,z.jsxs)(`div`,{className:`oc-introspect`,children:[(0,z.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,z.jsx)(`h3`,{className:`oc-introspect__title`,children:vIe()}),(0,z.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,z.jsx)(`strong`,{children:r.user.label}),(0,z.jsx)($,{variant:`secondary`,children:r.role})]})]}),(0,z.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,z.jsx)(`h3`,{className:`oc-introspect__title`,children:xIe()}),r.groups.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:U$()}):(0,z.jsx)(`div`,{className:`oc-introspect__chips`,children:r.groups.map(e=>(0,z.jsx)($,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,z.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,z.jsx)(`h3`,{className:`oc-introspect__title`,children:wIe()}),r.agents.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:U$()}):(0,z.jsx)(`ul`,{className:`oc-introspect__list`,children:r.agents.map(e=>(0,z.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,z.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,z.jsx)($,{variant:`default`,children:FIe()}):null,(0,z.jsx)($,{variant:`outline`,children:m3e(e.via)}),(0,z.jsx)($,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,z.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,z.jsx)(`h3`,{className:`oc-introspect__title`,children:DIe()}),r.charts.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:U$()}):(0,z.jsx)(`ul`,{className:`oc-introspect__list`,children:r.charts.map(e=>(0,z.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,z.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,z.jsx)($,{variant:`outline`,children:h3e(e.via)})]},e.key))})]}),(0,z.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,z.jsx)(`h3`,{className:`oc-introspect__title`,children:AIe()}),r.permissions.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:U$()}):(0,z.jsx)(`div`,{className:`oc-introspect__chips`,children:r.permissions.map(e=>(0,z.jsx)($,{variant:`secondary`,children:e},e))})]})]})]})}function v3e(){return L(H.bridgeHealth.getBridgeHealth,{})}function y3e(){let e=v3e(),t=Ro();return(0,z.jsxs)(`div`,{className:`oc-bridge`,children:[(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:TTe()}),e===void 0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:N$()}):e===null?(0,z.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:ATe()}):(0,z.jsx)(C3e,{health:e,onSeeAnomalies:()=>void t({to:`/settings/anomalies`,search:{status:`open`}})}),(0,z.jsx)(b3e,{})]})}function b3e(){let e=L(H.compat.getBridgeCompat,{});return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`h3`,{className:`oc-bridge__section`,children:YUe()}),e===void 0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:N$()}):e===null?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:QUe()}):(0,z.jsx)(x3e,{data:e})]})}function x3e({data:e}){let t=C9(e.compat,`openclaw`);return(0,z.jsxs)(`div`,{className:`oc-compat`,children:[(0,z.jsxs)(`div`,{className:`oc-compat__meta`,children:[(0,z.jsxs)(`span`,{children:[tWe(),` `,(0,z.jsx)(`code`,{className:`oc-traces__mono`,children:w9(e.bridgeVersion)})]}),(0,z.jsxs)(`span`,{children:[iWe(),` `,(0,z.jsx)(`code`,{className:`oc-traces__mono`,children:e.protocolVersion===null?e1():String(e.protocolVersion)})]}),(0,z.jsx)(`span`,{children:P$({time:new Date(e.fetchedAt).toLocaleString(`fr-FR`)})})]}),e.reachable?null:(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:lWe()}),e.compat===null?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:fWe()}):(0,z.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,z.jsx)(`span`,{className:`oc-compat__label`,children:hWe()}),t.range===null?(0,z.jsx)(`span`,{children:e1()}):(0,z.jsx)(`span`,{children:vWe({min:t.range.min,max:t.range.maxValidated})}),(0,z.jsx)(S3e,{versions:t.validatedVersions})]}),e.targets.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:AWe()}):(0,z.jsx)(`div`,{className:`oc-compat__targets`,children:e.targets.map(t=>{let n=Y4e(t,e.compat);return(0,z.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,z.jsx)(`code`,{className:`oc-traces__mono`,children:t.instanceName}),(0,z.jsx)(`span`,{className:`oc-compat__provider`,children:t.provider}),(0,z.jsx)(`code`,{className:`oc-traces__mono`,children:w9(t.gatewayVersion)}),(0,z.jsx)($,{variant:n===`supported`?`secondary`:n===`beyond`?`destructive`:`outline`,children:X4e(n)})]},t.instanceName)})}),Z4e(e.compat,`hermes`)?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:HWe()}):null]})}function S3e({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,z.jsxs)(Y1,{children:[(0,z.jsx)(X1,{asChild:!0,children:(0,z.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?xWe():wWe({count:e.length}),(0,z.jsx)(om,{size:13,"aria-hidden":!0})]})}),(0,z.jsxs)(Z1,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,z.jsx)(`p`,{className:`oc-compat__versions-title`,children:DWe()}),(0,z.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,z.jsx)($,{variant:`secondary`,children:e},e))})]})]})}function C3e({health:e,onSeeAnomalies:t}){let n=e.targets.filter(e=>e.state===`error`),r=!e.reachable,i=e.reachable&&n.length===0,a=i?`ok`:`error`,o=new Date(e.checkedAt).toLocaleString(`fr-FR`),s=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${a}`,children:[(0,z.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:i?(0,z.jsx)(lm,{size:22}):r?(0,z.jsx)(Eee,{size:22}):(0,z.jsx)(Om,{size:22})}),(0,z.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,z.jsx)(`div`,{className:`oc-bridge-card__title`,children:i?NTe():r?ITe():zTe({count:n.length})}),(0,z.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,z.jsxs)(`span`,{children:[(0,z.jsx)(See,{size:12,"aria-hidden":!0}),` `,P$({time:o})]}),s?(0,z.jsx)(`span`,{children:WTe({time:s})}):null]}),r?(0,z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:a9(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,z.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:t,children:qTe()})]}),(0,z.jsx)(`h3`,{className:`oc-bridge__section`,children:XTe({count:e.targets.length})}),e.targets.length===0?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:$Te()}):(0,z.jsx)(`div`,{className:`oc-bridge-targets`,children:e.targets.map(e=>{let t=e.lastErrorCode?a9(e.lastErrorCode):null;return(0,z.jsxs)(`div`,{className:`oc-bridge-target oc-bridge-target--${e.state}`,children:[(0,z.jsxs)(`div`,{className:`oc-bridge-target__head`,children:[(0,z.jsxs)(`code`,{className:`oc-traces__mono`,children:[e.canonical,`/`,e.agentId]}),(0,z.jsx)(w3e,{state:e.state}),(0,z.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})]}),(0,z.jsxs)(`div`,{className:`oc-bridge-target__stats`,children:[nEe({ok:e.okCount,errors:e.errorCount,attempts:e.attempts}),e.lastOkAt?aEe({time:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):``]}),t?(0,z.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,z.jsx)(`strong`,{children:t.label}),` `,(0,z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null]},e.key)})})]})}function w3e({state:e}){return e===`connected`?(0,z.jsx)($,{variant:`secondary`,children:cEe()}):e===`error`?(0,z.jsx)($,{variant:`destructive`,children:dEe()}):(0,z.jsx)($,{variant:`outline`,children:mEe()})}var j9=[{id:`personal`,label:()=>mze(),tabs:[`preferences`,`theme`,`files`]},{id:`agents`,label:()=>_ze(),tabs:[`instances`,`agentFiles`,`chatDefaults`,`bridge`]},{id:`access`,label:()=>bze(),tabs:[`users`,`groups`,`access`,`roles`,`serviceAccounts`]},{id:`observability`,label:()=>Cze(),tabs:[`traces`,`kpi`,`anomalies`,`audit`,`feedbacks`,`integrations`]}],T3e=new Map(j9.flatMap(e=>e.tabs.map(t=>[t,e.id])));function M9(e){let t=T3e.get(e);if(!t)throw Error(`Settings tab "${e}" belongs to no group`);return t}function E3e(e,t){return e.find(e=>M9(e)===t)}j9.flatMap(e=>[...e.tabs]);function D3e({delayDuration:e=0,...t}){return(0,z.jsx)(mue,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function O3e({...e}){return(0,z.jsx)(hue,{"data-slot":`tooltip`,...e})}function k3e({...e}){return(0,z.jsx)(gue,{"data-slot":`tooltip-trigger`,...e})}function A3e({className:e,sideOffset:t=0,children:n,...r}){return(0,z.jsx)(_ue,{children:(0,z.jsxs)(vue,{"data-slot":`tooltip-content`,sideOffset:t,className:V1(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,z.jsx)(yue,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function j3e(){let e=L(H.bridgeHealth.getBridgeAvailability,{});if(e===void 0)return null;let t=e.known?e.available?`ok`:`error`:`idle`,n=e.known?e.available?`${PAe()}${e.checkedAt?LAe({time:new Date(e.checkedAt).toLocaleTimeString(`fr-FR`)}):``}`:BAe({reason:e.reason??`?`}):jAe();return(0,z.jsx)(D3e,{delayDuration:150,children:(0,z.jsxs)(O3e,{children:[(0,z.jsx)(k3e,{asChild:!0,children:(0,z.jsx)(`span`,{className:`oc-bridge-dot oc-bridge-dot--${t}`,role:`img`,"aria-label":n})}),(0,z.jsx)(A3e,{children:n})]})})}var M3e={users:()=>TFe(),groups:()=>iIe(),instances:()=>OFe(),bridge:()=>jFe(),serviceAccounts:()=>PFe(),roles:()=>LFe(),traces:()=>BFe(),kpi:()=>UFe(),anomalies:()=>KFe(),files:()=>HM(),agentFiles:()=>CVe(),preferences:()=>eM(),chatDefaults:()=>sUe(),access:()=>sIe(),integrations:()=>YFe(),theme:()=>wP(),audit:()=>QFe(),feedbacks:()=>tIe()};function N9(e){let t=new Set(E7),n=new Set,r=[];for(let i of e??[])t.has(i)&&!n.has(i)&&(r.push(i),n.add(i));for(let e of E7)n.has(e)||r.push(e);return r}function N3e(e,t){let n=new Set(t),r=[...t];return e.map(e=>n.has(e)?r.shift():e)}function P3e({tab:e,active:t}){let n=M3e[e]?.()??O7[e]??e,r=`oc-settings-tabs__tab`+(t?` is-active`:``),i=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`oc-settings-tabs__label`,children:n}),e===`bridge`?(0,z.jsx)(j3e,{}):null]});return D7.includes(e)?(0,z.jsx)(Qo,{to:`/settings/$tab`,params:{tab:e},className:r,role:`tab`,"aria-selected":t,children:i}):(0,z.jsx)(Qo,{to:`/settings/${e}`,className:r,role:`tab`,"aria-selected":t,children:i})}function F3e({tab:e,active:t}){let{attributes:n,listeners:r,setNodeRef:i,transform:a,transition:o,isDragging:s}=E5({id:e});return(0,z.jsxs)(`div`,{ref:i,style:{transform:n8.Transform.toString(a),transition:o,opacity:s?.5:1},className:`oc-settings-tabs__item`,role:`presentation`,children:[(0,z.jsx)(`button`,{type:`button`,className:`oc-settings-tabs__grip`,"aria-label":nze(),...n,...r,children:(0,z.jsx)(mm,{size:14,"aria-hidden":!0})}),(0,z.jsx)(P3e,{tab:e,active:t})]})}function I3e(){let e=L(H.me.getMe),t=R(H.me.setSettingsTabOrder),n=N7(Ss({select:e=>e.pathname})),r=n===void 0?void 0:M9(n),i=(0,I.useMemo)(()=>N9(e?.settingsTabOrder??null),[e?.settingsTabOrder]),[a,o]=(0,I.useState)(i);(0,I.useEffect)(()=>o(i),[i]);let s=(0,I.useMemo)(()=>new Set(j7(e?.permissions??[])),[e?.permissions]),c=(0,I.useMemo)(()=>r===void 0?[]:a.filter(e=>s.has(e)&&M9(e)===r),[a,s,r]),l=c8(s8(H8,{activationConstraint:{distance:5}}),s8(R8,{coordinateGetter:O5}));if(r===void 0||c.length===0)return null;let u=j9.find(e=>e.id===r);function d(e){let{active:n,over:r}=e;if(!r||n.id===r.id)return;let i=c.indexOf(n.id),s=c.indexOf(r.id);if(i<0||s<0)return;let l=N3e(a,_5(c,i,s));o(l),t({order:l})}return(0,z.jsx)(`div`,{className:`oc-settings-tabs`,role:`tablist`,"aria-label":u?.label(),children:(0,z.jsx)(f5,{sensors:l,collisionDetection:j1e,modifiers:[V0e],onDragEnd:d,children:(0,z.jsx)(w5,{items:c,strategy:J0e,children:c.map(e=>(0,z.jsx)(F3e,{tab:e,active:e===n},e))})})})}function L3e(){let e=L(H.me.getMe),t=Ro(),n=N7(Ss({select:e=>e.pathname})),r=n===void 0?void 0:M9(n),i=(0,I.useMemo)(()=>new Set(j7(e?.permissions??[])),[e?.permissions]),a=(0,I.useMemo)(()=>N9(e?.settingsTabOrder??null).filter(e=>i.has(e)),[e?.settingsTabOrder,i]),o=j9.filter(e=>e.tabs.some(e=>i.has(e)));function s(e){let n=E3e(a,e.id);n&&t({to:M7(n)})}return(0,z.jsxs)(`nav`,{className:`oc-settings-nav`,"aria-label":aze(),children:[(0,z.jsx)(Qo,{to:`/`,className:`oc-settings-nav__back`,children:cze()}),(0,z.jsx)(`div`,{className:`oc-settings-nav__title`,children:dze()}),(0,z.jsx)(`div`,{className:`oc-settings-nav__list`,children:o.map(e=>(0,z.jsx)(`button`,{type:`button`,className:`oc-settings-nav__group`+(e.id===r?` is-active`:``),"aria-current":e.id===r?`true`:void 0,onClick:()=>s(e),children:e.label()},e.id))})]})}var R3e=`background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.destructive-foreground.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring`.split(`.`),P9=[{key:`ocean`,name:`Ocean`,tokens:{colors:{light:{background:`oklch(0.985 0.012 230)`,foreground:`oklch(0.22 0.04 245)`,card:`oklch(0.995 0.008 230)`,"card-foreground":`oklch(0.22 0.04 245)`,popover:`oklch(0.995 0.008 230)`,"popover-foreground":`oklch(0.22 0.04 245)`,primary:`oklch(0.55 0.13 235)`,"primary-foreground":`oklch(0.99 0.01 230)`,secondary:`oklch(0.93 0.03 220)`,"secondary-foreground":`oklch(0.28 0.05 240)`,muted:`oklch(0.94 0.02 225)`,"muted-foreground":`oklch(0.5 0.04 235)`,accent:`oklch(0.9 0.05 200)`,"accent-foreground":`oklch(0.28 0.06 230)`,border:`oklch(0.88 0.03 225)`,input:`oklch(0.88 0.03 225)`,ring:`oklch(0.55 0.13 235)`,"chart-1":`oklch(0.6 0.13 235)`,"chart-2":`oklch(0.65 0.12 200)`,"chart-3":`oklch(0.55 0.1 260)`,"chart-4":`oklch(0.7 0.11 180)`,"chart-5":`oklch(0.5 0.12 215)`,sidebar:`oklch(0.96 0.02 228)`,"sidebar-foreground":`oklch(0.24 0.04 245)`,"sidebar-primary":`oklch(0.55 0.13 235)`,"sidebar-primary-foreground":`oklch(0.99 0.01 230)`,"sidebar-accent":`oklch(0.9 0.05 200)`,"sidebar-accent-foreground":`oklch(0.28 0.06 230)`,"sidebar-border":`oklch(0.87 0.03 225)`,"sidebar-ring":`oklch(0.55 0.13 235)`},dark:{background:`oklch(0.2 0.03 245)`,foreground:`oklch(0.95 0.02 225)`,card:`oklch(0.25 0.04 245)`,"card-foreground":`oklch(0.95 0.02 225)`,popover:`oklch(0.25 0.04 245)`,"popover-foreground":`oklch(0.95 0.02 225)`,primary:`oklch(0.7 0.12 230)`,"primary-foreground":`oklch(0.18 0.04 245)`,secondary:`oklch(0.3 0.04 240)`,"secondary-foreground":`oklch(0.95 0.02 225)`,muted:`oklch(0.3 0.03 242)`,"muted-foreground":`oklch(0.72 0.04 228)`,accent:`oklch(0.4 0.07 210)`,"accent-foreground":`oklch(0.96 0.02 220)`,border:`oklch(0.35 0.03 242)`,input:`oklch(0.35 0.03 242)`,ring:`oklch(0.7 0.12 230)`,"chart-1":`oklch(0.7 0.13 230)`,"chart-2":`oklch(0.72 0.12 195)`,"chart-3":`oklch(0.65 0.11 260)`,"chart-4":`oklch(0.76 0.1 180)`,"chart-5":`oklch(0.62 0.12 215)`,sidebar:`oklch(0.23 0.04 246)`,"sidebar-foreground":`oklch(0.95 0.02 225)`,"sidebar-primary":`oklch(0.7 0.12 230)`,"sidebar-primary-foreground":`oklch(0.18 0.04 245)`,"sidebar-accent":`oklch(0.4 0.07 210)`,"sidebar-accent-foreground":`oklch(0.96 0.02 220)`,"sidebar-border":`oklch(0.34 0.03 242)`,"sidebar-ring":`oklch(0.7 0.12 230)`}},radius:`0.75rem`,fontSans:`ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif`}},{key:`forest`,name:`Forest`,tokens:{colors:{light:{background:`oklch(0.985 0.012 130)`,foreground:`oklch(0.24 0.04 145)`,card:`oklch(0.995 0.008 130)`,"card-foreground":`oklch(0.24 0.04 145)`,popover:`oklch(0.995 0.008 130)`,"popover-foreground":`oklch(0.24 0.04 145)`,primary:`oklch(0.52 0.12 150)`,"primary-foreground":`oklch(0.99 0.01 130)`,secondary:`oklch(0.93 0.04 130)`,"secondary-foreground":`oklch(0.3 0.05 150)`,muted:`oklch(0.94 0.03 135)`,"muted-foreground":`oklch(0.5 0.04 145)`,accent:`oklch(0.9 0.06 115)`,"accent-foreground":`oklch(0.3 0.06 150)`,border:`oklch(0.88 0.03 135)`,input:`oklch(0.88 0.03 135)`,ring:`oklch(0.52 0.12 150)`,"chart-1":`oklch(0.58 0.13 150)`,"chart-2":`oklch(0.68 0.12 120)`,"chart-3":`oklch(0.6 0.11 95)`,"chart-4":`oklch(0.55 0.1 175)`,"chart-5":`oklch(0.5 0.12 140)`,sidebar:`oklch(0.96 0.02 132)`,"sidebar-foreground":`oklch(0.26 0.04 145)`,"sidebar-primary":`oklch(0.52 0.12 150)`,"sidebar-primary-foreground":`oklch(0.99 0.01 130)`,"sidebar-accent":`oklch(0.9 0.06 115)`,"sidebar-accent-foreground":`oklch(0.3 0.06 150)`,"sidebar-border":`oklch(0.87 0.03 135)`,"sidebar-ring":`oklch(0.52 0.12 150)`},dark:{background:`oklch(0.2 0.03 150)`,foreground:`oklch(0.95 0.02 130)`,card:`oklch(0.25 0.04 150)`,"card-foreground":`oklch(0.95 0.02 130)`,popover:`oklch(0.25 0.04 150)`,"popover-foreground":`oklch(0.95 0.02 130)`,primary:`oklch(0.68 0.13 145)`,"primary-foreground":`oklch(0.18 0.04 150)`,secondary:`oklch(0.3 0.04 148)`,"secondary-foreground":`oklch(0.95 0.02 130)`,muted:`oklch(0.3 0.03 150)`,"muted-foreground":`oklch(0.72 0.04 135)`,accent:`oklch(0.4 0.07 120)`,"accent-foreground":`oklch(0.96 0.02 125)`,border:`oklch(0.35 0.03 148)`,input:`oklch(0.35 0.03 148)`,ring:`oklch(0.68 0.13 145)`,"chart-1":`oklch(0.68 0.14 148)`,"chart-2":`oklch(0.74 0.12 120)`,"chart-3":`oklch(0.68 0.11 95)`,"chart-4":`oklch(0.62 0.1 175)`,"chart-5":`oklch(0.6 0.12 140)`,sidebar:`oklch(0.23 0.04 150)`,"sidebar-foreground":`oklch(0.95 0.02 130)`,"sidebar-primary":`oklch(0.68 0.13 145)`,"sidebar-primary-foreground":`oklch(0.18 0.04 150)`,"sidebar-accent":`oklch(0.4 0.07 120)`,"sidebar-accent-foreground":`oklch(0.96 0.02 125)`,"sidebar-border":`oklch(0.34 0.03 148)`,"sidebar-ring":`oklch(0.68 0.13 145)`}},radius:`0.375rem`,fontSans:`Georgia, Cambria, 'Times New Roman', Times, serif`}},{key:`dusk`,name:`Dusk`,tokens:{colors:{light:{background:`oklch(0.985 0.012 300)`,foreground:`oklch(0.24 0.05 300)`,card:`oklch(0.995 0.008 300)`,"card-foreground":`oklch(0.24 0.05 300)`,popover:`oklch(0.995 0.008 300)`,"popover-foreground":`oklch(0.24 0.05 300)`,primary:`oklch(0.55 0.16 300)`,"primary-foreground":`oklch(0.99 0.01 300)`,secondary:`oklch(0.93 0.04 310)`,"secondary-foreground":`oklch(0.3 0.06 300)`,muted:`oklch(0.94 0.03 305)`,"muted-foreground":`oklch(0.5 0.05 300)`,accent:`oklch(0.9 0.07 70)`,"accent-foreground":`oklch(0.32 0.08 60)`,border:`oklch(0.88 0.03 305)`,input:`oklch(0.88 0.03 305)`,ring:`oklch(0.55 0.16 300)`,"chart-1":`oklch(0.58 0.17 300)`,"chart-2":`oklch(0.7 0.15 70)`,"chart-3":`oklch(0.55 0.15 330)`,"chart-4":`oklch(0.65 0.14 35)`,"chart-5":`oklch(0.5 0.16 280)`,sidebar:`oklch(0.96 0.02 303)`,"sidebar-foreground":`oklch(0.26 0.05 300)`,"sidebar-primary":`oklch(0.55 0.16 300)`,"sidebar-primary-foreground":`oklch(0.99 0.01 300)`,"sidebar-accent":`oklch(0.9 0.07 70)`,"sidebar-accent-foreground":`oklch(0.32 0.08 60)`,"sidebar-border":`oklch(0.87 0.03 305)`,"sidebar-ring":`oklch(0.55 0.16 300)`},dark:{background:`oklch(0.2 0.04 300)`,foreground:`oklch(0.95 0.02 305)`,card:`oklch(0.25 0.05 300)`,"card-foreground":`oklch(0.95 0.02 305)`,popover:`oklch(0.25 0.05 300)`,"popover-foreground":`oklch(0.95 0.02 305)`,primary:`oklch(0.72 0.15 300)`,"primary-foreground":`oklch(0.18 0.04 300)`,secondary:`oklch(0.3 0.05 305)`,"secondary-foreground":`oklch(0.95 0.02 305)`,muted:`oklch(0.3 0.04 303)`,"muted-foreground":`oklch(0.72 0.05 305)`,accent:`oklch(0.45 0.1 65)`,"accent-foreground":`oklch(0.96 0.02 70)`,border:`oklch(0.35 0.04 303)`,input:`oklch(0.35 0.04 303)`,ring:`oklch(0.72 0.15 300)`,"chart-1":`oklch(0.72 0.16 300)`,"chart-2":`oklch(0.78 0.14 70)`,"chart-3":`oklch(0.68 0.15 330)`,"chart-4":`oklch(0.72 0.13 35)`,"chart-5":`oklch(0.64 0.16 280)`,sidebar:`oklch(0.23 0.05 300)`,"sidebar-foreground":`oklch(0.95 0.02 305)`,"sidebar-primary":`oklch(0.72 0.15 300)`,"sidebar-primary-foreground":`oklch(0.18 0.04 300)`,"sidebar-accent":`oklch(0.45 0.1 65)`,"sidebar-accent-foreground":`oklch(0.96 0.02 70)`,"sidebar-border":`oklch(0.34 0.04 303)`,"sidebar-ring":`oklch(0.72 0.15 300)`}},radius:`1rem`,fontSans:`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`}}];new Set(P9.map(e=>e.key));function F9(e){let t=e??localStorage.getItem(`oc.theme`)??`system`,n=()=>t===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:t,[r,i]=(0,I.useState)(n);return(0,I.useEffect)(()=>{if(i(n()),t!==`system`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),r=()=>i(e.matches?`dark`:`light`);return e.addEventListener(`change`,r),()=>e.removeEventListener(`change`,r)},[t]),r}function z3e(e,t){let n=document.documentElement.style,r=e?.colors[t];for(let e of R3e){let t=r?.[e];t===void 0?n.removeProperty(`--`+e):n.setProperty(`--`+e,t)}e?.radius===void 0?n.removeProperty(`--radius`):n.setProperty(`--radius`,e.radius),e?.fontSans===void 0?n.removeProperty(`--ui-font-sans`):n.setProperty(`--ui-font-sans`,e.fontSans),e?.fontMono===void 0?n.removeProperty(`--ui-font-mono`):n.setProperty(`--ui-font-mono`,e.fontMono)}function B3e(e,t){(0,I.useEffect)(()=>{z3e(e??null,t)},[e,t])}var I9=`__all__`,L9={kind:`relative`,from:`now-24h`,to:`now`},V3e=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function R9({title:e,description:t,children:n}){return(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,z.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,z.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function H3e(e){return e===`light`?zj():e===`dark`?Hj():Gj()}var U3e=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function W3e({tokens:e,mode:t}){let n=e.colors[t];return(0,z.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:U3e.map(e=>{let t=n[e];return(0,z.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function z9({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a}){return(0,z.jsxs)(`button`,{type:`button`,className:V1(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,z.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,z.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,z.jsx)(am,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,z.jsx)(W3e,{tokens:r,mode:i}):(0,z.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,z.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,z.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]})}function G3e({selectedKey:e,resolvedMode:t}){let n=L(H.charts.listMyCharts),r=R(H.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h2`,{className:`oc-show__title`,children:ZP()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:eF()})]}),(0,z.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,z.jsx)(z9,{selected:e===null,title:rF(),subtitle:oF(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?lF():n.via===`owner`?fF():hF({group:n.via.group});return(0,z.jsx)(z9,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key)},n.key)})]}),n!==void 0&&n.length===0?(0,z.jsx)(`p`,{className:`oc-show__desc`,children:vF()}):null]})}function B9(){let e=R(H.charts.importChart),[t,n]=(0,I.useState)(``),[r,i]=(0,I.useState)(``),[a,o]=(0,I.useState)(null),[s,c]=(0,I.useState)(!1),[l,u]=(0,I.useState)(!1);async function d(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(xI())}}}async function f(){if(o(null),c(!1),t.trim()===``){o(DI());return}let a;try{a=JSON.parse(r)}catch{o(xI());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!1)}}return(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h2`,{className:`oc-show__title`,children:ZF()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:eI()})]}),(0,z.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,z.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,z.jsx)(`span`,{className:`oc-chart-import__label`,children:rI()}),(0,z.jsx)(n0,{value:t,onChange:e=>n(e.target.value),placeholder:oI(),maxLength:60})]}),(0,z.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,z.jsx)(`span`,{className:`oc-chart-import__label`,children:lI()}),(0,z.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:fI(),rows:8,spellCheck:!1})]}),(0,z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,z.jsx)(X,{variant:`outline`,size:`sm`,asChild:!0,children:(0,z.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,z.jsx)(Tee,{className:`size-4`}),hI(),(0,z.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,z.jsx)(X,{size:`sm`,disabled:l,onClick:()=>void f(),children:vI()})]}),a?(0,z.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,z.jsx)(`p`,{className:`oc-chart-import__ok`,children:wI()}):null]})]})}function K3e({chartKey:e,myGroups:t,restricted:n}){let r=R(H.charts.assignChartToGroup),i=R(H.charts.removeChartFromGroup),a=new Set((n??[]).map(e=>e.groupId)),o=t.filter(e=>!a.has(e.groupId));async function s(t){try{await r({groupId:t,chartKey:e})}catch{}}async function c(t){try{await i({groupId:t,chartKey:e})}catch{}}return(0,z.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,z.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:rL()}),(n??[]).map(e=>(0,z.jsxs)($,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,z.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":fL({group:e.name}),onClick:()=>void c(e.groupId),children:(0,z.jsx)(jm,{className:`size-3`})})]},e.groupId)),t.length===0?(0,z.jsx)(`span`,{className:`oc-show__desc`,children:oL()}):o.length>0?(0,z.jsxs)($3,{value:``,onValueChange:e=>void s(e),children:[(0,z.jsx)(t6,{size:`sm`,className:`w-56`,children:(0,z.jsx)(e6,{placeholder:lL()})}),(0,z.jsx)(n6,{children:o.map(e=>(0,z.jsx)(Q,{value:e.groupId,children:e.name},e.groupId))})]}):null]})}function q3e({chart:e,myGroups:t}){let n=R(H.charts.updateChart),r=R(H.charts.deleteChart),[i,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(e.name),[c,l]=(0,I.useState)(()=>JSON.stringify(e.tokens,null,2)),[u,d]=(0,I.useState)(null),[f,p]=(0,I.useState)(!1);function m(){s(e.name),l(JSON.stringify(e.tokens,null,2)),d(null),a(!0)}async function h(){if(e.chartId===void 0)return;d(null);let t;try{t=JSON.parse(c)}catch{d(xI());return}p(!0);try{await n({chartId:e.chartId,name:o.trim(),tokens:t}),a(!1)}catch(e){d(e instanceof Error?e.message:String(e))}finally{p(!1)}}async function g(){if(e.chartId!==void 0&&window.confirm(hL()))try{await r({chartId:e.chartId})}catch{}}return(0,z.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,z.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,z.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,z.jsx)(`div`,{className:`oc-show__row`,children:i?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(X,{variant:`outline`,size:`sm`,onClick:m,children:zI()}),(0,z.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>void g(),children:HI()})]})})]}),i?(0,z.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,z.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,z.jsx)(`span`,{className:`oc-chart-import__label`,children:ZI()}),(0,z.jsx)(n0,{value:o,onChange:e=>s(e.target.value),maxLength:60})]}),(0,z.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,z.jsx)(`span`,{className:`oc-chart-import__label`,children:eL()}),(0,z.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),u?(0,z.jsx)(`p`,{className:`oc-chart-import__error`,children:u}):null,(0,z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,z.jsx)(X,{size:`sm`,disabled:f,onClick:()=>void h(),children:GI()}),(0,z.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>a(!1),children:JI()})]})]}):null,(0,z.jsx)(K3e,{chartKey:e.key,myGroups:t,restricted:e.restrictedToGroups})]})}function J3e(){let e=L(H.charts.listMyCharts),t=L(H.groups.listMyGroups,{}),n=(e??[]).filter(e=>e.via===`owner`);return(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h2`,{className:`oc-show__title`,children:AI()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:NI()})]}),e!==void 0&&n.length===0?(0,z.jsx)(`p`,{className:`oc-show__desc`,children:II()}):(0,z.jsx)(`div`,{className:`oc-chart-mine-list`,children:n.map(e=>(0,z.jsx)(q3e,{chart:e,myGroups:t??[]},e.key))})]})}function Y3e({chart:e,groups:t}){let n=R(H.charts.assignChartToGroup),r=R(H.charts.removeChartFromGroup),i=e.restrictedToGroups,a=new Set((i??[]).map(e=>e.groupId)),o=t.filter(e=>!a.has(e._id));async function s(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function c(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,z.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,z.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,z.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,z.jsx)($,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?IF():e.kind===`custom`&&e.scope===`personal`?DL():NF()}),e.isGlobalDefault?(0,z.jsx)($,{variant:`default`,children:zF()}):null]}),(0,z.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(i??[]).map(e=>(0,z.jsxs)($,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,z.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":JF({group:e.name}),onClick:()=>void c(e.groupId),children:(0,z.jsx)(jm,{className:`size-3`})})]},e.groupId)),o.length>0?(0,z.jsxs)($3,{value:``,onValueChange:e=>void s(e),children:[(0,z.jsx)(t6,{size:`sm`,className:`w-56`,children:(0,z.jsx)(e6,{placeholder:HF()})}),(0,z.jsx)(n6,{children:o.map(e=>(0,z.jsx)(Q,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,z.jsx)(`span`,{className:`oc-show__desc`,children:GF()}):null]})]})}function X3e({chart:e}){let t=R(H.charts.promoteChartToCommon),n=R(H.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(hL()))try{await n({chartId:e.chartId})}catch{}}return(0,z.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,z.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,z.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,z.jsx)($,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?AL():DL()}),e.ownerLabel?(0,z.jsx)(`span`,{className:`oc-show__desc`,children:wL({owner:e.ownerLabel})}):null]}),(0,z.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,z.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:NL()}):null,(0,z.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:IL()})]})]})}function Z3e({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=R(H.admin.setDefaultThemeMode),i=R(H.admin.setDefaultLocale),a=R(H.charts.setDefaultChart),o=L(H.charts.listChartsAdmin),s=L(H.groups.listGroups,{}),c=e??`system`,l=t??`fr`;return(0,z.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h2`,{className:`oc-show__title`,children:GP()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:JP()})]}),(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h3`,{className:`oc-show__title`,children:xF()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:wF()})]}),(0,z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,z.jsx)(X,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:rF()}),P9.map(e=>(0,z.jsx)(X,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,z.jsx)(X,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h3`,{className:`oc-show__title`,children:DF()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:AF()})]}),(0,z.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,z.jsx)(Y3e,{chart:e,groups:s??[]},e.key))})]}),(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h3`,{className:`oc-show__title`,children:vL()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:xL()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,z.jsx)(`p`,{className:`oc-show__desc`,children:zL()}):(0,z.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,z.jsx)(X3e,{chart:e},e.key))})})()]}),(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h3`,{className:`oc-show__title`,children:DP()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:AP()})]}),(0,z.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,z.jsx)(X,{variant:c===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:H3e(e)},e))})]}),(0,z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,z.jsx)(`h3`,{className:`oc-show__title`,children:NP()}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:IP()})]}),(0,z.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,z.jsx)(X,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e}),children:e===`fr`?IM():zM()},e))}),(0,z.jsx)(`p`,{className:`oc-show__desc`,children:zP()})]})]})}function Q3e(){let e=L(H.me.getMe),t=F9(e?.resolvedThemeMode);return(0,z.jsxs)(`div`,{className:`oc-appearance`,children:[(0,z.jsx)(G3e,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,z.jsx)(B9,{}),(0,z.jsx)(J3e,{}),e?.role===`admin`?(0,z.jsx)(Z3e,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function $3e(){let[e,t]=(0,I.useState)(!0),[n,r]=(0,I.useState)(`per-user`),[i,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(I9),[c,l]=(0,I.useState)(I9),[u,d]=(0,I.useState)(L9),f=i!==``||o!==I9||c!==I9;function p(){a(``),s(I9),l(I9),d(L9)}return(0,z.jsxs)(`div`,{className:`oc-show`,children:[(0,z.jsx)(Q3e,{}),(0,z.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,z.jsx)(`summary`,{className:`oc-show__title`,children:HP()}),(0,z.jsxs)(R9,{title:`Buttons`,description:`Variants`,children:[(0,z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,z.jsx)(X,{children:`Default`}),(0,z.jsx)(X,{variant:`secondary`,children:`Secondary`}),(0,z.jsx)(X,{variant:`outline`,children:`Outline`}),(0,z.jsx)(X,{variant:`ghost`,children:`Ghost`}),(0,z.jsx)(X,{variant:`destructive`,children:`Destructive`}),(0,z.jsx)(X,{variant:`link`,children:`Link`})]}),(0,z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,z.jsx)(X,{size:`sm`,children:`Small`}),(0,z.jsx)(X,{children:`Default`}),(0,z.jsx)(X,{size:`lg`,children:`Large`}),(0,z.jsx)(X,{size:`icon`,"aria-label":`more`,children:(0,z.jsx)(pm,{})}),(0,z.jsx)(X,{disabled:!0,children:`Disabled`})]})]}),(0,z.jsx)(R9,{title:`Badges`,children:(0,z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,z.jsx)($,{children:`Default`}),(0,z.jsx)($,{variant:`secondary`,children:`Secondary`}),(0,z.jsx)($,{variant:`outline`,children:`Outline`}),(0,z.jsx)($,{variant:`destructive`,children:`Destructive`})]})}),(0,z.jsx)(R9,{title:`Inputs & selection`,children:(0,z.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,z.jsx)(n0,{placeholder:`Text input…`}),(0,z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,z.jsxs)($3,{value:n,onValueChange:r,children:[(0,z.jsx)(t6,{className:`w-56`,children:(0,z.jsx)(e6,{placeholder:`Select…`})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,z.jsx)(Q,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,z.jsxs)(`label`,{className:`oc-show__check`,children:[(0,z.jsx)(J5,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,z.jsx)(R9,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,z.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,z.jsxs)(f7,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,z.jsxs)($3,{value:o,onValueChange:s,children:[(0,z.jsx)(t6,{size:`sm`,children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:I9,children:`Toutes directions`}),(0,z.jsx)(Q,{value:`inbound`,children:`inbound`}),(0,z.jsx)(Q,{value:`outbound`,children:`outbound`}),(0,z.jsx)(Q,{value:`internal`,children:`internal`})]})]}),(0,z.jsxs)($3,{value:c,onValueChange:l,children:[(0,z.jsx)(t6,{size:`sm`,children:(0,z.jsx)(e6,{})}),(0,z.jsxs)(n6,{children:[(0,z.jsx)(Q,{value:I9,children:`Toutes sévérités`}),(0,z.jsx)(Q,{value:`info`,children:`info`}),(0,z.jsx)(Q,{value:`warn`,children:`warn`}),(0,z.jsx)(Q,{value:`critical`,children:`critical`})]})]})]}),(0,z.jsx)(m7,{fields:V3e,onChange:()=>{}}),(0,z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,z.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,z.jsx)(d7,{value:u,onChange:d})]})]})}),(0,z.jsx)(R9,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,z.jsxs)(H1,{children:[(0,z.jsx)(U1,{asChild:!0,children:(0,z.jsx)(X,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,z.jsx)(pm,{})})}),(0,z.jsxs)(W1,{align:`start`,children:[(0,z.jsx)(K1,{children:`Actions`}),(0,z.jsx)(q1,{}),(0,z.jsx)(G1,{children:`Edit`}),(0,z.jsx)(G1,{children:`Duplicate`}),(0,z.jsx)(q1,{}),(0,z.jsx)(G1,{variant:`destructive`,children:`Delete`})]})]})}),(0,z.jsx)(R9,{title:`Card`,children:(0,z.jsxs)(q7,{className:`w-80`,children:[(0,z.jsxs)(J7,{children:[(0,z.jsx)(Y7,{children:`Instance`}),(0,z.jsx)(X7,{children:`Non-secret metadata only.`})]}),(0,z.jsx)(Z7,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,z.jsxs)(g4e,{className:`gap-2`,children:[(0,z.jsx)(X,{size:`sm`,children:`Save`}),(0,z.jsx)(X,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,z.jsx)(R9,{title:`Table`,children:(0,z.jsxs)(Y5,{children:[(0,z.jsx)(X5,{children:(0,z.jsxs)(Q5,{children:[(0,z.jsx)($5,{className:`w-8`,children:(0,z.jsx)(J5,{"aria-label":`select all`})}),(0,z.jsx)($5,{children:`Name`}),(0,z.jsx)($5,{children:`Mode`}),(0,z.jsx)($5,{className:`text-right`,children:`Status`}),(0,z.jsx)($5,{className:`w-8`})]})}),(0,z.jsx)(Z5,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,z.jsxs)(Q5,{children:[(0,z.jsx)(e7,{children:(0,z.jsx)(J5,{"aria-label":`select ${e.n}`})}),(0,z.jsx)(e7,{className:`font-medium`,children:e.n}),(0,z.jsx)(e7,{children:(0,z.jsx)($,{variant:`secondary`,children:e.m})}),(0,z.jsx)(e7,{className:`text-right`,children:(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,z.jsx)(am,{className:`size-3.5`}),` `,e.s]})}),(0,z.jsx)(e7,{children:(0,z.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,z.jsx)(pm,{})})})]},e.n))})]})}),(0,z.jsx)(R9,{title:`App fragments`,description:`Chat-specific components`,children:(0,z.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,z.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,z.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,z.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,z.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,z.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,z.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,z.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,z.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,z.jsx)(`span`,{className:`oc-run-status__dot`}),(0,z.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}var V9=`oc.theme`;function H9(e){let t=e===`dark`||e===`system`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;document.documentElement.classList.toggle(`dark`,t)}function e6e(e){(0,I.useEffect)(()=>{let t=e??localStorage.getItem(V9)??`system`;if(localStorage.setItem(V9,t),H9(t),t===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>H9(`system`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}},[e])}function t6e(e){(0,I.useEffect)(()=>{if(!e)return;document.documentElement.lang=e;let t;try{t=q()}catch{t=void 0}t!==e&&Ej(e)},[e])}var U9=`oc.sidebar.width`,W9=`oc.sidebar.collapsed`,G9=200,K9=520,n6e=260;function q9(e){return Math.min(K9,Math.max(G9,e))}function r6e(){let[e,t]=(0,I.useState)(()=>{let e=Number(localStorage.getItem(U9));return e?q9(e):n6e}),[n,r]=(0,I.useState)(()=>localStorage.getItem(W9)===`1`);(0,I.useEffect)(()=>{localStorage.setItem(U9,String(e))},[e]),(0,I.useEffect)(()=>{localStorage.setItem(W9,n?`1`:`0`)},[n]);let i=(0,I.useCallback)(()=>r(e=>!e),[]),a=(0,I.useRef)(!1);return{width:e,collapsed:n,toggleCollapsed:i,startResize:(0,I.useCallback)(n=>{n.preventDefault(),a.current=!0;let r=n.clientX,i=e,o=e=>{a.current&&t(q9(i+(e.clientX-r)))},s=()=>{a.current=!1,window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),document.body.style.cursor=``,document.body.style.userSelect=``};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[e]),MIN_WIDTH:G9,MAX_WIDTH:K9}}function i6e(){return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Gn,{children:(0,z.jsx)(`div`,{className:`oc-boot`,children:k$()})}),(0,z.jsx)(Wn,{children:(0,z.jsx)(a6e,{})}),(0,z.jsx)(Un,{children:(0,z.jsx)(QGe,{children:(0,z.jsx)(o6e,{})})})]})}function a6e(){let{signIn:e}=pr(),t=L(H.me.authProviders),[n,r]=(0,I.useState)(null);async function i(t){r(null);try{await e(t)}catch{r(SCe())}}let a=t!==void 0&&!t.google&&!t.microsoft&&!t.anonymous;return(0,z.jsxs)(`div`,{className:`oc-signin`,children:[t?.google?(0,z.jsx)(`button`,{type:`button`,className:`oc-signin__btn`,onClick:()=>void i(`google`),children:TCe()}):null,t?.microsoft?(0,z.jsx)(`button`,{type:`button`,className:`oc-signin__btn`,onClick:()=>void i(`microsoft-entra-id`),children:OCe()}):null,n?(0,z.jsx)(`p`,{className:`oc-signin__error`,children:n}):null,a?(0,z.jsx)(`p`,{className:`oc-signin__error`,children:jCe()}):null,t?.anonymous?(0,z.jsx)(`button`,{type:`button`,className:`oc-signin__btn oc-signin__btn--dev`,onClick:()=>void e(`anonymous`),children:PCe()}):null]})}function o6e(){let e=L(H.me.getMe),t=R(H.me.bootstrap),n=Ro();(0,I.useEffect)(()=>{e&&!e.hasProfile&&t()},[e,t]),e6e(e?.resolvedThemeMode);let r=F9(e?.resolvedThemeMode);B3e(e?.resolvedChartTokens,r),t6e(e?.resolvedLocale);let i=(0,I.useRef)(null);if((0,I.useEffect)(()=>{e&&(i.current!==null&&i.current!==e.userId&&n({to:`/`}),i.current=e.userId)},[e,n]),e===void 0)return(0,z.jsx)(`div`,{className:`oc-boot`,children:k$()});let a=e.name||e.email||LCe();return e.role===`pending`?(0,z.jsxs)(`div`,{className:`oc-shell`,children:[(0,z.jsx)(J9,{}),(0,z.jsx)(G5,{}),(0,z.jsxs)(`header`,{className:`oc-topbar`,children:[(0,z.jsx)(`span`,{className:`oc-topbar__brand`,children:`OpenClaw`}),(0,z.jsx)(`div`,{className:`oc-topbar__actions`,children:(0,z.jsx)(K5,{label:a,mode:e.themeMode,minimal:!0})})]}),(0,z.jsxs)(`div`,{className:`oc-pending`,children:[(0,z.jsx)(`h1`,{className:`oc-pending__title`,children:BCe()}),(0,z.jsx)(`p`,{className:`oc-pending__body`,children:UCe()})]})]}):(0,z.jsx)(c6e,{canOpenSettings:j7(e.permissions??[]).length>0,userLabel:a,themeMode:e.themeMode},e.userId)}function J9(){let e=L(H.me.getImpersonation),t=R(H.admin.stopImpersonation);return!e||!e.impersonating?null:(0,z.jsxs)(`div`,{className:`oc-imp`,role:`alert`,children:[(0,z.jsx)(lee,{className:`size-4 shrink-0`}),(0,z.jsxs)(`span`,{className:`oc-imp__text`,children:[KCe(),` `,(0,z.jsx)(`strong`,{children:e.targetLabel}),YCe(),(0,z.jsx)(`strong`,{children:e.realLabel}),QCe()]}),(0,z.jsx)(X,{size:`sm`,variant:`outline`,className:`oc-imp__exit`,onClick:()=>void t(),children:twe()})]})}function s6e({userLabel:e,themeMode:t,collapsed:n,onToggleSidebar:r}){return(0,z.jsxs)(`header`,{className:`oc-topbar`,children:[(0,z.jsxs)(`div`,{className:`oc-topbar__left`,children:[(0,z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":n?iwe():swe(),onClick:r,children:n?(0,z.jsx)(_ee,{}):(0,z.jsx)(gee,{})}),(0,z.jsx)(Qo,{to:`/`,className:`oc-topbar__brand`,children:`OpenClaw`})]}),(0,z.jsx)(`div`,{className:`oc-topbar__search`,children:(0,z.jsx)(b2e,{})}),(0,z.jsxs)(`div`,{className:`oc-topbar__actions`,children:[(0,z.jsx)(v2e,{}),(0,z.jsx)(K5,{label:e,mode:t})]})]})}function c6e({canOpenSettings:e,userLabel:t,themeMode:n}){let{width:r,collapsed:i,toggleCollapsed:a,startResize:o}=r6e(),s=gs(),c=Io({strict:!1}),l=Ro(),u=!!s({to:`/settings`,fuzzy:!0});return(0,z.jsxs)(`div`,{className:`oc-shell`,children:[(0,z.jsx)(J9,{}),(0,z.jsx)(G5,{}),(0,z.jsx)(s6e,{userLabel:t,themeMode:n,collapsed:i,onToggleSidebar:a}),(0,z.jsxs)(`div`,{className:`oc-workspace`,children:[i?null:(0,z.jsxs)(`div`,{className:`oc-sidebar-col`,style:{width:r,flex:`0 0 ${r}px`},children:[u?(0,z.jsx)(L3e,{}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(p2e,{activeChatId:c.chatId??null,onSelect:e=>void l({to:`/chat/$chatId`,params:{chatId:e}})}),e?(0,z.jsx)(X,{variant:`ghost`,className:`m-2 justify-start`,asChild:!0,children:(0,z.jsx)(Qo,{to:`/settings`,children:uwe()})}):null]}),(0,z.jsx)(`div`,{className:`oc-sidebar-resizer`,onPointerDown:o,role:`separator`,"aria-orientation":`vertical`,"aria-label":pwe()})]}),(0,z.jsx)(`main`,{className:`oc-main`,children:(0,z.jsx)(fs,{})})]})]})}function l6e(){let e=L(H.me.getMe),t=Ro(),n=Ss({select:e=>e.pathname}),r=(0,I.useMemo)(()=>e?j7(e.permissions??[]):[],[e]),i=e!==void 0&&r.length===0;if((0,I.useEffect)(()=>{i&&t({to:`/`})},[i,t]),e===void 0)return(0,z.jsx)(`div`,{className:`oc-admin__hint`,style:{padding:16},children:k$()});if(i)return null;let a=N7(n),o=a!==void 0&&!r.includes(a);return(0,z.jsxs)(`div`,{className:`oc-admin`,children:[(0,z.jsx)(I3e,{}),(0,z.jsx)(`div`,{className:`oc-admin__body`,children:o?(0,z.jsx)(u6e,{}):(0,z.jsx)(fs,{})})]})}function u6e(){return(0,z.jsxs)(`div`,{className:`oc-route-error`,role:`alert`,children:[(0,z.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,z.jsx)(Om,{size:28})}),(0,z.jsx)(`h2`,{className:`oc-route-error__title`,children:gwe()}),(0,z.jsx)(`p`,{className:`oc-route-error__body`,children:ywe()})]})}function d6e(){let e=L(H.me.getMe),t=Ro();return(0,I.useEffect)(()=>{if(e===void 0)return;let n=j7(e.permissions??[]);t({to:n.length>0?M7(n[0]):`/`,replace:!0})},[e,t]),(0,z.jsx)(`div`,{className:`oc-admin__hint`,style:{padding:16},children:k$()})}function f6e(){let{tab:e}=Io({from:`/settings/$tab`});switch(e){case`groups`:return(0,z.jsx)(r4e,{});case`integrations`:return(0,z.jsx)(R4e,{});case`instances`:return(0,z.jsx)(V2e,{});case`bridge`:return(0,z.jsx)(y3e,{});case`theme`:return(0,z.jsx)($3e,{});case`feedbacks`:return(0,z.jsx)(V4e,{});case`files`:return(0,z.jsx)(H4e,{});case`agentFiles`:return(0,z.jsx)(Q4e,{});case`preferences`:return(0,z.jsx)(u3e,{});case`chatDefaults`:return(0,z.jsx)(p3e,{});case`access`:return(0,z.jsx)(_3e,{});default:return(0,z.jsx)(n4e,{})}}function p6e(){let{chatId:e}=Io({from:`/chat/$chatId`});return(0,z.jsx)(E6,{chatId:e})}function m6e(){return(0,z.jsx)(E6,{chatId:null})}var Y9=rs({component:i6e}),h6e=ts({getParentRoute:()=>Y9,path:`/`,component:m6e}),g6e=ts({getParentRoute:()=>Y9,path:`chat/$chatId`,component:p6e}),X9=ts({getParentRoute:()=>Y9,path:`settings`,component:l6e}),_6e=ts({getParentRoute:()=>X9,path:`/`,component:d6e}),v6e=ts({getParentRoute:()=>X9,path:`traces`,validateSearch:j2e,component:f4e}),y6e=ts({getParentRoute:()=>X9,path:`audit`,validateSearch:M2e,component:W2e}),b6e=ts({getParentRoute:()=>X9,path:`anomalies`,validateSearch:N2e,component:M4e}),x6e=ts({getParentRoute:()=>X9,path:`kpi`,validateSearch:P2e,component:x4e}),S6e=ts({getParentRoute:()=>X9,path:`serviceAccounts`,validateSearch:F2e,component:q2e}),C6e=ts({getParentRoute:()=>X9,path:`users`,validateSearch:I2e,component:B2e}),w6e=ts({getParentRoute:()=>X9,path:`uiprefs`,beforeLoad:()=>{throw Fi({to:`/settings/$tab`,params:{tab:R2e.uiprefs},replace:!0})}}),T6e=ts({getParentRoute:()=>X9,path:`$tab`,parseParams:e=>({tab:Sp([...D7]).catch(`roles`).parse(e.tab)}),component:f6e});function E6e({reset:e}){let t=Ro();return(0,z.jsxs)(`div`,{className:`oc-route-error`,role:`alert`,children:[(0,z.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,z.jsx)(Om,{size:28})}),(0,z.jsx)(`h2`,{className:`oc-route-error__title`,children:Swe()}),(0,z.jsx)(`p`,{className:`oc-route-error__body`,children:Twe()}),(0,z.jsxs)(`div`,{className:`oc-route-error__actions`,children:[(0,z.jsx)(`button`,{type:`button`,className:`oc-route-error__cta`,onClick:()=>e(),children:Owe()}),(0,z.jsx)(`button`,{type:`button`,className:`oc-route-error__cta oc-route-error__cta--ghost`,onClick:()=>void t({to:`/`}),children:A$()})]})]})}function D6e(){let e=Ro();return(0,z.jsxs)(`div`,{className:`oc-route-error`,role:`status`,children:[(0,z.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,z.jsx)(cee,{size:28})}),(0,z.jsx)(`h2`,{className:`oc-route-error__title`,children:Nwe()}),(0,z.jsx)(`p`,{className:`oc-route-error__body`,children:Iwe()}),(0,z.jsx)(`div`,{className:`oc-route-error__actions`,children:(0,z.jsx)(`button`,{type:`button`,className:`oc-route-error__cta`,onClick:()=>void e({to:`/`}),children:A$()})})]})}var Z9=vs({routeTree:Y9.addChildren([h6e,g6e,X9.addChildren([_6e,v6e,y6e,b6e,x6e,S6e,C6e,w6e,T6e])]),defaultPreload:`intent`,defaultErrorComponent:E6e,defaultNotFoundComponent:D6e});async function O6e(){try{let e=await fetch(`/config.json`,{cache:`no-store`});if(e.ok){let t=(await e.json())?.convexUrl;if(typeof t==`string`&&t.trim())return t.trim()}}catch{}throw Error(`No Convex URL configured: serve /config.json {"convexUrl":"…"} (production) or set VITE_CONVEX_URL (local dev).`)}var k6e=()=>null;function Q9({children:e}){return(0,z.jsx)(`div`,{style:{display:`flex`,minHeight:`100vh`,alignItems:`center`,justifyContent:`center`,padding:`2rem`,textAlign:`center`,font:`14px system-ui, sans-serif`,opacity:.6},children:e})}var $9=Jn.createRoot(document.getElementById(`root`));$9.render((0,z.jsx)(I.StrictMode,{children:(0,z.jsx)(Q9,{children:`Chargement…`})})),O6e().then(e=>{let t=new En(e);$9.render((0,z.jsx)(I.StrictMode,{children:(0,z.jsx)(mr,{client:t,children:(0,z.jsxs)(YGe,{children:[(0,z.jsx)(A$e,{children:(0,z.jsx)(xs,{router:Z9})}),(0,z.jsx)(I.Suspense,{fallback:null,children:(0,z.jsx)(k6e,{router:Z9,position:`bottom-right`})})]})})}))}).catch(e=>{console.error(`Boot failed:`,e),$9.render((0,z.jsx)(I.StrictMode,{children:(0,z.jsxs)(Q9,{children:[`Configuration manquante\xA0:`,` `,e instanceof Error?e.message:String(e)]})}))});
|