@lacneu/atrium 0.10.6 → 0.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-CVp_aMoo.js +164 -0
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/index-ChQ1I5Fs.js +0 -164
|
@@ -0,0 +1,164 @@
|
|
|
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 ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function A(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 j(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,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+k(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),j(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(te,`$&/`)+`/`)+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+k(a,u),c+=j(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+k(a,u++),c+=j(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return j(A(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 ne(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(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 M=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)},ie={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(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=ie,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:re}},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,M)}catch(e){M(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&&k(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&&k(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 ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function k(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,k(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`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function ne(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?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 ee: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?ne(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var re=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},oe=[],se=-1;function ce(e){return{current:e}}function le(e){0>se||(e.current=oe[se],oe[se]=null,se--)}function ue(e,t){se++,oe[se]=e.current,e.current=t}var de=ce(null),fe=ce(null),pe=ce(null),me=ce(null);function he(e,t){switch(ue(pe,t),ue(fe,e),ue(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?tf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=tf(t),e=nf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(de),ue(de,e)}function ge(){le(de),le(fe),le(pe)}function _e(e){e.memoizedState!==null&&ue(me,e);var t=de.current,n=nf(t,e.type);t!==n&&(ue(fe,e),ue(de,n))}function ve(e){fe.current===e&&(le(de),le(fe)),me.current===e&&(le(me),fp._currentValue=ae)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+ye+e+be}var Se=!1;function Ce(e,t){if(!e||Se)return``;Se=!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{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(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 Ze(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=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(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 Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(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 et(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function rt(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-Ue(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&&it(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function it(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ue(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function at(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ue(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ot(e,t){var n=t&-t;return n=n&42?1:st(n),(n&(e.suspendedLanes|t))===0?n:0}function st(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 ct(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function lt(){var e=ie.p;return e===0?(e=window.event,e===void 0?32:Op(e.type)):e}function ut(e,t){var n=ie.p;try{return ie.p=e,t()}finally{ie.p=n}}var dt=Math.random().toString(36).slice(2),ft=`__reactFiber$`+dt,pt=`__reactProps$`+dt,mt=`__reactContainer$`+dt,ht=`__reactEvents$`+dt,gt=`__reactListeners$`+dt,_t=`__reactHandles$`+dt,vt=`__reactResources$`+dt,yt=`__reactMarker$`+dt;function bt(e){delete e[ft],delete e[pt],delete e[ht],delete e[gt],delete e[_t]}function xt(e){var t=e[ft];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mt]||n[ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Tf(e);e!==null;){if(n=e[ft])return n;e=Tf(e)}return t}e=n,n=e.parentNode}return null}function St(e){if(e=e[ft]||e[mt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ct(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function wt(e){var t=e[vt];return t||=e[vt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Tt(e){e[yt]=!0}var Et=new Set,Dt={};function Ot(e,t){kt(e,t),kt(e+`Capture`,t)}function kt(e,t){for(Dt[e]=t,e=0;e<t.length;e++)Et.add(t[e])}var At=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]*$`),jt={},Mt={};function Nt(e){return Ee.call(Mt,e)?!0:Ee.call(jt,e)?!1:At.test(e)?Mt[e]=!0:(jt[e]=!0,!1)}function Pt(e,t,n){if(Nt(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 Ft(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 It(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 Lt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Rt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function zt(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 Bt(e){if(!e._valueTracker){var t=Rt(e)?`checked`:`value`;e._valueTracker=zt(e,t,``+e[t])}}function Vt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Rt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ht(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 Ut=/[\n"\\]/g;function Wt(e){return e.replace(Ut,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Gt(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=``+Lt(t)):e.value!==``+Lt(t)&&(e.value=``+Lt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):qt(e,o,Lt(n)):qt(e,o,Lt(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=``+Lt(s):e.removeAttribute(`name`)}function Kt(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)){Bt(e);return}n=n==null?``:``+Lt(n),t=t==null?n:``+Lt(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),Bt(e)}function qt(e,t,n){t===`number`&&Ht(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Jt(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=``+Lt(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 Yt(e,t,n){if(t!=null&&(t=``+Lt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Lt(n)}function Xt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(re(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Lt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Bt(e)}function Zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qt=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 $t(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||Qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function en(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&&$t(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&$t(e,o,t[o])}function tn(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 nn=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`]]),rn=/^[\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 an(e){return rn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function on(){}var sn=null;function cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ln=null,un=null;function dn(e){var t=St(e);if(t&&(e=t.stateNode)){var n=e[pt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Gt(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="`+Wt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[pt]||null;if(!a)throw Error(i(90));Gt(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&&Vt(r)}break a;case`textarea`:Yt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Jt(e,!!n.multiple,t,!1)}}}var fn=!1;function pn(e,t,n){if(fn)return e(t,n);fn=!0;try{return e(t)}finally{if(fn=!1,(ln!==null||un!==null)&&(ju(),ln&&(t=ln,e=un,un=ln=null,dn(t),e)))for(t=0;t<e.length;t++)dn(e[t])}}function mn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[pt]||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 hn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),gn=!1;if(hn)try{var _n={};Object.defineProperty(_n,"passive",{get:function(){gn=!0}}),window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=null,yn=null,bn=null;function xn(){if(bn)return bn;var e,t=yn,n=t.length,r,i=`value`in vn?vn.value:vn.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 bn=i.slice(e,1<r?1-r:void 0)}function Sn(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 Cn(){return!0}function wn(){return!1}function Tn(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)?Cn:wn,this.isPropagationStopped=wn,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=Cn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Cn)},persist:function(){},isPersistent:Cn}),t}var En={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dn=Tn(En),On=p({},En,{view:0,detail:0}),kn=Tn(On),An,jn,Mn,Nn=p({},On,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Un,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!==Mn&&(Mn&&e.type===`mousemove`?(An=e.screenX-Mn.screenX,jn=e.screenY-Mn.screenY):jn=An=0,Mn=e),An)},movementY:function(e){return`movementY`in e?e.movementY:jn}}),Pn=Tn(Nn),Fn=Tn(p({},Nn,{dataTransfer:0})),In=Tn(p({},On,{relatedTarget:0})),Ln=Tn(p({},En,{animationName:0,elapsedTime:0,pseudoElement:0})),Rn=Tn(p({},En,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),zn=Tn(p({},En,{data:0})),Bn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Vn={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`},N={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=N[e])?!!t[e]:!1}function Un(){return Hn}var Wn=Tn(p({},On,{key:function(e){if(e.key){var t=Bn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Sn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Vn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Un,charCode:function(e){return e.type===`keypress`?Sn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Sn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Gn=Tn(p({},Nn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Kn=Tn(p({},On,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Un})),qn=Tn(p({},En,{propertyName:0,elapsedTime:0,pseudoElement:0})),Jn=Tn(p({},Nn,{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})),Yn=Tn(p({},En,{newState:0,oldState:0})),Xn=[9,13,27,32],Zn=hn&&`CompositionEvent`in window,Qn=null;hn&&`documentMode`in document&&(Qn=document.documentMode);var P=hn&&`TextEvent`in window&&!Qn,F=hn&&(!Zn||Qn&&8<Qn&&11>=Qn),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Xn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Zn&&tr(e,t)?(e=xn(),bn=yn=vn=null,rr=!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 F&&t.locale!==`ko`?null:t.data;default:return null}}var or={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 sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!or[e.type]:t===`textarea`}function cr(e,t,n,r){ln?un?un.push(r):un=[r]:ln=r,t=zd(t,`onChange`),0<t.length&&(n=new Dn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var lr=null,ur=null;function dr(e){jd(e,0)}function fr(e){if(Vt(Ct(e)))return e}function pr(e,t){if(e===`change`)return t}var mr=!1;if(hn){var hr;if(hn){var gr=`oninput`in document;if(!gr){var _r=document.createElement(`div`);_r.setAttribute(`oninput`,`return;`),gr=typeof _r.oninput==`function`}hr=gr}else hr=!1;mr=hr&&(!document.documentMode||9<document.documentMode)}function I(){lr&&(lr.detachEvent(`onpropertychange`,vr),ur=lr=null)}function vr(e){if(e.propertyName===`value`&&fr(ur)){var t=[];cr(t,ur,e,cn(e)),pn(dr,t)}}function yr(e,t,n){e===`focusin`?(I(),lr=t,ur=n,lr.attachEvent(`onpropertychange`,vr)):e===`focusout`&&I()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return fr(ur)}function xr(e,t){if(e===`click`)return fr(t)}function Sr(e,t){if(e===`input`||e===`change`)return fr(t)}function Cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var wr=typeof Object.is==`function`?Object.is:Cr;function Tr(e,t){if(wr(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(!Ee.call(t,i)||!wr(e[i],t[i]))return!1}return!0}function Er(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dr(e,t){var n=Er(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=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ht(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=Ht(e.document)}return t}function Ar(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 jr=hn&&`documentMode`in document&&11>=document.documentMode,Mr=null,Nr=null,Pr=null,Fr=!1;function Ir(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fr||Mr==null||Mr!==Ht(r)||(r=Mr,`selectionStart`in r&&Ar(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}),Pr&&Tr(Pr,r)||(Pr=r,r=zd(Nr,`onSelect`),0<r.length&&(t=new Dn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Mr)))}function Lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Rr={animationend:Lr(`Animation`,`AnimationEnd`),animationiteration:Lr(`Animation`,`AnimationIteration`),animationstart:Lr(`Animation`,`AnimationStart`),transitionrun:Lr(`Transition`,`TransitionRun`),transitionstart:Lr(`Transition`,`TransitionStart`),transitioncancel:Lr(`Transition`,`TransitionCancel`),transitionend:Lr(`Transition`,`TransitionEnd`)},zr={},Br={};hn&&(Br=document.createElement(`div`).style,`AnimationEvent`in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),`TransitionEvent`in window||delete Rr.transitionend.transition);function Vr(e){if(zr[e])return zr[e];if(!Rr[e])return e;var t=Rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Br)return zr[e]=t[n];return e}var Hr=Vr(`animationend`),Ur=Vr(`animationiteration`),Wr=Vr(`animationstart`),Gr=Vr(`transitionrun`),Kr=Vr(`transitionstart`),qr=Vr(`transitioncancel`),Jr=Vr(`transitionend`),Yr=new Map,Xr=`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(` `);Xr.push(`scrollEnd`);function Zr(e,t){Yr.set(e,t),Ot(t,[e])}var Qr=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)},$r=[],ei=0,ti=0;function ni(){for(var e=ei,t=ti=ei=0;t<e;){var n=$r[t];$r[t++]=null;var r=$r[t];$r[t++]=null;var i=$r[t];$r[t++]=null;var a=$r[t];if($r[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&&oi(n,i,a)}}function ri(e,t,n,r){$r[ei++]=e,$r[ei++]=t,$r[ei++]=n,$r[ei++]=r,ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ii(e,t,n,r){return ri(e,t,n,r),si(e)}function ai(e,t){return ri(e,null,null,t),si(e)}function oi(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-Ue(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function si(e){if(50<Su)throw Su=0,Cu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ci={};function li(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 ui(e,t,n,r){return new li(e,t,n,r)}function di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fi(e,t){var n=e.alternate;return n===null?(n=ui(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 pi(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 mi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)di(e)&&(s=1);else if(typeof e==`string`)s=rp(e,n,de.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=ui(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return hi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ui(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ui(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ui(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=ui(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function hi(e,t,n,r){return e=ui(7,e,r,t),e.lanes=n,e}function gi(e,t,n){return e=ui(6,e,null,t),e.lanes=n,e}function _i(e){var t=ui(18,null,null,0);return t.stateNode=e,t}function vi(e,t,n){return t=ui(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yi=new WeakMap;function bi(e,t){if(typeof e==`object`&&e){var n=yi.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},yi.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var xi=[],Si=0,Ci=null,wi=0,Ti=[],Ei=0,Di=null,Oi=1,ki=``;function Ai(e,t){xi[Si++]=wi,xi[Si++]=Ci,Ci=e,wi=t}function ji(e,t,n){Ti[Ei++]=Oi,Ti[Ei++]=ki,Ti[Ei++]=Di,Di=e;var r=Oi;e=ki;var i=32-Ue(r)-1;r&=~(1<<i),n+=1;var a=32-Ue(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Oi=1<<32-Ue(t)+i|n<<i|r,ki=a+e}else Oi=1<<a|n<<i|r,ki=e}function Mi(e){e.return!==null&&(Ai(e,1),ji(e,1,0))}function Ni(e){for(;e===Ci;)Ci=xi[--Si],xi[Si]=null,wi=xi[--Si],xi[Si]=null;for(;e===Di;)Di=Ti[--Ei],Ti[Ei]=null,ki=Ti[--Ei],Ti[Ei]=null,Oi=Ti[--Ei],Ti[Ei]=null}function Pi(e,t){Ti[Ei++]=Oi,Ti[Ei++]=ki,Ti[Ei++]=Di,Oi=t.id,ki=t.overflow,Di=e}var Fi=null,Ii=null,Li=!1,Ri=null,zi=!1,Bi=Error(i(519));function Vi(e){throw qi(bi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Bi}function Hi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ft]=e,t[pt]=r,n){case`dialog`:Md(`cancel`,t),Md(`close`,t);break;case`iframe`:case`object`:case`embed`:Md(`load`,t);break;case`video`:case`audio`:for(n=0;n<kd.length;n++)Md(kd[n],t);break;case`source`:Md(`error`,t);break;case`img`:case`image`:case`link`:Md(`error`,t),Md(`load`,t);break;case`details`:Md(`toggle`,t);break;case`input`:Md(`invalid`,t),Kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Md(`invalid`,t);break;case`textarea`:Md(`invalid`,t),Xt(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||Gd(t.textContent,n)?(r.popover!=null&&(Md(`beforetoggle`,t),Md(`toggle`,t)),r.onScroll!=null&&Md(`scroll`,t),r.onScrollEnd!=null&&Md(`scrollend`,t),r.onClick!=null&&(t.onclick=on),t=!0):t=!1,t||Vi(e,!0)}function Ui(e){for(Fi=e.return;Fi;)switch(Fi.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Fi=Fi.return}}function Wi(e){if(e!==Fi)return!1;if(!Li)return Ui(e),Li=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||rf(e.type,e.memoizedProps)),n=!n),n&&Ii&&Vi(e),Ui(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ii=wf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ii=wf(e)}else t===27?(t=Ii,ff(e.type)?(e=Cf,Cf=null,Ii=e):Ii=t):Ii=Fi?Sf(e.stateNode.nextSibling):null;return!0}function Gi(){Ii=Fi=null,Li=!1}function Ki(){var e=Ri;return e!==null&&(cu===null?cu=e:cu.push.apply(cu,e),Ri=null),e}function qi(e){Ri===null?Ri=[e]:Ri.push(e)}var Ji=ce(null),Yi=null,Xi=null;function Zi(e,t,n){ue(Ji,t._currentValue),t._currentValue=n}function Qi(e){e._currentValue=Ji.current,le(Ji)}function $i(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 ea(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),$i(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),$i(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 ta(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;wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[fp]:e.push(fp))}a=a.return}e!==null&&ea(t,e,n,r),t.flags|=262144}function na(e){for(e=e.firstContext;e!==null;){if(!wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){Yi=e,Xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ia(e){return oa(Yi,e)}function aa(e,t){return Yi===null&&ra(e),oa(e,t)}function oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xi===null){if(e===null)throw Error(i(308));Xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xi=Xi.next=t;return n}var sa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ca=t.unstable_scheduleCallback,la=t.unstable_NormalPriority,ua={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function da(){return{controller:new sa,data:new Map,refCount:0}}function fa(e){e.refCount--,e.refCount===0&&ca(la,function(){e.controller.abort()})}var pa=null,ma=0,ha=0,ga=null;function _a(e,t){if(pa===null){var n=pa=[];ma=0,ha=Cd(),ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ma++,t.then(va,va),t}function va(){if(--ma===0&&pa!==null){ga!==null&&(ga.status=`fulfilled`);var e=pa;pa=null,ha=0,ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ya(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ba=M.S;M.S=function(e,t){du=je(),typeof t==`object`&&t&&typeof t.then==`function`&&_a(e,t),ba!==null&&ba(e,t)};var xa=ce(null);function Sa(){var e=xa.current;return e===null?ql.pooledCache:e}function Ca(e,t){t===null?ue(xa,xa.current):ue(xa,t.pool)}function wa(){var e=Sa();return e===null?null:{parent:ua._currentValue,pool:e}}var Ta=Error(i(460)),Ea=Error(i(474)),Da=Error(i(542)),Oa={then:function(){}};function ka(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Aa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(on,on),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Pa(e),e;default:if(typeof t.status==`string`)t.then(on,on);else{if(e=ql,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,Pa(e),e}throw Ma=t,Ta}}function ja(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ma=e,Ta):e}}var Ma=null;function Na(){if(Ma===null)throw Error(i(459));var e=Ma;return Ma=null,e}function Pa(e){if(e===Ta||e===Da)throw Error(i(483))}var Fa=null,Ia=0;function La(e){var t=Ia;return Ia+=1,Fa===null&&(Fa=[]),Aa(Fa,e,t)}function Ra(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function za(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 Ba(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=fi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=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=gi(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&&ja(i)===t.type)?(t=a(t,n.props),Ra(t,n),t.return=e,t):(t=mi(n.type,n.key,n.props,null,e.mode,r),Ra(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=vi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=hi(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=gi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=mi(t.type,t.key,t.props,null,e.mode,n),Ra(n,t),n.return=e,n;case v:return t=vi(t,e.mode,n),t.return=e,t;case O:return t=ja(t),f(e,t,n)}if(re(t)||A(t))return t=hi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,La(t),n);if(t.$$typeof===C)return f(e,aa(e,t),n);za(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=ja(n),p(e,t,n,r)}if(re(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,La(n),r);if(n.$$typeof===C)return p(e,t,aa(e,n),r);za(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=ja(r),m(e,t,n,r,i)}if(re(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,La(r),i);if(r.$$typeof===C)return m(e,t,n,aa(t,r),i);za(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),Li&&Ai(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 Li&&Ai(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)}),Li&&Ai(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),Li&&Ai(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 Li&&Ai(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)}),Li&&Ai(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&&ja(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ra(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=hi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=mi(o.type,o.key,o.props,null,e.mode,c),Ra(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=vi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ja(o),b(e,r,o,c)}if(re(o))return h(e,r,o,c);if(A(o)){if(l=A(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,La(o),c);if(o.$$typeof===C)return b(e,r,aa(e,o),c);za(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=gi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ia=0;var i=b(e,t,n,r);return Fa=null,i}catch(t){if(t===Ta||t===Da)throw t;var a=ui(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Va=Ba(!0),Ha=Ba(!1),Ua=!1;function Wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ga(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 Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Kl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=si(e),oi(e,null,n),t}return ri(e,r,t,n),si(e)}function Ja(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,at(e,n)}}function Ya(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 Xa=!1;function Za(){if(Xa){var e=ga;if(e!==null)throw e}}function Qa(e,t,n,r){Xa=!1;var i=e.updateQueue;Ua=!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?(z&f)===f:(r&f)===f){f!==0&&f===ha&&(Xa=!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:Ua=!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),nu|=o,e.lanes=o,e.memoizedState=d}}function $a(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)$a(n[e],t)}var to=ce(null),no=ce(0);function ro(e,t){e=eu,ue(no,e),ue(to,t),eu=e|t.baseLanes}function io(){ue(no,eu),ue(to,to.current)}function ao(){eu=no.current,le(to),le(no)}var oo=ce(null),so=null;function co(e){var t=e.alternate;ue(mo,mo.current&1),ue(oo,e),so===null&&(t===null||to.current!==null||t.memoizedState!==null)&&(so=e)}function lo(e){ue(mo,mo.current),ue(oo,e),so===null&&(so=e)}function uo(e){e.tag===22?(ue(mo,mo.current),ue(oo,e),so===null&&(so=e)):fo(e)}function fo(){ue(mo,mo.current),ue(oo,oo.current)}function po(e){le(oo),so===e&&(so=null),le(mo)}var mo=ce(0);function ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||yf(n)||bf(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 go=0,_o=null,vo=null,yo=null,bo=!1,xo=!1,So=!1,Co=0,wo=0,To=null,Eo=0;function Do(){throw Error(i(321))}function Oo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function ko(e,t,n,r,i,a){return go=a,_o=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Ks:L,So=!1,a=n(r,i),So=!1,xo&&(a=jo(t,n,r,i)),Ao(e),a}function Ao(e){M.H=Gs;var t=vo!==null&&vo.next!==null;if(go=0,yo=vo=_o=null,bo=!1,wo=0,To=null,t)throw Error(i(300));e===null||lc||(e=e.dependencies,e!==null&&na(e)&&(lc=!0))}function jo(e,t,n,r){_o=e;var a=0;do{if(xo&&(To=null),wo=0,xo=!1,25<=a)throw Error(i(301));if(a+=1,yo=vo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=qs,o=t(n,r)}while(xo);return o}function Mo(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?zo(t):t,e=e.useState()[0],(vo===null?null:vo.memoizedState)!==e&&(_o.flags|=1024),t}function No(){var e=Co!==0;return Co=0,e}function Po(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Fo(e){if(bo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bo=!1}go=0,yo=vo=_o=null,xo=!1,wo=Co=0,To=null}function Io(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yo===null?_o.memoizedState=yo=e:yo=yo.next=e,yo}function Lo(){if(vo===null){var e=_o.alternate;e=e===null?null:e.memoizedState}else e=vo.next;var t=yo===null?_o.memoizedState:yo.next;if(t!==null)yo=t,vo=e;else{if(e===null)throw _o.alternate===null?Error(i(467)):Error(i(310));vo=e,e={memoizedState:vo.memoizedState,baseState:vo.baseState,baseQueue:vo.baseQueue,queue:vo.queue,next:null},yo===null?_o.memoizedState=yo=e:yo=yo.next=e}return yo}function Ro(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zo(e){var t=wo;return wo+=1,To===null&&(To=[]),e=Aa(To,e,t),t=_o,(yo===null?t.memoizedState:yo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Ks:L),e}function Bo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return zo(e);if(e.$$typeof===C)return ia(e)}throw Error(i(438,String(e)))}function Vo(e){var t=null,n=_o.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=_o.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=Ro(),_o.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=te;return t.index++,n}function Ho(e,t){return typeof t==`function`?t(e):t}function Uo(e){return Wo(Lo(),vo,e)}function Wo(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?(go&f)===f:(z&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===ha&&(d=!0);else if((go&p)===p){u=u.next,p===ha&&(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,_o.lanes|=p,nu|=p;f=u.action,So&&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,_o.lanes|=f,nu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!wr(o,e.memoizedState)&&(lc=!0,d&&(n=ga,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 Go(e){var t=Lo(),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);wr(o,t.memoizedState)||(lc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ko(e,t,n){var r=_o,a=Lo(),o=Li;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!wr((vo||a).memoizedState,n);if(s&&(a.memoizedState=n,lc=!0),a=a.queue,_s(Yo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||yo!==null&&yo.memoizedState.tag&1){if(r.flags|=2048,fs(9,{destroy:void 0},Jo.bind(null,r,a,n,t),null),ql===null)throw Error(i(349));o||go&127||qo(r,t,n)}return n}function qo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=_o.updateQueue,t===null?(t=Ro(),_o.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Jo(e,t,n,r){t.value=n,t.getSnapshot=r,Xo(t)&&Zo(e)}function Yo(e,t,n){return n(function(){Xo(t)&&Zo(e)})}function Xo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function Zo(e){var t=ai(e,2);t!==null&&Eu(t,e,2)}function Qo(e){var t=Io();if(typeof e==`function`){var n=e;if(e=n(),So){He(!0);try{n()}finally{He(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:e},t}function $o(e,t,n,r){return e.baseState=n,Wo(e,vo,typeof r==`function`?r:Ho)}function es(e,t,n,r,a){if(Hs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ts(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ts(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),ns(e,t,s)}catch(n){is(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),ns(e,t,a)}catch(n){is(e,t,n)}}function ns(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){rs(e,t,n)},function(n){return is(e,t,n)}):rs(e,t,n)}function rs(e,t,n){t.status=`fulfilled`,t.value=n,as(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ts(e,n)))}function is(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,as(t),t=t.next;while(t!==r)}e.action=null}function as(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function os(e,t){return t}function ss(e,t){if(Li){var n=ql.formState;if(n!==null){a:{var r=_o;if(Li){if(Ii){b:{for(var i=Ii,a=zi;i.nodeType!==8;){if(!a){i=null;break b}if(i=Sf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ii=Sf(i.nextSibling),r=i.data===`F!`;break a}}Vi(r)}r=!1}r&&(t=n[0])}}return n=Io(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:t},n.queue=r,n=zs.bind(null,_o,r),r.dispatch=n,r=Qo(!1),a=Vs.bind(null,_o,!1,r.queue),r=Io(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=es.bind(null,_o,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function cs(e){return ls(Lo(),vo,e)}function ls(e,t,n){if(t=Wo(e,t,os)[0],e=Uo(Ho)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=zo(t)}catch(e){throw e===Ta?Da:e}else r=t;t=Lo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(_o.flags|=2048,fs(9,{destroy:void 0},us.bind(null,i,n),null)),[r,a,e]}function us(e,t){e.action=t}function ds(e){var t=Lo(),n=vo;if(n!==null)return ls(t,n,e);Lo(),t=t.memoizedState,n=Lo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=_o.updateQueue,t===null&&(t=Ro(),_o.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ps(){return Lo().memoizedState}function ms(e,t,n,r){var i=Io();_o.flags|=e,i.memoizedState=fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function hs(e,t,n,r){var i=Lo();r=r===void 0?null:r;var a=i.memoizedState.inst;vo!==null&&r!==null&&Oo(r,vo.memoizedState.deps)?i.memoizedState=fs(t,a,n,r):(_o.flags|=e,i.memoizedState=fs(1|t,a,n,r))}function gs(e,t){ms(8390656,8,e,t)}function _s(e,t){hs(2048,8,e,t)}function vs(e){_o.flags|=4;var t=_o.updateQueue;if(t===null)t=Ro(),_o.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ys(e){var t=Lo().memoizedState;return vs({ref:t,nextImpl:e}),function(){if(Kl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function bs(e,t){return hs(4,2,e,t)}function xs(e,t){return hs(4,4,e,t)}function Ss(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 Cs(e,t,n){n=n==null?null:n.concat([e]),hs(4,4,Ss.bind(null,t,e),n)}function ws(){}function Ts(e,t){var n=Lo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Oo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Es(e,t){var n=Lo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Oo(t,r[1]))return r[0];if(r=e(),So){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r}function Ds(e,t,n){return n===void 0||go&1073741824&&!(z&261930)?e.memoizedState=t:(e.memoizedState=n,e=Tu(),_o.lanes|=e,nu|=e,n)}function Os(e,t,n,r){return wr(n,t)?n:to.current===null?!(go&42)||go&1073741824&&!(z&261930)?(lc=!0,e.memoizedState=n):(e=Tu(),_o.lanes|=e,nu|=e,t):(e=Ds(e,n,r),wr(e,t)||(lc=!0),e)}function ks(e,t,n,r,i){var a=ie.p;ie.p=a!==0&&8>a?a:8;var o=M.T,s={};M.T=s,Vs(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Bs(e,t,ya(c,r),wu(e)):Bs(e,t,r,wu(e))}catch(n){Bs(e,t,{then:function(){},status:`rejected`,reason:n},wu())}finally{ie.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function As(){}function js(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ms(e).queue;ks(e,a,t,ae,n===null?As:function(){return Ns(e),n(r)})}function Ms(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ns(e){var t=Ms(e);t.next===null&&(t=e.alternate.memoizedState),Bs(e,t.next.queue,{},wu())}function Ps(){return ia(fp)}function Fs(){return Lo().memoizedState}function Is(){return Lo().memoizedState}function Ls(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=wu();e=Ka(n);var r=qa(t,e,n);r!==null&&(Eu(r,t,n),Ja(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Rs(e,t,n){var r=wu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Hs(e)?Us(t,n):(n=ii(e,t,n,r),n!==null&&(Eu(n,e,r),Ws(n,t,r)))}function zs(e,t,n){Bs(e,t,n,wu())}function Bs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Hs(e))Us(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,wr(s,o))return ri(e,t,i,0),ql===null&&ni(),!1}catch{}if(n=ii(e,t,i,r),n!==null)return Eu(n,e,r),Ws(n,t,r),!0}return!1}function Vs(e,t,n,r){if(r={lane:2,revertLane:Cd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Hs(e)){if(t)throw Error(i(479))}else t=ii(e,n,r,2),t!==null&&Eu(t,e,2)}function Hs(e){var t=e.alternate;return e===_o||t!==null&&t===_o}function Us(e,t){xo=bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ws(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,at(e,n)}}var Gs={readContext:ia,use:Bo,useCallback:Do,useContext:Do,useEffect:Do,useImperativeHandle:Do,useLayoutEffect:Do,useInsertionEffect:Do,useMemo:Do,useReducer:Do,useRef:Do,useState:Do,useDebugValue:Do,useDeferredValue:Do,useTransition:Do,useSyncExternalStore:Do,useId:Do,useHostTransitionStatus:Do,useFormState:Do,useActionState:Do,useOptimistic:Do,useMemoCache:Do,useCacheRefresh:Do};Gs.useEffectEvent=Do;var Ks={readContext:ia,use:Bo,useCallback:function(e,t){return Io().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:gs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ms(4194308,4,Ss.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ms(4194308,4,e,t)},useInsertionEffect:function(e,t){ms(4,2,e,t)},useMemo:function(e,t){var n=Io();t=t===void 0?null:t;var r=e();if(So){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Io();if(n!==void 0){var i=n(t);if(So){He(!0);try{n(t)}finally{He(!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=Rs.bind(null,_o,e),[r.memoizedState,e]},useRef:function(e){var t=Io();return e={current:e},t.memoizedState=e},useState:function(e){e=Qo(e);var t=e.queue,n=zs.bind(null,_o,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ws,useDeferredValue:function(e,t){return Ds(Io(),e,t)},useTransition:function(){var e=Qo(!1);return e=ks.bind(null,_o,e.queue,!0,!1),Io().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=_o,a=Io();if(Li){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ql===null)throw Error(i(349));z&127||qo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,gs(Yo.bind(null,r,o,e),[e]),r.flags|=2048,fs(9,{destroy:void 0},Jo.bind(null,r,o,n,t),null),n},useId:function(){var e=Io(),t=ql.identifierPrefix;if(Li){var n=ki,r=Oi;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Co++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Eo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ps,useFormState:ss,useActionState:ss,useOptimistic:function(e){var t=Io();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Vs.bind(null,_o,!0,n),n.dispatch=t,[e,t]},useMemoCache:Vo,useCacheRefresh:function(){return Io().memoizedState=Ls.bind(null,_o)},useEffectEvent:function(e){var t=Io(),n={impl:e};return t.memoizedState=n,function(){if(Kl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},L={readContext:ia,use:Bo,useCallback:Ts,useContext:ia,useEffect:_s,useImperativeHandle:Cs,useInsertionEffect:bs,useLayoutEffect:xs,useMemo:Es,useReducer:Uo,useRef:ps,useState:function(){return Uo(Ho)},useDebugValue:ws,useDeferredValue:function(e,t){return Os(Lo(),vo.memoizedState,e,t)},useTransition:function(){var e=Uo(Ho)[0],t=Lo().memoizedState;return[typeof e==`boolean`?e:zo(e),t]},useSyncExternalStore:Ko,useId:Fs,useHostTransitionStatus:Ps,useFormState:cs,useActionState:cs,useOptimistic:function(e,t){return $o(Lo(),vo,e,t)},useMemoCache:Vo,useCacheRefresh:Is};L.useEffectEvent=ys;var qs={readContext:ia,use:Bo,useCallback:Ts,useContext:ia,useEffect:_s,useImperativeHandle:Cs,useInsertionEffect:bs,useLayoutEffect:xs,useMemo:Es,useReducer:Go,useRef:ps,useState:function(){return Go(Ho)},useDebugValue:ws,useDeferredValue:function(e,t){var n=Lo();return vo===null?Ds(n,e,t):Os(n,vo.memoizedState,e,t)},useTransition:function(){var e=Go(Ho)[0],t=Lo().memoizedState;return[typeof e==`boolean`?e:zo(e),t]},useSyncExternalStore:Ko,useId:Fs,useHostTransitionStatus:Ps,useFormState:ds,useActionState:ds,useOptimistic:function(e,t){var n=Lo();return vo===null?(n.baseState=e,[e,n.queue.dispatch]):$o(n,vo,e,t)},useMemoCache:Vo,useCacheRefresh:Is};qs.useEffectEvent=ys;function Js(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 Ys={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wu(),i=Ka(r);i.payload=t,n!=null&&(i.callback=n),t=qa(e,i,r),t!==null&&(Eu(t,e,r),Ja(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wu(),i=Ka(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=qa(e,i,r),t!==null&&(Eu(t,e,r),Ja(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wu(),r=Ka(n);r.tag=2,t!=null&&(r.callback=t),t=qa(e,r,n),t!==null&&(Eu(t,e,n),Ja(t,e,n))}};function Xs(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?!Tr(n,r)||!Tr(i,a):!0}function Zs(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&&Ys.enqueueReplaceState(t,t.state,null)}function Qs(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 $s(e){Qr(e)}function ec(e){console.error(e)}function tc(e){Qr(e)}function nc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function rc(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 ic(e,t,n){return n=Ka(n),n.tag=3,n.payload={element:null},n.callback=function(){nc(e,t)},n}function ac(e){return e=Ka(e),e.tag=3,e}function oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){rc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){rc(t,n,r),typeof i!=`function`&&(mu===null?mu=new Set([this]):mu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function sc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ta(t,n,a,!0),n=oo.current,n!==null){switch(n.tag){case 31:case 13:return so===null?Ru():n.alternate===null&&tu===0&&(tu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Oa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),rd(e,r,a)),!1;case 22:return n.flags|=65536,r===Oa?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)),rd(e,r,a)),!1}throw Error(i(435,n.tag))}return rd(e,r,a),Ru(),!1}if(Li)return t=oo.current,t===null?(r!==Bi&&(t=Error(i(423),{cause:r}),qi(bi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=bi(r,n),a=ic(e.stateNode,r,a),Ya(e,a),tu!==4&&(tu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Bi&&(e=Error(i(422),{cause:r}),qi(bi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=bi(o,n),su===null?su=[o]:su.push(o),tu!==4&&(tu=2),t===null)return!0;r=bi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ic(n.stateNode,r,e),Ya(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`&&(mu===null||!mu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ac(a),oc(a,e,n,r),Ya(n,a),!1}n=n.return}while(n!==null);return!1}var cc=Error(i(461)),lc=!1;function uc(e,t,n,r){t.child=e===null?Ha(t,null,n,r):Va(t,e.child,n,r)}function dc(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 ra(t),r=ko(e,t,n,o,a,i),s=No(),e!==null&&!lc?(Po(e,t,i),Pc(e,t,i)):(Li&&s&&Mi(t),t.flags|=1,uc(e,t,r,i),t.child)}function fc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,pc(e,t,a,r,i)):(e=mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Fc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Tr:n,n(o,r)&&e.ref===t.ref)return Pc(e,t,i)}return t.flags|=1,e=fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Tr(a,r)&&e.ref===t.ref)if(lc=!1,t.pendingProps=r=a,Fc(e,i))e.flags&131072&&(lc=!0);else return t.lanes=e.lanes,Pc(e,t,i)}return bc(e,t,n,r,i)}function mc(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 gc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ca(t,a===null?null:a.cachePool),a===null?io():ro(t,a),uo(t);else return r=t.lanes=536870912,gc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ca(t,null),io(),fo(t)):(Ca(t,a.cachePool),ro(t,a),fo(t),t.memoizedState=null);return uc(e,t,i,n),t.child}function hc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function gc(e,t,n,r,i){var a=Sa();return a=a===null?null:{parent:ua._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ca(t,null),io(),uo(t),e!==null&&ta(e,t,r,!0),t.childLanes=i,null}function R(e,t){return t=kc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function _c(e,t,n){return Va(t,e.child,null,n),e=R(t,t.pendingProps),e.flags|=2,po(t),t.memoizedState=null,e}function vc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Li){if(r.mode===`hidden`)return e=R(t,r),t.lanes=536870912,hc(null,e);if(lo(t),(e=Ii)?(e=vf(e,zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Di===null?null:{id:Oi,overflow:ki},retryLane:536870912,hydrationErrors:null},n=_i(e),n.return=t,t.child=n,Fi=t,Ii=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return R(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(lo(t),a)if(t.flags&256)t.flags&=-257,t=_c(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(lc||ta(e,t,n,!1),a=(n&e.childLanes)!==0,lc||a){if(r=ql,r!==null&&(s=ot(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ai(e,s),Eu(r,e,s),cc;Ru(),t=_c(e,t,n)}else e=o.treeContext,Ii=Sf(s.nextSibling),Fi=t,Li=!0,Ri=null,zi=!1,e!==null&&Pi(t,e),t=R(t,r),t.flags|=4096;return t}return e=fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function yc(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 bc(e,t,n,r,i){return ra(t),n=ko(e,t,n,r,void 0,i),r=No(),e!==null&&!lc?(Po(e,t,i),Pc(e,t,i)):(Li&&r&&Mi(t),t.flags|=1,uc(e,t,n,i),t.child)}function xc(e,t,n,r,i,a){return ra(t),t.updateQueue=null,n=jo(t,r,n,i),Ao(e),r=No(),e!==null&&!lc?(Po(e,t,a),Pc(e,t,a)):(Li&&r&&Mi(t),t.flags|=1,uc(e,t,n,a),t.child)}function Sc(e,t,n,r,i){if(ra(t),t.stateNode===null){var a=ci,o=n.contextType;typeof o==`object`&&o&&(a=ia(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ys,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Wa(t),o=n.contextType,a.context=typeof o==`object`&&o?ia(o):ci,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Js(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&&Ys.enqueueReplaceState(a,a.state,null),Qa(t,r,a,i),Za(),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=Qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ci,typeof u==`object`&&u&&(o=ia(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)&&Zs(t,a,r,o),Ua=!1;var f=t.memoizedState;a.state=f,Qa(t,r,a,i),Za(),l=t.memoizedState,s||f!==l||Ua?(typeof d==`function`&&(Js(t,n,d,r),l=t.memoizedState),(c=Ua||Xs(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,Ga(e,t),o=t.memoizedProps,u=Qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ci,typeof l==`object`&&l&&(c=ia(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)&&Zs(t,a,r,c),Ua=!1,f=t.memoizedState,a.state=f,Qa(t,r,a,i),Za();var p=t.memoizedState;o!==d||f!==p||Ua||e!==null&&e.dependencies!==null&&na(e.dependencies)?(typeof s==`function`&&(Js(t,n,s,r),p=t.memoizedState),(u=Ua||Xs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&na(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,yc(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=Va(t,e.child,null,i),t.child=Va(t,null,n,i)):uc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Pc(e,t,i),e}function Cc(e,t,n,r){return Gi(),t.flags|=256,uc(e,t,n,r),t.child}var wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Tc(e){return{baseLanes:e,cachePool:wa()}}function Ec(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=au),e}function Dc(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:(mo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Li){if(a?co(t):fo(t),(e=Ii)?(e=vf(e,zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Di===null?null:{id:Oi,overflow:ki},retryLane:536870912,hydrationErrors:null},n=_i(e),n.return=t,t.child=n,Fi=t,Ii=null)):e=null,e===null)throw Vi(t);return bf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(fo(t),a=t.mode,c=kc({mode:`hidden`,children:c},a),r=hi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Tc(n),r.childLanes=Ec(e,s,n),t.memoizedState=wc,hc(null,r)):(co(t),Oc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(co(t),t.flags&=-257,t=Ac(e,t,n)):t.memoizedState===null?(fo(t),c=r.fallback,a=t.mode,r=kc({mode:`visible`,children:r.children},a),c=hi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Va(t,e.child,null,n),r=t.child,r.memoizedState=Tc(n),r.childLanes=Ec(e,s,n),t.memoizedState=wc,t=hc(null,r)):(fo(t),t.child=e.child,t.flags|=128,t=null);else if(co(t),bf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,qi({value:r,source:null,stack:null}),t=Ac(e,t,n)}else if(lc||ta(e,t,n,!1),s=(n&e.childLanes)!==0,lc||s){if(s=ql,s!==null&&(r=ot(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ai(e,r),Eu(s,e,r),cc;yf(c)||Ru(),t=Ac(e,t,n)}else yf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ii=Sf(c.nextSibling),Fi=t,Li=!0,Ri=null,zi=!1,e!==null&&Pi(t,e),t=Oc(t,r.children),t.flags|=4096);return t}return a?(fo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=fi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=hi(c,a,n,null),c.flags|=2):c=fi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,hc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Tc(n):(a=c.cachePool,a===null?a=wa():(l=ua._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Ec(e,s,n),t.memoizedState=wc,hc(e.child,r)):(co(t),n=e.child,e=n.sibling,n=fi(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 Oc(e,t){return t=kc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function kc(e,t){return e=ui(22,e,null,t),e.lanes=0,e}function Ac(e,t,n){return Va(t,e.child,null,n),e=Oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$i(e.return,t,n)}function Mc(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 Nc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=mo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,ue(mo,o),uc(e,t,r,n),r=Li?wi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jc(e,n,t);else if(e.tag===19)jc(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&&ho(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Mc(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&&ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Mc(t,!0,n,null,a,r);break;case`together`:Mc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Pc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),nu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&na(e))):!0}function Ic(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),Zi(t,ua,e.memoizedState.cache),Gi();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:Zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(co(t),e=Pc(e,t,n),e===null?null:e.sibling):Dc(e,t,n):(co(t),t.flags|=128,null);co(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Nc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ue(mo,mo.current),r)break;return null;case 22:return t.lanes=0,mc(e,t,n,t.pendingProps);case 24:Zi(t,ua,e.memoizedState.cache)}return Pc(e,t,n)}function Lc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)lc=!0;else{if(!Fc(e,n)&&!(t.flags&128))return lc=!1,Ic(e,t,n);lc=!!(e.flags&131072)}else lc=!1,Li&&t.flags&1048576&&ji(t,wi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ja(t.elementType),t.type=e,typeof e==`function`)di(e)?(r=Qs(e,r),t.tag=1,t=Sc(null,t,e,r,n)):(t.tag=0,t=bc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=dc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=fc(null,t,e,r,n);break a}}throw t=ne(e)||e,Error(i(306,t,``))}}return t;case 0:return bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Qs(r,t.pendingProps),Sc(e,t,r,a,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ga(e,t),Qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Zi(t,ua,r),r!==o.cache&&ea(t,[ua],n,!0),Za(),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=Cc(e,t,r,n);break a}else if(r!==a){a=bi(Error(i(424)),t),qi(a),t=Cc(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(Ii=Sf(e.firstChild),Fi=t,Li=!0,Ri=null,zi=!0,n=Ha(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Gi(),r===a){t=Pc(e,t,n);break a}uc(e,t,r,n)}t=t.child}return t;case 26:return yc(e,t),e===null?(n=Uf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Li||(n=t.type,e=t.pendingProps,r=ef(pe.current).createElement(n),r[ft]=t,r[pt]=e,Jd(r,n,e),Tt(r),t.stateNode=r):t.memoizedState=Uf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&Li&&(r=t.stateNode=Ef(t.type,t.pendingProps,pe.current),Fi=t,zi=!0,a=Ii,ff(t.type)?(Cf=a,Ii=Sf(r.firstChild)):Ii=a),uc(e,t,t.pendingProps.children,n),yc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Li&&((a=r=Ii)&&(r=gf(r,t.type,t.pendingProps,zi),r===null?a=!1:(t.stateNode=r,Fi=t,Ii=Sf(r.firstChild),zi=!1,a=!0)),a||Vi(t)),_e(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,rf(a,o)?r=null:s!==null&&rf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ko(e,t,Mo,null,null,n),fp._currentValue=a),yc(e,t),uc(e,t,r,n),t.child;case 6:return e===null&&Li&&((e=n=Ii)&&(n=_f(n,t.pendingProps,zi),n===null?e=!1:(t.stateNode=n,Fi=t,Ii=null,e=!0)),e||Vi(t)),null;case 13:return Dc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Va(t,null,r,n):uc(e,t,r,n),t.child;case 11:return dc(e,t,t.type,t.pendingProps,n);case 7:return uc(e,t,t.pendingProps,n),t.child;case 8:return uc(e,t,t.pendingProps.children,n),t.child;case 12:return uc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Zi(t,t.type,r.value),uc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ra(t),a=ia(a),r=r(a),t.flags|=1,uc(e,t,r,n),t.child;case 14:return fc(e,t,t.type,t.pendingProps,n);case 15:return pc(e,t,t.type,t.pendingProps,n);case 19:return Nc(e,t,n);case 31:return vc(e,t,n);case 22:return mc(e,t,n,t.pendingProps);case 24:return ra(t),r=ia(ua),e===null?(a=Sa(),a===null&&(a=ql,o=da(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Wa(t),Zi(t,ua,a)):((e.lanes&n)!==0&&(Ga(e,t),Qa(t,null,null,n),Za()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Zi(t,ua,r),r!==a.cache&&ea(t,[ua],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Zi(t,ua,r))),uc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Rc(e){e.flags|=4}function zc(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(Fu())e.flags|=8192;else throw Ma=Oa,Ea}else e.flags&=-16777217}function Bc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ip(t))if(Fu())e.flags|=8192;else throw Ma=Oa,Ea}function Vc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:et(),e.lanes|=t,ou|=t)}function Hc(e,t){if(!Li)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 Uc(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 Wc(e,t,n){var r=t.pendingProps;switch(Ni(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Uc(t),null;case 1:return Uc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qi(ua),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?Rc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ki())),Uc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Rc(t),o===null?(Uc(t),zc(t,a,null,r,n)):(Uc(t),Bc(t,o))):o?o===e.memoizedState?(Uc(t),t.flags&=-16777217):(Rc(t),Uc(t),Bc(t,o)):(e=e.memoizedProps,e!==r&&Rc(t),Uc(t),zc(t,a,e,r,n)),null;case 27:if(ve(t),n=pe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Uc(t),null}e=de.current,Wi(t)?Hi(t,e):(e=Ef(a,r,n),t.stateNode=e,Rc(t))}return Uc(t),null;case 5:if(ve(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Uc(t),null}if(o=de.current,Wi(t))Hi(t,o);else{var s=ef(pe.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[ft]=t,o[pt]=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(Jd(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&&Rc(t)}}return Uc(t),zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Fi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ft]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Gd(e.nodeValue,n)),e||Vi(t,!0)}else e=ef(e).createTextNode(r),e[ft]=t,t.stateNode=e}return Uc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(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[ft]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(po(t),t):(po(t),null);if(t.flags&128)throw Error(i(558))}return Uc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(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[ft]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(po(t),t):(po(t),null)}return po(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),Vc(t,t.updateQueue),Uc(t),null);case 4:return ge(),e===null&&Fd(t.stateNode.containerInfo),Uc(t),null;case 10:return Qi(t.type),Uc(t),null;case 19:if(le(mo),r=t.memoizedState,r===null)return Uc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Hc(r,!1);else{if(tu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ho(e),o!==null){for(t.flags|=128,Hc(r,!1),e=o.updateQueue,t.updateQueue=e,Vc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)pi(n,e),n=n.sibling;return ue(mo,mo.current&1|2),Li&&Ai(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>fu&&(t.flags|=128,a=!0,Hc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Vc(t,e),Hc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Li)return Uc(t),null}else 2*je()-r.renderingStartTime>fu&&n!==536870912&&(t.flags|=128,a=!0,Hc(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?(Uc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=mo.current,ue(mo,a?n&1|2:n&1),Li&&Ai(t,r.treeForkCount),e);case 22:case 23:return po(t),ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Uc(t),t.subtreeFlags&6&&(t.flags|=8192)):Uc(t),n=t.updateQueue,n!==null&&Vc(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&&le(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(ua),Uc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Gc(e,t){switch(Ni(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(ua),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(po(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(mo),null;case 4:return ge(),null;case 10:return Qi(t.type),null;case 22:case 23:return po(t),ao(),e!==null&&le(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(ua),null;case 25:return null;default:return null}}function Kc(e,t){switch(Ni(t),t.tag){case 3:Qi(ua),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&po(t);break;case 13:po(t);break;case 19:le(mo);break;case 10:Qi(t.type);break;case 22:case 23:po(t),ao(),e!==null&&le(xa);break;case 24:Qi(ua)}}function qc(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){nd(t,t.return,e)}}function Jc(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){nd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){nd(t,t.return,e)}}function Yc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{eo(t,n)}catch(t){nd(e,e.return,t)}}}function Xc(e,t,n){n.props=Qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){nd(e,t,n)}}function Zc(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){nd(e,t,n)}}function Qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){nd(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){nd(e,t,n)}else n.current=null}function $c(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){nd(e,e.return,t)}}function el(e,t,n){try{var r=e.stateNode;Yd(r,e.type,n,t),r[pt]=t}catch(t){nd(e,e.return,t)}}function tl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ff(e.type)||e.tag===4}function nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||tl(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&&ff(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 rl(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=on));else if(r!==4&&(r===27&&ff(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(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&&ff(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Jd(t,r,n),t[ft]=e,t[pt]=n}catch(t){nd(e,e.return,t)}}var ol=!1,sl=!1,cl=!1,ll=typeof WeakSet==`function`?WeakSet:Set,ul=null;function dl(e,t){if(e=e.containerInfo,Qd=xp,e=kr(e),Ar(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($d={focusedElem:e,selectionRange:n},xp=!1,ul=t;ul!==null;)if(t=ul,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ul=e;else for(;ul!==null;){switch(t=ul,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=Qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){nd(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)hf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:hf(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,ul=e;break}ul=t.return}}function fl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Dl(e,n),r&4&&qc(5,n);break;case 1:if(Dl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){nd(n,n.return,e)}else{var i=Qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){nd(n,n.return,e)}}r&64&&Yc(n),r&512&&Zc(n,n.return);break;case 3:if(Dl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{eo(e,t)}catch(e){nd(n,n.return,e)}}break;case 27:t===null&&r&4&&al(n);case 26:case 5:Dl(e,n),t===null&&r&4&&$c(n),r&512&&Zc(n,n.return);break;case 12:Dl(e,n);break;case 31:Dl(e,n),r&4&&vl(e,n);break;case 13:Dl(e,n),r&4&&yl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=od.bind(null,n),xf(e,n))));break;case 22:if(r=n.memoizedState!==null||ol,!r){t=t!==null&&t.memoizedState!==null||sl,i=ol;var a=sl;ol=r,(sl=t)&&!a?kl(e,n,(n.subtreeFlags&8772)!=0):Dl(e,n),ol=i,sl=a}break;case 30:break;default:Dl(e,n)}}function pl(e){var t=e.alternate;t!==null&&(e.alternate=null,pl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bt(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 ml=null,hl=!1;function gl(e,t,n){for(n=n.child;n!==null;)_l(e,t,n),n=n.sibling}function _l(e,t,n){if(Ve&&typeof Ve.onCommitFiberUnmount==`function`)try{Ve.onCommitFiberUnmount(Be,n)}catch{}switch(n.tag){case 26:sl||Qc(n,t),gl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:sl||Qc(n,t);var r=ml,i=hl;ff(n.type)&&(ml=n.stateNode,hl=!1),gl(e,t,n),Df(n.stateNode),ml=r,hl=i;break;case 5:sl||Qc(n,t);case 6:if(r=ml,i=hl,ml=null,gl(e,t,n),ml=r,hl=i,ml!==null)if(hl)try{(ml.nodeType===9?ml.body:ml.nodeName===`HTML`?ml.ownerDocument.body:ml).removeChild(n.stateNode)}catch(e){nd(n,t,e)}else try{ml.removeChild(n.stateNode)}catch(e){nd(n,t,e)}break;case 18:ml!==null&&(hl?(e=ml,pf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),qp(e)):pf(ml,n.stateNode));break;case 4:r=ml,i=hl,ml=n.stateNode.containerInfo,hl=!0,gl(e,t,n),ml=r,hl=i;break;case 0:case 11:case 14:case 15:Jc(2,n,t),sl||Jc(4,n,t),gl(e,t,n);break;case 1:sl||(Qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Xc(n,t,r)),gl(e,t,n);break;case 21:gl(e,t,n);break;case 22:sl=(r=sl)||n.memoizedState!==null,gl(e,t,n),sl=r;break;default:gl(e,t,n)}}function vl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qp(e)}catch(e){nd(t,t.return,e)}}}function yl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qp(e)}catch(e){nd(t,t.return,e)}}function bl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ll),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ll),t;default:throw Error(i(435,e.tag))}}function xl(e,t){var n=bl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=sd.bind(null,e,t);t.then(r,r)}})}function Sl(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(ff(c.type)){ml=c.stateNode,hl=!1;break a}break;case 5:ml=c.stateNode,hl=!1;break a;case 3:case 4:ml=c.stateNode.containerInfo,hl=!0;break a}c=c.return}if(ml===null)throw Error(i(160));_l(o,s,a),ml=null,hl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wl(t,e),t=t.sibling}var Cl=null;function wl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Sl(t,e),Tl(e),r&4&&(Jc(3,e,e.return),qc(3,e),Jc(5,e,e.return));break;case 1:Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(n,n.return)),r&64&&ol&&(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=Cl;if(Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(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[yt]||o[ft]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Jd(o,r,n),o[ft]=e,Tt(o),r=o;break a;case`link`:var s=tp(`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),Jd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=tp(`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),Jd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ft]=e,Tt(o),r=o}e.stateNode=r}else np(a,e.type,e.stateNode);else e.stateNode=Xf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&el(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?np(a,e.type,e.stateNode):Xf(a,r,e.memoizedProps))}break;case 27:Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(n,n.return)),n!==null&&r&4&&el(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(n,n.return)),e.flags&32){a=e.stateNode;try{Zt(a,``)}catch(t){nd(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,el(e,a,n===null?a:n.memoizedProps)),r&1024&&(cl=!0);break;case 6:if(Sl(t,e),Tl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){nd(e,e.return,t)}}break;case 3:if(ep=null,a=Cl,Cl=Af(t.containerInfo),Sl(t,e),Cl=a,Tl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{qp(t.containerInfo)}catch(t){nd(e,e.return,t)}cl&&(cl=!1,El(e));break;case 4:r=Cl,Cl=Af(e.stateNode.containerInfo),Sl(t,e),Tl(e),Cl=r;break;case 12:Sl(t,e),Tl(e);break;case 31:Sl(t,e),Tl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xl(e,r)));break;case 13:Sl(t,e),Tl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(uu=je()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=ol,d=sl;if(ol=u||a,sl=d||l,Sl(t,e),sl=d,ol=u,Tl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||ol||sl||Ol(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){nd(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){nd(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?mf(m,!0):mf(l.stateNode,!1)}catch(e){nd(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,xl(e,n))));break;case 19:Sl(t,e),Tl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xl(e,r)));break;case 30:break;case 21:break;default:Sl(t,e),Tl(e)}}function Tl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(tl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;il(e,nl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Zt(o,``),n.flags&=-33),il(e,nl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;rl(e,nl(e),s);break;default:throw Error(i(161))}}catch(t){nd(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function El(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;El(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Dl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fl(e,t.alternate,t),t=t.sibling}function Ol(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Jc(4,t,t.return),Ol(t);break;case 1:Qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Xc(t,t.return,n),Ol(t);break;case 27:Df(t.stateNode);case 26:case 5:Qc(t,t.return),Ol(t);break;case 22:t.memoizedState===null&&Ol(t);break;case 30:Ol(t);break;default:Ol(t)}e=e.sibling}}function kl(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:kl(i,a,n),qc(4,a);break;case 1:if(kl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){nd(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++)$a(c[i],s)}catch(e){nd(r,r.return,e)}}n&&o&64&&Yc(a),Zc(a,a.return);break;case 27:al(a);case 26:case 5:kl(i,a,n),n&&r===null&&o&4&&$c(a),Zc(a,a.return);break;case 12:kl(i,a,n);break;case 31:kl(i,a,n),n&&o&4&&vl(i,a);break;case 13:kl(i,a,n),n&&o&4&&yl(i,a);break;case 22:a.memoizedState===null&&kl(i,a,n),Zc(a,a.return);break;case 30:break;default:kl(i,a,n)}t=t.sibling}}function Al(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&fa(n))}function jl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e))}function Ml(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Nl(e,t,n,r),t=t.sibling}function Nl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ml(e,t,n,r),i&2048&&qc(9,t);break;case 1:Ml(e,t,n,r);break;case 3:Ml(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&&fa(e)));break;case 12:if(i&2048){Ml(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){nd(t,t.return,e)}}else Ml(e,t,n,r);break;case 31:Ml(e,t,n,r);break;case 13:Ml(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Ml(e,t,n,r):(a._visibility|=2,Pl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Ml(e,t,n,r):Fl(e,t),i&2048&&Al(o,t);break;case 24:Ml(e,t,n,r),i&2048&&jl(t.alternate,t);break;default:Ml(e,t,n,r)}}function Pl(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:Pl(a,o,s,c,i),qc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Pl(a,o,s,c,i)):u._visibility&2?Pl(a,o,s,c,i):Fl(a,o),i&&l&2048&&Al(o.alternate,o);break;case 24:Pl(a,o,s,c,i),i&&l&2048&&jl(o.alternate,o);break;default:Pl(a,o,s,c,i)}t=t.sibling}}function Fl(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:Fl(n,r),i&2048&&Al(r.alternate,r);break;case 24:Fl(n,r),i&2048&&jl(r.alternate,r);break;default:Fl(n,r)}t=t.sibling}}var Il=8192;function Ll(e,t,n){if(e.subtreeFlags&Il)for(e=e.child;e!==null;)Rl(e,t,n),e=e.sibling}function Rl(e,t,n){switch(e.tag){case 26:Ll(e,t,n),e.flags&Il&&e.memoizedState!==null&&ap(n,Cl,e.memoizedState,e.memoizedProps);break;case 5:Ll(e,t,n);break;case 3:case 4:var r=Cl;Cl=Af(e.stateNode.containerInfo),Ll(e,t,n),Cl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Il,Il=16777216,Ll(e,t,n),Il=r):Ll(e,t,n));break;default:Ll(e,t,n)}}function zl(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 Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ul=r,Ul(r,e)}zl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vl(e),e=e.sibling}function Vl(e){switch(e.tag){case 0:case 11:case 15:Bl(e),e.flags&2048&&Jc(9,e,e.return);break;case 3:Bl(e);break;case 12:Bl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hl(e)):Bl(e);break;default:Bl(e)}}function Hl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ul=r,Ul(r,e)}zl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Jc(8,t,t.return),Hl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Hl(t));break;default:Hl(t)}e=e.sibling}}function Ul(e,t){for(;ul!==null;){var n=ul;switch(n.tag){case 0:case 11:case 15:Jc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ul=r;else a:for(n=e;ul!==null;){r=ul;var i=r.sibling,a=r.return;if(pl(r),r===n){ul=null;break a}if(i!==null){i.return=a,ul=i;break a}ul=a}}}var Wl={getCacheForType:function(e){var t=ia(ua),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ia(ua).controller.signal}},Gl=typeof WeakMap==`function`?WeakMap:Map,Kl=0,ql=null,Jl=null,z=0,Yl=0,Xl=null,Zl=!1,Ql=!1,$l=!1,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=0,su=null,cu=null,lu=!1,uu=0,du=0,fu=1/0,pu=null,mu=null,hu=0,gu=null,_u=null,vu=0,yu=0,bu=null,xu=null,Su=0,Cu=null;function wu(){return Kl&2&&z!==0?z&-z:M.T===null?lt():Cd()}function Tu(){if(au===0)if(!(z&536870912)||Li){var e=Je;Je<<=1,!(Je&3932160)&&(Je=262144),au=e}else au=536870912;return e=oo.current,e!==null&&(e.flags|=32),au}function Eu(e,t,n){(e===ql&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)&&(Nu(e,0),Au(e,z,au,!1)),nt(e,n),(!(Kl&2)||e!==ql)&&(e===ql&&(!(Kl&2)&&(ru|=n),tu===4&&Au(e,z,au,!1)),hd(e))}function Du(e,t,n){if(Kl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Qe(e,t),a=r?Vu(e,t):zu(e,t,!0),o=r;do{if(a===0){Ql&&!r&&Au(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!ku(n)){a=zu(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=su;var l=c.current.memoizedState.isDehydrated;if(l&&(Nu(c,s).flags|=256),s=zu(c,s,!1),s!==2){if($l&&!l){c.errorRecoveryDisabledLanes|=o,ru|=o,a=4;break a}o=cu,cu=a,o!==null&&(cu===null?cu=o:cu.push.apply(cu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Nu(e,0),Au(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:Au(r,t,au,!Zl);break a;case 2:cu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=uu+300-je(),10<a)){if(Au(r,t,au,!Zl),Ze(r,0,!0)!==0)break a;vu=t,r.timeoutHandle=sf(Ou.bind(null,r,n,cu,pu,lu,t,au,ru,ou,Zl,o,`Throttled`,-0,0),a);break a}Ou(r,n,cu,pu,lu,t,au,ru,ou,Zl,o,null,-0,0)}}break}while(1);hd(e)}function Ou(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:on},Rl(t,a,d);var m=(a&62914560)===a?uu-je():(a&4194048)===a?du-je():0;if(m=sp(d,m),m!==null){vu=a,e.cancelPendingCommit=m(Ju.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Au(e,a,o,!l);return}}Ju(e,t,a,n,r,i,o,s,c)}function ku(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(!wr(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 Au(e,t,n,r){t&=~iu,t&=~ru,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ue(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&it(e,n,t)}function ju(){return Kl&6?!0:(gd(0,!1),!1)}function Mu(){if(Jl!==null){if(Yl===0)var e=Jl.return;else e=Jl,Xi=Yi=null,Fo(e),Fa=null,Ia=0,e=Jl;for(;e!==null;)Kc(e.alternate,e),e=e.return;Jl=null}}function Nu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,cf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),vu=0,Mu(),ql=e,Jl=n=fi(e.current,null),z=t,Yl=0,Xl=null,Zl=!1,Ql=Qe(e,t),$l=!1,ou=au=iu=ru=nu=tu=0,cu=su=null,lu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ue(r),a=1<<i;t|=e[i],r&=~a}return eu=t,ni(),n}function Pu(e,t){_o=null,M.H=Gs,t===Ta||t===Da?(t=Na(),Yl=3):t===Ea?(t=Na(),Yl=4):Yl=t===cc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Xl=t,Jl===null&&(tu=1,nc(e,bi(t,e.current)))}function Fu(){var e=oo.current;return e===null?!0:(z&4194048)===z?so===null:(z&62914560)===z||z&536870912?e===so:!1}function Iu(){var e=M.H;return M.H=Gs,e===null?Gs:e}function Lu(){var e=M.A;return M.A=Wl,e}function Ru(){tu=4,Zl||(z&4194048)!==z&&oo.current!==null||(Ql=!0),!(nu&134217727)&&!(ru&134217727)||ql===null||Au(ql,z,au,!1)}function zu(e,t,n){var r=Kl;Kl|=2;var i=Iu(),a=Lu();(ql!==e||z!==t)&&(pu=null,Nu(e,t)),t=!1;var o=tu;a:do try{if(Yl!==0&&Jl!==null){var s=Jl,c=Xl;switch(Yl){case 8:Mu(),o=6;break a;case 3:case 2:case 9:case 6:oo.current===null&&(t=!0);var l=Yl;if(Yl=0,Xl=null,Gu(e,s,c,l),n&&Ql){o=0;break a}break;default:l=Yl,Yl=0,Xl=null,Gu(e,s,c,l)}}Bu(),o=tu;break}catch(t){Pu(e,t)}while(1);return t&&e.shellSuspendCounter++,Xi=Yi=null,Kl=r,M.H=i,M.A=a,Jl===null&&(ql=null,z=0,ni()),o}function Bu(){for(;Jl!==null;)Uu(Jl)}function Vu(e,t){var n=Kl;Kl|=2;var r=Iu(),a=Lu();ql!==e||z!==t?(pu=null,fu=je()+500,Nu(e,t)):Ql=Qe(e,t);a:do try{if(Yl!==0&&Jl!==null){t=Jl;var o=Xl;b:switch(Yl){case 1:Yl=0,Xl=null,Gu(e,t,o,1);break;case 2:case 9:if(ka(o)){Yl=0,Xl=null,Wu(t);break}t=function(){Yl!==2&&Yl!==9||ql!==e||(Yl=7),hd(e)},o.then(t,t);break a;case 3:Yl=7;break a;case 4:Yl=5;break a;case 7:ka(o)?(Yl=0,Xl=null,Wu(t)):(Yl=0,Xl=null,Gu(e,t,o,7));break;case 5:var s=null;switch(Jl.tag){case 26:s=Jl.memoizedState;case 5:case 27:var c=Jl;if(s?ip(s):c.stateNode.complete){Yl=0,Xl=null;var l=c.sibling;if(l!==null)Jl=l;else{var u=c.return;u===null?Jl=null:(Jl=u,Ku(u))}break b}}Yl=0,Xl=null,Gu(e,t,o,5);break;case 6:Yl=0,Xl=null,Gu(e,t,o,6);break;case 8:Mu(),tu=6;break a;default:throw Error(i(462))}}Hu();break}catch(t){Pu(e,t)}while(1);return Xi=Yi=null,M.H=r,M.A=a,Kl=n,Jl===null?(ql=null,z=0,ni(),tu):0}function Hu(){for(;Jl!==null&&!ke();)Uu(Jl)}function Uu(e){var t=Lc(e.alternate,e,eu);e.memoizedProps=e.pendingProps,t===null?Ku(e):Jl=t}function Wu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=xc(n,t,t.pendingProps,t.type,void 0,z);break;case 11:t=xc(n,t,t.pendingProps,t.type.render,t.ref,z);break;case 5:Fo(t);default:Kc(n,t),t=Jl=pi(t,eu),t=Lc(n,t,eu)}e.memoizedProps=e.pendingProps,t===null?Ku(e):Jl=t}function Gu(e,t,n,r){Xi=Yi=null,Fo(t),Fa=null,Ia=0;var i=t.return;try{if(sc(e,i,t,n,z)){tu=1,nc(e,bi(n,e.current)),Jl=null;return}}catch(t){if(i!==null)throw Jl=i,t;tu=1,nc(e,bi(n,e.current)),Jl=null;return}t.flags&32768?(Li||r===1?e=!0:Ql||z&536870912?e=!1:(Zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),qu(t,e)):Ku(t)}function Ku(e){var t=e;do{if(t.flags&32768){qu(t,Zl);return}e=t.return;var n=Wc(t.alternate,t,eu);if(n!==null){Jl=n;return}if(t=t.sibling,t!==null){Jl=t;return}Jl=t=e}while(t!==null);tu===0&&(tu=5)}function qu(e,t){do{var n=Gc(e.alternate,e);if(n!==null){n.flags&=32767,Jl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Jl=e;return}Jl=e=n}while(e!==null);tu=6,Jl=null}function Ju(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do $u();while(hu!==0);if(Kl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ti,rt(e,n,o,s,c,l),e===ql&&(Jl=ql=null,z=0),_u=t,gu=e,vu=n,yu=o,bu=a,xu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,cd(Fe,function(){return ed(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=M.T,M.T=null,a=ie.p,ie.p=2,s=Kl,Kl|=4;try{dl(e,t,n)}finally{Kl=s,ie.p=a,M.T=r}}hu=1,Yu(),Xu(),Zu()}}function Yu(){if(hu===1){hu=0;var e=gu,t=_u,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=M.T,M.T=null;var r=ie.p;ie.p=2;var i=Kl;Kl|=4;try{wl(t,e);var a=$d,o=kr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Or(s.ownerDocument.documentElement,s)){if(c!==null&&Ar(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 _=Dr(s,h),v=Dr(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}}xp=!!Qd,$d=Qd=null}finally{Kl=i,ie.p=r,M.T=n}}e.current=t,hu=2}}function Xu(){if(hu===2){hu=0;var e=gu,t=_u,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=ie.p;ie.p=2;var i=Kl;Kl|=4;try{fl(e,t.alternate,t)}finally{Kl=i,ie.p=r,M.T=n}}hu=3}}function Zu(){if(hu===4||hu===3){hu=0,Ae();var e=gu,t=_u,n=vu,r=xu;t.subtreeFlags&10256||t.flags&10256?hu=5:(hu=0,_u=gu=null,Qu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(mu=null),ct(n),t=t.stateNode,Ve&&typeof Ve.onCommitFiberRoot==`function`)try{Ve.onCommitFiberRoot(Be,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=M.T,i=ie.p,ie.p=2,M.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{M.T=t,ie.p=i}}vu&3&&$u(),hd(e),i=e.pendingLanes,n&261930&&i&42?e===Cu?Su++:(Su=0,Cu=e):Su=0,gd(0,!1)}}function Qu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fa(t)))}function $u(){return Yu(),Xu(),Zu(),ed()}function ed(){if(hu!==5)return!1;var e=gu,t=yu;yu=0;var n=ct(vu),r=M.T,a=ie.p;try{ie.p=32>n?32:n,M.T=null,n=bu,bu=null;var o=gu,s=vu;if(hu=0,_u=gu=null,vu=0,Kl&6)throw Error(i(331));var c=Kl;if(Kl|=4,Vl(o.current),Nl(o,o.current,s,n),Kl=c,gd(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{ie.p=a,M.T=r,Qu(e,t)}}function td(e,t,n){t=bi(n,t),t=ic(e.stateNode,t,2),e=qa(e,t,2),e!==null&&(nt(e,2),hd(e))}function nd(e,t,n){if(e.tag===3)td(e,e,n);else for(;t!==null;){if(t.tag===3){td(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(mu===null||!mu.has(r))){e=bi(n,e),n=ac(2),r=qa(t,n,2),r!==null&&(oc(n,r,t,e),nt(r,2),hd(r));break}}t=t.return}}function rd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Gl;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)||($l=!0,i.add(n),e=id.bind(null,e,t,n),t.then(e,e))}function id(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ql===e&&(z&n)===n&&(tu===4||tu===3&&(z&62914560)===z&&300>je()-uu?!(Kl&2)&&Nu(e,0):iu|=n,ou===z&&(ou=0)),hd(e)}function ad(e,t){t===0&&(t=et()),e=ai(e,t),e!==null&&(nt(e,t),hd(e))}function od(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ad(e,n)}function sd(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),ad(e,n)}function cd(e,t){return De(e,t)}var ld=null,ud=null,dd=!1,fd=!1,pd=!1,md=0;function hd(e){e!==ud&&e.next===null&&(ud===null?ld=ud=e:ud=ud.next=e),fd=!0,dd||(dd=!0,Sd())}function gd(e,t){if(!pd&&fd){pd=!0;do for(var n=!1,r=ld;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-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,xd(r,a))}else a=z,a=Ze(r,r===ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Qe(r,a)||(n=!0,xd(r,a));r=r.next}while(n);pd=!1}}function _d(){vd()}function vd(){fd=dd=!1;var e=0;md!==0&&of()&&(e=md);for(var t=je(),n=null,r=ld;r!==null;){var i=r.next,a=yd(r,t);a===0?(r.next=null,n===null?ld=i:n.next=i,i===null&&(ud=n)):(n=r,(e!==0||a&3)&&(fd=!0)),r=i}hu!==0&&hu!==5||gd(e,!1),md!==0&&(md=0)}function yd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ue(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=$e(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ql,n=z,n=Ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Oe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Oe(r),ct(n)){case 2:case 8:n=Pe;break;case 32:n=Fe;break;case 268435456:n=Le;break;default:n=Fe}return r=bd.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Oe(r),e.callbackPriority=2,e.callbackNode=null,2}function bd(e,t){if(hu!==0&&hu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($u()&&e.callbackNode!==n)return null;var r=z;return r=Ze(e,e===ql?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Du(e,r,t),yd(e,je()),e.callbackNode!=null&&e.callbackNode===n?bd.bind(null,e):null)}function xd(e,t){if($u())return null;Du(e,t,!0)}function Sd(){uf(function(){Kl&6?De(Ne,_d):vd()})}function Cd(){if(md===0){var e=ha;e===0&&(e=qe,qe<<=1,!(qe&261888)&&(qe=256)),md=e}return md}function wd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:an(``+e)}function Td(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 Ed(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=wd((i[pt]||null).action),o=r.submitter;o&&(t=(t=o[pt]||null)?wd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Dn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(md!==0){var e=o?Td(i,o):new FormData(i);js(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Td(i,o):new FormData(i),js(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Dd=0;Dd<Xr.length;Dd++){var Od=Xr[Dd];Zr(Od.toLowerCase(),`on`+(Od[0].toUpperCase()+Od.slice(1)))}Zr(Hr,`onAnimationEnd`),Zr(Ur,`onAnimationIteration`),Zr(Wr,`onAnimationStart`),Zr(`dblclick`,`onDoubleClick`),Zr(`focusin`,`onFocus`),Zr(`focusout`,`onBlur`),Zr(Gr,`onTransitionRun`),Zr(Kr,`onTransitionStart`),Zr(qr,`onTransitionCancel`),Zr(Jr,`onTransitionEnd`),kt(`onMouseEnter`,[`mouseout`,`mouseover`]),kt(`onMouseLeave`,[`mouseout`,`mouseover`]),kt(`onPointerEnter`,[`pointerout`,`pointerover`]),kt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ot(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ot(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ot(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ot(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var kd=`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(` `),Ad=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(kd));function jd(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){Qr(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){Qr(e)}i.currentTarget=null,a=c}}}}function Md(e,t){var n=t[ht];n===void 0&&(n=t[ht]=new Set);var r=e+`__bubble`;n.has(r)||(Id(t,e,2,!1),n.add(r))}function Nd(e,t,n){var r=0;t&&(r|=4),Id(n,e,r,t)}var Pd=`_reactListening`+Math.random().toString(36).slice(2);function Fd(e){if(!e[Pd]){e[Pd]=!0,Et.forEach(function(t){t!==`selectionchange`&&(Ad.has(t)||Nd(t,!1,e),Nd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pd]||(t[Pd]=!0,Nd(`selectionchange`,!1,t))}}function Id(e,t,n,r){switch(Op(t)){case 2:var i=Sp;break;case 8:i=Cp;break;default:i=wp}n=i.bind(null,t,n,e),i=void 0,!gn||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 Ld(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=xt(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}pn(function(){var r=a,i=cn(n),s=[];a:{var c=Yr.get(e);if(c!==void 0){var l=Dn,u=e;switch(e){case`keypress`:if(Sn(n)===0)break a;case`keydown`:case`keyup`:l=Wn;break;case`focusin`:u=`focus`,l=In;break;case`focusout`:u=`blur`,l=In;break;case`beforeblur`:case`afterblur`:l=In;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=Pn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Fn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Kn;break;case Hr:case Ur:case Wr:l=Ln;break;case Jr:l=qn;break;case`scroll`:case`scrollend`:l=kn;break;case`wheel`:l=Jn;break;case`copy`:case`cut`:case`paste`:l=Rn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Gn;break;case`toggle`:case`beforetoggle`:l=Yn}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=mn(m,p),g!=null&&d.push(Rd(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!==sn&&(u=n.relatedTarget||n.fromElement)&&(xt(u)||u[mt]))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?xt(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=Pn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Gn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:Ct(l),h=u==null?c:Ct(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,xt(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=Bd,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&&Vd(s,c,l,d,!1),u!==null&&f!==null&&Vd(s,f,u,d,!0)}}a:{if(c=r?Ct(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=pr;else if(sr(c))if(mr)v=Sr;else{v=br;var y=yr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&tn(r.elementType)&&(v=pr):v=xr;if(v&&=v(e,r)){cr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&qt(c,`number`,c.value)}switch(y=r?Ct(r):window,e){case`focusin`:(sr(y)||y.contentEditable===`true`)&&(Mr=y,Nr=r,Pr=null);break;case`focusout`:Pr=Nr=Mr=null;break;case`mousedown`:Fr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Fr=!1,Ir(s,n,i);break;case`selectionchange`:if(jr)break;case`keydown`:case`keyup`:Ir(s,n,i)}var b;if(Zn)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 rr?tr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(F&&n.locale!==`ko`&&(rr||x!==`onCompositionStart`?x===`onCompositionEnd`&&rr&&(b=xn()):(vn=i,yn=`value`in vn?vn.value:vn.textContent,rr=!0)),y=zd(r,x),0<y.length&&(x=new zn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=nr(n),b!==null&&(x.data=b)))),(b=P?ir(e,n):ar(e,n))&&(x=zd(r,`onBeforeInput`),0<x.length&&(y=new zn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Ed(s,e,r,n,i)}jd(s,t)})}function Rd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zd(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=mn(e,n),i!=null&&r.unshift(Rd(e,i,a)),i=mn(e,t),i!=null&&r.push(Rd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Bd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vd(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=mn(n,a),l!=null&&o.unshift(Rd(n,l,c))):i||(l=mn(n,a),l!=null&&o.push(Rd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Hd=/\r\n?/g,Ud=/\u0000|\uFFFD/g;function Wd(e){return(typeof e==`string`?e:``+e).replace(Hd,`
|
|
9
|
+
`).replace(Ud,``)}function Gd(e,t){return t=Wd(t),Wd(e)===t}function Kd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Zt(e,``+r);break;case`className`:Ft(e,`class`,r);break;case`tabIndex`:Ft(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ft(e,n,r);break;case`style`:en(e,r,o);break;case`data`:if(t!==`object`){Ft(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=an(``+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`&&Kd(e,t,`name`,a.name,a,null),Kd(e,t,`formEncType`,a.formEncType,a,null),Kd(e,t,`formMethod`,a.formMethod,a,null),Kd(e,t,`formTarget`,a.formTarget,a,null)):(Kd(e,t,`encType`,a.encType,a,null),Kd(e,t,`method`,a.method,a,null),Kd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=on);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`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=an(``+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`:Md(`beforetoggle`,e),Md(`toggle`,e),Pt(e,`popover`,r);break;case`xlinkActuate`:It(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:It(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:It(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:It(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Pt(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=nn.get(n)||n,Pt(e,n,r))}}function qd(e,t,n,r,a,o){switch(n){case`style`:en(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`?Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Zt(e,``+r);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=on);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Dt.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[pt]||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,``):Pt(e,n,r)}}}function Jd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Md(`error`,e),Md(`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:Kd(e,t,o,s,n,null)}}a&&Kd(e,t,`srcSet`,n.srcSet,n,null),r&&Kd(e,t,`src`,n.src,n,null);return;case`input`:Md(`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:Kd(e,t,r,d,n,null)}}Kt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Md(`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:Kd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Jt(e,!!r,n,!0):Jt(e,!!r,t,!1);return;case`textarea`:for(s in Md(`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:Kd(e,t,s,c,n,null)}Xt(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:Kd(e,t,l,r,n,null)}return;case`dialog`:Md(`beforetoggle`,e),Md(`toggle`,e),Md(`cancel`,e),Md(`close`,e);break;case`iframe`:case`object`:Md(`load`,e);break;case`video`:case`audio`:for(r=0;r<kd.length;r++)Md(kd[r],e);break;case`image`:Md(`error`,e),Md(`load`,e);break;case`details`:Md(`toggle`,e);break;case`embed`:case`source`:case`link`:Md(`error`,e),Md(`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:Kd(e,t,u,r,n,null)}return;default:if(tn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&qd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Kd(e,t,c,r,n,null))}function Yd(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)||Kd(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&&Kd(e,t,p,m,r,f)}}Gt(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)||Kd(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&&Kd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Jt(e,!!n,n?[]:``,!1):Jt(e,!!n,t,!0)):Jt(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:Kd(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&&Kd(e,t,s,a,r,o)}Yt(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:Kd(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:Kd(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)&&Kd(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:Kd(e,t,u,p,r,m)}return;default:if(tn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&qd(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||qd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Kd(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||Kd(e,t,f,p,r,m)}function Xd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Zd(){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&&Xd(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&&Xd(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 Qd=null,$d=null;function ef(e){return e.nodeType===9?e:e.ownerDocument}function tf(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 nf(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 rf(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 af=null;function of(){var e=window.event;return e&&e.type===`popstate`?e===af?!1:(af=e,!0):(af=null,!1)}var sf=typeof setTimeout==`function`?setTimeout:void 0,cf=typeof clearTimeout==`function`?clearTimeout:void 0,lf=typeof Promise==`function`?Promise:void 0,uf=typeof queueMicrotask==`function`?queueMicrotask:lf===void 0?sf:function(e){return lf.resolve(null).then(e).catch(df)};function df(e){setTimeout(function(){throw e})}function ff(e){return e===`head`}function pf(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),qp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Df(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Df(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[yt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Df(e.ownerDocument.body);n=i}while(n);qp(t)}function mf(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 hf(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`:hf(n),bt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function gf(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[yt])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=Sf(e.nextSibling),e===null)break}return null}function _f(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Sf(e.nextSibling),e===null))return null;return e}function vf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Sf(e.nextSibling),e===null))return null;return e}function yf(e){return e.data===`$?`||e.data===`$~`}function bf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function xf(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 Sf(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 Cf=null;function wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Sf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Tf(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 Ef(e,t,n){switch(t=ef(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 Df(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bt(e)}var Of=new Map,kf=new Set;function Af(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jf=ie.d;ie.d={f:Mf,r:Nf,D:If,C:Lf,L:Rf,m:zf,X:Vf,S:Bf,M:Hf};function Mf(){var e=jf.f(),t=ju();return e||t}function Nf(e){var t=St(e);t!==null&&t.tag===5&&t.type===`form`?Ns(t):jf.r(e)}var Pf=typeof document>`u`?null:document;function Ff(e,t,n){var r=Pf;if(r&&typeof t==`string`&&t){var i=Wt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),kf.has(i)||(kf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Jd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function If(e){jf.D(e),Ff(`dns-prefetch`,e,null)}function Lf(e,t){jf.C(e,t),Ff(`preconnect`,e,t)}function Rf(e,t,n){jf.L(e,t,n);var r=Pf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Wt(n.imageSizes)+`"]`)):i+=`[href="`+Wt(e)+`"]`;var a=i;switch(t){case`style`:a=Wf(e);break;case`script`:a=Jf(e)}Of.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Of.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gf(a))||t===`script`&&r.querySelector(Yf(a))||(t=r.createElement(`link`),Jd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function zf(e,t){jf.m(e,t);var n=Pf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Wt(r)+`"][href="`+Wt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jf(e)}if(!Of.has(a)&&(e=p({rel:`modulepreload`,href:e},t),Of.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Yf(a)))return}r=n.createElement(`link`),Jd(r,`link`,e),Tt(r),n.head.appendChild(r)}}}function Bf(e,t,n){jf.S(e,t,n);var r=Pf;if(r&&e){var i=wt(r).hoistableStyles,a=Wf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Of.get(a))&&Qf(e,n);var c=o=r.createElement(`link`);Tt(c),Jd(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,Zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vf(e,t){jf.X(e,t);var n=Pf;if(n&&e){var r=wt(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=p({src:e,async:!0},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),Tt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t){jf.M(e,t);var n=Pf;if(n&&e){var r=wt(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),Tt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Uf(e,t,n,r){var a=(a=pe.current)?Af(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=Wf(n.href),n=wt(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=Wf(n.href);var o=wt(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(Gf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Of.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},Of.set(e,n),o||qf(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=Jf(n),n=wt(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 Wf(e){return`href="`+Wt(e)+`"`}function Gf(e){return`link[rel="stylesheet"][`+e+`]`}function Kf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function qf(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}),Jd(t,`link`,n),Tt(t),e.head.appendChild(t))}function Jf(e){return`[src="`+Wt(e)+`"]`}function Yf(e){return`script[async]`+e}function Xf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Wt(n.href)+`"]`);if(r)return t.instance=r,Tt(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`),Tt(r),Jd(r,`style`,a),Zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Wf(n.href);var o=e.querySelector(Gf(a));if(o)return t.state.loading|=4,t.instance=o,Tt(o),o;r=Kf(n),(a=Of.get(a))&&Qf(r,a),o=(e.ownerDocument||e).createElement(`link`),Tt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Jd(o,`link`,r),t.state.loading|=4,Zf(o,n.precedence,e),t.instance=o;case`script`:return o=Jf(n.src),(a=e.querySelector(Yf(o)))?(t.instance=a,Tt(a),a):(r=n,(a=Of.get(o))&&(r=p({},n),$f(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Tt(a),Jd(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,Zf(r,n.precedence,e));return t.instance}function Zf(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 Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $f(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ep=null;function tp(e,t,n){if(ep===null){var r=new Map,i=ep=new Map;i.set(n,r)}else i=ep,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[yt]||a[ft]||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 np(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rp(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 ip(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ap(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=Wf(r.href),a=t.querySelector(Gf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=cp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Tt(a);return}a=t.ownerDocument||t,r=Kf(r),(i=Of.get(i))&&Qf(r,i),a=a.createElement(`link`),Tt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Jd(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=cp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var op=0;function sp(e,t){return e.stylesheets&&e.count===0&&up(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&up(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&op===0&&(op=62500*Zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&up(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>op?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function cp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)up(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lp=null;function up(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lp=new Map,t.forEach(dp,e),lp=null,cp.call(e))}function dp(e,t){if(!(t.state.loading&4)){var n=lp.get(e);if(n)var r=n.get(null);else{n=new Map,lp.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=cp.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 fp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function pp(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=tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tt(0),this.hiddenUpdates=tt(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 mp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new pp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ui(3,null,null,t),e.current=a,a.stateNode=e,t=da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Wa(a),e}function hp(e){return e?(e=ci,e):ci}function gp(e,t,n,r,i,a){i=hp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ka(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=qa(e,r,t),n!==null&&(Eu(n,e,t),Ja(n,e,t))}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vp(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function yp(e){if(e.tag===13||e.tag===31){var t=ai(e,67108864);t!==null&&Eu(t,e,67108864),vp(e,67108864)}}function bp(e){if(e.tag===13||e.tag===31){var t=wu();t=st(t);var n=ai(e,t);n!==null&&Eu(n,e,t),vp(e,t)}}var xp=!0;function Sp(e,t,n,r){var i=M.T;M.T=null;var a=ie.p;try{ie.p=2,wp(e,t,n,r)}finally{ie.p=a,M.T=i}}function Cp(e,t,n,r){var i=M.T;M.T=null;var a=ie.p;try{ie.p=8,wp(e,t,n,r)}finally{ie.p=a,M.T=i}}function wp(e,t,n,r){if(xp){var i=Tp(r);if(i===null)Ld(e,t,r,Ep,n),Lp(e,r);else if(zp(i,e,t,n,r))r.stopPropagation();else if(Lp(e,r),t&4&&-1<Ip.indexOf(e)){for(;i!==null;){var a=St(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Xe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ue(o);s.entanglements[1]|=c,o&=~c}hd(a),!(Kl&6)&&(fu=je()+500,gd(0,!1))}}break;case 31:case 13:s=ai(a,2),s!==null&&Eu(s,a,2),ju(),vp(a,2)}if(a=Tp(r),a===null&&Ld(e,t,r,Ep,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ld(e,t,r,null,n)}}function Tp(e){return e=cn(e),Dp(e)}var Ep=null;function Dp(e){if(Ep=null,e=xt(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 Ep=e,null}function Op(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(Me()){case Ne:return 2;case Pe:return 8;case Fe:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var kp=!1,Ap=null,jp=null,Mp=null,Np=new Map,Pp=new Map,Fp=[],Ip=`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 Lp(e,t){switch(e){case`focusin`:case`focusout`:Ap=null;break;case`dragenter`:case`dragleave`:jp=null;break;case`mouseover`:case`mouseout`:Mp=null;break;case`pointerover`:case`pointerout`:Np.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Pp.delete(t.pointerId)}}function Rp(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=St(t),t!==null&&yp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zp(e,t,n,r,i){switch(t){case`focusin`:return Ap=Rp(Ap,e,t,n,r,i),!0;case`dragenter`:return jp=Rp(jp,e,t,n,r,i),!0;case`mouseover`:return Mp=Rp(Mp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Np.set(a,Rp(Np.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Pp.set(a,Rp(Pp.get(a)||null,e,t,n,r,i)),!0}return!1}function Bp(e){var t=xt(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,ut(e.priority,function(){bp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ut(e.priority,function(){bp(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 Vp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);sn=r,n.target.dispatchEvent(r),sn=null}else return t=St(n),t!==null&&yp(t),e.blockedOn=n,!1;t.shift()}return!0}function Hp(e,t,n){Vp(e)&&n.delete(t)}function Up(){kp=!1,Ap!==null&&Vp(Ap)&&(Ap=null),jp!==null&&Vp(jp)&&(jp=null),Mp!==null&&Vp(Mp)&&(Mp=null),Np.forEach(Hp),Pp.forEach(Hp)}function Wp(e,n){e.blockedOn===n&&(e.blockedOn=null,kp||(kp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Up)))}var Gp=null;function Kp(e){Gp!==e&&(Gp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gp===e&&(Gp=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(Dp(r||n)===null)continue;break}var a=St(n);a!==null&&(e.splice(t,3),t-=3,js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qp(e){function t(t){return Wp(t,e)}Ap!==null&&Wp(Ap,e),jp!==null&&Wp(jp,e),Mp!==null&&Wp(Mp,e),Np.forEach(t),Pp.forEach(t);for(var n=0;n<Fp.length;n++){var r=Fp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fp.length&&(n=Fp[0],n.blockedOn===null);)Bp(n),n.blockedOn===null&&Fp.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[pt]||null;if(typeof a==`function`)o||Kp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[pt]||null)s=o.formAction;else if(Dp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kp(n)}}}function Jp(){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 Yp(e){this._internalRoot=e}Xp.prototype.render=Yp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;gp(n,wu(),e,t,null,null)},Xp.prototype.unmount=Yp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gp(e.current,2,null,e,null,null),ju(),t[mt]=null}};function Xp(e){this._internalRoot=e}Xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=lt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fp.length&&t!==0&&t<Fp[n].priority;n++);Fp.splice(n,0,e),n===0&&Bp(e)}};var Zp=n.version;if(Zp!==`19.2.7`)throw Error(i(527,Zp,`19.2.7`));ie.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 Qp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$p.isDisabled&&$p.supportsFiber)try{Be=$p.inject(Qp),Ve=$p}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=$s,s=ec,c=tc;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=mp(e,1,!1,null,null,n,r,null,o,s,c,Jp),e[mt]=t.current,Fd(e),new Yp(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 ee(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 te(e){for(var t,n=e.length,r=n%3,i=[],a=16383,o=0,s=n-r;o<s;o+=a)i.push(ee(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 k(e){if(e===void 0)return{};if(!j(e))throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function A(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 j(e){let t=typeof e==`object`,n=Object.getPrototypeOf(e),r=n===null||n===Object.prototype||n?.constructor?.name===`Object`;return t&&r}var ne=!0,re=BigInt(`-9223372036854775808`),M=BigInt(`9223372036854775807`),ie=BigInt(`0`),ae=BigInt(`8`),oe=BigInt(`256`);function se(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function ce(e){e<ie&&(e-=re+re);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>>=ae;return te(n)}function le(e){let t=D(e);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let n=ie,r=ie;for(let e of t)n+=BigInt(e)*oe**r,r++;return n>M&&(n+=re+re),n}function ue(e){if(e<re||M<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),te(new Uint8Array(t))}function de(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 fe=DataView.prototype.setBigInt64?ue:ce,pe=DataView.prototype.getBigInt64?de:le,me=1024;function he(e){if(e.length>me)throw Error(`Field name ${e} exceeds maximum field name length ${me}.`);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 ge(e){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return e;if(Array.isArray(e))return e.map(e=>ge(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 pe(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,ne);if(!se(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))he(t),n[t]=ge(r);return n}var _e=16384;function ve(e){let t=JSON.stringify(e,(e,t)=>t===void 0?`undefined`:typeof t==`bigint`?`${t.toString()}n`:t);if(t.length>_e){let e=_e-14,n=t.codePointAt(e-1);return n!==void 0&&n>65535&&--e,t.substring(0,e)+`[...truncated]`}return t}function ye(e,t,n,r){if(e===void 0){let e=n&&` (present at path ${n} in original object ${ve(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<re||M<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:fe(e)}}if(typeof e==`number`)if(se(e)){let t=new ArrayBuffer(8);return new DataView(t).setFloat64(0,e,ne),{$float:te(new Uint8Array(t))}}else return e;if(typeof e==`boolean`||typeof e==`string`)return e;if(e instanceof ArrayBuffer)return{$bytes:te(new Uint8Array(e))};if(Array.isArray(e))return e.map((e,r)=>ye(e,t,n+`[${r}]`,!1));if(e instanceof Set)throw Error(be(n,`Set`,[...e],t));if(e instanceof Map)throw Error(be(n,`Map`,[...e],t));if(!j(e)){let r=e?.constructor?.name,i=r?`${r} `:``;throw Error(be(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&&(he(e),i[e]=xe(o,t,n+`.${e}`)):(he(e),i[e]=ye(o,t,n+`.${e}`,!1));return i}function be(e,t,n,r){return e?`${t}${ve(n)} is not a supported Convex type (present at path ${e} in original object ${ve(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${ve(n)} is not a supported Convex type.`}function xe(e,t,n){if(e===void 0)return{$undefined:null};if(t===void 0)throw Error(`Programming error. Current value is ${ve(e)} but original value is undefined`);return ye(e,t,n,!1)}function Se(e){return ye(e,e,``,!1)}var Ce=Object.defineProperty,we=(e,t,n)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Te=(e,t,n)=>we(e,typeof t==`symbol`?t:t+``,n),Ee=`https://docs.convex.dev/error#undefined-validator`;function De(e,t){let n=t===void 0?``:` for field "${t}"`;throw Error(`A validator is undefined${n} in ${e}. This is often caused by circular imports. See ${Ee} for details.`)}var Oe=class{constructor({isOptional:e}){Te(this,`type`),Te(this,`fieldPaths`),Te(this,`isOptional`),Te(this,`isConvexValidator`),this.isOptional=e,this.isConvexValidator=!0}},ke=class e extends Oe{constructor({isOptional:e,tableName:t}){if(super({isOptional:e}),Te(this,`tableName`),Te(this,`kind`,`id`),typeof t!=`string`)throw Error(`v.id(tableName) requires a string`);this.tableName=t}get json(){return{type:`id`,tableName:this.tableName}}asOptional(){return new e({isOptional:`optional`,tableName:this.tableName})}},Ae=class e extends Oe{constructor(){super(...arguments),Te(this,`kind`,`float64`)}get json(){return{type:`number`}}asOptional(){return new e({isOptional:`optional`})}},je=class e extends Oe{constructor(){super(...arguments),Te(this,`kind`,`int64`)}get json(){return{type:`bigint`}}asOptional(){return new e({isOptional:`optional`})}},Me=class e extends Oe{constructor(){super(...arguments),Te(this,`kind`,`boolean`)}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:`optional`})}},Ne=class e extends Oe{constructor(){super(...arguments),Te(this,`kind`,`bytes`)}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:`optional`})}},Pe=class e extends Oe{constructor(){super(...arguments),Te(this,`kind`,`string`)}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:`optional`})}},Fe=class e extends Oe{constructor(){super(...arguments),Te(this,`kind`,`null`)}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:`optional`})}},Ie=class e extends Oe{constructor(){super(...arguments),Te(this,`kind`,`any`)}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:`optional`})}},Le=class e extends Oe{constructor({isOptional:e,fields:t}){super({isOptional:e}),Te(this,`fields`),Te(this,`kind`,`object`),globalThis.Object.entries(t).forEach(([e,t])=>{if(t===void 0&&De(`v.object()`,e),!t.isConvexValidator)throw Error(`v.object() entries must be validators`)}),this.fields=t}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([e,t])=>[e,{fieldType:t.json,optional:t.isOptional===`optional`}]))}}asOptional(){return new e({isOptional:`optional`,fields:this.fields})}omit(...t){let n={...this.fields};for(let e of t)delete n[e];return new e({isOptional:this.isOptional,fields:n})}pick(...t){let n={};for(let e of t)n[e]=this.fields[e];return new e({isOptional:this.isOptional,fields:n})}partial(){let t={};for(let[e,n]of globalThis.Object.entries(this.fields))t[e]=n.asOptional();return new e({isOptional:this.isOptional,fields:t})}extend(t){return new e({isOptional:this.isOptional,fields:{...this.fields,...t}})}},Re=class e extends Oe{constructor({isOptional:e,value:t}){if(super({isOptional:e}),Te(this,`value`),Te(this,`kind`,`literal`),typeof t!=`string`&&typeof t!=`boolean`&&typeof t!=`number`&&typeof t!=`bigint`)throw Error(`v.literal(value) must be a string, number, or boolean`);this.value=t}get json(){return{type:this.kind,value:Se(this.value)}}asOptional(){return new e({isOptional:`optional`,value:this.value})}},ze=class e extends Oe{constructor({isOptional:e,element:t}){super({isOptional:e}),Te(this,`element`),Te(this,`kind`,`array`),t===void 0&&De(`v.array()`),this.element=t}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new e({isOptional:`optional`,element:this.element})}},Be=class e extends Oe{constructor({isOptional:e,key:t,value:n}){if(super({isOptional:e}),Te(this,`key`),Te(this,`value`),Te(this,`kind`,`record`),t===void 0&&De(`v.record()`,`key`),n===void 0&&De(`v.record()`,`value`),t.isOptional===`optional`)throw Error(`Record validator cannot have optional keys`);if(n.isOptional===`optional`)throw Error(`Record validator cannot have optional values`);if(!t.isConvexValidator||!n.isConvexValidator)throw Error(`Key and value of v.record() but be validators`);this.key=t,this.value=n}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new e({isOptional:`optional`,key:this.key,value:this.value})}},Ve=class e extends Oe{constructor({isOptional:e,members:t}){super({isOptional:e}),Te(this,`members`),Te(this,`kind`,`union`),t.forEach((e,t)=>{if(e===void 0&&De(`v.union()`,`member at index ${t}`),!e.isConvexValidator)throw Error(`All members of v.union() must be validators`)}),this.members=t}get json(){return{type:this.kind,value:this.members.map(e=>e.json)}}asOptional(){return new e({isOptional:`optional`,members:this.members})}},He={id:e=>new ke({isOptional:`required`,tableName:e}),null:()=>new Fe({isOptional:`required`}),number:()=>new Ae({isOptional:`required`}),float64:()=>new Ae({isOptional:`required`}),bigint:()=>new je({isOptional:`required`}),int64:()=>new je({isOptional:`required`}),boolean:()=>new Me({isOptional:`required`}),string:()=>new Pe({isOptional:`required`}),bytes:()=>new Ne({isOptional:`required`}),literal:e=>new Re({isOptional:`required`,value:e}),array:e=>new ze({isOptional:`required`,element:e}),object:e=>new Le({isOptional:`required`,fields:e}),record:(e,t)=>new Be({isOptional:`required`,key:e,value:t}),union:(...e)=>new Ve({isOptional:`required`,members:e}),any:()=>new Ie({isOptional:`required`}),optional:e=>e.asOptional(),nullable:e=>He.union(e,He.null())},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,qe,Je=Symbol.for(`ConvexError`),Ye=class extends (qe=Error,Ke=Je,qe){constructor(e){super(typeof e==`string`?e:ve(e)),Ge(this,`name`,`ConvexError`),Ge(this,`data`),Ge(this,Ke,!0),this.data=e}},Xe=`1.40.0`,Ze=Object.defineProperty,Qe=(e,t,n)=>t in e?Ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$e=(e,t,n)=>Qe(e,typeof t==`symbol`?t:t+``,n),et=`color:rgb(0, 145, 255)`;function tt(e){switch(e){case`query`:return`Q`;case`mutation`:return`M`;case`action`:return`A`;case`any`:return`?`}}var nt=class{constructor(e){$e(this,`_onLogLineFuncs`),$e(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 rt(e){let t=new nt(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 it(e){return new nt(e)}function at(e,t,n,r,i){let a=tt(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}]`,et,o)}else e.error(`[CONVEX ${a}(${r})] ${i}`)}function ot(e,t){let n=`[CONVEX FATAL ERROR] ${t}`;return e.error(n),Error(n)}function st(e,t,n){return`[CONVEX ${tt(e)}(${t})] ${n.errorMessage}
|
|
10
|
+
Called by client`}function ct(e,t){return t.data=e.errorData,t}function lt(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 ut(e,t){return JSON.stringify({udfPath:lt(e),args:Se(t)})}function dt(e,t,n){let{initialNumItems:r,id:i}=n;return JSON.stringify({type:`paginated`,udfPath:lt(e),args:Se(t),options:Se({initialNumItems:r,id:i})})}var ft=Object.defineProperty,pt=(e,t,n)=>t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mt=(e,t,n)=>pt(e,typeof t==`symbol`?t:t+``,n),ht=class{constructor(){mt(this,`nextQueryId`),mt(this,`querySetVersion`),mt(this,`querySet`),mt(this,`queryIdToToken`),mt(this,`identityVersion`),mt(this,`auth`),mt(this,`outstandingQueriesOlderThanRestart`),mt(this,`outstandingAuthOlderThanRestart`),mt(this,`paused`),mt(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=lt(e),a=ut(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:[Se(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=ut(lt(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:[Se(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]}}}},gt=Object.defineProperty,_t=(e,t,n)=>t in e?gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vt=(e,t,n)=>_t(e,typeof t==`symbol`?t:t+``,n),yt=class{constructor(e,t){this.logger=e,this.markConnectionStateDirty=t,vt(this,`inflightRequests`),vt(this,`requestsOlderThanRestart`),vt(this,`inflightMutationsCount`,0),vt(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)at(this.logger,`info`,n,r,t);let i=t.status,a,o;if(e.success)a={success:!0,logLines:e.logLines,value:ge(e.result)},o=()=>i.onResult(a);else{let t=e.result,{errorData:s}=e;at(this.logger,`error`,n,r,t),a={success:!1,errorMessage:t,errorData:s===void 0?void 0:ge(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}},bt=Symbol.for(`functionName`),xt=Symbol.for(`toReferencePath`);function St(e){return e[xt]??null}function Ct(e){return e.startsWith(`function://`)}function wt(e){let t;if(typeof e==`string`)t=Ct(e)?{functionHandle:e}:{name:e};else if(e[bt])t={name:e[bt]};else{let n=St(e);if(!n)throw Error(`${e} is not a functionReference`);t={reference:n}}return t}function Tt(e){let t=wt(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[bt];if(!n)throw Error(`${e} is not a functionReference`);return n}function Et(e){return{[bt]:e}}function Dt(e=[]){return new Proxy({},{get(t,n){if(typeof n==`string`)return Dt([...e,n]);if(n===bt){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 Ot=Dt(),kt=Object.defineProperty,At=(e,t,n)=>t in e?kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jt=(e,t,n)=>At(e,typeof t==`symbol`?t:t+``,n),Mt=class e{constructor(e){jt(this,`queryResults`),jt(this,`modifiedQueries`),this.queryResults=e,this.modifiedQueries=[]}getQuery(t,...n){let r=k(n[0]),i=Tt(t),a=this.queryResults.get(ut(i,r));if(a!==void 0)return e.queryValue(a.result)}getAllQueries(t){let n=[],r=Tt(t);for(let t of this.queryResults.values())t.udfPath===lt(r)&&n.push({args:t.args,value:e.queryValue(t.result)});return n}setQuery(e,t,n){let r=k(t),i=Tt(e),a=ut(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}},Nt=class{constructor(){jt(this,`queryResults`),jt(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 Mt(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 Mt(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(st(`query`,t.udfPath,n)):ct(n,new Ye(st(`query`,t.udfPath,n)))}}hasQueryResult(e){return this.queryResults.get(e)!==void 0}queryLogs(e){return this.queryResults.get(e)?.result?.logLines}},Pt=Object.defineProperty,Ft=(e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,It=(e,t,n)=>Ft(e,typeof t==`symbol`?t:t+``,n),Lt=class e{constructor(e,t){It(this,`low`),It(this,`high`),It(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?Rt:t>=Vt?Ht:new e(t%Bt|0,t/Bt|0)}toString(){return(BigInt(this.high)*BigInt(Bt)+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)}},Rt=new Lt(0,0),zt=65536,Bt=zt*zt,Vt=Bt*Bt,Ht=new Lt(-1,-1),Ut=Object.defineProperty,Wt=(e,t,n)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gt=(e,t,n)=>Wt(e,typeof t==`symbol`?t:t+``,n),Kt=class{constructor(e,t){Gt(this,`version`),Gt(this,`remoteQuerySet`),Gt(this,`queryPath`),Gt(this,`logger`),this.version={querySet:0,ts:Lt.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)at(this.logger,`info`,`query`,e,n);let n=ge(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)at(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:ge(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 qt(e){let t=D(e);return Lt.fromBytesLE(Array.from(t))}function Jt(e){return te(new Uint8Array(e.toBytesLE()))}function Yt(e){switch(e.type){case`FatalError`:case`AuthError`:case`ActionResponse`:case`TransitionChunk`:case`Ping`:return{...e};case`MutationResponse`:return e.success?{...e,ts:qt(e.ts)}:{...e};case`Transition`:return{...e,startVersion:{...e.startVersion,ts:qt(e.startVersion.ts)},endVersion:{...e.endVersion,ts:qt(e.endVersion.ts)}};default:}}function Xt(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:Jt(e.maxObservedTimestamp)};default:}}var Zt=Object.defineProperty,Qt=(e,t,n)=>t in e?Zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$t=(e,t,n)=>Qt(e,typeof t==`symbol`?t:t+``,n),en=1e3,tn=1001,nn=1005,rn=4040,an;function on(){return an===void 0&&(an=Date.now()),typeof performance>`u`||!performance.now?Date.now():Math.round(an+performance.now())}function sn(){return`t=${Math.round((on()-an)/100)/10}s`}var cn={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 ln(e){if(e===void 0)return`Unknown`;for(let t of Object.keys(cn))if(e.startsWith(t))return t;return`Unknown`}var un=class{constructor(e,t,n,r,i,a){this.markConnectionStateDirty=i,this.debug=a,$t(this,`socket`),$t(this,`connectionCount`),$t(this,`_hasEverConnected`,!1),$t(this,`lastCloseReason`),$t(this,`transitionChunkBuffer`,null),$t(this,`defaultInitialBackoff`),$t(this,`maxBackoff`),$t(this,`retries`),$t(this,`serverInactivityThreshold`),$t(this,`reconnectDueToServerInactivityTimeout`),$t(this,`scheduledReconnect`,null),$t(this,`networkOnlineHandler`,null),$t(this,`pendingNetworkRecoveryInfo`,null),$t(this,`uri`),$t(this,`onOpen`),$t(this,`onResume`),$t(this,`onMessage`),$t(this,`webSocketConstructor`),$t(this,`logger`),$t(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=Yt(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:on()})),this.lastCloseReason!==`InitialConnect`&&(this.lastCloseReason?this.logger.log(`WebSocket reconnected at`,sn(),`after disconnect due to`,this.lastCloseReason):this.logger.log(`WebSocket reconnected at`,sn())),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=Yt(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!==en&&e.code!==tn&&e.code!==nn&&e.code!==rn){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=ln(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=Xt(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=on(),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=on()-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:on()})):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:cn[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=on()-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 dn(){return fn()}function fn(){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 pn=class extends Error{};pn.prototype.name=`InvalidTokenError`;function mn(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 hn(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 mn(t)}catch{return atob(t)}}function gn(e,t){if(typeof e!=`string`)throw new pn(`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 pn(`Invalid token specified: missing part #${n+1}`);let i;try{i=hn(r)}catch(e){throw new pn(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new pn(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}var _n=Object.defineProperty,vn=(e,t,n)=>t in e?_n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yn=(e,t,n)=>vn(e,typeof t==`symbol`?t:t+``,n),bn=480*60*60*1e3,xn=2,Sn=class{constructor(e,t,n){yn(this,`authState`,{state:`noAuth`}),yn(this,`configVersion`,0),yn(this,`syncState`),yn(this,`authenticate`),yn(this,`stopSocket`),yn(this,`tryRestartSocket`),yn(this,`pauseSocket`),yn(this,`resumeSocket`),yn(this,`clearAuth`),yn(this,`logger`),yn(this,`refreshTokenLeewaySeconds`),yn(this,`lastRefreshChange`),yn(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>=xn){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, ${xn-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(bn,(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 gn(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}]`)}},Cn=[`convexClientConstructed`,`convexWebSocketOpen`,`convexFirstMessageReceived`];function wn(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 En(e){if(typeof performance>`u`||!performance.getEntriesByName)return[];let t=[];for(let n of Cn){let r=performance.getEntriesByName(n).filter(e=>e.entryType===`mark`).filter(t=>t.detail.sessionId===e);t.push(...r)}return t.map(Tn)}var Dn=Object.defineProperty,On=(e,t,n)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kn=(e,t,n)=>On(e,typeof t==`symbol`?t:t+``,n),An=class{constructor(e,t,n){if(kn(this,`address`),kn(this,`state`),kn(this,`requestManager`),kn(this,`webSocketManager`),kn(this,`authenticationManager`),kn(this,`remoteQuerySet`),kn(this,`optimisticQueryResults`),kn(this,`_transitionHandlerCounter`,0),kn(this,`_nextRequestId`),kn(this,`_onTransitionFns`,new Map),kn(this,`_sessionId`),kn(this,`firstMessageReceived`,!1),kn(this,`debug`),kn(this,`logger`),kn(this,`maxObservedTimestamp`),kn(this,`connectionStateSubscribers`,new Map),kn(this,`nextConnectionStateSubscriberId`,0),kn(this,`_lastPublishedConnectionState`),kn(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)}})}),kn(this,`mark`,e=>{this.debug&&wn(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&&A(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?it({verbose:n.verbose??!1}):n.logger!==!0&&n.logger?n.logger:rt({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/${Xe}/sync`;this.state=new ht,this.remoteQuerySet=new Kt(e=>this.state.queryPath(e),this.logger),this.requestManager=new yt(this.logger,this.markConnectionStateDirty);let u=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new Sn(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 Nt,this.addOnTransitionHandler(e=>{t(e.queries.map(e=>e.token))}),this._nextRequestId=0,this._sessionId=dn();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 un(l,{onOpen:e=>{this.mark(`convexWebSocketOpen`),this.webSocketManager.sendMessage({...e,type:`Connect`,sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp}),this.remoteQuerySet=new Kt(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=ot(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?gn(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=k(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=ut(e,k(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=ut(e,k(t));return this.optimisticQueryResults.queryLogs(n)}queryJournal(e,t){let n=ut(e,k(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(st(`mutation`,e,r)):ct(r,new Ye(st(`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=k(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:[Se(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(st(`action`,e,n)):ct(n,new Ye(st(`action`,e,n)));return n.value}async actionInternal(e,t,n){let r=k(t),i=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();let a={type:`Action`,requestId:i,udfPath:e,componentPath:n,args:[Se(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=En(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-${Xe}`},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 jn(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 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,t){this.client=e,this.onTransition=t,Pn(this,`paginatedQuerySet`,new Map),Pn(this,`lastTransitionTs`),this.lastTransitionTs=Lt.fromNumber(0),this.client.addOnTransitionHandler(e=>this.onBaseTransition(e))}subscribe(e,t,n){let r=lt(e),i=dt(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=dt(lt(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=jn(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=jn(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=jn(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}},In=Object.defineProperty,Ln=(e,t,n)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rn=(e,t,n)=>Ln(e,typeof t==`symbol`?t:t+``,n),zn=void 0,Bn=class{constructor(e,t){if(Rn(this,`address`),Rn(this,`auth`),Rn(this,`adminAuth`),Rn(this,`encodedTsPromise`),Rn(this,`debug`),Rn(this,`fetchOptions`),Rn(this,`fetch`),Rn(this,`logger`),Rn(this,`mutationQueue`,[]),Rn(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&&A(e),this.logger=t?.logger===!1?it({verbose:!1}):t?.logger!==!0&&t?.logger?t.logger:rt({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=k(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||zn||fetch,t={"Content-Type":`application/json`,"Convex-Client":`npm-${Xe}`},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=k(t[0]);return await this.queryInner(e,n,{})}async queryInner(e,t,n){let r=Tt(e),i=[Se(t)],a={"Content-Type":`application/json`,"Convex-Client":`npm-${Xe}`};this.adminAuth?a.Authorization=`Convex ${this.adminAuth}`:this.auth&&(a.Authorization=`Bearer ${this.auth}`);let o=this.fetch||zn||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??[])at(this.logger,`info`,`query`,r,e);switch(u.status){case`success`:return ge(u.value);case`error`:throw u.errorData===void 0?Error(u.errorMessage):Vn(u.errorData,new Ye(u.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(u)}`)}}async mutationInner(e,t){let n=Tt(e),r=JSON.stringify({path:n,format:`convex_encoded_json`,args:[Se(t)]}),i={"Content-Type":`application/json`,"Convex-Client":`npm-${Xe}`};this.adminAuth?i.Authorization=`Convex ${this.adminAuth}`:this.auth&&(i.Authorization=`Bearer ${this.auth}`);let a=await(this.fetch||zn||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??[])at(this.logger,`info`,`mutation`,n,e);switch(o.status){case`success`:return ge(o.value);case`error`:throw o.errorData===void 0?Error(o.errorMessage):Vn(o.errorData,new Ye(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=k(n);return r?.skipQueue?await this.mutationInner(e,i):await this.enqueueMutation(e,i)}async action(e,...t){let n=k(t[0]),r=Tt(e),i=JSON.stringify({path:r,format:`convex_encoded_json`,args:[Se(n)]}),a={"Content-Type":`application/json`,"Convex-Client":`npm-${Xe}`};this.adminAuth?a.Authorization=`Convex ${this.adminAuth}`:this.auth&&(a.Authorization=`Bearer ${this.auth}`);let o=await(this.fetch||zn||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??[])at(this.logger,`info`,`action`,r,e);switch(s.status){case`success`:return ge(s.value);case`error`:throw s.errorData===void 0?Error(s.errorMessage):Vn(s.errorData,new Ye(s.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(s)}`)}}async function(e,t,...n){let r=k(n[0]),i=typeof e==`string`?e:Tt(e),a=JSON.stringify({componentPath:t,path:i,format:`convex_encoded_json`,args:Se(r)}),o={"Content-Type":`application/json`,"Convex-Client":`npm-${Xe}`};this.adminAuth?o.Authorization=`Convex ${this.adminAuth}`:this.auth&&(o.Authorization=`Bearer ${this.auth}`);let s=await(this.fetch||zn||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??[])at(this.logger,`info`,`any`,i,e);switch(c.status){case`success`:return ge(c.value);case`error`:throw c.errorData===void 0?Error(c.errorMessage):Vn(c.errorData,new Ye(c.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(c)}`)}}};function Vn(e,t){return t.data=ge(e),t}var N=u(f(),1);function Hn({getCurrentValue:e,subscribe:t}){let[n,r]=(0,N.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,N.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 Un=Object.defineProperty,Wn=(e,t,n)=>t in e?Un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gn=(e,t,n)=>Wn(e,typeof t==`symbol`?t:t+``,n),Kn=5e3;if(N.default===void 0)throw Error(`Required dependency 'react' not found`);function qn(e,t,n){function r(r){return er(r),t.mutation(e,r,{optimisticUpdate:n})}return r.withOptimisticUpdate=function(r){if(n!==void 0)throw Error(`Already specified optimistic update for mutation ${Tt(e)}`);return qn(e,t,r)},r}function Jn(e,t){return function(n){return t.action(e,n)}}var Yn=class{constructor(e,t){if(Gn(this,`address`),Gn(this,`cachedSync`),Gn(this,`cachedPaginatedQueryClient`),Gn(this,`listeners`),Gn(this,`options`),Gn(this,`closed`,!1),Gn(this,`_logger`),Gn(this,`adminAuth`),Gn(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?it({verbose:t?.verbose??!1}):t?.logger!==!0&&t?.logger?t.logger:rt({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 An(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=Tt(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??Kn,n=this.watchQuery(e.query,e.args||{}).onUpdate(()=>{});setTimeout(n,t)}watchPaginatedQuery(e,t,n){let r=Tt(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=Tt(e);return this.sync.mutation(i,n,r)}action(e,...t){let n=Tt(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()}}},Xn=N.createContext(void 0);function Zn(){return(0,N.useContext)(Xn)}var Qn=({client:e,children:t})=>N.createElement(Xn.Provider,{value:e},t);function P(e,...t){let n=t[0]===`skip`,r=t[0]===`skip`?{}:k(t[0]),i=typeof e==`string`?Et(e):e,a=Tt(i),o=ar((0,N.useMemo)(()=>n?{}:{query:{query:i,args:r}},[JSON.stringify(Se(r)),a,n])).query;if(o instanceof Error)throw o;return o}function F(e){let t=typeof e==`string`?Et(e):e,n=(0,N.useContext)(Xn);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,N.useMemo)(()=>qn(t,n),[n,Tt(t)])}function $n(e){let t=(0,N.useContext)(Xn),n=typeof e==`string`?Et(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,N.useMemo)(()=>Jn(n,t),[t,Tt(n)])}function er(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 tr=Object.defineProperty,nr=(e,t,n)=>t in e?tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rr=(e,t,n)=>nr(e,typeof t==`symbol`?t:t+``,n),ir=class{constructor(e){rr(this,`createWatch`),rr(this,`queries`),rr(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(Tt(n),this.queries[t]===void 0)this.addQuery(t,n,r,i?{paginationOptions:i}:{});else{let e=this.queries[t];(Tt(n)!==Tt(e.query)||JSON.stringify(Se(r))!==JSON.stringify(Se(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;Tt(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 ar(e){let t=Zn();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 or(e,(0,N.useMemo)(()=>(e,n,{journal:r,paginationOptions:i})=>i?t.watchPaginatedQuery(e,n,i):t.watchQuery(e,n,r?{journal:r}:{}),[t]))}function or(e,t){let[n]=(0,N.useState)(()=>new ir(t));return n.createWatch!==t&&n.setCreateWatch(t),(0,N.useEffect)(()=>()=>n.destroy(),[n]),Hn((0,N.useMemo)(()=>({getCurrentValue:()=>n.getLocalResults(e),subscribe:t=>(n.setQueries(e),n.subscribe(t))}),[n,e]))}var sr=(0,N.createContext)(void 0);function cr(){let e=(0,N.useContext)(sr);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 lr({children:e,client:t,useAuth:n}){let{isLoading:r,isAuthenticated:i,fetchAccessToken:a}=n(),[o,s]=(0,N.useState)(null),[c,l]=(0,N.useState)(!1);r&&o!==null&&(s(null),l(!1)),!r&&!i&&o!==!1&&(s(!1),l(!1));let u=i&&(o??!1);return N.createElement(sr.Provider,{value:{isLoading:o===null,isAuthenticated:u,isRefreshing:c&&u}},N.createElement(ur,{authProviderAuthenticated:i,fetchAccessToken:a,authProviderLoading:r,client:t,setIsConvexAuthenticated:s,setIsRefreshing:l}),N.createElement(Qn,{client:t},e),N.createElement(dr,{authProviderAuthenticated:i,fetchAccessToken:a,authProviderLoading:r,client:t,setIsConvexAuthenticated:s,setIsRefreshing:l}))}function ur({authProviderAuthenticated:e,fetchAccessToken:t,authProviderLoading:n,client:r,setIsConvexAuthenticated:i,setIsRefreshing:a}){return(0,N.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 dr({authProviderAuthenticated:e,fetchAccessToken:t,authProviderLoading:n,client:r,setIsConvexAuthenticated:i,setIsRefreshing:a}){return(0,N.useEffect)(()=>{if(e)return()=>{r.clearAuth(),i(()=>null),a(!1)}},[e,t,n,r,i,a]),null}function fr({children:e}){let{isLoading:t,isAuthenticated:n}=cr();return t||!n?null:N.createElement(N.Fragment,null,e)}function pr({children:e}){let{isLoading:t,isAuthenticated:n}=cr();return t||n?null:N.createElement(N.Fragment,null,e)}function mr({children:e}){let{isLoading:t}=cr();return t?N.createElement(N.Fragment,null,e):null}var hr=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})),gr=o(((e,t)=>{t.exports=hr()})),_r=u(v(),1),I=gr(),vr=(0,N.createContext)(void 0),yr=(0,N.createContext)(void 0);function br(){return(0,N.useContext)(yr)}var xr=(0,N.createContext)(null),Sr=`__convexAuthOAuthVerifier`,Cr=`__convexAuthJWT`,wr=`__convexAuthRefreshToken`,Tr=`__convexAuthServerStateFetchTime`;function Er({client:e,serverState:t,onChange:n,storage:r,storageNamespace:i,replaceURL:a,children:o}){let s=(0,N.useRef)(t?._state.token??null),[c,l]=(0,N.useState)(s.current===null),[u,d]=(0,N.useState)(s.current),f=e.verbose??!1,p=(0,N.useCallback)(e=>{f&&console.debug(`${new Date().toISOString()} ${e}`)},[f]),{storageSet:m,storageGet:h,storageRemove:g,storageKey:_}=Dr(r,i),[v,y]=(0,N.useState)(!1),b=(0,N.useCallback)(async e=>{let t=s.current!==null,r;if(e.tokens===null)s.current=null,e.shouldStore&&(await g(Cr),await g(wr)),r=null;else{let{token:t}=e.tokens;if(s.current=t,e.shouldStore){let{refreshToken:n}=e.tokens;await m(Cr,t),await m(wr,n)}r=t}t!==(r!==null)&&await n?.(),d(r),l(!1)},[m,g]);(0,N.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 Pr(`beforeunload`,e),()=>{Fr(`beforeunload`,e)}}),(0,N.useEffect)(()=>{let e=e=>{(async()=>{if(e.storageArea===r&&e.key===_(Cr)){let t=e.newValue;p(`synced access token, is null: ${t===null}`),await b({shouldStore:!1,tokens:t===null?null:{token:t}})}})()};return Pr(`storage`,e),()=>Fr(`storage`,e)},[b]);let x=(0,N.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,N.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(Sr)??void 0;await g(Sr);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(Sr,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,N.useCallback)(async()=>{try{await e.authenticatedCall(`auth:signOut`)}catch{}p(`signed out, erasing tokens`),await b({shouldStore:!0,tokens:null})},[b,e]),w=(0,N.useCallback)(async({forceRefreshToken:e})=>{if(e){let e=s.current;return await kr(wr,async()=>{let t=s.current;if(t!==e)return p(`returning synced token, is null: ${t===null}`),t;let n=await h(wr)??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,N.useRef)(!1);(0,N.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(Cr)??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(Tr),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(Tr,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,N.useMemo)(()=>({signIn:S,signOut:C}),[S,C]),D=u!==null,O=(0,N.useMemo)(()=>({isLoading:c,isAuthenticated:D,fetchAccessToken:w}),[w,c,D]);return(0,I.jsx)(yr.Provider,{value:O,children:(0,I.jsx)(vr.Provider,{value:E,children:(0,I.jsx)(xr.Provider,{value:u,children:o})})})}function Dr(e,t){let n=Or(),r=(0,N.useMemo)(()=>e??n(),[e]),i=t.replace(/[^a-zA-Z0-9]/g,``),a=(0,N.useCallback)(e=>`${e}_${i}`,[t]);return{storageSet:(0,N.useCallback)((e,t)=>r.setItem(a(e),t),[r,a]),storageGet:(0,N.useCallback)(e=>r.getItem(a(e)),[r,a]),storageRemove:(0,N.useCallback)(e=>r.removeItem(a(e)),[r,a]),storageKey:a}}function Or(){let[e,t]=(0,N.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 kr(e,t){let n=window?.navigator?.locks;return n===void 0?await Nr(e,t):await n.request(e,t)}function Ar(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 jr(e,t){globalThis.__convexAuthMutexes[e]=t}async function Mr(e,t){let n=Ar(e);n.currentlyRunning===null?jr(e,{currentlyRunning:t().finally(()=>{let t=Ar(e).waiting.shift();Ar(e).currentlyRunning=null,jr(e,{...Ar(e),currentlyRunning:t===void 0?null:Mr(e,t)})}),waiting:[]}):jr(e,{...n,waiting:[...n.waiting,t]})}async function Nr(e,t){return new Promise((n,r)=>{Mr(e,()=>t().then(e=>n(e)).catch(e=>r(e)))})}function Pr(e,t,n){window.addEventListener?.(e,t,n)}function Fr(e,t,n){window.removeEventListener?.(e,t,n)}function Ir(){return(0,N.useContext)(vr)}function Lr(e){let{client:t,storage:n,storageNamespace:r,replaceURL:i,children:a}=e;return(0,I.jsx)(Er,{client:(0,N.useMemo)(()=>({authenticatedCall(e,n){return t.action(e,n)},unauthenticatedCall(e,n){return new Bn(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,I.jsx)(lr,{client:t,useAuth:br,children:a})})}var Rr=typeof window<`u`?N.useLayoutEffect:N.useEffect;function zr(e){let t=N.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Br(e,t,n={},r={}){N.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=N.useRef(null);return N.useImperativeHandle(e,()=>t.current,[]),t}function Hr(e){return e[e.length-1]}function Ur(e){return typeof e==`function`}function Wr(e,t){return Ur(e)?e(t):e}var Gr=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable;function qr(e){for(let t in e)if(Gr.call(e,t))return!0;return!1}var Jr=()=>Object.create(null),Yr=(e,t)=>Xr(e,t,Jr);function Xr(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ei(e)&&ei(i);if(!a&&!(Qr(e)&&Qr(i)))return i;let o=a?e:Zr(e);if(!o)return i;let s=a?i:Zr(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:Gr.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=Xr(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function Zr(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!Kr.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(!Kr.call(e,t))return!1;r.push(t)}return r}function Qr(e){if(!$r(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!$r(n)||!n.hasOwnProperty(`isPrototypeOf`))}function $r(e){return Object.prototype.toString.call(e)===`[object Object]`}function ei(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ti(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(!ti(e[r],t[r],n))return!1;return!0}if(Qr(e)&&Qr(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!ti(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||!ti(e[o],t[o],n)))return!1;return i===a}return!1}function ni(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 ri(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function ii(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function ai(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 ii(t)}var oi=[`http:`,`https:`,`mailto:`,`tel:`];function si(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ci(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+=ai(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ai(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function li(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ui(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 di(){throw Error(`Invariant failed`)}function fi(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 pi=4,mi=5;function hi(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 gi(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=hi(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 _i(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=gi(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=bi(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=bi(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=xi(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=xi(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=xi(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=bi(n.fullPath??n.from);e.kind=mi,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=bi(n.fullPath??n.from);e.kind=pi,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)_i(e,t,r,s,i,a,o)}function vi(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 yi(e){if(e.pathless)for(let t of e.pathless)yi(t);if(e.static)for(let t of e.static.values())yi(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())yi(t);if(e.dynamic?.length){e.dynamic.sort(vi);for(let t of e.dynamic)yi(t)}if(e.optional?.length){e.optional.sort(vi);for(let t of e.optional)yi(t)}if(e.wildcard?.length){e.wildcard.sort(vi);for(let t of e.wildcard)yi(t)}}function bi(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 xi(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 Si(e,t){let n=bi(`/`),r=new Uint16Array(6);for(let t of e)_i(!1,r,t,1,n,0);yi(n),t.masksTree=n,t.flatCache=fi(1e3)}function Ci(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Oi(e,t.masksTree);return t.flatCache.set(e,r),r}function wi(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=bi(`/`),_i(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Oi(r,o,n)}function Ti(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=Oi(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Ai(a.route)),t.matchCache.set(r,a),a}function Ei(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Di(e,t=!1,n){let r=bi(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return _i(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&di(),a[e.id]=e,s!==0&&e.path){let t=Ei(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),yi(r),{processedTree:{segmentTree:r,singleCache:fi(1e3),matchCache:fi(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Oi(e,t,n=!1){let r=e.split(`/`),i=Mi(e,r,t,n);if(!i)return null;let[a]=ki(e,r,i);return{route:i.node.route,rawParams:a}}function ki(e,t,n){let r=ji(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===pi)break;if(u.kind===mi){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 Ai(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ji(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Mi(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!Hr(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&&!Ii(l,n))continue;if(i.parse){if(!Fi(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==pi&&Ii(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===pi||i.kind===2)&&Ii(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&&Pi(p,o))return n;Ii(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+Ni(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+Ni(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+Ni(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+Ni(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 Ni(e,t){return 2**(e-t-1)}function Pi(e,t){return e===2**(t-1)-1}function Fi(e,t,n){let r,i;try{[r,i]=ki(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 Ii(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===pi)>(e.node.kind===pi)||t.node.kind===pi==(e.node.kind===pi)&&t.depth>e.depth))):!0}function Li(e){return Ri(e.filter(e=>e!==void 0).join(`/`))}function Ri(e){return e.replace(/\/{2,}/g,`/`)}function zi(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Bi(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Vi(e){return Bi(zi(e))}function Hi(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ui(e,t,n){return Hi(e,n)===Hi(t,n)}function Wi({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&&Hr(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&&(Hr(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Ri(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Gi(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 Ki(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ji(e,n)).join(`/`):Ji(r,n):r}function qi({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=gi(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=Ki(`_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=Ki(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=Ki(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ji(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Yi(e){return e?.isNotFound===!0}function Xi(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 Zi(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Qi(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]=Zi(r):Array.isArray(t)?t.push(Zi(r)):n[e]=[t,Zi(r)]}return n}var $i=ta(JSON.parse),ea=na(JSON.stringify,JSON.parse);function ta(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Qi(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function na(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=Xi(e,r);return t?`?${t}`:``}}var ra=`__root__`;function ia(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 aa(e){return e instanceof Response&&!!e.options}var oa=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},sa=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),ca=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),la=(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},ua=(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},da=(e,t,n)=>{if(!(!aa(n)&&!Yi(n)))throw aa(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:aa(n)?`redirected`:Yi(n)?`notFound`:r.status===`pending`?`success`:r.status,context:la(e,t.index),isFetching:!1,error:n})),Yi(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),aa(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},fa=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},pa=(e,t,n)=>{let r=la(e,n);e.updateMatch(t,e=>({...e,context:r}))},ma=(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,da(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,da(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&&!aa(n)&&!Yi(n)&&(e.serialError??=n)},ha=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!ca(e,t)&&(n.options.loader||n.options.beforeLoad||Ea(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{oa(e)},i);r._nonReactive.pendingTimeout=t}},ga=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;ha(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&da(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},_a=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=ni(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&ma(e,n,o),s&&ma(e,n,s),ha(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=ni();let f={...la(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=ca(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}(aa(r)||Yi(r))&&(u(),ma(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),ri(y))return u(),y.catch(t=>{ma(e,n,t)}).then(v)}catch(t){u(),ma(e,n,t)}v(y)},va=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>_a(e,n,t,i),s=()=>{if(fa(e,n))return;let t=ga(e,n,i);return ri(t)?t.then(o):o()};return a()},ya=(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}))},ba=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=la(e,r),d=ca(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}},xa=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Ta(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(ba(e,t,n,r,i)),l=!!s&&ri(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;da(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:la(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:la(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,Yi(t)&&await i.options.notFoundComponent?.preload?.(),da(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,da(e,e.router.getMatch(n),t)}!aa(o)&&!Yi(o)&&await Ta(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:la(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),da(e,r,t)}},Sa=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(ba(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 xa(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){aa(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await xa(e,t,i,n,d):pa(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(fa(e,i)){if(!e.router.getMatch(i))return e.matches[n];pa(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=ca(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&&da(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=ni(),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 Ca(e){let t=e,n=[];sa(t.router)&&oa(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=va(t,e);ri(n)&&await n}catch(e){if(aa(e))throw e;if(Yi(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?ua(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(Sa(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(aa(e))throw e;Yi(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=ua(t,l);e===void 0&&di();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 Ta(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 Ta(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=ya(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=oa(t);if(ri(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function wa(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Ta(e,t=Da){!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===Da?(()=>{if(e._componentsPromise===void 0){let t=wa(e,Da);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():wa(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ea(e){for(let t of Da)if(e.options[t]?.preload)return!0;return!1}var Da=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function Oa(e){return{input:({url:t})=>{for(let n of e)t=Aa(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ja(e[n],t);return t}}}function ka(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=Li([`/`,t,e.pathname]),e)}}function Aa(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 ja(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 Ma(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(()=>Na(o,_.get())),x=r(()=>Na(s,v.get())),S=r(()=>Na(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=fi(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 ee={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:te,setPending:k,setCached:A};te(e.matches),a?.(ee);function te(e){Pa(e,o,_,n,i)}function k(e){Pa(e,s,v,n,i)}function A(e){Pa(e,c,y,n,i)}return ee}function Na(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Pa(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)}ui(n.get(),a)||n.set(a)})}var Fa=`__TSR_index`,Ia=`popstate`,La=`beforeunload`;function Ra(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=Ha(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=za(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=za(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 za(e,t){t||={};let n=Ua();return{...t,key:n,__TSR_key:n,[Fa]:e}}function Ba(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??(()=>Ha(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Ua();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=Ha(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=Ra({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(La,S,{capture:!0}),t.removeEventListener(Ia,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(La,S,{capture:!0}),t.addEventListener(Ia,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 Ha(e,t){let n=Va(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Ua();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 Ua(){return(Math.random()+1).toString(36).substring(7)}function Wa(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 Ga=new WeakMap,Ka=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=Gi(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Ba()),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=fi(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Ma(Ya(this.latestLocation),e),go(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(ka({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Oa(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=Di(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Si(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:ci(e).path,external:!1,searchStr:o,search:Yr(t?.search,i),hash:ci(r.slice(1)).path,state:Xr(t?.state,a)}}let o=new URL(i,this.origin),s=Aa(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:ci(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:Yr(t?.search,c),hash:ci(s.hash.slice(1)).path,state:Xr(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)=>Wi({base:e,to:t.includes(`//`)?Ri(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=>Za({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,Wr(t.params,s)),d=this.routesByPath[Bi(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&&qr(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:ci(qi({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,Xa(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=Qa({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=Yr(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?Wr(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?Wr(t.state,n.state):{};v=Xr(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=ja(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=li(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=Ci(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,Wr(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=ti(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Bi(this.latestLocation.href)===Bi(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=ni(()=>{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=Ha(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Aa(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(si(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?Ga.set(this.latestLocation,t):Ga.delete(this.latestLocation);let n=this.latestLocation,r=Wa(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await Ca({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){aa(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Yi(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(Wa(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&&si(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=Ta,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 Ca({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(aa(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});Yi(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=wi(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!ti(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?ti(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??ea,parseSearch:e.parseSearch??$i,protocolAllowlist:e.protocolAllowlist??oi}),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=Ai(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[`**`]:Bi(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?eo(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=Xa(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof qa||(r=new qa(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}=qi({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{to(r,b)}catch(e){if(x=Yi(e)||aa(e)?e:new Ja(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:Yr(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Ea(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?Yr(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:ni()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?Xr(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?Yr(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=Hr(t),i={...e.search};for(let e of t)try{Object.assign(i,Xa(e.options.validateSearch,i))}catch{}let a=Hr(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{to(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},qa=class extends Error{},Ja=class extends Error{};function Ya(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Xa(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new qa(`Async validation not supported`);if(n.issues)throw new qa(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 Za({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Bi(e),a,o=Ti(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Qa({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return $a(n)(e,t,r??!1)}function $a(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=Xa(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=Wr(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 eo(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 ra}function to(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 no(){try{return sessionStorage}catch{return}}var ro=`tsr-scroll-restoration-v1_3`,io=no();function ao(){try{return JSON.parse(io?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function oo(){try{io?.setItem(ro,JSON.stringify(so))}catch{}}var so=ao(),co=`data-scroll-restoration-id`,lo=e=>e.state.__TSR_key||e.href;function uo(e){let t=e.getAttribute(co);if(t)return`[${co}="${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 fo=!1,po=`window`;function mo(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function ho(e){let t=[];for(let n of e){if(n===po)continue;let e=mo(n);e&&t.push(e)}return t}function go(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||lo,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(!(fo||!r.restoring))if(e.target===document)o(po,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=so[e]||={};for(let[e,n]of a)e===po?t[po]=n:e.isConnected&&(t[uo(e)]=n)};n&&!r.restoration&&(r.restoration=!0,fo=!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())),oo()})),!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=so[u];if(e){let t=so[l];for(let n in e){if(n===po){if(s)continue}else{let e=mo(n);if(!e||s&&o&&(c??=ho(o),c.includes(e)))continue}t||=so[l]={},t[n]??=e[n]}}}fo=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=Ga.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?so[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===po){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=mo(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=ho(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{fo=!1}}))}var _o=`Error preloading route! ☝️`,vo=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=ra:this.parentRoute||di();let r=n?ra:t?.path;r&&r!==`/`&&(r=zi(r));let i=t?.id||r,a=n?ra:Li([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Li([`/`,a]));let o=a===`__root__`?`/`:Li([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Bi(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=>ia({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.`)}},yo=class extends vo{constructor(e){super(e)}};function bo(e){let t=e.errorComponent??So;return(0,I.jsx)(xo,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?N.createElement(t,{error:n,reset:r}):e.children})}var xo=class extends N.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 So({error:e}){let[t,n]=N.useState(!1);return(0,I.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,I.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,I.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,I.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,I.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,I.jsx)(`div`,{children:(0,I.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,I.jsx)(`code`,{children:e.message}):null})}):null]})}function Co({children:e,fallback:t=null}){return wo()?(0,I.jsx)(N.Fragment,{children:e}):(0,I.jsx)(N.Fragment,{children:t})}function wo(){return N.useSyncExternalStore(To,()=>!0,()=>!1)}function To(){return()=>{}}var Eo=N.createContext(null);function Do(e){return N.useContext(Eo)}var Oo=N.createContext(void 0),ko=N.createContext(void 0),Ao=(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))(Ao||{});function jo({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 Mo(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 No=[],Po=0,{link:Fo,unlink:Io,propagate:Lo,checkDirty:Ro,shallowPropagate:zo}=jo({update(e){return e._update()},notify(e){No[Vo++]=e,e.flags&=~Ao.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Ao.Mutable|Ao.Dirty,Go(e))}}),Bo=0,Vo=0,Ho,Uo=0;function Wo(e){try{++Uo,e()}finally{--Uo||Ko()}}function Go(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Io(n,e)}function Ko(){if(!(Uo>0)){for(;Bo<Vo;){let e=No[Bo];No[Bo++]=void 0,e.notify()}Bo=0,Vo=0}}function qo(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?Ao.None:Ao.Mutable,get(){return Ho!==void 0&&Fo(i,Ho,Po),i._snapshot},subscribe(e){let t=Mo(e),n={current:!1},r=Jo(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Ho,o=t?.compare??Object.is;if(n)Ho=i,++Po,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Ao.Mutable|Ao.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{Ho=a,n&&(i.flags&=~Ao.RecursedCheck),Go(i)}}};return n?(i.flags=Ao.Mutable|Ao.Dirty,i.get=function(){let e=i.flags;if(e&Ao.Dirty||e&Ao.Pending&&Ro(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&zo(e)}}else e&Ao.Pending&&(i.flags=e&~Ao.Pending);return Ho!==void 0&&Fo(i,Ho,Po),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Lo(e),zo(e),Ko())}},i}function Jo(e){let t=()=>{let t=Ho;Ho=n,++Po,n.depsTail=void 0,n.flags=Ao.Watching|Ao.RecursedCheck;try{return e()}finally{Ho=t,n.flags&=~Ao.RecursedCheck,Go(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ao.Watching|Ao.RecursedCheck,notify(){let e=this.flags;e&Ao.Dirty||e&Ao.Pending&&Ro(this.deps,this)?t():this.flags=Ao.Watching},stop(){this.flags=Ao.None,this.depsTail=void 0,Go(this)}};return t(),n}var Yo=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})),Xo=o(((e,t)=>{t.exports=Yo()})),Zo=o((e=>{var t=f(),n=Xo();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}})),Qo=o(((e,t)=>{t.exports=Zo()}))();function $o(e,t){return e===t}function es(e,t,n=$o){let r=(0,N.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,N.useCallback)(()=>e?.get(),[e]);return(0,Qo.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var ts={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function ns(e){let t=Do(),n=N.useContext(e.from?ko:Oo),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=N.useRef(void 0);return es(i??ts,n=>{if((e.shouldThrow??!0)&&!n&&di(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=Xr(a.current,r);return a.current=e,e}return r})}function rs(e){return ns({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function is(e){let{select:t,...n}=e;return ns({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function as(e){return ns({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 os(e){return ns({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ss(e){let t=Do();return N.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function cs(e){return ns({...e,select:t=>e.select?e.select(t.context):t.context})}var ls=u(g(),1);function us(e,t){let n=Do(),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:ee,hash:te,state:k,mask:A,reloadDocument:j,unsafeRelative:ne,from:re,_fromLocation:M,...ie}=e,ae=wo(),oe=N.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=es(n.stores.location,e=>e,(e,t)=>e.href===t.href),ce=N.useMemo(()=>{let e={_fromLocation:se,...oe};return n.buildLocation(e)},[n,se,oe]),le=ce.maskedLocation?ce.maskedLocation.publicHref:ce.publicHref,ue=ce.maskedLocation?ce.maskedLocation.external:ce.external,de=N.useMemo(()=>ys(le,ue,n.history,v),[v,ue,le,n.history]),fe=N.useMemo(()=>{if(de?.external)return si(de.href,n.protocolAllowlist)?void 0:de.href;if(!bs(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),si(s,n.protocolAllowlist)?void 0:s}catch{}},[s,de,n.protocolAllowlist]),pe=N.useMemo(()=>{if(fe)return!1;if(o?.exact){if(!Ui(se.pathname,ce.pathname,n.basepath))return!1}else{let e=Hi(se.pathname,n.basepath),t=Hi(ce.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!ti(se.search,ce.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ae&&se.hash===ce.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,se,fe,ae,ce.hash,ce.pathname,ce.search,n.basepath]),me=pe?Wr(i,{})??fs:ds,he=pe?ds:Wr(a,{})??ds,ge=[b,me.className,he.className].filter(Boolean).join(` `),_e=(y||me.style||he.style)&&{...y,...me.style,...he.style},[ve,ye]=N.useState(!1),be=N.useRef(!1),xe=e.reloadDocument||fe?!1:c??n.options.defaultPreload,Se=l??n.options.defaultPreloadDelay??0,Ce=N.useCallback(()=>{n.preloadRoute({...oe,_builtLocation:ce}).catch(e=>{console.warn(e),console.warn(_o)})},[n,oe,ce]);Br(r,N.useCallback(e=>{e?.isIntersecting&&Ce()},[Ce]),_s,{disabled:!!v||xe!==`viewport`}),N.useEffect(()=>{be.current||!v&&xe===`render`&&(Ce(),be.current=!0)},[v,Ce,xe]);let we=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!Ss(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,ls.flushSync)(()=>{ye(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ye(!1)});n.navigate({...oe,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(fe)return{...ie,ref:r,href:fe,...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 Te=e=>{if(v||xe!==`intent`)return;if(!Se){Ce();return}let t=e.currentTarget;if(gs.has(t))return;let n=setTimeout(()=>{gs.delete(t),Ce()},Se);gs.set(t,n)},Ee=e=>{v||xe!==`intent`||Ce()},De=e=>{if(v||!xe||!Se)return;let t=e.currentTarget,n=gs.get(t);n&&(clearTimeout(n),gs.delete(t))};return{...ie,...me,...he,href:de?.href,ref:r,onClick:vs([x,we]),onBlur:vs([S,De]),onFocus:vs([C,Te]),onMouseEnter:vs([w,Te]),onMouseLeave:vs([T,De]),onTouchStart:vs([E,Ee]),disabled:!!v,target:_,..._e&&{style:_e},...ge&&{className:ge},...v&&ps,...pe&&ms,...ae&&ve&&hs}}var ds={},fs={className:`active`},ps={role:`link`,"aria-disabled":!0},ms={"data-status":`active`,"aria-current":`page`},hs={"data-transitioning":`transitioning`},gs=new WeakMap,_s={rootMargin:`100px`},vs=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function ys(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function bs(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var xs=N.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=us(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return N.createElement(`a`,t,o)}return N.createElement(n,a,o)});function Ss(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Cs=class extends vo{constructor(e){super(e),this.useMatch=e=>ns({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>cs({...e,from:this.id}),this.useSearch=e=>os({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>as({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>is({...e,from:this.id}),this.useLoaderData=e=>rs({...e,from:this.id}),this.useNavigate=()=>ss({from:this.fullPath}),this.Link=N.forwardRef((e,t)=>(0,I.jsx)(xs,{ref:t,from:this.fullPath,...e}))}};function ws(e){return new Cs(e)}var Ts=class extends yo{constructor(e){super(e),this.useMatch=e=>ns({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>cs({...e,from:this.id}),this.useSearch=e=>os({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>as({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>is({...e,from:this.id}),this.useLoaderData=e=>rs({...e,from:this.id}),this.useNavigate=()=>ss({from:this.fullPath}),this.Link=N.forwardRef((e,t)=>(0,I.jsx)(xs,{ref:t,from:this.fullPath,...e}))}};function Es(e){return new Ts(e)}function Ds(e){let t=Do(),n=`not-found-${es(t.stores.location,e=>e.pathname)}-${es(t.stores.status,e=>e)}`;return(0,I.jsx)(bo,{getResetKey:()=>n,onCatch:(t,n)=>{if(Yi(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Yi(t))return e.fallback?.(t);throw t},children:e.children})}function Os(){return(0,I.jsx)(`p`,{children:`Not Found`})}function ks(e){return(0,I.jsx)(I.Fragment,{children:e.children})}function As(e,t,n){return t.options.notFoundComponent?(0,I.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,I.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,I.jsx)(Os,{})}var js=N.memo(function({matchId:e}){let t=Do(),n=t.stores.matchStores.get(e);n||di();let r=es(t.stores.loadedAt,e=>e),i=es(n,e=>e);return(0,I.jsx)(Ms,{router:t,matchId:e,resetKey:r,matchState:N.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 Ms({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,I.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))?N.Suspense:ks,f=s?bo:ks,p=l?Ds:ks;return(0,I.jsxs)(i.isRoot?i.options.shellComponent??ks:ks,{children:[(0,I.jsx)(Oo.Provider,{value:t,children:(0,I.jsx)(d,{fallback:o,children:(0,I.jsx)(f,{getResetKey:()=>n,errorComponent:s||So,onCatch:(e,t)=>{if(Yi(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,I.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return N.createElement(l,e)},children:u||r._displayPending?(0,I.jsx)(Co,{fallback:o,children:(0,I.jsx)(Ps,{matchId:t})}):(0,I.jsx)(Ps,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Ns,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function Ns({resetKey:e}){let t=Do(),n=N.useRef(void 0);return Rr(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Wa(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var Ps=N.memo(function({matchId:e}){let t=Do(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||di();let i=es(r,e=>e),a=i.routeId,o=t.routesById[a],s=N.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=N.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,I.jsx)(e,{},s):(0,I.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=ni();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return Yi(i.error)||di(),As(t,o,i.error);if(i.status===`redirected`)throw aa(i.error)||di(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),Fs=N.memo(function(){let e=Do(),t=N.useContext(Oo),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=es(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=es(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,I.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||di(),As(e,a,void 0);if(!i)return null;let s=(0,I.jsx)(js,{matchId:i});return n===`__root__`?(0,I.jsx)(N.Suspense,{fallback:o,children:s}):s});function Is(){let e=Do(),t=N.useRef({router:e,mounted:!1}),[n,r]=N.useState(!1),i=es(e.stores.isLoading,e=>e),a=es(e.stores.hasPending,e=>e),o=zr(i),s=i||n||a,c=zr(s),l=i||a,u=zr(l);return e.startTransition=e=>{r(!0),N.startTransition(()=>{e(),r(!1)})},N.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 Bi(e.latestLocation.publicHref)!==Bi(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),Rr(()=>{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]),Rr(()=>{o&&!i&&e.emit({type:`onLoad`,...Wa(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),Rr(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Wa(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),Rr(()=>{if(c&&!s){let t=Wa(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),Wo(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function Ls(){let e=Do(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,I.jsx)(t,{}):null,r=(0,I.jsxs)(typeof document<`u`&&e.ssr?ks:N.Suspense,{fallback:n,children:[(0,I.jsx)(Is,{}),(0,I.jsx)(Rs,{})]});return e.options.InnerWrap?(0,I.jsx)(e.options.InnerWrap,{children:r}):r}function Rs(){let e=Do(),t=es(e.stores.firstId,e=>e),n=es(e.stores.loadedAt,e=>e),r=t?(0,I.jsx)(js,{matchId:t}):null;return(0,I.jsx)(Oo.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,I.jsx)(bo,{getResetKey:()=>n,errorComponent:So,onCatch:void 0,children:r})})}function zs(){let e=Do();return es(e.stores.matchRouteDeps,e=>e),N.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 Bs=e=>({createMutableStore:qo,createReadonlyStore:qo,batch:Wo}),Vs=e=>new Hs(e),Hs=class extends Ka{constructor(e){super(e,Bs)}};function Us({router:e,children:t,...n}){qr(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,I.jsx)(Eo.Provider,{value:e,children:t});return e.options.Wrap?(0,I.jsx)(e.options.Wrap,{children:r}):r}function Ws({router:e,...t}){return(0,I.jsx)(Us,{router:e,...t,children:(0,I.jsx)(Ls,{})})}function Gs(e){let t=Do(),n=(0,N.useRef)(void 0);return es(t.stores.location,r=>{let i=e?.select?e.select(r):r;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=Xr(n.current,i);return n.current=e,e}return i})}var Ks;function L(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 qs=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Js=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Ks=globalThis).__zod_globalConfig??(Ks.__zod_globalConfig={});var Ys=globalThis.__zod_globalConfig;function Xs(e){return e&&Object.assign(Ys,e),Ys}function Zs(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 Qs(e,t){return typeof t==`bigint`?t.toString():t}function $s(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function ec(e){return e==null}function tc(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function nc(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 rc=Symbol(`evaluating`);function ic(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==rc)return r===void 0&&(r=rc,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ac(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function oc(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function sc(e){return JSON.stringify(e)}function cc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var lc=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function uc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var dc=$s(()=>{if(Ys.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function fc(e){if(uc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(uc(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function pc(e){return fc(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var mc=new Set([`string`,`number`,`symbol`]);function hc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function gc(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function R(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 _c(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var vc={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function yc(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 gc(e,oc(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 ac(this,`shape`,e),e},checks:[]}))}function bc(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 gc(e,oc(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 ac(this,`shape`,r),r},checks:[]}))}function xc(e,t){if(!fc(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 gc(e,oc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ac(this,`shape`,n),n}}))}function Sc(e,t){if(!fc(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return gc(e,oc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ac(this,`shape`,n),n}}))}function Cc(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return gc(e,oc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ac(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function wc(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 gc(t,oc(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 ac(this,`shape`,i),i},checks:[]}))}function Tc(e,t,n){return gc(t,oc(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 ac(this,`shape`,i),i}}))}function Ec(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 Dc(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 Oc(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function kc(e){return typeof e==`string`?e:e?.message}function Ac(e,t,n){let r=e.message?e.message:kc(e.inst?._zod.def?.error?.(e))??kc(t?.error?.(e))??kc(n.customError?.(e))??kc(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 jc(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Mc(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Nc=(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,Qs,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pc=L(`$ZodError`,Nc),Fc=L(`$ZodError`,Nc,{Parent:Error});function Ic(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 Lc(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 Rc=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 qs;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Ac(e,a,Xs())));throw lc(t,i?.callee),t}return o.value},zc=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=>Ac(e,a,Xs())));throw lc(t,i?.callee),t}return o.value},Bc=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 qs;return a.issues.length?{success:!1,error:new(e??Pc)(a.issues.map(e=>Ac(e,i,Xs())))}:{success:!0,data:a.value}},Vc=Bc(Fc),Hc=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=>Ac(e,i,Xs())))}:{success:!0,data:a.value}},Uc=Hc(Fc),Wc=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Rc(e)(t,n,i)},Gc=e=>(t,n,r)=>Rc(e)(t,n,r),Kc=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return zc(e)(t,n,i)},qc=e=>async(t,n,r)=>zc(e)(t,n,r),Jc=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Bc(e)(t,n,i)},Yc=e=>(t,n,r)=>Bc(e)(t,n,r),Xc=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Hc(e)(t,n,i)},Zc=e=>async(t,n,r)=>Hc(e)(t,n,r),Qc=/^[cC][0-9a-z]{6,}$/,$c=/^[0-9a-z]+$/,el=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tl=/^[0-9a-vA-V]{20}$/,nl=/^[A-Za-z0-9]{27}$/,rl=/^[a-zA-Z0-9_-]{21}$/,il=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,al=/^([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})$/,ol=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)$/,sl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cl=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function ll(){return new RegExp(cl,`u`)}var ul=/^(?:(?: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])$/,dl=/^(([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}|:))$/,fl=/^((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])$/,pl=/^(([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])$/,ml=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hl=/^[A-Za-z0-9_-]*$/,gl=/^https?$/,_l=/^\+[1-9]\d{6,14}$/,vl=`(?:(?:\\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])))`,yl=RegExp(`^${vl}$`);function bl(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 xl(e){return RegExp(`^${bl(e)}$`)}function Sl(e){let t=bl({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(`^${vl}T(?:${r})$`)}var Cl=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},wl=/^-?\d+$/,Tl=/^-?\d+(?:\.\d+)?$/,El=/^[^A-Z]*$/,Dl=/^[^a-z]*$/,Ol=L(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),kl={number:`number`,bigint:`bigint`,object:`date`},Al=L(`$ZodCheckLessThan`,(e,t)=>{Ol.init(e,t);let n=kl[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})}}),jl=L(`$ZodCheckGreaterThan`,(e,t)=>{Ol.init(e,t);let n=kl[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})}}),Ml=L(`$ZodCheckMultipleOf`,(e,t)=>{Ol.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):nc(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})}}),Nl=L(`$ZodCheckNumberFormat`,(e,t)=>{Ol.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=vc[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=wl)}),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})}}),Pl=L(`$ZodCheckMaxLength`,(e,t)=>{var n;Ol.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ec(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=jc(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Fl=L(`$ZodCheckMinLength`,(e,t)=>{var n;Ol.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ec(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=jc(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Il=L(`$ZodCheckLengthEquals`,(e,t)=>{var n;Ol.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ec(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=jc(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})}}),Ll=L(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Ol.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=()=>{})}),Rl=L(`$ZodCheckRegex`,(e,t)=>{Ll.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})}}),zl=L(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=El,Ll.init(e,t)}),Bl=L(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Dl,Ll.init(e,t)}),Vl=L(`$ZodCheckIncludes`,(e,t)=>{Ol.init(e,t);let n=hc(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})}}),Hl=L(`$ZodCheckStartsWith`,(e,t)=>{Ol.init(e,t);let n=RegExp(`^${hc(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})}}),Ul=L(`$ZodCheckEndsWith`,(e,t)=>{Ol.init(e,t);let n=RegExp(`.*${hc(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})}}),Wl=L(`$ZodCheckOverwrite`,(e,t)=>{Ol.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Gl=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
|
+
`))}},Kl={major:4,minor:4,patch:3},ql=L(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Kl;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=Ec(e),i;for(let a of t){if(a._zod.def.when){if(Dc(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 qs;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Ec(e,t))});else{if(e.issues.length===t)continue;r||=Ec(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Ec(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new qs;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 qs;return o.then(e=>t(e,r,a))}return t(o,r,a)}}ic(e,`~standard`,()=>({validate:t=>{try{let n=Vc(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Uc(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Jl=L(`$ZodString`,(e,t)=>{ql.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Cl(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}}),z=L(`$ZodStringFormat`,(e,t)=>{Ll.init(e,t),Jl.init(e,t)}),Yl=L(`$ZodGUID`,(e,t)=>{t.pattern??=al,z.init(e,t)}),Xl=L(`$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??=ol(e)}else t.pattern??=ol();z.init(e,t)}),Zl=L(`$ZodEmail`,(e,t)=>{t.pattern??=sl,z.init(e,t)}),Ql=L(`$ZodURL`,(e,t)=>{z.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===gl.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})}}}),$l=L(`$ZodEmoji`,(e,t)=>{t.pattern??=ll(),z.init(e,t)}),eu=L(`$ZodNanoID`,(e,t)=>{t.pattern??=rl,z.init(e,t)}),tu=L(`$ZodCUID`,(e,t)=>{t.pattern??=Qc,z.init(e,t)}),nu=L(`$ZodCUID2`,(e,t)=>{t.pattern??=$c,z.init(e,t)}),ru=L(`$ZodULID`,(e,t)=>{t.pattern??=el,z.init(e,t)}),iu=L(`$ZodXID`,(e,t)=>{t.pattern??=tl,z.init(e,t)}),au=L(`$ZodKSUID`,(e,t)=>{t.pattern??=nl,z.init(e,t)}),ou=L(`$ZodISODateTime`,(e,t)=>{t.pattern??=Sl(t),z.init(e,t)}),su=L(`$ZodISODate`,(e,t)=>{t.pattern??=yl,z.init(e,t)}),cu=L(`$ZodISOTime`,(e,t)=>{t.pattern??=xl(t),z.init(e,t)}),lu=L(`$ZodISODuration`,(e,t)=>{t.pattern??=il,z.init(e,t)}),uu=L(`$ZodIPv4`,(e,t)=>{t.pattern??=ul,z.init(e,t),e._zod.bag.format=`ipv4`}),du=L(`$ZodIPv6`,(e,t)=>{t.pattern??=dl,z.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})}}}),fu=L(`$ZodCIDRv4`,(e,t)=>{t.pattern??=fl,z.init(e,t)}),pu=L(`$ZodCIDRv6`,(e,t)=>{t.pattern??=pl,z.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 mu(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var hu=L(`$ZodBase64`,(e,t)=>{t.pattern??=ml,z.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{mu(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function gu(e){if(!hl.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return mu(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var _u=L(`$ZodBase64URL`,(e,t)=>{t.pattern??=hl,z.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{gu(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),vu=L(`$ZodE164`,(e,t)=>{t.pattern??=_l,z.init(e,t)});function yu(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 bu=L(`$ZodJWT`,(e,t)=>{z.init(e,t),e._zod.check=n=>{yu(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),xu=L(`$ZodNumber`,(e,t)=>{ql.init(e,t),e._zod.pattern=e._zod.bag.pattern??Tl,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}}),Su=L(`$ZodNumberFormat`,(e,t)=>{Nl.init(e,t),xu.init(e,t)}),Cu=L(`$ZodUnknown`,(e,t)=>{ql.init(e,t),e._zod.parse=e=>e}),wu=L(`$ZodNever`,(e,t)=>{ql.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Tu(e,t,n){e.issues.length&&t.issues.push(...Oc(n,e.issues)),t.value[n]=e.value}var Eu=L(`$ZodArray`,(e,t)=>{ql.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=>Tu(t,n,e))):Tu(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Du(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Oc(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=_c(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ku(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=>Du(e,n,i,t,u,d))):Du(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 Au=L(`$ZodObject`,(e,t)=>{if(ql.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=$s(()=>Ou(t));ic(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=uc,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=>Du(n,t,e,s,r,i))):Du(a,t,e,s,r,i)}return i?ku(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ju=L(`$ZodObjectJIT`,(e,t)=>{Au.init(e,t);let n=e._zod.parse,r=$s(()=>Ou(t)),i=e=>{let t=new Gl([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=sc(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=sc(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=uc,s=!Ys.jitless,c=s&&dc.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?ku([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Mu(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=>!Ec(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=>Ac(e,r,Xs())))}),t)}var Nu=L(`$ZodUnion`,(e,t)=>{ql.init(e,t),ic(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),ic(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),ic(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),ic(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=>tc(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=>Mu(t,r,e,i)):Mu(o,r,e,i)}}),Pu=L(`$ZodIntersection`,(e,t)=>{ql.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])=>Iu(e,t,n)):Iu(e,i,a)}});function Fu(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(fc(e)&&fc(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=Fu(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=Fu(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 Iu(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}),Ec(e))return e;let o=Fu(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Lu=L(`$ZodEnum`,(e,t)=>{ql.init(e,t);let n=Zs(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>mc.has(typeof e)).map(e=>typeof e==`string`?hc(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}}),Ru=L(`$ZodLiteral`,(e,t)=>{if(ql.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`?hc(e):e?hc(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}}),zu=L(`$ZodTransform`,(e,t)=>{ql.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Js(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 qs;return n.value=i,n.fallback=!0,n}});function Bu(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Vu=L(`$ZodOptional`,(e,t)=>{ql.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,ic(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ic(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${tc(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=>Bu(e,r)):Bu(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Hu=L(`$ZodExactOptional`,(e,t)=>{Vu.init(e,t),ic(e._zod,`values`,()=>t.innerType._zod.values),ic(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Uu=L(`$ZodNullable`,(e,t)=>{ql.init(e,t),ic(e._zod,`optin`,()=>t.innerType._zod.optin),ic(e._zod,`optout`,()=>t.innerType._zod.optout),ic(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${tc(e.source)}|null)$`):void 0}),ic(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)}),Wu=L(`$ZodDefault`,(e,t)=>{ql.init(e,t),e._zod.optin=`optional`,ic(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=>Gu(e,t)):Gu(r,t)}});function Gu(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ku=L(`$ZodPrefault`,(e,t)=>{ql.init(e,t),e._zod.optin=`optional`,ic(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))}),qu=L(`$ZodNonOptional`,(e,t)=>{ql.init(e,t),ic(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=>Ju(t,e)):Ju(i,e)}});function Ju(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 Yu=L(`$ZodCatch`,(e,t)=>{ql.init(e,t),e._zod.optin=`optional`,ic(e._zod,`optout`,()=>t.innerType._zod.optout),ic(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=>Ac(e,n,Xs()))},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=>Ac(e,n,Xs()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Xu=L(`$ZodPipe`,(e,t)=>{ql.init(e,t),ic(e._zod,`values`,()=>t.in._zod.values),ic(e._zod,`optin`,()=>t.in._zod.optin),ic(e._zod,`optout`,()=>t.out._zod.optout),ic(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=>Zu(e,t.in,n)):Zu(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Zu(e,t.out,n)):Zu(r,t.out,n)}});function Zu(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 Qu=L(`$ZodReadonly`,(e,t)=>{ql.init(e,t),ic(e._zod,`propValues`,()=>t.innerType._zod.propValues),ic(e._zod,`values`,()=>t.innerType._zod.values),ic(e._zod,`optin`,()=>t.innerType?._zod?.optin),ic(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($u):$u(r)}});function $u(e){return e.value=Object.freeze(e.value),e}var ed=L(`$ZodCustom`,(e,t)=>{Ol.init(e,t),ql.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=>td(t,n,r,e));td(i,n,r,e)}});function td(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(Mc(e))}}var nd,rd=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 id(){return new rd}(nd=globalThis).__zod_globalRegistry??(nd.__zod_globalRegistry=id());var ad=globalThis.__zod_globalRegistry;function od(e,t){return new e({type:`string`,...R(t)})}function sd(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...R(t)})}function cd(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...R(t)})}function ld(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...R(t)})}function ud(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...R(t)})}function dd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...R(t)})}function fd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...R(t)})}function pd(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...R(t)})}function md(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...R(t)})}function hd(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...R(t)})}function gd(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...R(t)})}function _d(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...R(t)})}function vd(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...R(t)})}function yd(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...R(t)})}function bd(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...R(t)})}function xd(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...R(t)})}function Sd(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...R(t)})}function Cd(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...R(t)})}function wd(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...R(t)})}function Td(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...R(t)})}function Ed(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...R(t)})}function Dd(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...R(t)})}function Od(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...R(t)})}function kd(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...R(t)})}function Ad(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...R(t)})}function jd(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...R(t)})}function Md(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...R(t)})}function Nd(e,t){return new e({type:`number`,coerce:!0,checks:[],...R(t)})}function Pd(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...R(t)})}function Fd(e){return new e({type:`unknown`})}function Id(e,t){return new e({type:`never`,...R(t)})}function Ld(e,t){return new Al({check:`less_than`,...R(t),value:e,inclusive:!1})}function Rd(e,t){return new Al({check:`less_than`,...R(t),value:e,inclusive:!0})}function zd(e,t){return new jl({check:`greater_than`,...R(t),value:e,inclusive:!1})}function Bd(e,t){return new jl({check:`greater_than`,...R(t),value:e,inclusive:!0})}function Vd(e,t){return new Ml({check:`multiple_of`,...R(t),value:e})}function Hd(e,t){return new Pl({check:`max_length`,...R(t),maximum:e})}function Ud(e,t){return new Fl({check:`min_length`,...R(t),minimum:e})}function Wd(e,t){return new Il({check:`length_equals`,...R(t),length:e})}function Gd(e,t){return new Rl({check:`string_format`,format:`regex`,...R(t),pattern:e})}function Kd(e){return new zl({check:`string_format`,format:`lowercase`,...R(e)})}function qd(e){return new Bl({check:`string_format`,format:`uppercase`,...R(e)})}function Jd(e,t){return new Vl({check:`string_format`,format:`includes`,...R(t),includes:e})}function Yd(e,t){return new Hl({check:`string_format`,format:`starts_with`,...R(t),prefix:e})}function Xd(e,t){return new Ul({check:`string_format`,format:`ends_with`,...R(t),suffix:e})}function Zd(e){return new Wl({check:`overwrite`,tx:e})}function Qd(e){return Zd(t=>t.normalize(e))}function $d(){return Zd(e=>e.trim())}function ef(){return Zd(e=>e.toLowerCase())}function tf(){return Zd(e=>e.toUpperCase())}function nf(){return Zd(e=>cc(e))}function rf(e,t,n){return new e({type:`array`,element:t,...R(n)})}function af(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...R(n)})}function of(e,t){let n=sf(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Mc(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(Mc(r))}},e(t.value,t)),t);return n}function sf(e,t){let n=new Ol({check:`custom`,...R(t)});return n._zod.check=e,n}function cf(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??ad,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 lf(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,lf(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`&&ff(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 uf(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 df(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:mf(t,`input`,e.processors),output:mf(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ff(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 ff(r.element,n);if(r.type===`set`)return ff(r.valueType,n);if(r.type===`lazy`)return ff(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 ff(r.innerType,n);if(r.type===`intersection`)return ff(r.left,n)||ff(r.right,n);if(r.type===`record`||r.type===`map`)return ff(r.keyType,n)||ff(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:ff(r.in,n)||ff(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ff(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ff(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ff(e,n))return!0;return!!(r.rest&&ff(r.rest,n))}return!1}var pf=(e,t={})=>n=>{let r=cf({...n,processors:t});return lf(e,r),uf(r,e),df(r,e)},mf=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=cf({...i??{},target:a,io:t,processors:n});return lf(e,o),uf(o,e),df(o,e)},hf={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},gf=(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=hf[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}))])}},_f=(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)},vf=(e,t,n,r)=>{n.not={}},yf=(e,t,n,r)=>{let i=e._zod.def,a=Zs(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},bf=(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},xf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Sf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Cf=(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=lf(a.element,t,{...r,path:[...r.path,`items`]})},wf=(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]=lf(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=lf(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Tf=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>lf(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ef=(e,t,n,r)=>{let i=e._zod.def,a=lf(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=lf(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]]},Df=(e,t,n,r)=>{let i=e._zod.def,a=lf(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;lf(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},kf=(e,t,n,r)=>{let i=e._zod.def;lf(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Af=(e,t,n,r)=>{let i=e._zod.def;lf(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)))},jf=(e,t,n,r)=>{let i=e._zod.def;lf(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},Mf=(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;lf(o,t,r);let s=t.seen.get(e);s.ref=o},Nf=(e,t,n,r)=>{let i=e._zod.def;lf(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Pf=(e,t,n,r)=>{let i=e._zod.def;lf(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ff=L(`ZodISODateTime`,(e,t)=>{ou.init(e,t),cp.init(e,t)});function If(e){return kd(Ff,e)}var Lf=L(`ZodISODate`,(e,t)=>{su.init(e,t),cp.init(e,t)});function Rf(e){return Ad(Lf,e)}var zf=L(`ZodISOTime`,(e,t)=>{cu.init(e,t),cp.init(e,t)});function Bf(e){return jd(zf,e)}var Vf=L(`ZodISODuration`,(e,t)=>{lu.init(e,t),cp.init(e,t)});function Hf(e){return Md(Vf,e)}var Uf=L(`ZodError`,(e,t)=>{Pc.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Lc(e,t)},flatten:{value:t=>Ic(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Qs,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Qs,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Wf=Rc(Uf),Gf=zc(Uf),Kf=Bc(Uf),qf=Hc(Uf),Jf=Wc(Uf),Yf=Gc(Uf),Xf=Kc(Uf),Zf=qc(Uf),Qf=Jc(Uf),$f=Yc(Uf),ep=Xc(Uf),tp=Zc(Uf),np=new WeakMap;function rp(e,t,n){let r=Object.getPrototypeOf(e),i=np.get(r);if(i||(i=new Set,np.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 ip=L(`ZodType`,(e,t)=>(ql.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:mf(e,`input`),output:mf(e,`output`)}}),e.toJSONSchema=pf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Wf(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Kf(e,t,n),e.parseAsync=async(t,n)=>Gf(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>qf(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Jf(e,t,n),e.decode=(t,n)=>Yf(e,t,n),e.encodeAsync=async(t,n)=>Xf(e,t,n),e.decodeAsync=async(t,n)=>Zf(e,t,n),e.safeEncode=(t,n)=>Qf(e,t,n),e.safeDecode=(t,n)=>$f(e,t,n),e.safeEncodeAsync=async(t,n)=>ep(e,t,n),e.safeDecodeAsync=async(t,n)=>tp(e,t,n),rp(e,`ZodType`,{check(...e){let t=this.def;return this.clone(oc(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 gc(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(uee(e,t))},superRefine(e,t){return this.check(dee(e,t))},overwrite(e){return this.check(Zd(e))},optional(){return Xp(this)},exactOptional(){return Qp(this)},nullable(){return em(this)},nullish(){return Xp(em(this))},nonoptional(e){return nm(this,e)},array(){return Ip(this)},or(e){return Bp([this,e])},and(e){return Hp(this,e)},transform(e){return rm(this,Jp(e))},default(e){return tee(this,e)},prefault(e){return ree(this,e)},catch(e){return aee(this,e)},pipe(e){return rm(this,e)},readonly(){return cee(this)},describe(e){let t=this.clone();return ad.add(t,{description:e}),t},meta(...e){if(e.length===0)return ad.get(this);let t=this.clone();return ad.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 ad.get(e)?.description},configurable:!0}),e)),ap=L(`_ZodString`,(e,t)=>{Jl.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gf(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,rp(e,`_ZodString`,{regex(...e){return this.check(Gd(...e))},includes(...e){return this.check(Jd(...e))},startsWith(...e){return this.check(Yd(...e))},endsWith(...e){return this.check(Xd(...e))},min(...e){return this.check(Ud(...e))},max(...e){return this.check(Hd(...e))},length(...e){return this.check(Wd(...e))},nonempty(...e){return this.check(Ud(1,...e))},lowercase(e){return this.check(Kd(e))},uppercase(e){return this.check(qd(e))},trim(){return this.check($d())},normalize(...e){return this.check(Qd(...e))},toLowerCase(){return this.check(ef())},toUpperCase(){return this.check(tf())},slugify(){return this.check(nf())}})}),op=L(`ZodString`,(e,t)=>{Jl.init(e,t),ap.init(e,t),e.email=t=>e.check(sd(lp,t)),e.url=t=>e.check(pd(fp,t)),e.jwt=t=>e.check(Od(Dp,t)),e.emoji=t=>e.check(md(pp,t)),e.guid=t=>e.check(cd(up,t)),e.uuid=t=>e.check(ld(dp,t)),e.uuidv4=t=>e.check(ud(dp,t)),e.uuidv6=t=>e.check(dd(dp,t)),e.uuidv7=t=>e.check(fd(dp,t)),e.nanoid=t=>e.check(hd(mp,t)),e.guid=t=>e.check(cd(up,t)),e.cuid=t=>e.check(gd(hp,t)),e.cuid2=t=>e.check(_d(gp,t)),e.ulid=t=>e.check(vd(_p,t)),e.base64=t=>e.check(Td(wp,t)),e.base64url=t=>e.check(Ed(Tp,t)),e.xid=t=>e.check(yd(vp,t)),e.ksuid=t=>e.check(bd(yp,t)),e.ipv4=t=>e.check(xd(bp,t)),e.ipv6=t=>e.check(Sd(xp,t)),e.cidrv4=t=>e.check(Cd(Sp,t)),e.cidrv6=t=>e.check(wd(Cp,t)),e.e164=t=>e.check(Dd(Ep,t)),e.datetime=t=>e.check(If(t)),e.date=t=>e.check(Rf(t)),e.time=t=>e.check(Bf(t)),e.duration=t=>e.check(Hf(t))});function sp(e){return od(op,e)}var cp=L(`ZodStringFormat`,(e,t)=>{z.init(e,t),ap.init(e,t)}),lp=L(`ZodEmail`,(e,t)=>{Zl.init(e,t),cp.init(e,t)}),up=L(`ZodGUID`,(e,t)=>{Yl.init(e,t),cp.init(e,t)}),dp=L(`ZodUUID`,(e,t)=>{Xl.init(e,t),cp.init(e,t)}),fp=L(`ZodURL`,(e,t)=>{Ql.init(e,t),cp.init(e,t)}),pp=L(`ZodEmoji`,(e,t)=>{$l.init(e,t),cp.init(e,t)}),mp=L(`ZodNanoID`,(e,t)=>{eu.init(e,t),cp.init(e,t)}),hp=L(`ZodCUID`,(e,t)=>{tu.init(e,t),cp.init(e,t)}),gp=L(`ZodCUID2`,(e,t)=>{nu.init(e,t),cp.init(e,t)}),_p=L(`ZodULID`,(e,t)=>{ru.init(e,t),cp.init(e,t)}),vp=L(`ZodXID`,(e,t)=>{iu.init(e,t),cp.init(e,t)}),yp=L(`ZodKSUID`,(e,t)=>{au.init(e,t),cp.init(e,t)}),bp=L(`ZodIPv4`,(e,t)=>{uu.init(e,t),cp.init(e,t)}),xp=L(`ZodIPv6`,(e,t)=>{du.init(e,t),cp.init(e,t)}),Sp=L(`ZodCIDRv4`,(e,t)=>{fu.init(e,t),cp.init(e,t)}),Cp=L(`ZodCIDRv6`,(e,t)=>{pu.init(e,t),cp.init(e,t)}),wp=L(`ZodBase64`,(e,t)=>{hu.init(e,t),cp.init(e,t)}),Tp=L(`ZodBase64URL`,(e,t)=>{_u.init(e,t),cp.init(e,t)}),Ep=L(`ZodE164`,(e,t)=>{vu.init(e,t),cp.init(e,t)}),Dp=L(`ZodJWT`,(e,t)=>{bu.init(e,t),cp.init(e,t)}),Op=L(`ZodNumber`,(e,t)=>{xu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_f(e,t,n,r),rp(e,`ZodNumber`,{gt(e,t){return this.check(zd(e,t))},gte(e,t){return this.check(Bd(e,t))},min(e,t){return this.check(Bd(e,t))},lt(e,t){return this.check(Ld(e,t))},lte(e,t){return this.check(Rd(e,t))},max(e,t){return this.check(Rd(e,t))},int(e){return this.check(Ap(e))},safe(e){return this.check(Ap(e))},positive(e){return this.check(zd(0,e))},nonnegative(e){return this.check(Bd(0,e))},negative(e){return this.check(Ld(0,e))},nonpositive(e){return this.check(Rd(0,e))},multipleOf(e,t){return this.check(Vd(e,t))},step(e,t){return this.check(Vd(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}),kp=L(`ZodNumberFormat`,(e,t)=>{Su.init(e,t),Op.init(e,t)});function Ap(e){return Pd(kp,e)}var jp=L(`ZodUnknown`,(e,t)=>{Cu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Mp(){return Fd(jp)}var Np=L(`ZodNever`,(e,t)=>{wu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vf(e,t,n,r)});function Pp(e){return Id(Np,e)}var Fp=L(`ZodArray`,(e,t)=>{Eu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cf(e,t,n,r),e.element=t.element,rp(e,`ZodArray`,{min(e,t){return this.check(Ud(e,t))},nonempty(e){return this.check(Ud(1,e))},max(e,t){return this.check(Hd(e,t))},length(e,t){return this.check(Wd(e,t))},unwrap(){return this.element}})});function Ip(e,t){return rf(Fp,e,t)}var Lp=L(`ZodObject`,(e,t)=>{ju.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wf(e,t,n,r),ic(e,`shape`,()=>t.shape),rp(e,`ZodObject`,{keyof(){return Wp(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Mp()})},loose(){return this.clone({...this._zod.def,catchall:Mp()})},strict(){return this.clone({...this._zod.def,catchall:Pp()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return xc(this,e)},safeExtend(e){return Sc(this,e)},merge(e){return Cc(this,e)},pick(e){return yc(this,e)},omit(e){return bc(this,e)},partial(...e){return wc(Yp,this,e[0])},required(...e){return Tc(tm,this,e[0])}})});function Rp(e,t){return new Lp({type:`object`,shape:e??{},...R(t)})}var zp=L(`ZodUnion`,(e,t)=>{Nu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tf(e,t,n,r),e.options=t.options});function Bp(e,t){return new zp({type:`union`,options:e,...R(t)})}var Vp=L(`ZodIntersection`,(e,t)=>{Pu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ef(e,t,n,r)});function Hp(e,t){return new Vp({type:`intersection`,left:e,right:t})}var Up=L(`ZodEnum`,(e,t)=>{Lu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yf(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 Up({...t,checks:[],...R(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 Up({...t,checks:[],...R(r),entries:i})}});function Wp(e,t){return new Up({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...R(t)})}var Gp=L(`ZodLiteral`,(e,t)=>{Ru.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bf(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 Kp(e,t){return new Gp({type:`literal`,values:Array.isArray(e)?e:[e],...R(t)})}var qp=L(`ZodTransform`,(e,t)=>{zu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sf(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Js(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Mc(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(Mc(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 Jp(e){return new qp({type:`transform`,transform:e})}var Yp=L(`ZodOptional`,(e,t)=>{Vu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xp(e){return new Yp({type:`optional`,innerType:e})}var Zp=L(`ZodExactOptional`,(e,t)=>{Hu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qp(e){return new Zp({type:`optional`,innerType:e})}var $p=L(`ZodNullable`,(e,t)=>{Uu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Df(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function em(e){return new $p({type:`nullable`,innerType:e})}var eee=L(`ZodDefault`,(e,t)=>{Wu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tee(e,t){return new eee({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():pc(t)}})}var nee=L(`ZodPrefault`,(e,t)=>{Ku.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Af(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ree(e,t){return new nee({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():pc(t)}})}var tm=L(`ZodNonOptional`,(e,t)=>{qu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Of(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function nm(e,t){return new tm({type:`nonoptional`,innerType:e,...R(t)})}var iee=L(`ZodCatch`,(e,t)=>{Yu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function aee(e,t){return new iee({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var oee=L(`ZodPipe`,(e,t)=>{Xu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mf(e,t,n,r),e.in=t.in,e.out=t.out});function rm(e,t){return new oee({type:`pipe`,in:e,out:t})}var see=L(`ZodReadonly`,(e,t)=>{Qu.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cee(e){return new see({type:`readonly`,innerType:e})}var lee=L(`ZodCustom`,(e,t)=>{ed.init(e,t),ip.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xf(e,t,n,r)});function uee(e,t={}){return af(lee,e,t)}function dee(e,t){return of(e,t)}function fee(e){return Nd(Op,e)}var im=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),pee=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),mee=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),am=e=>{let t=mee(e);return t.charAt(0).toUpperCase()+t.slice(1)},om={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`},hee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},gee=(0,N.createContext)({}),_ee=()=>(0,N.useContext)(gee),vee=(0,N.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=``}=_ee()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,N.createElement)(`svg`,{ref:c,...om,width:t??l??om.width,height:t??l??om.height,stroke:e??f,strokeWidth:m,className:im(`lucide`,p,i),...!a&&!hee(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,N.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),B=(e,t)=>{let n=(0,N.forwardRef)(({className:n,...r},i)=>(0,N.createElement)(vee,{ref:i,iconNode:t,className:im(`lucide-${pee(am(e))}`,`lucide-${e}`,n),...r}));return n.displayName=am(e),n},sm=B(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),cm=B(`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`}]]),lm=B(`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`}]]),yee=B(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),um=B(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),dm=B(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),bee=B(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),fm=B(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),pm=B(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),mm=B(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),hm=B(`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`}]]),gm=B(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),xee=B(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),See=B(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Cee=B(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),wee=B(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Tee=B(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Eee=B(`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`}]]),_m=B(`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`}]]),vm=B(`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`}]]),ym=B(`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`}]]),Dee=B(`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`}]]),bm=B(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Oee=B(`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`}]]),xm=B(`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`}]]),Sm=B(`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`}]]),kee=B(`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`}]]),Aee=B(`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`}]]),Cm=B(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),wm=B(`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`}]]),Tm=B(`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`}]]),Em=B(`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`}]]),Dm=B(`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`}]]),Om=B(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),km=B(`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`}]]),Am=B(`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`}]]),jm=B(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Mm=B(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),jee=B(`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`}]]),Mee=B(`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`}]]),Nee=B(`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`}]]),Pee=B(`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`}]]),Fee=B(`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`}]]),Iee=B(`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`}]]),Nm=B(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Lee=B(`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`}]]),Pm=B(`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`}]]),Fm=B(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Im=B(`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`}]]),Lm=B(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Rm=B(`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`}]]),Ree=B(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),zee=B(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),zm=B(`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`}]]),Bee=B(`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`}]]),Bm=B(`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`}]]),Vm=B(`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`}]]),Hm=B(`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`}]]),Um=B(`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`}]]),Vee=B(`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`}]]),Wm=B(`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`}]]),Gm=B(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Km(e,t){return new Proxy({},{get(n,r){if(typeof r==`string`)return Km(e,[...t,r]);if(r===xt){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 Hee=()=>Km(`components`,[]),V=Ot;Hee();var qm=typeof process<`u`&&!1,Jm=null;function Uee(e,t){e.currentIndex=0;let n=Jm;Jm=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{Jm=n}}function Ym(){if(!Jm)throw Error(`No resource fiber available`);return Jm}function Xm(){return Jm}function Wee(e){return qm?Jm?.devStrictMode?Jm.isFirstRender?`child`:`root`:e?`root`:null:null}var Zm=e=>({version:0,committedVersion:0,dispatchUpdate:e,changelog:[],dirtyCells:[]}),Qm=e=>{for(let t of e.dirtyCells)t.dirty=!1,t.queue.clear(),t.current=t.workInProgress;e.committedVersion=e.version,e.changelog.length=0,e.dirtyCells.length=0},$m=(e,t)=>{let n=e.version>t;if(e.version=t,n){for(let t of e.dirtyCells)t.dirty=!1,t.queue.clear(),t.workInProgress=t.current;if(e.dirtyCells.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();e.changelog.forEach(e=>e()),Qm(e)}}},eh=(e,t)=>{t.dirty||(t.dirty=!0,e.markDirty?.(),e.root.dirtyCells.push(t))},th=(e,t)=>{let n=Ym(),r=n.currentIndex++;if(!n.isFirstRender&&r>=n.cells.length)throw Error(`Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.`);let i=n.cells[r];if(i||(i=t(),n.cells[r]=i),i.type!==e)throw Error(`Hook order changed between renders`);return i},Gee=e=>{Ym().renderContext.effectTasks.push(e)},Kee=(e,t)=>{if(e.renderContext)throw Error(`Resource updated during render`);if(e.isNeverMounted)throw Error(`Resource updated before mount`);e.root.dispatchUpdate(()=>{let n=t();return n?(n(),e.root.changelog.push(n),!0):!1})};function nh(e,t,n,r){let i=th(`reducer`,()=>{let t=Ym(),a=r?r(n):n;return qm&&t.devStrictMode&&r&&r(n),{type:`reducer`,queue:new Set,dirty:!1,workInProgress:a,current:a,reducer:e,dispatch:n=>{let r={action:n,hasEagerState:!1,eagerState:void 0};Kee(t,()=>t.root.dirtyCells.length===0&&!r.hasEagerState&&(r.eagerState=e(i.workInProgress,n),r.hasEagerState=!0,Object.is(i.current,r.eagerState))?null:()=>{eh(t,i),i.queue.add(r)})}}}),a=Ym(),o=e===i.reducer;i.reducer=e;for(let t of i.queue)(!t.hasEagerState||!o)&&(t.eagerState=e(i.workInProgress,t.action),t.hasEagerState=!0),qm&&a.devStrictMode&&e(i.workInProgress,t.action),i.workInProgress=t.eagerState;if(i.queue.clear(),t){let e=t(i.workInProgress);Object.is(e,i.workInProgress)||(eh(a,i),i.workInProgress=e)}return[i.workInProgress,i.dispatch]}function rh(e,t,n){return nh(e,void 0,t,n)}function ih(e,t,n,r){return nh(e,t,n,r)}var qee=(e,t)=>typeof t==`function`?t(e):t,Jee=e=>typeof e==`function`?e():e;function ah(e){return rh(qee,e,Jee)}function oh(e){let[t]=ah(()=>({current:e}));return t}var sh=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0},Yee=()=>{throw Error(`Memo reducer should not be called`)},ch=(e,t)=>{let n=Ym(),[r]=ih(Yee,r=>{if(r&&sh(r.deps,t))return r;let i=e();return qm&&n.devStrictMode&&e(),{value:i,deps:t}},null);return r.value},lh=(e,t)=>ch(()=>e,t),uh=()=>({type:`effect`,cleanup:void 0,deps:null});function dh(e,t){let n=th(`effect`,uh);if(!(t&&n.deps&&sh(n.deps,t))){if(n.deps!==null&&!!t!=!!n.deps)throw Error(`useEffect called with and without dependencies across re-renders`);Gee(()=>{let r=[];try{n.cleanup?.()}catch(e){r.push(e)}finally{n.cleanup=void 0}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}`);n.cleanup=t}catch(e){r.push(e)}if(n.deps=t,r.length>0){if(r.length===1)throw r[0];for(let e of r)console.error(e);throw AggregateError(r,`Errors during commit`)}})}}function fh(e){let t=oh(e);dh(()=>{t.current=e});let n=Ym();return lh(((...e)=>{if(qm&&n.renderContext)throw Error(`useEffectEvent cannot be called during render`);return t.current(...e)}),[n])}var ph=Symbol(`tap.Context`),mh=e=>e,hh=e=>({[ph]:e}),gh=e=>typeof e==`object`&&!!e&&ph in e,_h=(e,t,n)=>{let r=mh(e),i=r[ph];r[ph]=t;try{return n()}finally{r[ph]=i}},vh=e=>mh(e)[ph],H=s({default:()=>N.default,use:()=>Th,useCallback:()=>W,useContext:()=>Eh,useEffect:()=>Sh,useEffectEvent:()=>wh,useLayoutEffect:()=>Ch,useMemo:()=>U,useReducer:()=>Xee,useRef:()=>xh,useState:()=>bh});l(H,u(f(),1));var yh=()=>Xm()!==null,bh=e=>yh()?ah(e):N.useState(e),Xee=(e,t,n)=>yh()?rh(e,t,n):N.useReducer(e,t,n),xh=e=>yh()?oh(e):N.useRef(e),U=(e,t)=>yh()?ch(e,t):N.useMemo(e,t),W=(e,t)=>yh()?lh(e,t):N.useCallback(e,t),Sh=(e,t)=>yh()?dh(e,t):N.useEffect(e,t),Ch=(e,t)=>yh()?dh(e,t):N.useLayoutEffect(e,t),wh=e=>yh()?fh(e):N.useEffectEvent(e),Th=e=>gh(e)?vh(e):N.use(e),Eh=e=>gh(e)?vh(e):N.useContext(e);function Zee(e,t){let n=e[Dh];if(!n)throw Error(`ResourceElement.type is not a valid Resource`);return n(t)}var Dh=Symbol(`fnSymbol`);function Oh(e){let t=e=>({type:t,props:e});return t[Dh]=e,t}function kh(e,t){return{...t,key:e}}var Qee=50,Ah={schedulers:new Set([]),isScheduled:!1},$ee=class{_task;_isDirty=!1;constructor(e){this._task=e}get isDirty(){return this._isDirty}markDirty(){this._isDirty=!0,Ah.schedulers.add(this),ete()}runTask(){this._isDirty=!1,this._task()}},ete=()=>{Ah.isScheduled||(Ah.isScheduled=!0,tte())},jh=()=>{try{let e=[],t=0;for(let n of Ah.schedulers)if(Ah.schedulers.delete(n),n.isDirty){if(t++,t>Qee)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{Ah.schedulers.clear(),Ah.isScheduled=!1}},tte=(()=>{if(typeof MessageChannel<`u`){let e=new MessageChannel;return e.port1.onmessage=jh,()=>e.port2.postMessage(null)}return()=>setTimeout(jh,0)})(),Mh=e=>{let t=Ah;Ah={schedulers:new Set([]),isScheduled:!0};try{let t=e();return jh(),t}finally{Ah=t}};function Nh(e){let t=[];for(let n of e.effectTasks)try{n()}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 Ph(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 Fh=e=>{if(!gh(e))throw Error("A tap resource's `use()` only accepts a resource context.");return vh(e)},nte=Symbol.for(`react.memo_cache_sentinel`),rte={useState:ah,useReducer:rh,useRef:oh,useMemo:ch,useCallback:lh,useEffect:dh,useLayoutEffect:dh,useInsertionEffect:dh,useEffectEvent:fh,useContext:Fh,use:Fh,useMemoCache:e=>{let t=!1,[n]=ih(()=>[],e=>t?e:(t=!0,[...e]),e,e=>Array.from({length:e}).fill(nte));return n}},Ih=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE??N.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Lh=Ih==null?null:`H`in Ih?{get current(){return Ih.H},set current(e){Ih.H=e}}:`ReactCurrentDispatcher`in Ih?{get current(){return Ih.ReactCurrentDispatcher.current},set current(e){Ih.ReactCurrentDispatcher.current=e}}:null;function ite(e){if(!Lh)return e();let t=Lh.current;Lh.current=rte;try{return e()}finally{Lh.current=t}}function Rh(e,t,n=void 0,r=Wee(!1)){return{type:e,root:t,markDirty:n,devStrictMode:r,cells:[],currentIndex:0,renderContext:void 0,isFirstRender:!0,isMounted:!1,isNeverMounted:!0}}function zh(e){if(!e.isMounted)throw Error(`Tried to unmount a fiber that is already unmounted`);e.isMounted=!1,Ph(e)}function Bh(e,t){let n={effectTasks:[],props:t,output:void 0};return Uee(e,()=>{e.renderContext=n;try{n.output=ite(()=>Zee(e.type,t))}finally{e.renderContext=void 0}}),n}function Vh(e,t){e.isMounted=!0,qm&&e.isNeverMounted&&e.devStrictMode===`root`&&(e.isNeverMounted=!1,Nh(t),Ph(e)),e.isNeverMounted=!1,Nh(t)}var ate=e=>{let t=ch(()=>new $ee(()=>l(null)),[]),n=ch(()=>[],[]),r=ch(()=>(e.key,Rh(e.type,Zm(e=>{!t.isDirty&&!e()||(n.push(e),t.markDirty())}))),[e.type,e.key,n,t]);$m(r.root,r.root.committedVersion);let i=Bh(r,e.props),a=oh(!1),o=oh(e.props),s=oh(i.output),c=ch(()=>new Set,[]),l=fh(e=>{if(e===null&&($m(r.root,2),$m(r.root,1),n.forEach(e=>{qm&&r.devStrictMode&&e(),e()}),qm&&r.devStrictMode&&Bh(r,o.current),e=Bh(r,o.current)),t.isDirty)throw Error(`Scheduler is dirty, this should never happen`);Qm(r.root),n.length=0,a.current&&Vh(r,e),!(t.isDirty||s.current===e.output)&&(s.current=e.output,c.forEach(e=>e()))});return dh(()=>(a.current=!0,()=>{a.current=!1,zh(r)}),[r]),dh(()=>{o.current=i.props,Qm(r.root),Vh(r,i),!(t.isDirty||s.current===i.output)&&(s.current=i.output,c.forEach(e=>e()))}),ch(()=>({getValue:()=>s.current,subscribe:e=>(c.add(e),()=>c.delete(e))}),[c])};function ote(e,t){let n=Ym(),r=oh(0),i=ch(()=>(e.key,Rh(e.type,n.root,()=>{r.current++,n.markDirty?.()})),[e.type,e.key,n]),a=t?ch(()=>Bh(i,e.props),[i,...t,r.current]):Bh(i,e.props);return dh(()=>()=>zh(i),[i]),dh(()=>{Vh(i,a)},[i,a]),a.output}function ste(e,t){let n=oh(0),r=n.current,i=ch(()=>Ym(),[]),a=ch(()=>()=>{n.current++,i.markDirty?.()},[i]),o=ch(()=>new Map,[]),s=t?lh(e,t):e,c=ch(()=>{let e=s(),t=new Set,n=[],r=0;for(let s=0;s<e.length;s++){let c=e[s],l=c.key;if(l===void 0)throw Error(`useResources did not provide a key for array at index ${s}`);if(t.has(l))throw Error(`Duplicate key ${l} in useResources`);t.add(l);let u=o.get(l);if(!u){let e=Rh(c.type,i.root,a),t=Bh(e,c.props);u={fiber:e,next:t},r++,o.set(l,u),n.push(t.output)}else if(u.fiber.type!==c.type){let e=Rh(c.type,i.root,a),t=Bh(e,c.props);u.next=[e,t],n.push(t.output)}else u.next=Bh(u.fiber,c.props),n.push(u.next.output)}if(o.size>n.length-r)for(let e of o.keys())t.has(e)||(o.get(e).next=`delete`);return n},[s,r,i,a,o]);return dh(()=>()=>{for(let e of o.keys()){let t=o.get(e).fiber;zh(t)}},[o]),dh(()=>{for(let[e,t]of o.entries())t.next===`delete`?(t.fiber.isMounted&&zh(t.fiber),o.delete(e)):Array.isArray(t.next)?(zh(t.fiber),t.fiber=t.next[0],Vh(t.fiber,t.next[1])):Vh(t.fiber,t.next)},[c,o]),c}var cte=()=>{if(!qm)return null;let e=(0,N.useRef)(0),t=e.current===0;return(0,N.useState)(()=>e.current++),e.current===2?t?`child`:`root`:null},lte=Oh(function(e){return e()}),ute=e=>{let t=(0,N.useMemo)(()=>Zm(e=>r(e)),[]),[n,r]=(0,N.useReducer)((e,n)=>($m(t,e),e+ +!!n()),0);$m(t,n);let i=cte(),a=(0,N.useMemo)(()=>Rh(lte,t,void 0,i),[t,i]),o=Bh(a,e);return(0,N.useLayoutEffect)(()=>()=>zh(a),[a]),(0,N.useLayoutEffect)(()=>{Qm(t),Vh(a,o)}),o.output},Hh=e=>((...t)=>Xm()?e(...t):ute(()=>e(...t))),Uh=Hh(ote),Wh=Hh(ste),dte=Hh(ate),fte=Oh(function(){let[e,t]=bh(()=>({renderers:{},fallbacks:[]}));return{getState:()=>e,setDataUI:W((e,n)=>(t(t=>({...t,renderers:{...t.renderers,[e]:[...t.renderers[e]??[],n]}})),()=>{t(t=>({...t,renderers:{...t.renderers,[e]:t.renderers[e]?.filter(e=>e!==n)??[]}}))}),[]),setFallbackDataUI:W(e=>(t(t=>({...t,fallbacks:[...t.fallbacks,e]})),()=>{t(t=>({...t,fallbacks:t.fallbacks.filter(t=>t!==e)}))}),[])}}),pte=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},{})},Gh=class{_providers=new Set;getModelContext(){return pte(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)}}},Kh=[],mte={modelName:void 0,toolNames:Kh},hte=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>e===t[n]),qh=(e,t)=>{let n=e.getModelContext(),r=n.config?.modelName,i=n.tools?Object.keys(n.tools).sort():Kh,a=i.length?i:Kh;return r===t.modelName&&hte(a,t.toolNames)?t:{modelName:r,toolNames:a}},Jh=Oh(function(){let e=U(()=>new Gh,[]),[t,n]=bh(()=>qh(e,mte));return Sh(()=>(n(t=>qh(e,t)),e.subscribe(()=>{n(t=>qh(e,t))})),[e]),{getState:()=>qh(e,t),getModelContext:()=>e.getModelContext(),subscribe:t=>e.subscribe(t),register:t=>e.registerModelContextProvider(t)}}),gte=e=>e.display===void 0?e.type===`human`:e.display===`standalone`,_te=(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},vte=e=>function(t){return _te(e,t)},Yh=Symbol(`assistant-ui.store.clientIndex`),yte=e=>e[Yh],Xh=hh([]),Zh=()=>Th(Xh),bte=(e,t)=>{let n=Zh();return _h(Xh,U(()=>[...n,e],[n,e]),t)},xte=new Set([`$$typeof`,`nodeType`,`then`]),Qh=(e,t)=>{if(e===Symbol.toStringTag)return t;if(typeof e!=`symbol`){if(e===`toJSON`)return()=>t;if(!xte.has(e))return!1}},$h=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}},eg=e=>{let t=Oh(e);return e=>{let n=t(e);return e.key===void 0?n:kh(e.key,n)}},tg=Symbol(`assistant-ui.store.getValue`),Ste=e=>{let t=e[tg];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?.()},ng=new Map;function Cte(e){let t=ng.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[tg];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)},ng.set(e,t)),t}var wte=class extends $h{outputRef;index;boundFns;cachedReceiver;constructor(e,t){super(),this.outputRef=e,this.index=t}get(e,t,n){if(t===tg)return this.outputRef.current;if(t===Yh)return this.index;let r=Qh(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=Cte(t).bind(n),this.boundFns.set(t,e)),e}return i}ownKeys(){return Object.keys(this.outputRef.current)}has(e,t){return t===tg||t===Yh?!0:t in this.outputRef.current}},rg=eg(e=>{let t=xh(null),n=Zh().length,r=U(()=>new Proxy({},new wte(t,n)),[n]),i=bte(r,()=>Uh(e));return t.current||=i,Sh(()=>{t.current=i}),{methods:r,state:i.getState?.(),key:e.key}}),ig=e=>Uh(rg(e)),ag=Symbol(`assistant-ui.store.proxiedAssistantState`),og=e=>e===`on`||e===`subscribe`||typeof e==`symbol`,sg=e=>{class t extends $h{get(t,n){let r=Qh(n,`AssistantState`);if(r!==!1)return r;let i=n;if(!og(i))return Ste(e[i]())}ownKeys(){return Object.keys(e).filter(e=>!og(e))}has(t,n){return!og(n)&&n in e}}return new Proxy({},new t)},Tte=e=>e[ag],cg=()=>()=>{},lg=e=>{let t=(()=>{throw Error(e)});return t.source=null,t.query=null,t},ug=new Proxy({},new class extends $h{get(e,t){if(t===`subscribe`||t===`on`)return cg;if(t===ag)return dg;let n=Qh(t,`DefaultAssistantClient`);return n===!1?lg(`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}}),dg=sg(ug),fg=()=>new Proxy({},{get(e,t){let n=Qh(t,`AssistantClient`);return n===!1?lg(`The current scope does not have a "${String(t)}" property.`):n}}),pg=(0,H.createContext)(ug),mg=()=>Eh(pg),hg=({value:e,children:t})=>(0,I.jsx)(pg.Provider,{value:e,children:t}),gg=Oh(function(e){return null}),_g=Symbol(`assistant-ui.transform-scopes`);function vg(e,t){let n=e;if(n[_g])throw Error(`transformScopes is already attached to this resource`);n[_g]=t}function yg(e){return e[_g]}var bg=e=>typeof e==`string`?{scope:e.split(`.`)[0],event:e}:{scope:e.scope,event:e.event},xg=hh(null),Ete=(e,t)=>_h(xg,e,t),Sg=()=>{let e=Th(xg);if(!e)throw Error(`AssistantTapContext is not available`);return e},Cg=()=>Sg().clientRef,wg=()=>{let{emit:e}=Sg(),t=Zh();return wh((n,r)=>{e(n,r,t)})};function Dte(e,t){let n={...e},r=new Set,i=!0;for(;i;){i=!1;for(let e of Object.values(n)){if(e.type===gg||r.has(e.type))continue;r.add(e.type);let a=yg(e.type);if(a){a(n,t),i=!0;break}}}let a={},o={};for(let[e,t]of Object.entries(n))t.type===gg?o[e]=t:a[e]=t;return{rootClients:a,derivedClients:o}}var Tg=e=>U(()=>e,[...Object.entries(e).flat()]),Ote=(e,t)=>{let{rootClients:n,derivedClients:r}=Dte(e,t);return{rootClients:Tg(n),derivedClients:Tg(r)}},kte=Oh(function(){return U(()=>{let e=new Map,t=new Set,n=new Set;return{on(n,r){let i=r;if(n===`*`)return t.add(i),()=>t.delete(i);let a=e.get(n);return a||(a=new Set,e.set(n,a)),a.add(i),()=>{a.delete(i),a.size===0&&e.delete(n)}},emit(n,r,i){let a=e.get(n);!a&&t.size===0||queueMicrotask(()=>{let e=[];if(a)for(let t of a)try{t(r,i)}catch(t){e.push(t)}if(t.size>0){let a={event:n,payload:r};for(let n of t)try{n(a,i)}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 event emission`)}})},subscribe(e){return n.add(e),()=>n.delete(e)},notifySubscribers(){for(let e of n)try{e()}catch(e){console.error(`NotificationManager: subscriber callback error`,e)}}}},[])}),Eg=e=>U(()=>e,e),Ate=Oh(function({element:e,emit:t,clientRef:n}){let{methods:r,state:i}=Ete({clientRef:n,emit:t},()=>ig(e));return U(()=>({state:i,methods:r}),[r,i])}),jte=Oh(function({element:e,notifications:t,clientRef:n,name:r}){let i=dte(Ate({element:e,emit:t.emit,clientRef:n}));return Sh(()=>i.subscribe(t.notifySubscribers),[i,t]),U(()=>{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])}),Mte=Oh(function(){return U(()=>({clients:[],subscribe:void 0,on:void 0}),[])}),Nte=Oh(function({clients:e,clientRef:t}){let n=Uh(kte());Sh(()=>t.parent.subscribe(n.notifySubscribers),[t,n]);let r=Eg(Wh(()=>Object.keys(e).map(r=>kh(r,jte({element:e[r],notifications:n,clientRef:t,name:r}))),[e,n,t]));return U(()=>({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}=bg(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[yte(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])}),Pte=Oh(function({element:e,clientRef:t,name:n}){let r=xh(e.props);return r.current=e.props,U(()=>{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])}),Fte=(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}`},Ite=Oh(function({clients:e,clientRef:t}){return Eg(Wh(()=>Object.keys(e).map(n=>{let r=n,i=e[r];return kh(Fte(r,i.props),Pte({element:i,clientRef:t,name:r}))}),[e,t]))}),Lte=Oh(function({parent:e,clients:t}){let{rootClients:n,derivedClients:r}=Ote(t,e),i=xh({parent:e,current:null}).current;Sh(()=>{i.current=s});let a=Uh(Object.keys(n).length>0?Nte({clients:n,clientRef:i}):Mte()),o=Uh(Ite({clients:r,clientRef:i})),s=U(()=>{let t=e===ug?fg():e,n=Object.create(t);Object.assign(n,{subscribe:a.subscribe??e.subscribe,on:a.on??e.on,[ag]:sg(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});function Dg(e,{parent:t}={parent:mg()}){if(e)return Uh(Lte({parent:t??ug,clients:e}));if(t===null)throw Error(`received null parent, this usage is not allowed`);return t}var G=e=>{let t=Dg(),n=Tte(t),r=(0,H.useSyncExternalStore)(t.subscribe,()=>e(n),()=>e(n));if(r===n)throw Error(`You tried to return the entire AssistantState. This is not supported due to technical limitations.`);return(0,H.useDebugValue)(r),r},Rte=e=>{let t=Dg(),n=xh(!1),r=n.current?null:e(t);return G(()=>n.current?e(t):r),()=>(n.current=!0,e(t))},zte=Object.freeze({});function Og({getItemState:e,children:t}){return Bte(t(Rte(e)))}var Bte=e=>{let t=typeof e==`object`&&e&&`type`in e?e:null,n=t?.type,r=t?.key;return U(()=>t,[n,r,typeof t?.props==`object`&&t.props!=null&&Object.entries(t.props).length===0?zte:t?.props])??e},Vte=N.createContext(!0);function kg(){throw Error(`A function wrapped in useEffectEvent can't be called during rendering.`)}var Hte=`use`in N.default?()=>{try{return N.use(Vte)}catch{return!1}}:()=>!1;function Ute(e){let t=N.useRef(kg);return N.useInsertionEffect(()=>{t.current=e},[e]),(...e)=>{Hte()&&kg();let n=t.current;return n(...e)}}var Ag=(e,t)=>{let n=Dg(),r=Ute(t),{scope:i,event:a}=bg(e);Sh(()=>n.on({scope:i,event:a},r),[n,i,a])},Wte=eg(e=>{if(e.key===void 0)throw Error(`useClientResource: Element has no key`);return Uh(rg(e))});function jg(e,t){let n=Wh(()=>e().map(e=>Wte(e)),t),r=U(()=>Object.keys(n),[n]),i=U(()=>n.reduce((e,t,n)=>(e[t.key]=n,e),{}),[n]);return{state:U(()=>n.map(e=>e.state),[n]),get:e=>{if(`index`in e){if(e.index<0||e.index>=r.length)throw Error(`useClientLookup: Index ${e.index} out of bounds (length: ${r.length})`);return n[e.index].methods}let t=i[e.key];if(t===void 0)throw Error(`useClientLookup: Key "${e.key}" not found`);return n[t].methods}}}var Mg=Oh(function({toolkit:e,mcpApp:t}){let n=Wh(()=>t?[kh(`mcpApp`,t)]:[],[t])[0],[r,i]=bh(()=>({})),a=U(()=>({toolUIs:r,mcpApp:n,tools:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,t.map(e=>e.render)]))}),[r,n]),o=Cg(),s=W((e,t,n)=>{let r={render:t,standalone:n?.standalone??!1};return i(t=>({...t,[e]:[...t[e]??[],r]})),()=>{i(t=>{let n=t[e]?.filter(e=>e!==r)??[];if(n.length>0)return{...t,[e]:n};let{[e]:i,...a}=t;return a})}},[]);return Sh(()=>{if(!e)return;let t=[];for(let[n,r]of Object.entries(e)){let e=`render`in r?r.render:void 0,i=`renderText`in r?r.renderText:void 0,a=e??(i?vte(i):void 0);a&&t.push(s(n,a,{standalone:gte(r)}))}let n=Object.entries(e).reduce((e,[t,n])=>{if(n.type===`mcp`)return e;let{display:r,render:i,renderText:a,...o}=n;return e[t]=o,e},{});return t.push(o.current.modelContext().register({getModelContext:()=>({tools:n})})),()=>{t.forEach(e=>e())}},[e,s,o]),{getState:()=>a,setToolUI:s}});vg(Mg,(e,t)=>{!e.modelContext&&t.modelContext.source===null&&(e.modelContext=Jh())});var Ng=e=>{let[,t]=bh(e.getState);return Sh(()=>(t(e.getState()),e.subscribe(()=>{t(e.getState())})),[e]),e.getState()},Pg=Oh(function({runtime:e}){let t=Ng(e);return{getState:()=>t,remove:e.remove,__internal_getRuntime:()=>e}}),Gte=Oh(function({runtime:e,index:t}){return Uh(Pg({runtime:U(()=>e.getAttachmentByIndex(t),[e,t])}))}),Kte=Oh(function({item:e,onSteer:t,onRemove:n}){return{getState:()=>e,steer:t,remove:n}}),Fg=Oh(function({threadIdRef:e,messageIdRef:t,runtime:n}){let r=Ng(n),i=wg();Sh(()=>{let r=[];for(let a of[`send`,`attachmentAdd`]){let o=n.unstable_on(a,()=>{i(`composer.${a}`,{threadId:e.current,...t&&{messageId:t.current}})});r.push(o)}return r.push(n.unstable_on(`attachmentAddError`,n=>{i(`composer.attachmentAddError`,{threadId:e.current,...t&&{messageId:t.current},...n.attachmentId&&{attachmentId:n.attachmentId},reason:n.reason,message:n.message})})),()=>{for(let e of r)e()}},[n,i,e,t]);let a=jg(()=>r.attachments.map((e,t)=>kh(e.id,Gte({runtime:n,index:t}))),[r.attachments,n]),o=r.queue,s=jg(()=>o.map(e=>kh(e.id,Kte({item:e,onSteer:()=>n.steerQueueItem(e.id),onRemove:()=>n.removeQueueItem(e.id)}))),[o,n]),c=U(()=>({text:r.text,role:r.role,attachments:a.state,runConfig:r.runConfig,isEditing:r.isEditing,canCancel:r.canCancel,canSend:r.canSend,attachmentAccept:r.attachmentAccept,isEmpty:r.isEmpty,type:r.type??`thread`,dictation:r.dictation,quote:r.quote,queue:o}),[r,a.state,o]);return{getState:()=>c,setText:n.setText,setRole:n.setRole,setRunConfig:n.setRunConfig,addAttachment:n.addAttachment,reset:n.reset,clearAttachments:n.clearAttachments,send:n.send,cancel:n.cancel,beginEdit:n.beginEdit??(()=>{throw Error(`beginEdit is not supported in this runtime`)}),startDictation:n.startDictation,stopDictation:n.stopDictation,setQuote:n.setQuote,attachment:e=>`id`in e?a.get({key:e.id}):a.get(e),queueItem:e=>s.get(e),__internal_getRuntime:()=>n}}),qte=Oh(function({runtime:e}){let t=Ng(e);return{getState:()=>t,addToolResult:t=>e.addToolResult(t),resumeToolCall:t=>e.resumeToolCall(t),respondToToolApproval:t=>e.respondToToolApproval(t),__internal_getRuntime:()=>e}}),Jte=Oh(function({runtime:e,index:t}){return Uh(Pg({runtime:U(()=>e.getAttachmentByIndex(t),[e,t])}))}),Yte=Oh(function({runtime:e,index:t}){return Uh(qte({runtime:U(()=>e.getMessagePartByIndex(t),[e,t])}))}),Xte=Oh(function({runtime:e,threadIdRef:t}){let n=Ng(e),[r,i]=bh(!1),[a,o]=bh(!1),s=U(()=>({get current(){return e.getState().id}}),[e]),c=ig(Fg({runtime:e.composer,threadIdRef:t,messageIdRef:s})),l=jg(()=>n.content.map((t,n)=>kh(`toolCallId`in t&&t.toolCallId!=null?`toolCallId-${t.toolCallId}`:`index-${n}`,Yte({runtime:e,index:n}))),[n.content,e]),u=jg(()=>(n.attachments??[]).map((t,n)=>kh(t.id,Jte({runtime:e,index:n}))),[n.attachments,e]),d=U(()=>({...n,parts:l.state,composer:c.state,isCopied:r,isHovering:a}),[n,l.state,c.state,r,a]);return{getState:()=>d,composer:()=>c.methods,reload:t=>e.reload(t),speak:()=>e.speak(),stopSpeaking:()=>e.stopSpeaking(),submitFeedback:t=>e.submitFeedback(t),switchToBranch:t=>e.switchToBranch(t),getCopyText:()=>e.unstable_getCopyText(),part:e=>`index`in e?l.get({index:e.index}):l.get({key:`toolCallId-${e.toolCallId}`}),attachment:e=>`id`in e?u.get({key:e.id}):u.get(e),setIsCopied:i,setIsHovering:o,__internal_getRuntime:()=>e}}),Zte=Oh(function({runtime:e,id:t,threadIdRef:n}){return Uh(Xte({runtime:U(()=>e.getMessageById(t),[e,t]),threadIdRef:n}))}),Qte=Oh(function({runtime:e}){let t=Ng(e),n=wg();Sh(()=>{let t=[];for(let r of[`runStart`,`runEnd`,`initialize`,`modelContextUpdate`]){let i=e.unstable_on(r,()=>{let t=e.getState()?.threadId||`unknown`;n(`thread.${r}`,{threadId:t})});t.push(i)}return()=>{for(let e of t)e()}},[e,n]);let r=U(()=>({get current(){return e.getState().threadId}}),[e]),i=ig(Fg({runtime:e.composer,threadIdRef:r})),a=jg(()=>t.messages.map(t=>kh(t.id,Zte({runtime:e,id:t.id,threadIdRef:r}))),[t.messages,e,r]),o=U(()=>({isEmpty:a.state.length===0&&!t.isLoading,isDisabled:t.isDisabled,isLoading:t.isLoading,isRunning:t.isRunning,capabilities:t.capabilities,state:t.state,suggestions:t.suggestions,extras:t.extras,speech:t.speech,voice:t.voice,composer:i.state,messages:a.state}),[t,a,i.state]);return{getState:()=>o,composer:()=>i.methods,append:e.append,startRun:e.startRun,resumeRun:e.resumeRun,cancelRun:e.cancelRun,getModelContext:e.getModelContext,export:e.export,import:e.import,reset:e.reset,stopSpeaking:e.stopSpeaking,connectVoice:e.connectVoice,disconnectVoice:e.disconnectVoice,getVoiceVolume:e.getVoiceVolume,subscribeVoiceVolume:e.subscribeVoiceVolume,muteVoice:e.muteVoice,unmuteVoice:e.unmuteVoice,message:e=>`id`in e?a.get({key:e.id}):a.get(e),__internal_getRuntime:()=>e}}),$te=Oh(function({runtime:e}){let t=Ng(e),n=wg();return Sh(()=>{let t=[];for(let r of[`switchedTo`,`switchedAway`]){let i=e.unstable_on(r,()=>{n(`threadListItem.${r}`,{threadId:e.getState().id})});t.push(i)}return()=>{for(let e of t)e()}},[e,n]),{getState:()=>t,switchTo:e.switchTo,rename:e.rename,updateCustom:e.updateCustom,archive:e.archive,unarchive:e.unarchive,delete:e.delete,generateTitle:e.generateTitle,initialize:e.initialize,detach:e.detach,__internal_getRuntime:()=>e}}),ene=Oh(function({runtime:e,id:t}){return Uh($te({runtime:U(()=>e.getItemById(t),[e,t])}))}),tne=Oh(function({runtime:e,__internal_assistantRuntime:t}){let n=Ng(e),r=ig(Qte({runtime:e.main})),i=jg(()=>Object.keys(n.threadItems).map(t=>kh(t,ene({runtime:e,id:t}))),[n.threadItems,e]),a=U(()=>({mainThreadId:n.mainThreadId,newThreadId:n.newThreadId??null,isLoading:n.isLoading,isLoadingMore:n.isLoadingMore,hasMore:n.hasMore,threadIds:n.threadIds,archivedThreadIds:n.archivedThreadIds,threadItems:i.state,main:r.state}),[n,i.state,r.state]);return{getState:()=>a,thread:()=>r.methods,item:e=>{if(e===`main`)return i.get({key:a.mainThreadId});if(`id`in e)return i.get({key:e.id});let{index:t,archived:n=!1}=e,r=n?a.archivedThreadIds[t]:a.threadIds[t];return i.get({key:r})},switchToThread:async(t,n)=>{await e.switchToThread(t,n)},switchToNewThread:async()=>{await e.switchToNewThread()},getLoadThreadsPromise:()=>e.getLoadThreadsPromise(),reload:()=>e.reload(),loadMore:()=>e.loadMore(),__internal_getAssistantRuntime:()=>t}}),nne=Oh(function(e){return{getState:()=>e}}),rne=Oh(function(e){let[t]=bh(()=>({suggestions:(e??[]).map(e=>typeof e==`string`?{title:e,label:``,prompt:e}:{title:e.title,label:e.label,prompt:e.prompt})})),n=jg(()=>t.suggestions.map((e,t)=>kh(t,nne(e))),[t.suggestions]);return{getState:()=>t,suggestion:({index:e})=>n.get({index:e})}}),ine=Oh(function(e){let t=Cg();return Sh(()=>e.registerModelContextProvider(t.current.modelContext()),[e,t]),Uh(tne({runtime:e.threads,__internal_assistantRuntime:e}))}),ane=(e,t)=>{e.thread??=gg({source:`threads`,query:{type:`main`},get:e=>e.threads().thread(`main`)}),e.threadListItem??=gg({source:`threads`,query:{type:`main`},get:e=>e.threads().item(`main`)}),e.composer??=gg({source:`thread`,query:{},get:e=>e.threads().thread(`main`).composer()}),!e.modelContext&&t.modelContext.source===null&&(e.modelContext=Jh()),!e.suggestions&&t.suggestions.source===null&&(e.suggestions=rne())},Ig=Oh(function(e){return Uh(ine(e))});vg(Ig,(e,t)=>{ane(e,t),!e.tools&&t.tools.source===null&&(e.tools=Mg({})),!e.dataRenderers&&t.dataRenderers.source===null&&(e.dataRenderers=fte())});var one=e=>e._core?.RenderComponent,sne=(0,H.memo)(({runtime:e,aui:t=null,children:n})=>{let r=Dg({threads:Ig(e)},{parent:t}),i=one(e);return(0,I.jsxs)(hg,{value:r,children:[i&&(0,I.jsx)(i,{}),n]})}),Lg=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},cne=(e=>e?Lg(e):Lg),lne=e=>e;function une(e,t=lne){let n=N.useSyncExternalStore(e.subscribe,N.useCallback(()=>t(e.getState()),[e,t]),N.useCallback(()=>t(e.getInitialState()),[e,t]));return N.useDebugValue(n),n}var Rg=e=>{let t=cne(e),n=e=>une(t,e);return Object.assign(n,t),n},zg=(e=>e?Rg(e):Rg),Bg=()=>{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}},dne=()=>{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=Bg(),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()}}))}}},Vg=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())}},Hg=e=>new ReadableStream({start(t){return e.start?.(new Vg(t))},pull(t){return e.pull?.(new Vg(t))},cancel(t){return e.cancel?.(t)}}),Ug=()=>{let e;return[Hg({start(t){e=t}}),e]},Wg=class{_controller;_isClosed=!1;_mergeTask;constructor(e){this._controller=e;let t=Hg({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())}},fne=e=>new ReadableStream({start(t){return e.start?.(new Wg(t))},pull(t){return e.pull?.(new Wg(t))},cancel(t){return e.cancel?.(t)}}),pne=()=>{let e;return[fne({start(t){e=t}}),e]},Gg=class{value=-1;up(){return++this.value}},mne=class extends TransformStream{constructor(e){super({transform(t,n){n.enqueue({...t,path:[e,...t.path]})}})}};TransformStream;var hne=class extends TransformStream{constructor(e){let t=new Gg,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]})}})}},gne=class extends TransformStream{constructor(e){super();let t=e(super.readable);Object.defineProperty(this,"readable",{value:t,writable:!1})}},Kg=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)}})}},qg=(e,t=21)=>(n=t)=>{let r=``,i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r},_ne=qg(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,7),vne=class e{_state;_parentId;constructor(e){this._state=e||{merger:dne(),contentCounter:new Gg}}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 mne(this._state.contentCounter.value)))}merge(e){this._state.merger.addStream(e.pipeThrough(new hne(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]=Ug();return this._addPart(this._withParentIdOption({type:`text`}),e),t}addReasoningPart(){let[e,t]=Ug();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??_ne(),[i,a]=pne();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 yne(e){let t=new vne;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 bne(){let{resolve:e,promise:t}=Bg(),n;return[yne(r=>(n=r,n.__internal_subscribeToClose(e),t)),n]}function xne(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 Jg=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),Yg=Symbol(`aui.parse-partial-json-object.meta`),Sne=e=>e?.[Yg],Xg=e=>{if(e.length===0)return{[Yg]:{state:`partial`,partialPath:[]}};try{let t=Jg.default.parse(e);if(typeof t!=`object`||!t)throw Error(`argsText is expected to be an object`);return t[Yg]={state:`complete`,partialPath:[]},t}catch{try{let[t,n]=xne(e),r=Jg.default.parse(t);if(typeof r!=`object`||!r)throw Error(`argsText is expected to be an object`);return r[Yg]={state:`partial`,partialPath:n},r}catch{return}}},Zg=(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 Zg(s,{state:`partial`,partialPath:o},i)},Qg=(e,t)=>{let n=Sne(e);if(!n)throw Error(`unable to determine object state`);return Zg(e,n,t.map(String))};async function*Cne(){let e=this.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)break;yield n}}finally{e.releaseLock()}}function $g(e){return e[Symbol.asyncIterator]??=Cne,e}var e_=Symbol.for(`aui.tool-response`),t_=class e{get[e_](){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&&e_ in e}static toResponse(t){return t instanceof e?t:new e({result:t===void 0?`<no result>`:t})}};function wne(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 n_(e,t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}var Tne=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(Qg(e,this.fieldPath)===`complete`){let t=n_(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=n_(e,this.fieldPath);this.resolve(t)}catch(e){this.reject(e)}finally{this.dispose()}}dispose(){this.disposed=!0}},Ene=class{controller;disposed=!1;fieldPath;constructor(e,t){this.controller=e,this.fieldPath=t}update(e){if(!this.disposed)try{let t=n_(e,this.fieldPath);t!==void 0&&this.controller.enqueue(t),Qg(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}},Dne=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=n_(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)}Qg(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}},One=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=n_(e,this.fieldPath);if(!Array.isArray(t))return;for(let n=0;n<t.length;n++)this.processedIndexes.has(n)||Qg(e,[...this.fieldPath,n])===`complete`&&(this.controller.enqueue(t[n]),this.processedIndexes.add(n));Qg(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}},kne=class{argTextDeltas;handles=new Set;args=Xg(``);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=Xg(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 Tne(t,n,e);if(this.args&&Qg(this.args,e)===`complete`){let n=n_(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 $g(new ReadableStream({start:e=>{n=new Ene(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 $g(new ReadableStream({start:e=>{n=new Dne(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 $g(new ReadableStream({start:e=>{n=new One(e,t),this.finished||this.handles.add(n),n.update(this.args),this.finished&&n.end()},cancel:()=>{n&&(n.dispose(),this.handles.delete(n))}}))}},Ane=class{promise;constructor(e){this.promise=e}get(){return this.promise}},jne=class{args;response;writable;resolve;argsText=``;constructor(){let e=new TransformStream;this.writable=e.writable,this.args=new kne(e.readable);let{promise:t,resolve:n}=Bg();this.resolve=n,this.response=new Ane(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}},Mne=class extends gne{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 jne;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 t_({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=wne(()=>{let t;try{t=Jg.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 t_({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 t_({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 Kg).pipeThrough(i)})}},Nne=e=>typeof e==`object`&&!!e&&`~standard`in e&&e[`~standard`].version===1;function Pne(e,t,n,r){let i=e?.[n.toolName];return i?.execute?(async e=>{if(t.aborted)return new t_({result:`Tool execution was cancelled.`,isError:!0});let a=e;if(Nne(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 t_({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=t_.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 t_({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 Fne(e,t,n,r,i){e?.[r.toolName]?.streamCall?.(n,{toolCallId:r.toolCallId,abortSignal:t,human:e=>i(r.toolCallId,e)})}function Ine(e,t,n,r){let i=typeof e==`function`?e:()=>e,a=typeof t==`function`?t:()=>t;return new Mne({execute:e=>Pne(i(),a(),e,n),streamCall:({reader:e,...t})=>Fne(i(),a(),e,t,n),onExecutionStart:r?.onExecutionStart,onExecutionEnd:r?.onExecutionEnd})}var r_=({index:e,children:t})=>(0,I.jsx)(hg,{value:Dg({attachment:gg({source:`message`,query:{type:`index`,index:e},get:t=>t.message().attachment({index:e})})}),children:t}),i_=({index:e,children:t})=>(0,I.jsx)(hg,{value:Dg({attachment:gg({source:`composer`,query:{type:`index`,index:e},get:t=>t.composer().attachment({index:e})})}),children:t}),a_=({index:e,children:t})=>(0,I.jsx)(hg,{value:Dg({message:gg({source:`thread`,query:{type:`index`,index:e},get:t=>t.thread().message({index:e})}),composer:gg({source:`message`,query:{},get:t=>t.thread().message({index:e}).composer()})}),children:t}),o_=({index:e,children:t})=>(0,I.jsx)(hg,{value:Dg({part:gg({source:`message`,query:{type:`index`,index:e},get:t=>t.message().part({index:e})})}),children:t}),Lne=Oh(function({text:e,isRunning:t}){let n=U(()=>({type:`text`,text:e,status:t?{type:`running`}:{type:`complete`}}),[e,t]);return{getState:()=>n,addToolResult:()=>{throw Error(`Not supported`)},resumeToolCall:()=>{throw Error(`Not supported`)},respondToToolApproval:()=>{throw Error(`Not supported`)}}}),s_=({text:e,isRunning:t=!1,children:n})=>(0,I.jsx)(hg,{value:Dg({part:Lne({text:e,isRunning:t})}),children:n}),Rne=Object.freeze({type:`complete`}),zne=Oh(function({parts:e,getMessagePart:t}){let[n,r]=bh(!0),i=U(()=>e[e.length-1]?.status??Rne,[e]),a=U(()=>({parts:e,collapsed:n,status:i}),[e,n,i]);return{getState:()=>a,setCollapsed:r,part:t}}),Bne=({startIndex:e,endIndex:t,children:n})=>{let r=G(e=>e.message.parts).slice(e,t+1),i=Dg();return(0,I.jsx)(hg,{value:Dg({chainOfThought:zne({parts:r,getMessagePart:({index:t})=>{if(t<0||t>=r.length)throw Error(`ChainOfThought part index ${t} is out of bounds (0..${r.length-1})`);return i.message().part({index:e+t})}})}),children:n})},c_=({index:e,children:t})=>(0,I.jsx)(hg,{value:Dg({suggestion:gg({source:`suggestions`,query:{index:e},get:t=>t.suggestions().suggestion({index:e})})}),children:t}),Vne=({index:e,children:t})=>(0,I.jsx)(hg,{value:Dg({queueItem:gg({source:`composer`,query:{index:e},get:t=>t.composer().queueItem({index:e})})}),children:t}),l_=Symbol(`innerMessage`),u_=Symbol(`innerMessages`),Hne=[],Une=(e,t)=>{l_ in e||(e[l_]=t)},Wne=e=>{let t=`messages`in e?e.messages:e,n=t[u_]||t[l_];return n?Array.isArray(n)?n:(t[u_]=[n],t[u_]):Hne},d_=Symbol(`skip-update`);function Gne(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 Kne=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)}}},f_=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()}}},p_=class extends f_{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e;let t=e.getState();if(t===d_)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===d_||Gne(e,this._previousState)?!1:(this._previousState=e,!0)}_connect(){return this.binding.subscribe(()=>{this._syncState()&&this.notifySubscribers()})}},m_=class extends f_{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!==d_&&(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()})}},h_=class extends f_{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?.()}}},g_=class extends f_{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?.()}}},__=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)}},v_=class extends __{_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)}},qne=class extends v_{get source(){return`thread-composer`}},Jne=class extends v_{get source(){return`edit-composer`}},Yne=class extends __{get source(){return`message`}remove(){throw Error(`Message attachments cannot be removed`)}},y_=Object.freeze([]),b_=Object.freeze({}),Xne=e=>Object.freeze({type:`thread`,isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,canSend:e?.canSend??!1,isEmpty:e?.isEmpty??!0,attachments:e?.attachments??y_,text:e?.text??``,role:e?.role??`user`,runConfig:e?.runConfig??b_,attachmentAccept:e?.attachmentAccept??``,dictation:e?.dictation,quote:e?.quote,queue:e?.queue??y_,value:e?.text??``}),Zne=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??y_,runConfig:e?.runConfig??b_,attachmentAccept:e?.attachmentAccept??``,dictation:e?.dictation,quote:e?.quote,queue:e?.queue??y_,parentId:e?.parentId??null,sourceId:e?.sourceId??null,value:e?.text??``}),x_=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 g_({event:e,binding:this._core}),this._eventSubscriptionSubjects.set(e,n)),n.subscribe(t)}},Qne=class extends x_{get path(){return this._core.path}get type(){return`thread`}_getState;constructor(e){let t=new m_({path:e.path,getState:()=>Xne(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 qne(new p_({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`}:d_},subscribe:e=>this._core.subscribe(e)}),this._core)}},$ne=class extends x_{_beginEdit;get path(){return this._core.path}get type(){return`edit`}_getState;constructor(e,t){let n=new m_({path:e.path,getState:()=>Zne(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 Jne(new p_({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`}:d_},subscribe:e=>this._core.subscribe(e)}),this._core)}},S_=e=>e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
76
|
+
|
|
77
|
+
`),C_=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=t_.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)throw Error(`Tool call has no pending approval`);if(!this.threadApi)throw Error(`Thread API is not available`);this.threadApi.getState().respondToToolApproval({approvalId:t.approval.id,approved:e.approved,...e.reason!=null&&{reason:e.reason}})}subscribe(e){return this.contentBinding.subscribe(e)}},w_=Object.freeze({type:`complete`}),ere=(e,t,n)=>{if(e.role!==`assistant`)return w_;if(n.type===`tool-call`)return n.result?w_:e.status;let r=t===Math.max(0,e.content.length-1);return e.status.type===`requires-action`?w_:r?e.status:w_},T_=(e,t)=>{let n=e.content[t];if(!n)return d_;let r=ere(e,t,n);return Object.freeze({...n,[l_]:n[l_],status:r})},tre=class{_core;_threadBinding;get path(){return this._core.path}constructor(e,t){this._core=e,this._threadBinding=t,this.composer=new $ne(new h_({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.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()}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 S_(this.getState())}subscribe(e){return this._core.subscribe(e)}getMessagePartByIndex(e){if(e<0)throw Error(`Message part index must be >= 0`);return new C_(new p_({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.content[${e}]`,messagePartSelector:{type:`index`,index:e}},getState:()=>T_(this.getState(),e),subscribe:e=>this._core.subscribe(e)}),this._core,this._threadBinding)}getMessagePartByToolCallId(e){return new C_(new p_({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?d_:T_(t,n)},subscribe:e=>this._core.subscribe(e)}),this._core,this._threadBinding)}getAttachmentByIndex(e){return new Yne(new p_({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`}:d_},subscribe:e=>this._core.subscribe(e)}))}},nre=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{},...e.stream?{stream:e.stream}:{}}),rre=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{}}),ire=(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},are=(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})},E_=class{get path(){return this._threadBinding.path}get __internal_threadBinding(){return this._threadBinding}_threadBinding;constructor(e,t){let n=new p_({path:e.path,getState:()=>are(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 Qne(new h_({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.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(ire(this._threadBinding.getState().messages,e))}subscribe(e){return this._threadBinding.subscribe(e)}getModelContext(){return this._threadBinding.getState().getModelContext()}startRun(e){return this._threadBinding.getState().startRun(rre(e))}resumeRun(e){return this._threadBinding.getState().resumeRun(nre(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 tre(new p_({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 d_;let o=this._threadBinding.getState().getBranches(e.id);return{...e,[l_]:e[l_],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 g_({event:e,binding:this._threadBinding}),this._eventSubscriptionSubjects.set(e,n)),n.subscribe(t)}},ore=(0,H.createContext)(null),sre=()=>Eh(ore),D_=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}},O_=Promise.resolve(),cre=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}),k_=(e,t)=>{if(t===void 0)return d_;let n=e.getItemById(t);return n?{id:n.id,remoteId:n.remoteId,externalId:n.externalId,title:n.title,status:n.status,custom:n.custom,isMain:n.id===e.mainThreadId}:d_},lre=class{_core;_runtimeFactory;_getState;constructor(e,t=E_){this._core=e,this._runtimeFactory=t;let n=new m_({path:{},getState:()=>cre(e),subscribe:t=>e.subscribe(t)});this._getState=n.getState.bind(n),this._mainThreadListItemRuntime=new D_(new p_({path:{ref:`threadItems[main]`,threadSelector:{type:`main`}},getState:()=>k_(this._core,this._core.mainThreadId),subscribe:e=>this._core.subscribe(e)}),this._core),this.main=new t(new h_({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?.()??O_}loadMore(){return this._core.loadMore?.()??O_}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 h_({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 D_(new p_({path:{ref:`threadItems[${e}]`,threadSelector:{type:`index`,index:e}},getState:()=>k_(this._core,this._core.threadIds[e]),subscribe:e=>this._core.subscribe(e)}),this._core)}getArchivedItemByIndex(e){return new D_(new p_({path:{ref:`archivedThreadItems[${e}]`,threadSelector:{type:`archiveIndex`,index:e}},getState:()=>k_(this._core,this._core.archivedThreadIds[e]),subscribe:e=>this._core.subscribe(e)}),this._core)}getItemById(e){return new D_(new p_({path:{ref:`threadItems[threadId=${e}]`,threadSelector:{type:`threadId`,threadId:e}},getState:()=>k_(this._core,e),subscribe:e=>this._core.subscribe(e)}),this._core)}},A_=class{_core;threads;_thread;constructor(e){this._core=e,this.threads=new lre(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)}},j_=class{_contextProvider=new Gh;registerModelContextProvider(e){return this._contextProvider.registerModelContextProvider(e)}getModelContextProvider(){return this._contextProvider}},M_=Object.freeze([]),N_=`DEFAULT_THREAD_ID`,ure=Object.freeze([N_]),dre=Object.freeze({id:N_,remoteId:void 0,externalId:void 0,status:`regular`}),fre=Promise.resolve(),P_=Object.freeze({[N_]:dre}),pre=class{threadFactory;_mainThreadId=N_;_threads=ure;_archivedThreads=M_;_threadData=P_;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 fre}_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??N_,i=e.threads??M_,a=e.archivedThreads??M_,o=n.threadId??N_,s=n.threads??M_,c=n.archivedThreads??M_;!t&&o===r&&s===i&&c===a||((s!==i||c!==a||o!==r)&&(this._threadData={...P_,...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)??M_),c!==a&&(this._archivedThreads=this.adapter.archivedThreads?.map(e=>e.id)??M_),(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()}},F_=qg(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,7),I_=Symbol(`autoStatus`),mre=Object.freeze(Object.assign({type:`running`},{[I_]:!0})),hre=Object.freeze(Object.assign({type:`complete`,reason:`unknown`},{[I_]:!0})),gre=Object.freeze(Object.assign({type:`requires-action`,reason:`tool-calls`},{[I_]:!0})),_re=Object.freeze(Object.assign({type:`requires-action`,reason:`interrupt`},{[I_]:!0})),vre=e=>e[I_]===!0,L_=(e,t,n,r,i)=>e&&i?Object.assign({type:`incomplete`,reason:`error`,error:i},{[I_]:!0}):e&&t?mre:n?_re:r?gre:hre,R_=(e,t)=>{if(e.startsWith(`data-`))return{type:`data`,name:e.substring(5),data:t}},z_=(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-${F_()}`,...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:Xg(e.argsText??``)??{},argsText:e.argsText??``}}default:{let n=R_(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=R_(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=>R_(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}`)}},B_={fromArray:e=>{let t=e.map(e=>z_(e,F_(),L_(!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=L_(!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:z_(e,e.id,n)}})}}},V_=e=>e.next?V_(e.next):`current`in e?e:null,yre=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}},H_=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],(V_(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 yre(()=>{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=V_(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=V_(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)}},U_=Object.freeze([]);function W_(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 G_(e,t){return e.length===t.length?e.every((e,n)=>e.id===t[n].id):!1}function K_(e){let t=F_();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 q_(e){let t=[];for(let n of e)n.type!==`text`&&t.push(K_(n));return t}var J_=e=>e.status.type===`complete`,Y_=class extends Kne{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=>!J_(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(J_(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 U_}steerQueueItem(e){}removeQueueItem(e){}async addAttachment(e){if(!(e instanceof File)){let t=this.getAttachmentAdapter();if(t&&!W_({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??F_(),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(!W_({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(!J_(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)}}},X_=class extends Y_{runtime;_canCancel=!1;get canCancel(){return this._canCancel}get canSend(){return!this.isEmpty&&!this.runtime.isSendDisabled}get queue(){return this.runtime.getQueueItems?.()??U_}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()}},Z_=class extends Y_{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=S_(r),this.setText(this._previousText),this.setRole(r.role),r.role===`user`?(this._previousAttachments=[...r.attachments??[],...q_(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=S_(e),r=!G_(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()}},Q_=class{_contextProvider;_subscriptions=new Set;_isInitialized=!1;repository=new H_;_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 X_(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 Z_(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(S_(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:F_(),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:F_(),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(B_.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)}}},$_=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 ev(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function tv(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=>tv(e,t+1)):ev(e)?Object.entries(e).every(([e,n])=>typeof e==`string`&&tv(n,t+1)):!1}var nv=100,rv=(e,t,n)=>{if(e===t)return!0;if(n>nv||e==null||t==null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,r)=>rv(e,t[r],n+1));if(Array.isArray(t)||!ev(e)||!ev(t))return!1;let r=Object.keys(e),i=Object.keys(t);return r.length===i.length?r.every(r=>Object.hasOwn(t,r)&&rv(e[r],t[r],n+1)):!1},iv=(e,t)=>!tv(e)||!tv(t)?!1:rv(e,t,0),av=e=>{try{return JSON.parse(e),!0}catch{return!1}},ov=e=>{try{return JSON.parse(e)}catch{return}},sv=(e,t)=>{let n=ov(e),r=ov(t);return n===void 0||r===void 0?!1:iv(n,r)},cv=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]=bne();this._controller=t;let n=Ine(()=>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 Kg).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)&&av(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)sv(e.argsText,t.argsText)&&(e.argsText=t.argsText),r=!1;else if(!t.argsText.startsWith(e.argsText))if(av(e.argsText)&&av(t.argsText)&&sv(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 t_({result:e.result,artifact:e.artifact,isError:e.isError,...e.modelContent===void 0?{}:{modelContent:e.modelContent}})),t.close()}e.messages&&this._processMessages(e.messages)}}},lv=Object.freeze([]),uv=(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},dv=(e,t)=>e&&t[t.length-1]?.role!==`assistant`,fv=class extends Q_{_capabilities={switchToBranch:!1,switchBranchDuringRun:!1,edit:!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 $_;_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??lv;uv(this.suggestions,r)||(this.suggestions=r);let i={switchToBranch:this._store.setMessages!==void 0,switchBranchDuringRun:!1,edit:this._store.onEdit!==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};uv(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 $_;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=L_(i===(e.messages?.length??0)-1,t,!1,!1,void 0);if(n&&(n.role!==`assistant`||!vre(n.status)||n.status===a))return n;let o=z_(e.convertMessage(r,i),i.toString(),a);return Une(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;dv(t,a)&&(o=F_(),this.repository.addOrUpdateMessage(a.at(-1)?.id??null,z_({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 cv(()=>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)}getQueueItems(){return this._store?.queue?.items??U_}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(S_(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 H_;t.import(B_.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(Wne))}},pv=e=>e.adapters?.threadList??{},mv=class extends j_{threads;constructor(e){super(),this.threads=new pre(pv(e),()=>new fv(this._contextProvider,e))}setAdapter(e){this.threads.__internal_setAdapter(pv(e)),this.threads.getMainThreadRuntimeCore().__internal_setAdapter(e)}},hv=e=>{let[t]=bh(()=>new mv(e));Sh(()=>{t.setAdapter(e)});let{modelContext:n}=sre()??{};return Sh(()=>{if(n)return t.registerModelContextProvider(n)},[n,t]),U(()=>new A_(t),[t])},gv=(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,bre=()=>null,xre=(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??bre;default:throw Error(`Unknown message role: ${t}`)}},_v=({components:e})=>(0,I.jsx)(xre(e,G(e=>e.message.role),G(e=>e.message.composer.isEditing)),{}),vv=(0,H.memo)(({index:e,components:t})=>(0,I.jsx)(a_,{index:e,children:(0,I.jsx)(_v,{components:t})}),(e,t)=>e.index===t.index&&gv(e.components,t.components));vv.displayName=`ThreadPrimitive.MessageByIndex`;var yv=({children:e})=>{let t=G(e=>e.thread.messages.length);return U(()=>t===0?null:Array.from({length:t},(t,n)=>(0,I.jsx)(a_,{index:n,children:(0,I.jsx)(Og,{getItemState:e=>e.thread().message({index:n}).getState(),children:t=>e({get message(){return t()}})})},n)),[t,e])},bv=({components:e,children:t})=>e?(0,I.jsx)(yv,{children:()=>(0,I.jsx)(_v,{components:e})}):(0,I.jsx)(yv,{children:t});bv.displayName=`ThreadPrimitive.Messages`;var Sre=(0,H.memo)(bv,(e,t)=>e.children||t.children?e.children===t.children:gv(e.components,t.components)),xv=e=>{let t=e.message.metadata;if(!(!t||typeof t!=`object`))return t.custom?.quote},Cre=class extends Error{componentName;constructor(e,t=`Component "${e}" is not in the generative-ui allowlist.`){super(t),this.name=`GenerativeUIRenderError`,this.componentName=e}},wre=e=>typeof e==`object`&&!!e,Sv=(e,t,n,r)=>{if(e==null)return null;if(typeof e==`string`)return e;if(!wre(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,I.jsx)(n,{component:i,props:a},s??r);throw new Cre(i)}let l=o?.length?o.map((e,i)=>Sv(e,t,n,`${r}/${i}`)):void 0;return(0,H.createElement)(c,{...a??{},key:s??r},...l??[])},Tre=e=>{if(!e||e.root===void 0||e.root===null)return[];let t=e.root;return Array.isArray(t)?t:[t]},Cv=({spec:e,components:t,Fallback:n})=>(0,I.jsx)(I.Fragment,{children:U(()=>Tre(e),[e]).map((e,r)=>Sv(e,t,n,`${r}`))});Cv.displayName=`GenerativeUIRender`;var wv=({components:e,spec:t,Fallback:n})=>{let r=G(e=>{let t=e.part;return t?.type===`generative-ui`?t.spec:void 0}),i=t??r;return i?(0,I.jsx)(Cv,{spec:i,components:e,Fallback:n}):null};wv.displayName=`MessagePrimitive.GenerativeUI`;var Ere=`ui://`,Dre=e=>!!e?.startsWith(Ere),Tv=e=>Symbol.iterator in e,Ev=e=>`entries`in e,Dv=(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},Ore=(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 kre(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Tv(e)&&Tv(t)?Ev(e)&&Ev(t)?Dv(e,t):Ore(e,t):Dv({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Ov(e){let t=N.useRef(void 0);return n=>{let r=e(n);return kre(t.current,r)?t.current:t.current=r}}var kv=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})}}},Are=(e,t)=>{let n=[];if(t){let t=kv(`chainOfThoughtGroup`);for(let r=0;r<e.length;r++){let i=e[r];i===`tool-call`||i===`reasoning`?t.startGroup(r):(t.endGroup(r-1,n),n.push({type:`single`,index:r}))}t.finalize(e.length-1,n)}else{let t=kv(`toolGroup`),r=kv(`reasoningGroup`);for(let i=0;i<e.length;i++){let a=e[i];a===`tool-call`?(r.endGroup(i-1,n),t.startGroup(i)):a===`reasoning`?(t.endGroup(i-1,n),r.startGroup(i)):(t.endGroup(i-1,n),r.endGroup(i-1,n),n.push({type:`single`,index:i}))}t.finalize(e.length-1,n),r.finalize(e.length-1,n)}return n},jre=e=>{let t=G(Ov(e=>e.message.parts.map(e=>e.type)));return U(()=>t.length===0?[]:Are(t,e),[t,e])},Mre=({Fallback:e,...t})=>{let n=G(n=>n.tools.toolUIs[t.toolName]?.[0]?.render??e);return n?(0,I.jsx)(n,{...t}):null},Av=(e,t,n)=>e.renderers[t]?.[0]||(e.fallbacks[0]??n),Nre=({Fallback:e,...t})=>{let n=G(n=>Av(n.dataRenderers,t.name,e));return n?(0,I.jsx)(n,{...t}):null},jv={Text:()=>null,Reasoning:()=>null,Source:()=>null,Image:()=>null,File:()=>null,Unstable_Audio:()=>null,ToolGroup:({children:e})=>e,ReasoningGroup:({children:e})=>e},Pre=({components:{Text:e=jv.Text,Reasoning:t=jv.Reasoning,Image:n=jv.Image,Source:r=jv.Source,File:i=jv.File,Unstable_Audio:a=jv.Unstable_Audio,tools:o={},data:s,generativeUI:c}={}})=>{let l=Dg(),u=G(e=>e.part),d=u.type;if(d===`tool-call`){let e=l.part().addToolResult,t=l.part().resumeToolCall,n=l.part().respondToToolApproval;if(`Override`in o)return(0,I.jsx)(o.Override,{...u,addResult:e,resume:t,respondToApproval:n});let r=o.by_name?.[u.toolName]??o.Fallback;return(0,I.jsx)(Mre,{...u,Fallback:r,addResult:e,resume:t,respondToApproval:n})}if(u.status?.type===`requires-action`)throw Error(`Encountered unexpected requires-action status`);switch(d){case`text`:return(0,I.jsx)(e,{...u});case`reasoning`:return(0,I.jsx)(t,{...u});case`source`:return(0,I.jsx)(r,{...u});case`image`:return(0,I.jsx)(n,{...u});case`file`:return(0,I.jsx)(i,{...u});case`audio`:return(0,I.jsx)(a,{...u});case`data`:{let e=s?.by_name?.[u.name]??s?.Fallback;return(0,I.jsx)(Nre,{...u,Fallback:e})}case`generative-ui`:return c?.components?(0,I.jsx)(Cv,{spec:u.spec,components:c.components,Fallback:c.Fallback}):null;default:return console.warn(`Unknown message part type: ${d}`),null}},Mv=(0,H.memo)(({index:e,components:t})=>(0,I.jsx)(o_,{index:e,children:(0,I.jsx)(Pre,{components:t})}),(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);Mv.displayName=`MessagePrimitive.PartByIndex`;var Fre=({status:e,component:t})=>(0,I.jsx)(s_,{text:``,isRunning:e.type===`running`,children:(0,I.jsx)(t,{type:`text`,text:``,status:e})}),Ire=Object.freeze({type:`complete`}),Lre=Object.freeze({type:`running`}),Nv=(0,H.memo)(({components:e})=>{let t=G(e=>e.message.status??Ire);return e?.Empty?(0,I.jsx)(e.Empty,{status:t}):t.type===`running`?(0,I.jsx)(Fre,{status:t,component:e?.Text??jv.Text}):null},(e,t)=>e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),Rre=(0,H.memo)(({components:e,enabled:t})=>G(e=>{if(!t||e.message.parts.length===0)return!1;let n=e.message.parts[e.message.parts.length-1];return n?.type!==`text`&&n?.type!==`reasoning`})?(0,I.jsx)(Nv,{components:e}):null,(e,t)=>e.enabled===t.enabled&&e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),zre=(0,H.memo)(({Quote:e})=>{let t=G(xv);return t?(0,I.jsx)(e,{text:t.text,messageId:t.messageId}):null});function Pv(e,t){return(e.toolUIs[t.toolName]?.[0]?.render??null)||(Dre(t.mcp?.app?.resourceUri)&&e.mcpApp?e.mcpApp.render:null)}var Fv=()=>{let e=Dg(),t=G(e=>e.part),n=G(e=>e.part.type===`tool-call`?Pv(e.tools,e.part):null);return!n||t.type!==`tool-call`?null:(0,I.jsx)(n,{...t,addResult:e.part().addToolResult,resume:e.part().resumeToolCall,respondToApproval:e.part().respondToToolApproval})},Iv=()=>{let e=G(e=>e.part),t=G(e=>e.part.type===`data`?Av(e.dataRenderers,e.part.name,void 0)??null:null);return!t||e.type!==`data`?null:(0,I.jsx)(t,{...e})},Bre=()=>{let e=G(e=>e.part.type);return e===`tool-call`?(0,I.jsx)(Fv,{}):e===`data`?(0,I.jsx)(Iv,{}):null},Vre=Object.freeze({type:`text`,text:``,status:Lre}),Lv=({index:e,children:t})=>{let n=Dg(),r=G(e=>e.dataRenderers);return(0,I.jsx)(o_,{index:e,children:(0,I.jsx)(Og,{getItemState:t=>t.message().part({index:e}).getState(),children:i=>t({get part(){let t=i();if(t.type===`tool-call`){let r=Pv(n.tools().getState(),t)!==null,i=n.message().part({index:e});return{...t,toolUI:r?(0,I.jsx)(Fv,{}):null,addResult:i.addToolResult,resume:i.resumeToolCall,respondToApproval:i.respondToToolApproval}}if(t.type===`data`){let e=Av(r,t.name,void 0)!==void 0;return{...t,dataRendererUI:e?(0,I.jsx)(Iv,{}):null}}return t}})})})},Hre=({children:e})=>{let t=G(e=>e.message.parts.length),n=G(e=>(e.message.status?.type??`complete`)===`running`);return t===0?t===0&&n?(0,I.jsx)(s_,{text:``,isRunning:!0,children:e({part:Vre})}):null:(0,I.jsx)(I.Fragment,{children:Array.from({length:t},(t,n)=>(0,I.jsx)(Lv,{index:n,children:t=>e(t)??(0,I.jsx)(Bre,{})},n))})},Rv=({components:e,unstable_showEmptyOnNonTextEnd:t=!0,children:n})=>n?(0,I.jsx)(Hre,{children:n}):(0,I.jsx)(Ure,{components:e,unstable_showEmptyOnNonTextEnd:t});Rv.displayName=`MessagePrimitive.Parts`;var Ure=({components:e,unstable_showEmptyOnNonTextEnd:t})=>{let n=G(e=>e.message.parts.length),r=jre(!!e?.ChainOfThought),i=U(()=>n===0?(0,I.jsx)(Nv,{components:e}):r.map(t=>{if(t.type===`single`)return(0,I.jsx)(Mv,{index:t.index,components:e},t.index);if(t.type===`chainOfThoughtGroup`){let n=e?.ChainOfThought;return n?(0,I.jsx)(Bne,{startIndex:t.startIndex,endIndex:t.endIndex,children:(0,I.jsx)(n,{})},`chainOfThought-${t.startIndex}`):null}else if(t.type===`toolGroup`)return(0,I.jsx)(e?.ToolGroup??jv.ToolGroup,{startIndex:t.startIndex,endIndex:t.endIndex,children:Array.from({length:t.endIndex-t.startIndex+1},(n,r)=>{let i=t.startIndex+r;return(0,I.jsx)(Mv,{index:i,components:e},`part-${i}`)})},`tool-${t.startIndex}`);else return(0,I.jsx)(e?.ReasoningGroup??jv.ReasoningGroup,{startIndex:t.startIndex,endIndex:t.endIndex,children:Array.from({length:t.endIndex-t.startIndex+1},(n,r)=>{let i=t.startIndex+r;return(0,I.jsx)(Mv,{index:i,components:e},`part-${i}`)})},`reasoning-${t.startIndex}`)}),[r,e,n]);return(0,I.jsxs)(I.Fragment,{children:[e?.Quote&&(0,I.jsx)(zre,{Quote:e.Quote}),i,(0,I.jsx)(Rre,{components:e,enabled:t})]})},Wre=Symbol.for(`@assistant-ui/groupBy.memoKey`),zv=e=>{let t=e.nextChildIdx++;return e.nodeKey===``?String(t):`${e.nodeKey}.${t}`},Gre=e=>{let t={key:``,nodeKey:``,indices:[],children:[],nextChildIdx:0},n=[t],r=()=>{let e=n.pop();n[n.length-1].children.push({type:`group`,key:e.key,nodeKey:e.nodeKey,indices:e.indices,children:e.children})};for(let t=0;t<e.length;t++){let i=e[t],a=0;for(;a<n.length-1&&a<i.length&&n[a+1].key===i[a];)a++;for(;n.length-1>a;)r();for(;n.length-1<i.length;){let e=n[n.length-1];n.push({key:i[n.length-1],nodeKey:zv(e),indices:[],children:[],nextChildIdx:0})}let o=n[n.length-1];o.children.push({type:`part`,index:t,nodeKey:zv(o)});for(let e=1;e<n.length;e++)n[e].indices.push(t)}for(;n.length>1;)r();return t.children},Kre=Object.freeze({type:`complete`}),qre=(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`}}},Bv=()=>{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.")},Vv=(e,t,n)=>{if(e.type===`part`)return(0,I.jsx)(Lv,{index:e.index,children:({part:e})=>n({part:e,children:(0,I.jsx)(Bv,{})})},`part-${e.index}`);let r=t[e.indices.at(-1)]?.status??Kre;return(0,I.jsx)(H.Fragment,{children:n({part:{type:e.key,status:r,indices:e.indices},children:(0,I.jsx)(I.Fragment,{children:e.children.map(e=>Vv(e,t,n))})})},e.nodeKey)},Hv=({groupBy:e,indicator:t=`no-text`,children:n})=>{let r=G(Ov(e=>e.message.parts)),i=G(e=>e.tools.toolUIs),a=G(e=>t===`never`?!1:e.message.status?.type===`running`);return(0,I.jsxs)(I.Fragment,{children:[U(()=>{let t={toolUIs:i};return Gre(r.map(n=>e(n,t)??[]))},[r,e[Wre]??e,i]).map(e=>Vv(e,r,n)),qre(t,r,a)&&n({part:{type:`indicator`},children:(0,I.jsx)(Bv,{})})]})};Hv.displayName=`MessagePrimitive.GroupedParts`;var Uv=(0,H.memo)(({children:e})=>{let t=G(xv);return t?(0,I.jsx)(I.Fragment,{children:e(t)}):null});Uv.displayName=`MessagePrimitive.Quote`;var Wv=(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}},Jre=({components:e})=>{let t=G(e=>e.attachment);if(!t)return null;let n=Wv(e,t);return n?(0,I.jsx)(n,{}):null},Gv=(0,H.memo)(({index:e,components:t})=>(0,I.jsx)(r_,{index:e,children:(0,I.jsx)(Jre,{components:t})}),(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);Gv.displayName=`MessagePrimitive.AttachmentByIndex`;var Kv=({children:e})=>{let t=G(e=>e.message.role===`user`?(e.message.attachments??[]).length:0);return U(()=>Array.from({length:t},(t,n)=>(0,I.jsx)(r_,{index:n,children:(0,I.jsx)(Og,{getItemState:e=>e.message().attachment({index:n}).getState(),children:t=>e({get attachment(){return t()}})})},n)),[t,e])},qv=({components:e,children:t})=>e?(0,I.jsx)(Kv,{children:({attachment:t})=>{let n=Wv(e,t);return n?(0,I.jsx)(n,{}):null}}):(0,I.jsx)(Kv,{children:t});qv.displayName=`MessagePrimitive.Attachments`;var Jv=(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}},Yre=({components:e})=>{let t=G(e=>e.attachment);if(!t)return null;let n=Jv(e,t);return n?(0,I.jsx)(n,{}):null},Yv=(0,H.memo)(({index:e,components:t})=>(0,I.jsx)(i_,{index:e,children:(0,I.jsx)(Yre,{components:t})}),(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);Yv.displayName=`ComposerPrimitive.AttachmentByIndex`;var Xv=({children:e})=>{let t=G(e=>e.composer.attachments.length);return U(()=>Array.from({length:t},(t,n)=>(0,I.jsx)(i_,{index:n,children:(0,I.jsx)(Og,{getItemState:e=>e.composer().attachment({index:n}).getState(),children:t=>e({get attachment(){return t()}})})},n)),[t,e])},Zv=({components:e,children:t})=>e?(0,I.jsx)(Xv,{children:({attachment:t})=>{let n=Jv(e,t);return n?(0,I.jsx)(n,{}):null}}):(0,I.jsx)(Xv,{children:t});Zv.displayName=`ComposerPrimitive.Attachments`;var Qv=(0,H.memo)(({children:e})=>{let t=G(e=>e.composer.queue.length);return U(()=>Array.from({length:t},(t,n)=>(0,I.jsx)(Vne,{index:n,children:(0,I.jsx)(Og,{getItemState:e=>e.composer().queueItem({index:n}).getState(),children:t=>e({get queueItem(){return t()}})})},n)),[t,e])});Qv.displayName=`ComposerPrimitive.Queue`;var $v=({children:e})=>G(e=>e.part.status.type===`running`)?e:null;$v.displayName=`MessagePartPrimitive.InProgress`;var ey=({components:e})=>{let t=e.Suggestion;return(0,I.jsx)(t,{})},ty=(0,H.memo)(({index:e,components:t})=>(0,I.jsx)(c_,{index:e,children:(0,I.jsx)(ey,{components:t})}),(e,t)=>e.index===t.index&&e.components.Suggestion===t.components.Suggestion);ty.displayName=`ThreadPrimitive.SuggestionByIndex`;var ny=({children:e})=>{let t=G(e=>e.suggestions.suggestions.length);return U(()=>t===0?null:Array.from({length:t},(t,n)=>(0,I.jsx)(c_,{index:n,children:(0,I.jsx)(Og,{getItemState:e=>e.suggestions().suggestion({index:n}).getState(),children:t=>e({get suggestion(){return t()}})})},n)),[t,e])},ry=({components:e,children:t})=>e?(0,I.jsx)(ny,{children:()=>(0,I.jsx)(ey,{components:e})}):(0,I.jsx)(ny,{children:t});ry.displayName=`ThreadPrimitive.Suggestions`;var Xre=(0,H.memo)(ry,(e,t)=>e.children||t.children?e.children===t.children:e.components.Suggestion===t.components.Suggestion),Zre=e=>G(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)}),iy=({children:e,...t})=>Zre(t)?e:null;iy.displayName=`ComposerPrimitive.If`;var Qre=()=>{let e=Dg(),t=G(e=>!e.composer.canSend||e.thread.isRunning&&!e.thread.capabilities.queue);return{send:W(t=>{e.composer().send(t)},[e]),disabled:t}},$re=()=>{let e=Dg(),t=G(e=>!e.composer.canCancel);return{cancel:W(()=>{e.composer().cancel()},[e]),disabled:t}},eie=()=>{let e=Dg(),t=G(e=>e.composer.dictation!=null||!e.thread.capabilities.dictation||!e.composer.isEditing);return{startDictation:W(()=>{e.composer().startDictation()},[e]),disabled:t}},tie=()=>{let e=Dg(),t=G(e=>!e.composer.isEditing);return{addAttachment:W(t=>e.composer().addAttachment(t),[e]),disabled:t}},nie=({copiedDuration:e=3e3,copyToClipboard:t}={})=>{let n=Dg(),r=G(e=>!((e.message.role!==`assistant`||e.message.status?.type!==`running`)&&e.message.parts.some(e=>e.type===`text`&&e.text.length>0))),i=G(e=>e.message.isCopied),a=G(e=>e.composer.isEditing),o=G(e=>e.composer.text);return{copy:W(()=>{let r=a?o:n.message().getCopyText();if(!r)return;let i=t??(()=>{});Promise.resolve(i(r)).then(()=>{n.message().setIsCopied(!0),setTimeout(()=>n.message().setIsCopied(!1),e)},()=>{})},[n,a,o,e,t]),disabled:r,isCopied:i}},rie=()=>{let e=Dg(),t=G(e=>e.composer.isEditing);return{edit:W(()=>{e.composer().beginEdit()},[e]),disabled:t}},iie=()=>{let e=Dg(),t=G(e=>e.thread.isRunning||e.thread.isDisabled||e.message.role!==`assistant`);return{reload:W(()=>{e.message().reload()},[e]),disabled:t}},aie=()=>{let e=Dg(),t=G(e=>e.message.metadata.submittedFeedback?.type===`positive`);return{submit:W(()=>{e.message().submitFeedback({type:`positive`})},[e]),isSubmitted:t}},oie=()=>{let e=Dg(),t=G(e=>e.message.metadata.submittedFeedback?.type===`negative`);return{submit:W(()=>{e.message().submitFeedback({type:`negative`})},[e]),isSubmitted:t}},sie=()=>{let e=Dg(),t=G(e=>!((e.message.role!==`assistant`||e.message.status?.type!==`running`)&&e.message.parts.some(e=>e.type===`text`&&e.text.length>0)));return{speak:W(async()=>{e.message().speak()},[e]),disabled:t}},cie=()=>{let e=Dg(),t=G(e=>e.message.speech==null);return{stopSpeaking:W(()=>{e.message().stopSpeaking()},[e]),disabled:t}},lie=({prompt:e,send:t,clearComposer:n=!0})=>{let r=Dg(),i=G(e=>e.thread.isDisabled),a=t??!1;return{trigger:W(()=>{let t=r.thread().getState().isRunning;if(a&&!t)r.thread().append({content:[{type:`text`,text:e}],runConfig:r.composer().getState().runConfig}),n&&r.composer().setText(``);else if(n)r.composer().setText(e);else{let t=r.composer().getState().text;r.composer().setText(t.trim()?`${t} ${e}`:e)}},[r,a,n,e]),disabled:i}},uie=()=>G(e=>e.message.status?.type===`incomplete`&&e.message.status.reason===`error`?e.message.status.error??`An error occurred`:void 0),die=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}},fie=/:([\w-]{1,64})\[([^\]\n]{1,1024})\](?:\{name=([^}\n]{1,1024})\})?/gu,ay={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(fie)){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 pie(e,t){function n(n){let r=Eh(e);if(!n?.optional&&!r)throw Error(`This component must be used within ${t}.`);return r}return n}function oy(e,t){function n(n){let r=e(n);return r?r[t]:null}function r(e){let t=!1,r;typeof e==`function`?r=e:e&&typeof e==`object`&&(t=!!e.optional,r=e.selector);let i=n({optional:t});return i?r?i(r):i():null}return{[t]:r,[`${t}Store`]:n}}var sy=(0,H.createContext)(null),{useThreadViewport:cy,useThreadViewportStore:ly}=oy(pie(sy,`ThreadPrimitive.Viewport`),`useThreadViewport`),uy=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()}}}}},mie=(e={})=>{let t=new Set,n=uy(e=>{a.setState({height:{...a.getState().height,viewport:e}})}),r=uy(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=zg(()=>({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},dy=e=>e,hie=e=>{let t=ly({optional:!0}),[n]=bh(()=>mie(e));return Sh(()=>t?.getState().onScrollToBottom(()=>{n.getState().scrollToBottom()}),[t,n]),Sh(()=>{if(t)return n.subscribe(e=>{t.getState().isAtBottom!==e.isAtBottom&&dy(t).setState({isAtBottom:e.isAtBottom})})},[n,t]),n},fy=({children:e,options:t={}})=>{let n=hie(t),[r]=bh(()=>({useThreadViewport:n}));return(0,I.jsx)(sy.Provider,{value:r,children:e})},gie=()=>(Sh(()=>{},[Dg()]),null),_ie=(0,H.memo)(({children:e,aui:t,runtime:n})=>(0,I.jsxs)(sne,{runtime:n,aui:t??null,children:[(0,I.jsx)(gie,{}),(0,I.jsx)(fy,{children:e})]})),vie=e=>{let t=e;t.__isBound||=(t.__internal_bindMethods?.(),!0)};function yie(e,t=bie){vie(e);let n=(0,H.useSyncExternalStore)(e.subscribe,()=>t(e.getState()),()=>t(e.getState()));return(0,H.useDebugValue)(n),n}var bie=e=>e;function py(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?yie(i,r):null}return t}function xie(e){let t=Dg(),n=G(()=>t.attachment.source?t.attachment().__internal_getRuntime?.()??null:null);if(!n&&!e?.optional)throw Error(`AttachmentRuntime is not available`);return n}var my=py(xie);function hy(e){let t=Dg(),n=G(()=>t.composer.source?t.composer().__internal_getRuntime?.()??null:null);if(!n&&!e?.optional)throw Error(`ComposerRuntime is not available`);return n}var Sie=py(hy);function Cie(e){let t=Dg(),n=G(()=>t.message.source?t.message().__internal_getRuntime?.()??null:null);if(!n&&!e?.optional)throw Error(`MessageRuntime is not available`);return n}var gy=py(Cie);function wie(e){let t=Dg(),n=G(()=>t.thread.source?t.thread().__internal_getRuntime?.()??null:null);if(!n&&!e?.optional)throw Error(`ThreadRuntime is not available`);return n}var Tie=py(wie);function _y(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function vy(...e){return t=>{let n=!1,r=e.map(e=>{let r=_y(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():_y(e[t],null)}}}}function yy(...e){return N.useCallback(vy(...e),e)}var by=Object.defineProperty,xy=(e,t)=>{let n={};for(var r in e)by(n,r,{get:e[r],enumerable:!0});return t||by(n,Symbol.toStringTag,{value:`Module`}),n};function Sy(e){let t=N.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Ey(r)&&typeof Dy==`function`&&(r=Dy(r._payload)),N.Children.forEach(r,e=>{if(kie(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ey(n)&&typeof Dy==`function`&&(n=Dy(n._payload)),a=Eie(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=N.cloneElement(a,void 0,s):!o&&N.Children.count(r)===1&&N.isValidElement(r)&&(a=r);let c=a?Oie(a):void 0,l=yy(n,c);if(!a){if(r||r===0)throw Error(o?Nie(e):Mie(e));return r}let u=Die(i,a.props??{});return a.type!==N.Fragment&&(u.ref=n?l:c),N.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var Cy=Sy(`Slot`),wy=Symbol.for(`radix.slottable`);function Ty(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=wy,t}var Eie=(e,t)=>{if(`child`in e.props){let t=e.props.child;return N.isValidElement(t)?N.cloneElement(t,void 0,e.props.children(t.props.children)):null}return N.isValidElement(t)?t:null};function Die(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 Oie(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 kie(e){return N.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===wy}var Aie=Symbol.for(`react.lazy`);function Ey(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Aie&&`_payload`in e&&jie(e._payload)}function jie(e){return typeof e==`object`&&!!e&&`then`in e}var Mie=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Nie=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Dy=N.use,Oy=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Sy(`Primitive.${t}`),r=N.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ky(e,t){e&&ls.flushSync(()=>e.dispatchEvent(t))}var Pie=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`];function Fie(e){let t=(0,H.forwardRef)(({render:t,asChild:n,children:r,...i},a)=>{let o=e;if(t&&(0,H.isValidElement)(t)){let e=r===void 0?t.props.children:r;return(0,I.jsx)(o,{...i,asChild:!0,ref:a,children:(0,H.cloneElement)(t,void 0,e)})}return(0,I.jsx)(o,{...i,asChild:n,ref:a,children:r})});return t.displayName=typeof e==`string`?e:e.displayName??e.name??`Component`,t}function Iie(e){let t=Oy[e],n=Fie(t);return n.displayName=`Primitive.${e}`,n}var Ay=Pie.reduce((e,t)=>(e[t]=Iie(t),e),{}),Lie=({hideWhenRunning:e,autohide:t,autohideFloat:n,forceVisible:r})=>G(i=>{if(e&&i.thread.isRunning)return`hidden`;let a=t===`always`||t===`not-last`&&!i.message.isLast,o=r||i.message.isHovering;return a?o?n===`always`||n===`single-branch`&&i.message.branchCount<=1?`floating`:`normal`:`hidden`:`normal`}),Rie=(0,H.createContext)(null),jy=(0,H.forwardRef)(({hideWhenRunning:e,autohide:t,autohideFloat:n,...r},i)=>{let[a,o]=bh(0),s=W(()=>{let e=!1;return o(e=>e+1),()=>{e||(e=!0,o(e=>Math.max(0,e-1)))}},[]),c=U(()=>({acquireInteractionLock:s}),[s]),l=Lie({hideWhenRunning:e,autohide:t,autohideFloat:n,forceVisible:a>0});return l===`hidden`?null:(0,I.jsx)(Rie.Provider,{value:c,children:(0,I.jsx)(Ay.div,{...l===`floating`?{"data-floating":`true`}:null,...r,ref:i})})});jy.displayName=`ActionBarPrimitive.Root`,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 zie=({copiedDuration:e=3e3}={})=>{let{copy:t,disabled:n}=nie({copiedDuration:e,copyToClipboard:e=>typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API is unavailable`)):navigator.clipboard.writeText(e)});return n?null:t},My=(0,H.forwardRef)(({copiedDuration:e,onClick:t,disabled:n,...r},i)=>{let a=G(e=>e.message.isCopied),o=zie({copiedDuration:e});return(0,I.jsx)(Ay.button,{type:`button`,...a?{"data-copied":`true`}:{},...r,ref:i,disabled:n||!o,onClick:K(t,()=>{o?.()})})});My.displayName=`ActionBarPrimitive.Copy`;var Ny=(e,t,n=[])=>{let r=(0,H.forwardRef)((e,r)=>{let i={},a={};Object.keys(e).forEach(t=>{n.includes(t)?i[t]=e[t]:a[t]=e[t]});let o=t(i)??void 0;return(0,I.jsx)(Ay.button,{...a,type:`button`,ref:r,disabled:a.disabled||!o,onClick:K(a.onClick,o)})});return r.displayName=e,r},Bie=Ny(`ActionBarPrimitive.Reload`,()=>{let{disabled:e,reload:t}=iie();return e?null:t}),Vie=Ny(`ActionBarPrimitive.Edit`,()=>{let{disabled:e,edit:t}=rie();return e?null:t}),Hie=Ny(`ActionBarPrimitive.Speak`,()=>{let{disabled:e,speak:t}=sie();return e?null:t});function Py(e){let t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>((...e)=>t.current?.(...e)),[])}function Fy(e,t=globalThis?.document){let n=Py(e);N.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 Uie=()=>{let{disabled:e,stopSpeaking:t}=cie();return e?null:t},Iy=(0,H.forwardRef)((e,t)=>{let n=Uie();return Fy(e=>{n&&(e.preventDefault(),n())}),(0,I.jsx)(Ay.button,{type:`button`,disabled:!n,...e,ref:t,onClick:K(e.onClick,()=>{n?.()})})});Iy.displayName=`ActionBarPrimitive.StopSpeaking`;var Wie=()=>{let{submit:e}=aie();return e},Ly=(0,H.forwardRef)(({onClick:e,disabled:t,...n},r)=>{let i=G(e=>e.message.metadata.submittedFeedback?.type===`positive`),a=Wie();return(0,I.jsx)(Ay.button,{type:`button`,...i?{"data-submitted":`true`}:{},...n,ref:r,disabled:t||!a,onClick:K(e,()=>{a?.()})})});Ly.displayName=`ActionBarPrimitive.FeedbackPositive`;var Gie=()=>{let{submit:e}=oie();return e},Ry=(0,H.forwardRef)(({onClick:e,disabled:t,...n},r)=>{let i=G(e=>e.message.metadata.submittedFeedback?.type===`negative`),a=Gie();return(0,I.jsx)(Ay.button,{type:`button`,...i?{"data-submitted":`true`}:{},...n,ref:r,disabled:t||!a,onClick:K(e,()=>{a?.()})})});Ry.displayName=`ActionBarPrimitive.FeedbackNegative`;var Kie=({filename:e,onExport:t}={})=>{let n=Dg(),r=G(e=>(e.message.role!==`assistant`||e.message.status?.type!==`running`)&&e.message.parts.some(e=>e.type===`text`&&e.text.length>0)),i=W(async()=>{let r=n.message().getCopyText();if(!r)return;if(t){await t(r);return}let i=new Blob([r],{type:`text/markdown`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e??`message-${Date.now()}.md`,o.click(),URL.revokeObjectURL(a)},[n,e,t]);return r?i:null},zy=(0,H.forwardRef)(({filename:e,onExport:t,onClick:n,disabled:r,...i},a)=>{let o=Kie({filename:e,onExport:t});return(0,I.jsx)(Ay.button,{type:`button`,...i,ref:a,disabled:r||!o,onClick:K(n,()=>{o?.()})})});zy.displayName=`ActionBarPrimitive.ExportMarkdown`;var By=xy({Copy:()=>My,Edit:()=>Vie,ExportMarkdown:()=>zy,FeedbackNegative:()=>Ry,FeedbackPositive:()=>Ly,Reload:()=>Bie,Root:()=>jy,Speak:()=>Hie,StopSpeaking:()=>Iy}),Vy=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`}),qie=`VisuallyHidden`,Hy=N.forwardRef((e,t)=>(0,I.jsx)(Oy.span,{...e,ref:t,style:{...Vy,...e.style}}));Hy.displayName=qie;var Jie=Hy;function Yie(e,t){let n=N.createContext(t);n.displayName=e+`Context`;let r=e=>{let{children:t,...r}=e,i=N.useMemo(()=>r,Object.values(r));return(0,I.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=N.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Uy(e,t=[]){let n=[];function r(t,r){let i=N.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=N.useMemo(()=>o,Object.values(o));return(0,I.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=N.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=>N.createContext(e));return function(n){let r=n?.[e]||t;return N.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Xie(i,...t)]}function Xie(...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 N.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Wy(e){let t=e+`CollectionProvider`,[n,r]=Uy(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=N.useRef(null),a=N.useRef(new Map).current;return(0,I.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Sy(s),l=N.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,I.jsx)(c,{ref:yy(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Sy(u),p=N.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=N.useRef(null),s=yy(t,o),c=a(u,n);return N.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,I.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return N.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 Gy=globalThis?.document?N.useLayoutEffect:()=>{},Zie=N.useInsertionEffect||Gy;function Ky({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Qie({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=N.useRef(e!==void 0);N.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,N.useCallback(t=>{if(s){let n=$ie(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Qie({defaultProp:e,onChange:t}){let[n,r]=N.useState(e),i=N.useRef(n),a=N.useRef(t);return Zie(()=>{a.current=t},[t]),N.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function $ie(e){return typeof e==`function`}function eae(e,t){return N.useReducer((e,n)=>t[e][n]??e,e)}var qy=e=>{let{present:t,children:n}=e,r=tae(t),i=typeof n==`function`?n({present:r.isPresent}):N.Children.only(n),a=nae(r.ref,rae(i));return typeof n==`function`||r.isPresent?N.cloneElement(i,{ref:a}):null};qy.displayName=`Presence`;function tae(e){let[t,n]=N.useState(),r=N.useRef(null),i=N.useRef(e),a=N.useRef(`none`),[o,s]=eae(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return N.useEffect(()=>{let e=Yy(r.current);a.current=o===`mounted`?e:`none`},[o]),Gy(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Yy(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Gy(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Yy(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=Yy(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:N.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Jy(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function nae(...e){let t=N.useRef(e);return t.current=e,N.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Jy(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():Jy(n[e],null)}}},[])}function Yy(e){return e?.animationName||`none`}function rae(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 iae=N.useId||(()=>void 0),aae=0;function Xy(e){let[t,n]=N.useState(iae());return Gy(()=>{e||n(e=>e??String(aae++))},[e]),e||(t?`radix-${t}`:``)}var oae=N.createContext(void 0);function Zy(e){let t=N.useContext(oae);return e||t||`ltr`}var sae=`DismissableLayer`,Qy=`dismissableLayer.update`,cae=`dismissableLayer.pointerDownOutside`,lae=`dismissableLayer.focusOutside`,$y,eb=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tb=N.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=N.useContext(eb),[u,d]=N.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=N.useState({}),m=yy(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=fae(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=pae(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Fy(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),N.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&($y=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),nb(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(u),l.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=$y))}},[u,f,n,l]),N.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),nb())},[u,l]),N.useEffect(()=>{let e=()=>p({});return document.addEventListener(Qy,e),()=>document.removeEventListener(Qy,e)},[]),(0,I.jsx)(Oy.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)})});tb.displayName=sae;var uae=`DismissableLayerBranch`,dae=N.forwardRef((e,t)=>{let n=N.useContext(eb),r=N.useRef(null),i=yy(t,r);return N.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,I.jsx)(Oy.div,{...e,ref:i})});dae.displayName=uae;function fae(e,t=globalThis?.document){let n=Py(e),r=N.useRef(!1),i=N.useRef(()=>{});return N.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){rb(cae,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 pae(e,t=globalThis?.document){let n=Py(e),r=N.useRef(!1);return N.useEffect(()=>{let e=e=>{e.target&&!r.current&&rb(lae,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 nb(){let e=new CustomEvent(Qy);document.dispatchEvent(e)}function rb(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?ky(i,a):i.dispatchEvent(a)}var ib=`focusScope.autoFocusOnMount`,ab=`focusScope.autoFocusOnUnmount`,ob={bubbles:!1,cancelable:!0},mae=`FocusScope`,sb=N.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=N.useState(null),l=Py(i),u=Py(a),d=N.useRef(null),f=yy(t,e=>c(e)),p=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ub(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ub(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ub(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]),N.useEffect(()=>{if(s){db.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ib,ob);s.addEventListener(ib,l),s.dispatchEvent(t),t.defaultPrevented||(hae(bae(cb(s)),{select:!0}),document.activeElement===e&&ub(s))}return()=>{s.removeEventListener(ib,l),setTimeout(()=>{let t=new CustomEvent(ab,ob);s.addEventListener(ab,u),s.dispatchEvent(t),t.defaultPrevented||ub(e??document.body,{select:!0}),s.removeEventListener(ab,u),db.remove(p)},0)}}},[s,l,u,p]);let m=N.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]=gae(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ub(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ub(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,I.jsx)(Oy.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});sb.displayName=mae;function hae(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ub(r,{select:t}),document.activeElement!==n)return}function gae(e){let t=cb(e);return[lb(t,e),lb(t.reverse(),e)]}function cb(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 lb(e,t){for(let n of e)if(!_ae(n,{upTo:t}))return n}function _ae(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 vae(e){return e instanceof HTMLInputElement&&`select`in e}function ub(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vae(e)&&t&&e.select()}}var db=yae();function yae(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=fb(e,t),e.unshift(t)},remove(t){e=fb(e,t),e[0]?.resume()}}}function fb(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bae(e){return e.filter(e=>e.tagName!==`A`)}var xae=`Portal`,pb=N.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=N.useState(!1);Gy(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ls.createPortal((0,I.jsx)(Oy.div,{...r,ref:t}),o):null});pb.displayName=xae;var mb=0,hb=null;function gb(){N.useEffect(()=>{hb||={start:_b(),end:_b()};let{start:e,end:t}=hb;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),mb++,()=>{mb===1&&(hb?.start.remove(),hb?.end.remove(),hb=null),mb=Math.max(0,mb-1)}},[])}function _b(){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 vb=function(){return vb=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},vb.apply(this,arguments)};function yb(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 Sae(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 bb=`right-scroll-bar-position`,xb=`width-before-scroll-bar`,Cae=`with-scroll-bars-hidden`,wae=`--removed-body-scroll-bar-size`;function Sb(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Tae(e,t){var n=(0,N.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 Eae=typeof window<`u`?N.useLayoutEffect:N.useEffect,Cb=new WeakMap;function Dae(e,t){var n=Tae(t||null,function(t){return e.forEach(function(e){return Sb(e,t)})});return Eae(function(){var t=Cb.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Sb(e,null)}),i.forEach(function(e){r.has(e)||Sb(e,a)})}Cb.set(n,e)},[e]),n}function Oae(e){return e}function kae(e,t){t===void 0&&(t=Oae);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 Aae(e){e===void 0&&(e={});var t=kae(null);return t.options=vb({async:!0,ssr:!1},e),t}var wb=function(e){var t=e.sideCar,n=yb(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 N.createElement(r,vb({},n))};wb.isSideCarExport=!0;function jae(e,t){return e.useMedium(t),wb}var Tb=Aae(),Eb=function(){},Db=N.forwardRef(function(e,t){var n=N.useRef(null),r=N.useState({onScrollCapture:Eb,onWheelCapture:Eb,onTouchMoveCapture:Eb}),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=yb(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Dae([n,t]),C=vb(vb({},b),i);return N.createElement(N.Fragment,null,u&&N.createElement(x,{sideCar:Tb,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?N.cloneElement(N.Children.only(s),vb(vb({},C),{ref:S})):N.createElement(v,vb({},C,{className:c,ref:S}),s))});Db.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Db.classNames={fullWidth:xb,zeroRight:bb};var Ob,Mae=function(){if(Ob)return Ob;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Nae(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Mae();return t&&e.setAttribute(`nonce`,t),e}function Pae(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Fae(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Iae=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Nae())&&(Pae(t,n),Fae(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Lae=function(){var e=Iae();return function(t,n){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},kb=function(){var e=Lae();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Rae={left:0,top:0,right:0,gap:0},Ab=function(e){return parseInt(e||``,10)||0},zae=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[Ab(n),Ab(r),Ab(i)]},Bae=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Rae;var t=zae(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])}},Vae=kb(),jb=`data-scroll-locked`,Hae=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
78
|
+
.${Cae} {
|
|
79
|
+
overflow: hidden ${r};
|
|
80
|
+
padding-right: ${s}px ${r};
|
|
81
|
+
}
|
|
82
|
+
body[${jb}] {
|
|
83
|
+
overflow: hidden ${r};
|
|
84
|
+
overscroll-behavior: contain;
|
|
85
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
86
|
+
padding-left: ${i}px;
|
|
87
|
+
padding-top: ${a}px;
|
|
88
|
+
padding-right: ${o}px;
|
|
89
|
+
margin-left:0;
|
|
90
|
+
margin-top:0;
|
|
91
|
+
margin-right: ${s}px ${r};
|
|
92
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.${bb} {
|
|
96
|
+
right: ${s}px ${r};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.${xb} {
|
|
100
|
+
margin-right: ${s}px ${r};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.${bb} .${bb} {
|
|
104
|
+
right: 0 ${r};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.${xb} .${xb} {
|
|
108
|
+
margin-right: 0 ${r};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
body[${jb}] {
|
|
112
|
+
${wae}: ${s}px;
|
|
113
|
+
}
|
|
114
|
+
`},Mb=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Uae=function(){N.useEffect(function(){return document.body.setAttribute(jb,(Mb()+1).toString()),function(){var e=Mb()-1;e<=0?document.body.removeAttribute(jb):document.body.setAttribute(jb,e.toString())}},[])},Wae=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Uae();var a=N.useMemo(function(){return Bae(i)},[i]);return N.createElement(Vae,{styles:Hae(a,!t,i,n?``:`!important`)})},Nb=!1;if(typeof window<`u`)try{var Pb=Object.defineProperty({},"passive",{get:function(){return Nb=!0,!0}});window.addEventListener(`test`,Pb,Pb),window.removeEventListener(`test`,Pb,Pb)}catch{Nb=!1}var Fb=Nb?{passive:!1}:!1,Gae=function(e){return e.tagName===`TEXTAREA`},Ib=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Gae(e)&&n[t]===`visible`)},Kae=function(e){return Ib(e,`overflowY`)},qae=function(e){return Ib(e,`overflowX`)},Lb=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Rb(e,r)){var i=zb(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Jae=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Yae=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Rb=function(e,t){return e===`v`?Kae(t):qae(t)},zb=function(e,t){return e===`v`?Jae(t):Yae(t)},Xae=function(e,t){return e===`h`&&t===`rtl`?-1:1},Zae=function(e,t,n,r,i){var a=Xae(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=zb(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Rb(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},Bb=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vb=function(e){return[e.deltaX,e.deltaY]},Hb=function(e){return e&&`current`in e?e.current:e},Qae=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$ae=function(e){return`
|
|
115
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
116
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
117
|
+
`},eoe=0,Ub=[];function toe(e){var t=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),i=N.useState(eoe++)[0],a=N.useState(kb)[0],o=N.useRef(e);N.useEffect(function(){o.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Sae([e.lockRef.current],(e.shards||[]).map(Hb),!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=N.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Bb(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=Lb(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Lb(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 Zae(h,t,e,h===`h`?s:c,!0)},[]),c=N.useCallback(function(e){var n=e;if(!(!Ub.length||Ub[Ub.length-1]!==a)){var r=`deltaY`in n?Vb(n):Bb(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Qae(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Hb).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=N.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:noe(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=N.useCallback(function(e){n.current=Bb(e),r.current=void 0},[]),d=N.useCallback(function(t){l(t.type,Vb(t),t.target,s(t,e.lockRef.current))},[]),f=N.useCallback(function(t){l(t.type,Bb(t),t.target,s(t,e.lockRef.current))},[]);N.useEffect(function(){return Ub.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Fb),document.addEventListener(`touchmove`,c,Fb),document.addEventListener(`touchstart`,u,Fb),function(){Ub=Ub.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Fb),document.removeEventListener(`touchmove`,c,Fb),document.removeEventListener(`touchstart`,u,Fb)}},[]);var p=e.removeScrollBar,m=e.inert;return N.createElement(N.Fragment,null,m?N.createElement(a,{styles:$ae(i)}):null,p?N.createElement(Wae,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function noe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var roe=jae(Tb,toe),Wb=N.forwardRef(function(e,t){return N.createElement(Db,vb({},e,{ref:t,sideCar:roe}))});Wb.classNames=Db.classNames;var ioe=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Gb=new WeakMap,Kb=new WeakMap,qb={},Jb=0,Yb=function(e){return e&&(e.host||Yb(e.parentNode))},aoe=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Yb(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})},ooe=function(e,t,n,r){var i=aoe(t,Array.isArray(e)?e:[e]);qb[n]||(qb[n]=new WeakMap);var a=qb[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=(Gb.get(e)||0)+1,l=(a.get(e)||0)+1;Gb.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Kb.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(),Jb++,function(){o.forEach(function(e){var t=Gb.get(e)-1,i=a.get(e)-1;Gb.set(e,t),a.set(e,i),t||(Kb.has(e)||e.removeAttribute(r),Kb.delete(e)),i||e.removeAttribute(n)}),Jb--,Jb||(Gb=new WeakMap,Gb=new WeakMap,Kb=new WeakMap,qb={})}},Xb=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ioe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ooe(r,i,n,`aria-hidden`)):function(){return null}},Zb=`Dialog`,[Qb,$b]=Uy(Zb),[soe,ex]=Qb(Zb),tx=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=N.useRef(null),c=N.useRef(null),[l,u]=Ky({prop:r,defaultProp:i??!1,onChange:a,caller:Zb});return(0,I.jsx)(soe,{scope:t,triggerRef:s,contentRef:c,contentId:Xy(),titleId:Xy(),descriptionId:Xy(),open:l,onOpenChange:u,onOpenToggle:N.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};tx.displayName=Zb;var nx=`DialogTrigger`,rx=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ex(nx,n),a=yy(t,i.triggerRef);return(0,I.jsx)(Oy.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":vx(i.open),...r,ref:a,onClick:K(e.onClick,i.onOpenToggle)})});rx.displayName=nx;var ix=`DialogPortal`,[coe,ax]=Qb(ix,{forceMount:void 0}),ox=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ex(ix,t);return(0,I.jsx)(coe,{scope:t,forceMount:n,children:N.Children.map(r,e=>(0,I.jsx)(qy,{present:n||a.open,children:(0,I.jsx)(pb,{asChild:!0,container:i,children:e})}))})};ox.displayName=ix;var sx=`DialogOverlay`,cx=N.forwardRef((e,t)=>{let n=ax(sx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ex(sx,e.__scopeDialog);return a.modal?(0,I.jsx)(qy,{present:r||a.open,children:(0,I.jsx)(uoe,{...i,ref:t})}):null});cx.displayName=sx;var loe=Sy(`DialogOverlay.RemoveScroll`),uoe=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ex(sx,n);return(0,I.jsx)(Wb,{as:loe,allowPinchZoom:!0,shards:[i.contentRef],children:(0,I.jsx)(Oy.div,{"data-state":vx(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),lx=`DialogContent`,ux=N.forwardRef((e,t)=>{let n=ax(lx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ex(lx,e.__scopeDialog);return(0,I.jsx)(qy,{present:r||a.open,children:a.modal?(0,I.jsx)(doe,{...i,ref:t}):(0,I.jsx)(foe,{...i,ref:t})})});ux.displayName=lx;var doe=N.forwardRef((e,t)=>{let n=ex(lx,e.__scopeDialog),r=N.useRef(null),i=yy(t,n.contentRef,r);return N.useEffect(()=>{let e=r.current;if(e)return Xb(e)},[]),(0,I.jsx)(dx,{...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())})}),foe=N.forwardRef((e,t)=>{let n=ex(lx,e.__scopeDialog),r=N.useRef(!1),i=N.useRef(!1);return(0,I.jsx)(dx,{...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()}})}),dx=N.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ex(lx,n),c=N.useRef(null),l=yy(t,c);return gb(),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(sb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(tb,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":vx(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(moe,{titleId:s.titleId}),(0,I.jsx)(goe,{contentRef:c,descriptionId:s.descriptionId})]})]})}),fx=`DialogTitle`,px=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ex(fx,n);return(0,I.jsx)(Oy.h2,{id:i.titleId,...r,ref:t})});px.displayName=fx;var mx=`DialogDescription`,hx=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ex(mx,n);return(0,I.jsx)(Oy.p,{id:i.descriptionId,...r,ref:t})});hx.displayName=mx;var gx=`DialogClose`,_x=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ex(gx,n);return(0,I.jsx)(Oy.button,{type:`button`,...r,ref:t,onClick:K(e.onClick,()=>i.onOpenChange(!1))})});_x.displayName=gx;function vx(e){return e?`open`:`closed`}var yx=`DialogTitleWarning`,[poe,bx]=Yie(yx,{contentName:lx,titleName:fx,docsSlug:`dialog`}),moe=({titleId:e})=>{let t=bx(yx),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
118
|
+
|
|
119
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
120
|
+
|
|
121
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},hoe=`DialogDescriptionWarning`,goe=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${bx(hoe).contentName}}.`;return N.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},xx=tx,_oe=rx,Sx=ox,Cx=cx,wx=ux,Tx=px,Ex=hx,Dx=_x,Ox=`AlertDialog`,[voe,yoe]=Uy(Ox,[$b]),kx=$b(),Ax=e=>{let{__scopeAlertDialog:t,...n}=e,r=kx(t);return(0,I.jsx)(xx,{...r,...n,modal:!0})};Ax.displayName=Ox;var boe=`AlertDialogTrigger`,xoe=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=kx(n);return(0,I.jsx)(_oe,{...i,...r,ref:t})});xoe.displayName=boe;var Soe=`AlertDialogPortal`,jx=e=>{let{__scopeAlertDialog:t,...n}=e,r=kx(t);return(0,I.jsx)(Sx,{...r,...n})};jx.displayName=Soe;var Coe=`AlertDialogOverlay`,Mx=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=kx(n);return(0,I.jsx)(Cx,{...i,...r,ref:t})});Mx.displayName=Coe;var Nx=`AlertDialogContent`,[woe,Toe]=voe(Nx),Eoe=Ty(`AlertDialogContent`),Px=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=kx(n),o=N.useRef(null),s=yy(t,o),c=N.useRef(null);return(0,I.jsx)(poe,{contentName:Nx,titleName:Fx,docsSlug:`alert-dialog`,children:(0,I.jsx)(woe,{scope:n,cancelRef:c,children:(0,I.jsxs)(wx,{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,I.jsx)(Eoe,{children:r}),(0,I.jsx)(Ux,{contentRef:o})]})})})});Px.displayName=Nx;var Fx=`AlertDialogTitle`,Ix=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=kx(n);return(0,I.jsx)(Tx,{...i,...r,ref:t})});Ix.displayName=Fx;var Lx=`AlertDialogDescription`,Rx=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=kx(n);return(0,I.jsx)(Ex,{...i,...r,ref:t})});Rx.displayName=Lx;var zx=`AlertDialogAction`,Bx=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=kx(n);return(0,I.jsx)(Dx,{...i,...r,ref:t})});Bx.displayName=zx;var Vx=`AlertDialogCancel`,Hx=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Toe(Vx,n),a=kx(n),o=yy(t,i);return(0,I.jsx)(Dx,{...a,...r,ref:o})});Hx.displayName=Vx;var Ux=({contentRef:e})=>{let t=`\`${Nx}\` requires a description for the component to be accessible for screen reader users.
|
|
122
|
+
|
|
123
|
+
You can add a description to the \`${Nx}\` by passing a \`${Lx}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
124
|
+
|
|
125
|
+
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 \`${Nx}\`. 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.
|
|
126
|
+
|
|
127
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return N.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},Wx=Ax,Gx=jx,Kx=Mx,qx=Px,Jx=Bx,Yx=Hx,Xx=Ix,Zx=Rx;function Qx(e){let t=N.useRef({value:e,previous:e});return N.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function $x(e){let[t,n]=N.useState(void 0);return Gy(()=>{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 eS=`Checkbox`,[tS,Doe]=Uy(eS),[nS,rS]=tS(eS);function iS(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]=Ky({prop:n,defaultProp:i??!1,onChange:c,caller:eS}),[m,h]=N.useState(null),[g,_]=N.useState(null),v=N.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:pS(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:_};return(0,I.jsx)(nS,{scope:t,...b,children:fS(d)?d(b):r})}var aS=`CheckboxTrigger`,oS=N.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}=rS(aS,e),h=yy(i,u),g=N.useRef(c);return N.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,I.jsx)(Oy.button,{type:`button`,role:`checkbox`,"aria-checked":pS(c)?`mixed`:c,"aria-required":l,"data-state":mS(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=>pS(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});oS.displayName=aS;var sS=N.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,I.jsx)(iS,{__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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(oS,{...d,ref:t,__scopeCheckbox:n}),e&&(0,I.jsx)(dS,{__scopeCheckbox:n})]})})});sS.displayName=eS;var cS=`CheckboxIndicator`,lS=N.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=rS(cS,n);return(0,I.jsx)(qy,{present:r||pS(a.checked)||a.checked===!0,children:(0,I.jsx)(Oy.span,{"data-state":mS(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});lS.displayName=cS;var uS=`CheckboxBubbleInput`,dS=N.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}=rS(uS,e),m=yy(n,p),h=Qx(a),g=$x(r);N.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=pS(a),n.call(e,pS(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=N.useRef(pS(a)?!1:a);return(0,I.jsx)(Oy.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%)`}})});dS.displayName=uS;function fS(e){return typeof e==`function`}function pS(e){return e===`indeterminate`}function mS(e){return pS(e)?`indeterminate`:e?`checked`:`unchecked`}var hS=[`top`,`right`,`bottom`,`left`],gS=Math.min,_S=Math.max,vS=Math.round,yS=Math.floor,bS=e=>({x:e,y:e}),Ooe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function xS(e,t,n){return _S(e,gS(t,n))}function SS(e,t){return typeof e==`function`?e(t):e}function CS(e){return e.split(`-`)[0]}function wS(e){return e.split(`-`)[1]}function TS(e){return e===`x`?`y`:`x`}function ES(e){return e===`y`?`height`:`width`}function DS(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function OS(e){return TS(DS(e))}function koe(e,t,n){n===void 0&&(n=!1);let r=wS(e),i=OS(e),a=ES(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=MS(o)),[o,MS(o)]}function Aoe(e){let t=MS(e);return[kS(e),t,kS(t)]}function kS(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var AS=[`left`,`right`],jS=[`right`,`left`],joe=[`top`,`bottom`],Moe=[`bottom`,`top`];function Noe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?jS:AS:t?AS:jS;case`left`:case`right`:return t?joe:Moe;default:return[]}}function Poe(e,t,n,r){let i=wS(e),a=Noe(CS(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(kS)))),a}function MS(e){let t=CS(e);return Ooe[t]+e.slice(t.length)}function Foe(e){return{top:0,right:0,bottom:0,left:0,...e}}function NS(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Foe(e)}function PS(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 FS(e,t,n){let{reference:r,floating:i}=e,a=DS(t),o=OS(t),s=ES(o),c=CS(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(wS(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 Ioe(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}=SS(t,e),p=NS(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=PS(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=PS(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 Loe=50,Roe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ioe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=FS(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<Loe&&(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}=FS(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},zoe=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}=SS(e,t)||{};if(l==null)return{};let d=NS(u),f={x:n,y:r},p=OS(i),m=ES(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=gS(d[_],T),D=gS(d[v],T),O=E,ee=C-h[m]-D,te=C/2-h[m]/2+w,k=xS(O,te,ee),A=!c.arrow&&wS(i)!=null&&te!==k&&a.reference[m]/2-(te<O?E:D)-h[m]/2<0,j=A?te<O?te-O:te-ee:0;return{[p]:f[p]+j,data:{[p]:k,centerOffset:te-k-j,...A&&{alignmentOffset:j}},reset:A}}}),Boe=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}=SS(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=CS(r),_=DS(o),v=CS(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[MS(o)]:Aoe(o)),x=p!==`none`;!d&&x&&b.push(...Poe(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=koe(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`&&_!==DS(t))||T.every(e=>DS(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=DS(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 IS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function LS(e){return hS.some(t=>e[t]>=0)}var Voe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=SS(e,t);switch(i){case`referenceHidden`:{let e=IS(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:LS(e)}}}case`escaped`:{let e=IS(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:LS(e)}}}default:return{}}}}},RS=new Set([`left`,`top`]);async function Hoe(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=CS(n),s=wS(n),c=DS(n)===`y`,l=RS.has(o)?-1:1,u=a&&c?-1:1,d=SS(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 Uoe=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 Hoe(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}}}}},Woe=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}=SS(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=DS(CS(i)),p=TS(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=xS(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=xS(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}}}}}},Goe=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}=SS(e,t),u={x:n,y:r},d=DS(i),f=TS(d),p=u[f],m=u[d],h=SS(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=RS.has(CS(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}}}},Koe=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}=SS(e,t),u=await o.detectOverflow(t,l),d=CS(i),f=wS(i),p=DS(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=gS(h-u[g],v),x=gS(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=_S(u.left,0),t=_S(u.right,0),n=_S(u.top,0),r=_S(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:_S(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:_S(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 zS(){return typeof window<`u`}function BS(e){return US(e)?(e.nodeName||``).toLowerCase():`#document`}function VS(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function HS(e){return((US(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function US(e){return zS()?e instanceof Node||e instanceof VS(e).Node:!1}function WS(e){return zS()?e instanceof Element||e instanceof VS(e).Element:!1}function GS(e){return zS()?e instanceof HTMLElement||e instanceof VS(e).HTMLElement:!1}function KS(e){return!zS()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof VS(e).ShadowRoot}function qS(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=eC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function qoe(e){return/^(table|td|th)$/.test(BS(e))}function JS(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Joe=/transform|translate|scale|rotate|perspective|filter/,Yoe=/paint|layout|strict|content/,YS=e=>!!e&&e!==`none`,XS;function ZS(e){let t=WS(e)?eC(e):e;return YS(t.transform)||YS(t.translate)||YS(t.scale)||YS(t.rotate)||YS(t.perspective)||!QS()&&(YS(t.backdropFilter)||YS(t.filter))||Joe.test(t.willChange||``)||Yoe.test(t.contain||``)}function Xoe(e){let t=nC(e);for(;GS(t)&&!$S(t);){if(ZS(t))return t;if(JS(t))return null;t=nC(t)}return null}function QS(){return XS??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),XS}function $S(e){return/^(html|body|#document)$/.test(BS(e))}function eC(e){return VS(e).getComputedStyle(e)}function tC(e){return WS(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nC(e){if(BS(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||KS(e)&&e.host||HS(e);return KS(t)?t.host:t}function rC(e){let t=nC(e);return $S(t)?e.ownerDocument?e.ownerDocument.body:e.body:GS(t)&&qS(t)?t:rC(t)}function iC(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=rC(e),i=r===e.ownerDocument?.body,a=VS(r);if(i){let e=aC(a);return t.concat(a,a.visualViewport||[],qS(r)?r:[],e&&n?iC(e):[])}else return t.concat(r,iC(r,[],n))}function aC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oC(e){let t=eC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=GS(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=vS(n)!==a||vS(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function sC(e){return WS(e)?e:e.contextElement}function cC(e){let t=sC(e);if(!GS(t))return bS(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=oC(t),o=(a?vS(n.width):n.width)/r,s=(a?vS(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Zoe=bS(0);function lC(e){let t=VS(e);return!QS()||!t.visualViewport?Zoe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qoe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==VS(e)?!1:t}function uC(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=sC(e),o=bS(1);t&&(r?WS(r)&&(o=cC(r)):o=cC(e));let s=Qoe(a,n,r)?lC(a):bS(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=VS(a),t=r&&WS(r)?VS(r):r,n=e,i=aC(n);for(;i&&r&&t!==n;){let e=cC(i),t=i.getBoundingClientRect(),r=eC(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=VS(i),i=aC(n)}}return PS({width:u,height:d,x:c,y:l})}function dC(e,t){let n=tC(e).scrollLeft;return t?t.left+n:uC(HS(e)).left+n}function fC(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-dC(e,n),y:n.top+t.scrollTop}}function $oe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=HS(r),s=t?JS(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=bS(1),u=bS(0),d=GS(r);if((d||!d&&!a)&&((BS(r)!==`body`||qS(o))&&(c=tC(r)),d)){let e=uC(r);l=cC(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?fC(o,c):bS(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 ese(e){return Array.from(e.getClientRects())}function tse(e){let t=HS(e),n=tC(e),r=e.ownerDocument.body,i=_S(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=_S(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+dC(e),s=-n.scrollTop;return eC(r).direction===`rtl`&&(o+=_S(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var pC=25;function nse(e,t){let n=VS(e),r=HS(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=QS();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=dC(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<=pC&&(a-=o)}else l<=pC&&(a+=l);return{width:a,height:o,x:s,y:c}}function rse(e,t){let n=uC(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=GS(e)?cC(e):bS(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function mC(e,t,n){let r;if(t===`viewport`)r=nse(e,n);else if(t===`document`)r=tse(HS(e));else if(WS(t))r=rse(t,n);else{let n=lC(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return PS(r)}function hC(e,t){let n=nC(e);return n===t||!WS(n)||$S(n)?!1:eC(n).position===`fixed`||hC(n,t)}function ise(e,t){let n=t.get(e);if(n)return n;let r=iC(e,[],!1).filter(e=>WS(e)&&BS(e)!==`body`),i=null,a=eC(e).position===`fixed`,o=a?nC(e):e;for(;WS(o)&&!$S(o);){let t=eC(o),n=ZS(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||qS(o)&&!n&&hC(e,o))?r=r.filter(e=>e!==o):i=t,o=nC(o)}return t.set(e,r),r}function ase(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?JS(t)?[]:ise(t,this._c):[].concat(n),r],o=mC(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=mC(t,a[e],i);s=_S(n.top,s),c=gS(n.right,c),l=gS(n.bottom,l),u=_S(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ose(e){let{width:t,height:n}=oC(e);return{width:t,height:n}}function sse(e,t,n){let r=GS(t),i=HS(t),a=n===`fixed`,o=uC(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=bS(0);function l(){c.x=dC(i)}if(r||!r&&!a)if((BS(t)!==`body`||qS(i))&&(s=tC(t)),r){let e=uC(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?fC(i,s):bS(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 gC(e){return eC(e).position===`static`}function _C(e,t){if(!GS(e)||eC(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return HS(e)===n&&(n=n.ownerDocument.body),n}function vC(e,t){let n=VS(e);if(JS(e))return n;if(!GS(e)){let t=nC(e);for(;t&&!$S(t);){if(WS(t)&&!gC(t))return t;t=nC(t)}return n}let r=_C(e,t);for(;r&&qoe(r)&&gC(r);)r=_C(r,t);return r&&$S(r)&&gC(r)&&!ZS(r)?n:r||Xoe(e)||n}var cse=async function(e){let t=this.getOffsetParent||vC,n=this.getDimensions,r=await n(e.floating);return{reference:sse(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lse(e){return eC(e).direction===`rtl`}var use={convertOffsetParentRelativeRectToViewportRelativeRect:$oe,getDocumentElement:HS,getClippingRect:ase,getOffsetParent:vC,getElementRects:cse,getClientRects:ese,getDimensions:ose,getScale:cC,isElement:WS,isRTL:lse};function yC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dse(e,t){let n=null,r,i=HS(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=yS(d),h=yS(i.clientWidth-(u+f)),g=yS(i.clientHeight-(d+p)),_=yS(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:_S(0,gS(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&&!yC(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 fse(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=sC(e),u=i||a?[...l?iC(l):[],...t?iC(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?dse(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?uC(e):null;c&&g();function g(){let t=uC(e);h&&!yC(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 pse=Uoe,mse=Woe,hse=Boe,gse=Koe,_se=Voe,bC=zoe,vse=Goe,yse=(e,t,n)=>{let r=new Map,i={platform:use,...n},a={...i.platform,_c:r};return Roe(e,t,{...i,platform:a})},xC=typeof document<`u`?N.useLayoutEffect:function(){};function SC(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(!SC(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)&&!SC(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function CC(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wC(e,t){let n=CC(e);return Math.round(t*n)/n}function TC(e){let t=N.useRef(e);return xC(()=>{t.current=e}),t}function bse(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]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=N.useState(r);SC(f,r)||p(r);let[m,h]=N.useState(null),[g,_]=N.useState(null),v=N.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=N.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=N.useRef(null),C=N.useRef(null),w=N.useRef(u),T=c!=null,E=TC(c),D=TC(i),O=TC(l),ee=N.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),yse(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};te.current&&!SC(w.current,t)&&(w.current=t,ls.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);xC(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=N.useRef(!1);xC(()=>(te.current=!0,()=>{te.current=!1}),[]),xC(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ee);ee()}},[b,x,ee,E,T]);let k=N.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=N.useMemo(()=>({reference:b,floating:x}),[b,x]),j=N.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=wC(A.floating,u.x),r=wC(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...CC(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:ee,refs:k,elements:A,floatingStyles:j}),[u,ee,k,A,j])}var xse=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?{}:bC({element:r.current,padding:i}).fn(n):r?bC({element:r,padding:i}).fn(n):{}}}},Sse=(e,t)=>{let n=pse(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cse=(e,t)=>{let n=mse(e);return{name:n.name,fn:n.fn,options:[e,t]}},wse=(e,t)=>({fn:vse(e).fn,options:[e,t]}),Tse=(e,t)=>{let n=hse(e);return{name:n.name,fn:n.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=xse(e);return{name:n.name,fn:n.fn,options:[e,t]}},kse=`Arrow`,EC=N.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,I.jsx)(Oy.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,I.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});EC.displayName=kse;var Ase=EC,DC=`Popper`,[OC,kC]=Uy(DC),[jse,AC]=OC(DC),jC=e=>{let{__scopePopper:t,children:n}=e,[r,i]=N.useState(null),[a,o]=N.useState(void 0);return(0,I.jsx)(jse,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};jC.displayName=DC;var MC=`PopperAnchor`,NC=N.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=AC(MC,n),o=N.useRef(null),s=a.onAnchorChange,c=yy(t,N.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=N.useRef(null);N.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&RC(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,I.jsx)(Oy.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});NC.displayName=MC;var PC=`PopperContent`,[Mse,Nse]=OC(PC),FC=N.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=AC(PC,n),[_,v]=N.useState(null),y=yy(t,e=>v(e)),[b,x]=N.useState(null),S=$x(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,ee={padding:E,boundary:D?.filter(Fse),altBoundary:O},{refs:te,floatingStyles:k,placement:A,isPositioned:j,middlewareData:ne}=bse({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>fse(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Sse({mainAxis:i+w,alignmentAxis:o}),c&&Cse({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?wse():void 0,...ee}),c&&Tse({...ee}),Ese({...ee,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&&Ose({element:b,padding:s}),Ise({arrowWidth:C,arrowHeight:w}),f&&Dse({strategy:`referenceHidden`,...ee})]}),re=g.setPlacementState;Gy(()=>(re(A),()=>{re(void 0)}),[A,re]);let[M,ie]=RC(A),ae=Py(m);Gy(()=>{j&&ae?.()},[j,ae]);let oe=ne.arrow?.x,se=ne.arrow?.y,ce=ne.arrow?.centerOffset!==0,[le,ue]=N.useState();return Gy(()=>{_&&ue(window.getComputedStyle(_).zIndex)},[_]),(0,I.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...k,transform:j?k.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[ne.transformOrigin?.x,ne.transformOrigin?.y].join(` `),...ne.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(Mse,{scope:n,placedSide:M,placedAlign:ie,onArrowChange:x,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,I.jsx)(Oy.div,{"data-side":M,"data-align":ie,...h,ref:y,style:{...h.style,animation:j?void 0:`none`}})})})});FC.displayName=PC;var IC=`PopperArrow`,Pse={top:`bottom`,right:`left`,bottom:`top`,left:`right`},LC=N.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Nse(IC,n),a=Pse[i.placedSide];return(0,I.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,I.jsx)(Ase,{...r,ref:t,style:{...r.style,display:`block`}})})});LC.displayName=IC;function Fse(e){return e!==null}var Ise=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]=RC(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 RC(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var zC=jC,BC=NC,VC=FC,HC=LC,UC=`rovingFocusGroup.onEntryFocus`,Lse={bubbles:!1,cancelable:!0},WC=`RovingFocusGroup`,[GC,KC,Rse]=Wy(WC),[zse,qC]=Uy(WC,[Rse]),[Bse,Vse]=zse(WC),JC=N.forwardRef((e,t)=>(0,I.jsx)(GC.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(GC.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(Hse,{...e,ref:t})})}));JC.displayName=WC;var Hse=N.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=N.useRef(null),p=yy(t,f),m=Zy(a),[h,g]=Ky({prop:o,defaultProp:s??null,onChange:c,caller:WC}),[_,v]=N.useState(!1),y=Py(l),b=KC(n),x=N.useRef(!1),[S,C]=N.useState(0);return N.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(UC,y),()=>e.removeEventListener(UC,y)},[y]),(0,I.jsx)(Bse,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:N.useCallback(e=>g(e),[g]),onItemShiftTab:N.useCallback(()=>v(!0),[]),onFocusableItemAdd:N.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:N.useCallback(()=>C(e=>e-1),[]),children:(0,I.jsx)(Oy.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(UC,Lse);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);ZC([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))})})}),YC=`RovingFocusGroupItem`,XC=N.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Xy(),l=a||c,u=Vse(YC,n),d=u.currentTabStopId===l,f=KC(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return N.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,I.jsx)(GC.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,I.jsx)(Oy.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=Gse(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?Kse(n,r+1):n.slice(r+1)}setTimeout(()=>ZC(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});XC.displayName=YC;var Use={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Wse(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Gse(e,t,n){let r=Wse(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Use[r]}function ZC(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Kse(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var QC=JC,$C=XC,ew=[`Enter`,` `],qse=[`ArrowDown`,`PageUp`,`Home`],tw=[`ArrowUp`,`PageDown`,`End`],Jse=[...qse,...tw],Yse={ltr:[...ew,`ArrowRight`],rtl:[...ew,`ArrowLeft`]},Xse={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},nw=`Menu`,[rw,Zse,Qse]=Wy(nw),[iw,aw]=Uy(nw,[Qse,kC,qC]),ow=kC(),sw=qC(),[cw,lw]=iw(nw),[$se,uw]=iw(nw),dw=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ow(t),[c,l]=N.useState(null),u=N.useRef(!1),d=Py(a),f=Zy(i);return N.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,I.jsx)(zC,{...s,children:(0,I.jsx)(cw,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,I.jsx)($se,{scope:t,onClose:N.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};dw.displayName=nw;var ece=`MenuAnchor`,fw=N.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ow(n);return(0,I.jsx)(BC,{...i,...r,ref:t})});fw.displayName=ece;var pw=`MenuPortal`,[tce,mw]=iw(pw,{forceMount:void 0}),hw=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=lw(pw,t);return(0,I.jsx)(tce,{scope:t,forceMount:n,children:(0,I.jsx)(qy,{present:n||a.open,children:(0,I.jsx)(pb,{asChild:!0,container:i,children:r})})})};hw.displayName=pw;var gw=`MenuContent`,[nce,_w]=iw(gw),vw=N.forwardRef((e,t)=>{let n=mw(gw,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=lw(gw,e.__scopeMenu),o=uw(gw,e.__scopeMenu);return(0,I.jsx)(rw.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(qy,{present:r||a.open,children:(0,I.jsx)(rw.Slot,{scope:e.__scopeMenu,children:o.modal?(0,I.jsx)(rce,{...i,ref:t}):(0,I.jsx)(ice,{...i,ref:t})})})})}),rce=N.forwardRef((e,t)=>{let n=lw(gw,e.__scopeMenu),r=N.useRef(null),i=yy(t,r);return N.useEffect(()=>{let e=r.current;if(e)return Xb(e)},[]),(0,I.jsx)(yw,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:K(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ice=N.forwardRef((e,t)=>{let n=lw(gw,e.__scopeMenu);return(0,I.jsx)(yw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ace=Sy(`MenuContent.ScrollLock`),yw=N.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=lw(gw,n),_=uw(gw,n),v=ow(n),y=sw(n),b=Zse(n),[x,S]=N.useState(null),C=N.useRef(null),w=yy(t,C,g.onContentChange),T=N.useRef(0),E=N.useRef(``),D=N.useRef(0),O=N.useRef(null),ee=N.useRef(`right`),te=N.useRef(0),k=m?Wb:N.Fragment,A=m?{as:ace,allowPinchZoom:!0}:void 0,j=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=vce(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())};N.useEffect(()=>()=>window.clearTimeout(T.current),[]),gb();let ne=N.useCallback(e=>ee.current===O.current?.side&&bce(e,O.current?.area),[]);return(0,I.jsx)(nce,{scope:n,searchRef:E,onItemEnter:N.useCallback(e=>{ne(e)&&e.preventDefault()},[ne]),onItemLeave:N.useCallback(e=>{ne(e)||(C.current?.focus(),S(null))},[ne]),onTriggerLeave:N.useCallback(e=>{ne(e)&&e.preventDefault()},[ne]),pointerGraceTimerRef:D,onPointerGraceIntentChange:N.useCallback(e=>{O.current=e},[]),children:(0,I.jsx)(k,{...A,children:(0,I.jsx)(sb,{asChild:!0,trapped:i,onMountAutoFocus:K(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,I.jsx)(tb,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,I.jsx)(QC,{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,I.jsx)(VC,{role:`menu`,"aria-orientation":`vertical`,"data-state":Hw(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&&j(e.key));let i=C.current;if(e.target!==i||!Jse.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);tw.includes(e.key)&&a.reverse(),gce(a)}),onBlur:K(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:K(e.onPointerMove,Gw(e=>{let t=e.target,n=te.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ee.current=e.clientX>te.current?`right`:`left`,te.current=e.clientX)}))})})})})})})});vw.displayName=gw;var oce=`MenuGroup`,bw=N.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(Oy.div,{role:`group`,...r,ref:t})});bw.displayName=oce;var sce=`MenuLabel`,xw=N.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(Oy.div,{...r,ref:t})});xw.displayName=sce;var Sw=`MenuItem`,Cw=`menu.itemSelect`,ww=N.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=N.useRef(null),o=uw(Sw,e.__scopeMenu),s=_w(Sw,e.__scopeMenu),c=yy(t,a),l=N.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Cw,{bubbles:!0,cancelable:!0});e.addEventListener(Cw,e=>r?.(e),{once:!0}),ky(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,I.jsx)(Tw,{...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===` `||ew.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ww.displayName=Sw;var Tw=N.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=_w(Sw,n),s=sw(n),c=N.useRef(null),l=yy(t,c),[u,d]=N.useState(!1),[f,p]=N.useState(``);return N.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,I.jsx)(rw.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,I.jsx)($C,{asChild:!0,...s,focusable:!r,children:(0,I.jsx)(Oy.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,Gw(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:K(e.onPointerLeave,Gw(e=>o.onItemLeave(e))),onFocus:K(e.onFocus,()=>d(!0)),onBlur:K(e.onBlur,()=>d(!1))})})})}),cce=`MenuCheckboxItem`,Ew=N.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,I.jsx)(Mw,{scope:e.__scopeMenu,checked:n,children:(0,I.jsx)(ww,{role:`menuitemcheckbox`,"aria-checked":Uw(n)?`mixed`:n,...i,ref:t,"data-state":Ww(n),onSelect:K(i.onSelect,()=>r?.(Uw(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ew.displayName=cce;var Dw=`MenuRadioGroup`,[lce,uce]=iw(Dw,{value:void 0,onValueChange:()=>{}}),Ow=N.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Py(r);return(0,I.jsx)(lce,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,I.jsx)(bw,{...i,ref:t})})});Ow.displayName=Dw;var kw=`MenuRadioItem`,Aw=N.forwardRef((e,t)=>{let{value:n,...r}=e,i=uce(kw,e.__scopeMenu),a=n===i.value;return(0,I.jsx)(Mw,{scope:e.__scopeMenu,checked:a,children:(0,I.jsx)(ww,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Ww(a),onSelect:K(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Aw.displayName=kw;var jw=`MenuItemIndicator`,[Mw,dce]=iw(jw,{checked:!1}),Nw=N.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=dce(jw,n);return(0,I.jsx)(qy,{present:r||Uw(a.checked)||a.checked===!0,children:(0,I.jsx)(Oy.span,{...i,ref:t,"data-state":Ww(a.checked)})})});Nw.displayName=jw;var fce=`MenuSeparator`,Pw=N.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(Oy.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Pw.displayName=fce;var pce=`MenuArrow`,Fw=N.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ow(n);return(0,I.jsx)(HC,{...i,...r,ref:t})});Fw.displayName=pce;var Iw=`MenuSub`,[mce,Lw]=iw(Iw),hce=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=lw(Iw,t),o=ow(t),[s,c]=N.useState(null),[l,u]=N.useState(null),d=Py(i);return N.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,I.jsx)(zC,{...o,children:(0,I.jsx)(cw,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,I.jsx)(mce,{scope:t,contentId:Xy(),triggerId:Xy(),trigger:s,onTriggerChange:c,children:n})})})};hce.displayName=Iw;var Rw=`MenuSubTrigger`,zw=N.forwardRef((e,t)=>{let n=lw(Rw,e.__scopeMenu),r=uw(Rw,e.__scopeMenu),i=Lw(Rw,e.__scopeMenu),a=_w(Rw,e.__scopeMenu),o=N.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=N.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return N.useEffect(()=>u,[u]),N.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,I.jsx)(fw,{asChild:!0,...l,children:(0,I.jsx)(Tw,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Hw(n.open),...e,ref:vy(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:K(e.onPointerMove,Gw(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,Gw(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===` `||Yse[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});zw.displayName=Rw;var Bw=`MenuSubContent`,Vw=N.forwardRef((e,t)=>{let n=mw(gw,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=lw(gw,e.__scopeMenu),s=uw(gw,e.__scopeMenu),c=Lw(Bw,e.__scopeMenu),l=N.useRef(null),u=yy(t,l);return(0,I.jsx)(rw.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(qy,{present:r||o.open,children:(0,I.jsx)(rw.Slot,{scope:e.__scopeMenu,children:(0,I.jsx)(yw,{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=Xse[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});Vw.displayName=Bw;function Hw(e){return e?`open`:`closed`}function Uw(e){return e===`indeterminate`}function Ww(e){return Uw(e)?`indeterminate`:e?`checked`:`unchecked`}function gce(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function _ce(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vce(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=_ce(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 yce(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 bce(e,t){return t?yce({x:e.clientX,y:e.clientY},t):!1}function Gw(e){return t=>t.pointerType===`mouse`?e(t):void 0}var xce=dw,Sce=fw,Cce=hw,wce=vw,Tce=bw,Ece=xw,Dce=ww,Oce=Ew,kce=Ow,Ace=Aw,jce=Nw,Mce=Pw,Nce=Fw,Pce=zw,Fce=Vw,Kw=`DropdownMenu`,[Ice,Lce]=Uy(Kw,[aw]),qw=aw(),[Rce,Jw]=Ice(Kw),Yw=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=qw(t),l=N.useRef(null),[u,d]=Ky({prop:i,defaultProp:a??!1,onChange:o,caller:Kw});return(0,I.jsx)(Rce,{scope:t,triggerId:Xy(),triggerRef:l,contentId:Xy(),open:u,onOpenChange:d,onOpenToggle:N.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,I.jsx)(xce,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Yw.displayName=Kw;var Xw=`DropdownMenuTrigger`,Zw=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Jw(Xw,n),o=qw(n);return(0,I.jsx)(Sce,{asChild:!0,...o,children:(0,I.jsx)(Oy.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:vy(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())})})})});Zw.displayName=Xw;var zce=`DropdownMenuPortal`,Qw=e=>{let{__scopeDropdownMenu:t,...n}=e,r=qw(t);return(0,I.jsx)(Cce,{...r,...n})};Qw.displayName=zce;var $w=`DropdownMenuContent`,eT=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Jw($w,n),a=qw(n),o=N.useRef(!1);return(0,I.jsx)(wce,{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)`}})});eT.displayName=$w;var Bce=`DropdownMenuGroup`,Vce=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(Tce,{...i,...r,ref:t})});Vce.displayName=Bce;var Hce=`DropdownMenuLabel`,tT=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(Ece,{...i,...r,ref:t})});tT.displayName=Hce;var Uce=`DropdownMenuItem`,nT=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(Dce,{...i,...r,ref:t})});nT.displayName=Uce;var Wce=`DropdownMenuCheckboxItem`,Gce=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(Oce,{...i,...r,ref:t})});Gce.displayName=Wce;var Kce=`DropdownMenuRadioGroup`,rT=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(kce,{...i,...r,ref:t})});rT.displayName=Kce;var qce=`DropdownMenuRadioItem`,iT=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(Ace,{...i,...r,ref:t})});iT.displayName=qce;var Jce=`DropdownMenuItemIndicator`,aT=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(jce,{...i,...r,ref:t})});aT.displayName=Jce;var Yce=`DropdownMenuSeparator`,oT=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(Mce,{...i,...r,ref:t})});oT.displayName=Yce;var Xce=`DropdownMenuArrow`,Zce=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(Nce,{...i,...r,ref:t})});Zce.displayName=Xce;var Qce=`DropdownMenuSubTrigger`,$ce=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(Pce,{...i,...r,ref:t})});$ce.displayName=Qce;var ele=`DropdownMenuSubContent`,tle=N.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qw(n);return(0,I.jsx)(Fce,{...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)`}})});tle.displayName=ele;var nle=Yw,rle=Zw,ile=Qw,ale=eT,ole=tT,sle=nT,cle=rT,lle=iT,ule=aT,dle=oT;function sT(e,[t,n]){return Math.min(n,Math.max(t,e))}var cT=`Popover`,[lT,fle]=Uy(cT,[kC]),uT=kC(),[ple,dT]=lT(cT),fT=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=uT(t),c=N.useRef(null),[l,u]=N.useState(!1),[d,f]=Ky({prop:r,defaultProp:i??!1,onChange:a,caller:cT});return(0,I.jsx)(zC,{...s,children:(0,I.jsx)(ple,{scope:t,contentId:Xy(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:N.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:N.useCallback(()=>u(!0),[]),onCustomAnchorRemove:N.useCallback(()=>u(!1),[]),modal:o,children:n})})};fT.displayName=cT;var pT=`PopoverAnchor`,mle=N.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=dT(pT,n),a=uT(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return N.useEffect(()=>(o(),()=>s()),[o,s]),(0,I.jsx)(BC,{...a,...r,ref:t})});mle.displayName=pT;var mT=`PopoverTrigger`,hT=N.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=dT(mT,n),a=uT(n),o=yy(t,i.triggerRef),s=(0,I.jsx)(Oy.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":ST(i.open),...r,ref:o,onClick:K(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,I.jsx)(BC,{asChild:!0,...a,children:s})});hT.displayName=mT;var gT=`PopoverPortal`,[hle,gle]=lT(gT,{forceMount:void 0}),_T=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=dT(gT,t);return(0,I.jsx)(hle,{scope:t,forceMount:n,children:(0,I.jsx)(qy,{present:n||a.open,children:(0,I.jsx)(pb,{asChild:!0,container:i,children:r})})})};_T.displayName=gT;var vT=`PopoverContent`,yT=N.forwardRef((e,t)=>{let n=gle(vT,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=dT(vT,e.__scopePopover);return(0,I.jsx)(qy,{present:r||a.open,children:a.modal?(0,I.jsx)(vle,{...i,ref:t}):(0,I.jsx)(yle,{...i,ref:t})})});yT.displayName=vT;var _le=Sy(`PopoverContent.RemoveScroll`),vle=N.forwardRef((e,t)=>{let n=dT(vT,e.__scopePopover),r=N.useRef(null),i=yy(t,r),a=N.useRef(!1);return N.useEffect(()=>{let e=r.current;if(e)return Xb(e)},[]),(0,I.jsx)(Wb,{as:_le,allowPinchZoom:!0,children:(0,I.jsx)(bT,{...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})})})}),yle=N.forwardRef((e,t)=>{let n=dT(vT,e.__scopePopover),r=N.useRef(!1),i=N.useRef(!1);return(0,I.jsx)(bT,{...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()}})}),bT=N.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=dT(vT,n),p=uT(n);return gb(),(0,I.jsx)(sb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(tb,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,I.jsx)(VC,{"data-state":ST(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)`}})})})}),xT=`PopoverClose`,ble=N.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=dT(xT,n);return(0,I.jsx)(Oy.button,{type:`button`,...r,ref:t,onClick:K(e.onClick,()=>i.onOpenChange(!1))})});ble.displayName=xT;var xle=`PopoverArrow`,Sle=N.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=uT(n);return(0,I.jsx)(HC,{...i,...r,ref:t})});Sle.displayName=xle;function ST(e){return e?`open`:`closed`}var CT=fT,wT=hT,TT=_T,ET=yT,Cle=[` `,`Enter`,`ArrowUp`,`ArrowDown`],wle=[` `,`Enter`],DT=`Select`,[OT,kT,Tle]=Wy(DT),[AT,Ele]=Uy(DT,[Tle,kC]),jT=kC(),[Dle,MT]=AT(DT),[Ole,kle]=AT(DT),Ale=`SelectProvider`;function NT(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=jT(t),[_,v]=N.useState(null),[y,b]=N.useState(null),[x,S]=N.useState(!1),C=Zy(l),[w,T]=Ky({prop:r,defaultProp:i??!1,onChange:a,caller:DT}),[E,D]=Ky({prop:o,defaultProp:s,onChange:c,caller:DT}),O=N.useRef(null),ee=_?!!m||!!_.closest(`form`):!0,[te,k]=N.useState(new Set),A=Xy(),j=Array.from(te).map(e=>e.props.value).join(`;`),ne=N.useCallback(e=>{k(t=>new Set(t).add(e))},[]),re=N.useCallback(e=>{k(t=>{let n=new Set(t);return n.delete(e),n})},[]),M={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:A,value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:te,nativeSelectKey:j,isFormControl:ee};return(0,I.jsx)(zC,{...g,children:(0,I.jsx)(Dle,{scope:t,...M,children:(0,I.jsx)(OT.Provider,{scope:t,children:(0,I.jsx)(Ole,{scope:t,onNativeOptionAdd:ne,onNativeOptionRemove:re,children:qle(h)?h(M):n})})})})}NT.displayName=Ale;var PT=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,I.jsx)(NT,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[n,e?(0,I.jsx)(gE,{__scopeSelect:t}):null]})})};PT.displayName=DT;var FT=`SelectTrigger`,IT=N.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=jT(n),o=MT(FT,n),s=o.disabled||r,c=yy(t,o.onTriggerChange),l=kT(n),u=N.useRef(`touch`),[d,f,p]=vE(e=>{let t=l().filter(e=>!e.disabled),n=yE(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,I.jsx)(BC,{asChild:!0,...a,children:(0,I.jsx)(Oy.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":_E(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===` `)&&Cle.includes(e.key)&&(m(),e.preventDefault())})})})});IT.displayName=FT;var LT=`SelectValue`,RT=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=MT(LT,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=yy(t,c.onValueNodeChange);Gy(()=>{l(u)},[l,u]);let f=_E(c.value);return(0,I.jsx)(Oy.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,I.jsx)(N.Fragment,{children:f?o:a},f?`placeholder`:`value`)})});RT.displayName=LT;var jle=`SelectIcon`,zT=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(Oy.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});zT.displayName=jle;var BT=`SelectPortal`,[Mle,Nle]=AT(BT,{forceMount:void 0}),VT=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,I.jsx)(Mle,{scope:e.__scopeSelect,forceMount:n,children:(0,I.jsx)(pb,{asChild:!0,...r})})};VT.displayName=BT;var HT=`SelectContent`,UT=N.forwardRef((e,t)=>{let n=Nle(HT,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=MT(HT,e.__scopeSelect),[o,s]=N.useState();return Gy(()=>{s(new DocumentFragment)},[]),(0,I.jsx)(qy,{present:r||a.open,children:({present:e})=>e?(0,I.jsx)(JT,{...i,ref:t}):(0,I.jsx)(WT,{...i,fragment:o})})});UT.displayName=HT;var WT=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?ls.createPortal((0,I.jsx)(KT,{scope:n,children:(0,I.jsx)(OT.Slot,{scope:n,children:(0,I.jsx)(`div`,{ref:t,children:r})})}),i):null});WT.displayName=`SelectContentFragment`;var GT=10,[KT,qT]=AT(HT),Ple=`SelectContentImpl`,Fle=Sy(`SelectContent.RemoveScroll`),JT=N.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=MT(HT,n),[y,b]=N.useState(null),[x,S]=N.useState(null),C=yy(t,e=>b(e)),[w,T]=N.useState(null),[E,D]=N.useState(null),O=kT(n),[ee,te]=N.useState(!1),k=N.useRef(!1);N.useEffect(()=>{if(y)return Xb(y)},[y]),gb();let A=N.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]),j=N.useCallback(()=>A([w,y]),[A,w,y]);N.useEffect(()=>{ee&&j()},[ee,j]);let{onOpenChange:ne,triggerPointerDownPosRef:re}=v;N.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(re.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(re.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||ne(!1),document.removeEventListener(`pointermove`,t),re.current=null};return re.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,ne,re]),N.useEffect(()=>{let e=()=>ne(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ne]);let[M,ie]=vE(e=>{let t=O().filter(e=>!e.disabled),n=yE(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ae=N.useCallback((e,t,n)=>{let r=!k.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(k.current=!0))},[v.value]),oe=N.useCallback(()=>y?.focus(),[y]),se=N.useCallback((e,t,n)=>{let r=!k.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),ce=r===`popper`?XT:YT,le=ce===XT?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,I.jsx)(KT,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ae,selectedItem:w,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:j,selectedItemText:E,position:r,isPositioned:ee,searchRef:M,children:(0,I.jsx)(Wb,{as:Fle,allowPinchZoom:!0,children:(0,I.jsx)(sb,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:K(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(tb,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,I.jsx)(ce,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...le,onPlaced:()=>te(!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&&ie(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(()=>A(t)),e.preventDefault()}})})})})})})});JT.displayName=Ple;var Ile=`SelectItemAlignedPosition`,YT=N.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=MT(HT,n),o=qT(HT,n),[s,c]=N.useState(null),[l,u]=N.useState(null),d=yy(t,e=>u(e)),f=kT(n),p=N.useRef(!1),m=N.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=N.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-GT,d=sT(a,[GT,Math.max(GT,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-GT,d=sT(a,[GT,Math.max(GT,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-GT*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-GT,D=c-E,O=g.offsetHeight/2,ee=g.offsetTop+O,te=m+v+ee,k=x-te;if(te<=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=te+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)+k;s.style.height=t+`px`,h.scrollTop=te-E+h.offsetTop}s.style.margin=`${GT}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]);Gy(()=>y(),[y]);let[b,x]=N.useState();return Gy(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,I.jsx)(Rle,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:N.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,I.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,I.jsx)(Oy.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});YT.displayName=Ile;var Lle=`SelectPopperPosition`,XT=N.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=GT,...a}=e,o=jT(n);return(0,I.jsx)(VC,{...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)`}})});XT.displayName=Lle;var[Rle,ZT]=AT(HT,{}),QT=`SelectViewport`,$T=N.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=qT(QT,n),o=ZT(QT,n),s=yy(t,a.onViewportChange),c=N.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.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,I.jsx)(OT.Slot,{scope:n,children:(0,I.jsx)(Oy.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-GT*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})})})]})});$T.displayName=QT;var eE=`SelectGroup`,[zle,Ble]=AT(eE),Vle=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Xy();return(0,I.jsx)(zle,{scope:n,id:i,children:(0,I.jsx)(Oy.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Vle.displayName=eE;var tE=`SelectLabel`,Hle=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ble(tE,n);return(0,I.jsx)(Oy.div,{id:i.id,...r,ref:t})});Hle.displayName=tE;var nE=`SelectItem`,[Ule,rE]=AT(nE),iE=N.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=MT(nE,n),c=qT(nE,n),l=s.value===r,[u,d]=N.useState(a??``),[f,p]=N.useState(!1),m=yy(t,e=>c.itemRefCallback?.(e,r,i)),h=Xy(),g=N.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,I.jsx)(Ule,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:N.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(OT.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,I.jsx)(Oy.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===` `||(wle.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});iE.displayName=nE;var aE=`SelectItemText`,oE=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=MT(aE,n),s=qT(aE,n),c=rE(aE,n),l=kle(aE,n),[u,d]=N.useState(null),f=yy(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=N.useMemo(()=>(0,I.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Gy(()=>(h(m),()=>g(m)),[h,g,m]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Oy.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?ls.createPortal(a.children,o.valueNode):null]})});oE.displayName=aE;var sE=`SelectItemIndicator`,cE=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return rE(sE,n).isSelected?(0,I.jsx)(Oy.span,{"aria-hidden":!0,...r,ref:t}):null});cE.displayName=sE;var lE=`SelectScrollUpButton`,uE=N.forwardRef((e,t)=>{let n=qT(lE,e.__scopeSelect),r=ZT(lE,e.__scopeSelect),[i,a]=N.useState(!1),o=yy(t,r.onScrollButtonChange);return Gy(()=>{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,I.jsx)(pE,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});uE.displayName=lE;var dE=`SelectScrollDownButton`,fE=N.forwardRef((e,t)=>{let n=qT(dE,e.__scopeSelect),r=ZT(dE,e.__scopeSelect),[i,a]=N.useState(!1),o=yy(t,r.onScrollButtonChange);return Gy(()=>{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,I.jsx)(pE,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});fE.displayName=dE;var pE=N.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=qT(`SelectScrollButton`,n),o=N.useRef(null),s=kT(n),c=N.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return N.useEffect(()=>()=>c(),[c]),Gy(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,I.jsx)(Oy.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()})})}),Wle=`SelectSeparator`,Gle=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(Oy.div,{"aria-hidden":!0,...r,ref:t})});Gle.displayName=Wle;var mE=`SelectArrow`,Kle=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=jT(n);return qT(mE,n).position===`popper`?(0,I.jsx)(HC,{...i,...r,ref:t}):null});Kle.displayName=mE;var hE=`SelectBubbleInput`,gE=N.forwardRef(({__scopeSelect:e,...t},n)=>{let r=MT(hE,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=N.useRef(null),m=yy(n,p),h=i??``,g=Qx(h);return N.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,I.jsxs)(Oy.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Vy,...t.style},ref:m,defaultValue:h,children:[_E(i)?(0,I.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});gE.displayName=hE;function qle(e){return typeof e==`function`}function _E(e){return e===``||e===void 0}function vE(e){let t=Py(e),n=N.useRef(``),r=N.useRef(0),i=N.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=N.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function yE(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=Jle(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 Jle(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var bE=`Tabs`,[Yle,Xle]=Uy(bE,[qC]),xE=qC(),[Zle,SE]=Yle(bE),CE=N.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Zy(s),[d,f]=Ky({prop:r,onChange:i,defaultProp:a??``,caller:bE});return(0,I.jsx)(Zle,{scope:n,baseId:Xy(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(Oy.div,{dir:u,"data-orientation":o,...l,ref:t})})});CE.displayName=bE;var wE=`TabsList`,TE=N.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=SE(wE,n),o=xE(n);return(0,I.jsx)(QC,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(Oy.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});TE.displayName=wE;var EE=`TabsTrigger`,DE=N.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=SE(EE,n),s=xE(n),c=AE(o.baseId,r),l=jE(o.baseId,r),u=r===o.value;return(0,I.jsx)($C,{asChild:!0,...s,focusable:!i,active:u,children:(0,I.jsx)(Oy.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:K(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:K(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:K(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});DE.displayName=EE;var OE=`TabsContent`,kE=N.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=SE(OE,n),c=AE(s.baseId,r),l=jE(s.baseId,r),u=r===s.value,d=N.useRef(u);return N.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.jsx)(qy,{present:i||u,children:({present:n})=>(0,I.jsx)(Oy.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});kE.displayName=OE;function AE(e,t){return`${e}-trigger-${t}`}function jE(e,t){return`${e}-content-${t}`}var Qle=CE,$le=TE,eue=DE,tue=kE,[ME,nue]=Uy(`Tooltip`,[kC]),NE=kC(),PE=`TooltipProvider`,rue=700,FE=`tooltip.open`,[iue,IE]=ME(PE),LE=e=>{let{__scopeTooltip:t,delayDuration:n=rue,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=N.useRef(!0),s=N.useRef(!1),c=N.useRef(0);return N.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,I.jsx)(iue,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:N.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:N.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:N.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};LE.displayName=PE;var RE=`Tooltip`,[aue,zE]=ME(RE),BE=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=IE(RE,e.__scopeTooltip),l=NE(t),[u,d]=N.useState(null),f=Xy(),p=N.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=N.useRef(!1),[_,v]=Ky({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(FE))):c.onClose(),a?.(e)},caller:RE}),y=N.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=N.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=N.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=N.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return N.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,I.jsx)(zC,{...l,children:(0,I.jsx)(aue,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:N.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:N.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};BE.displayName=RE;var VE=`TooltipTrigger`,HE=N.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=zE(VE,n),a=IE(VE,n),o=NE(n),s=yy(t,N.useRef(null),i.onTriggerChange),c=N.useRef(!1),l=N.useRef(!1),u=N.useCallback(()=>c.current=!1,[]);return N.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,I.jsx)(BC,{asChild:!0,...o,children:(0,I.jsx)(Oy.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)})})});HE.displayName=VE;var UE=`TooltipPortal`,[oue,sue]=ME(UE,{forceMount:void 0}),WE=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=zE(UE,t);return(0,I.jsx)(oue,{scope:t,forceMount:n,children:(0,I.jsx)(qy,{present:n||a.open,children:(0,I.jsx)(pb,{asChild:!0,container:i,children:r})})})};WE.displayName=UE;var GE=`TooltipContent`,KE=N.forwardRef((e,t)=>{let n=sue(GE,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=zE(GE,e.__scopeTooltip);return(0,I.jsx)(qy,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(qE,{side:i,...a,ref:t}):(0,I.jsx)(cue,{side:i,...a,ref:t})})}),cue=N.forwardRef((e,t)=>{let n=zE(GE,e.__scopeTooltip),r=IE(GE,e.__scopeTooltip),i=N.useRef(null),a=yy(t,i),[o,s]=N.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=N.useCallback(()=>{s(null),d(!1)},[d]),p=N.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=pue(r,fue(r,n.getBoundingClientRect())),a=mue(t.getBoundingClientRect());s(gue([...i,...a])),d(!0)},[d]);return N.useEffect(()=>()=>f(),[f]),N.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]),N.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=!hue(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(qE,{...e,ref:a})}),[lue,uue]=ME(RE,{isInside:!1}),due=Ty(`TooltipContent`),qE=N.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=zE(GE,n),l=NE(n),{onClose:u}=c;return N.useEffect(()=>(document.addEventListener(FE,u),()=>document.removeEventListener(FE,u)),[u]),N.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,I.jsx)(tb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,I.jsxs)(VC,{"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,I.jsx)(due,{children:r}),(0,I.jsx)(lue,{scope:n,isInside:!0,children:(0,I.jsx)(Jie,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});KE.displayName=GE;var JE=`TooltipArrow`,YE=N.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=NE(n);return uue(JE,n).isInside?null:(0,I.jsx)(HC,{...i,...r,ref:t})});YE.displayName=JE;function fue(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 pue(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 mue(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 hue(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 gue(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)),_ue(t)}function _ue(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 vue=LE,yue=BE,bue=HE,xue=WE,Sue=KE,Cue=YE,XE=(0,H.forwardRef)((e,t)=>(0,I.jsx)(Ay.div,{...e,ref:t}));XE.displayName=`AttachmentPrimitive.Root`;var ZE=(0,H.forwardRef)((e,t)=>{let n=G(e=>{let t=e.attachment.name.split(`.`);return t.length>1?t.pop():``});return(0,I.jsxs)(Ay.div,{...e,ref:t,children:[`.`,n]})});ZE.displayName=`AttachmentPrimitive.unstable_Thumb`;var QE=()=>(0,I.jsx)(I.Fragment,{children:G(e=>e.attachment.name)});QE.displayName=`AttachmentPrimitive.Name`;var wue=Ny(`AttachmentPrimitive.Remove`,()=>{let e=Dg();return W(()=>{e.attachment().remove()},[e])}),$E=xy({Name:()=>QE,Remove:()=>wue,Root:()=>XE,unstable_Thumb:()=>ZE}),Tue=e=>G(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)}),eD=({children:e,...t})=>Tue(t)?e:null;eD.displayName=`MessagePrimitive.If`;var tD=(0,H.createContext)(null),nD=()=>Eh(tD),Eue=({children:e})=>{let t=xh(new Map),n=xh([]),r=W(()=>{let e=Array.from(t.current.entries());e.sort((e,t)=>t[1]-e[1]),n.current=e.map(([e])=>e)},[]),i=W((e,n)=>{let i=n?.priority??0;return t.current.set(e,i),r(),()=>{t.current.delete(e),r()}},[r]),a=W(()=>n.current,[]),o=U(()=>({register:i,getPlugins:a}),[i,a]);return(0,I.jsx)(tD.Provider,{value:o,children:e})},rD=(0,H.createContext)(null),iD=(0,H.createContext)(null),aD=()=>{let e=Eh(rD);if(!e)throw Error(`useTriggerPopoverRootContext must be used within ComposerPrimitive.TriggerPopoverRoot`);return e},oD=()=>Eh(rD),Due=()=>{let e=Eh(iD);if(!e)throw Error(`useTriggerPopoverAriaPublish must be used within ComposerPrimitive.TriggerPopoverRoot`);return e},Oue=()=>{let e=aD();return(0,H.useSyncExternalStore)(e.subscribe,e.getTriggers,e.getTriggers)},kue=new Map,sD=()=>()=>{},cD=()=>kue,Aue=()=>{let e=oD();return(0,H.useSyncExternalStore)(e?e.subscribe:sD,e?e.getTriggers:cD,e?e.getTriggers:cD)},lD=()=>null,jue=()=>{let e=oD();return(0,H.useSyncExternalStore)(e?e.subscribeAria:sD,e?e.getActiveAria:lD,e?e.getActiveAria:lD)};function uD(){let e=xh(new Set);return{notify:W(()=>{for(let t of e.current)t()},[]),subscribe:W(t=>(e.current.add(t),()=>{e.current.delete(t)}),[])}}var dD=({children:e})=>{let t=xh(new Map),n=xh(new Set),{notify:r,subscribe:i}=uD(),a=W(e=>{let{char:i}=e;if(t.current.has(i))return()=>{};let a=new Map(t.current);a.set(i,e),t.current=a,r();for(let t of n.current)t.added(e);return()=>{let e=new Map(t.current);e.delete(i),t.current=e,r();for(let e of n.current)e.removed(i)}},[r]),o=W(()=>t.current,[]),s=W(e=>(n.current.add(e),()=>{n.current.delete(e)}),[]),c=xh(null),l=xh(null),{notify:u,subscribe:d}=uD(),f=W((e,t)=>{if(t===null){if(l.current!==e)return;c.current=null,l.current=null,u();return}let n=c.current;l.current===e&&n!==null&&n.popoverId===t.popoverId&&n.highlightedItemId===t.highlightedItemId||(c.current=t,l.current=e,u())},[u]),p=W(()=>c.current,[]),m=U(()=>({register:a,getTriggers:o,subscribe:i,subscribeLifecycle:s,getActiveAria:p,subscribeAria:d}),[a,o,i,s,p,d]),h=U(()=>({setActiveAria:f}),[f]);return(0,I.jsx)(rD.Provider,{value:m,children:(0,I.jsx)(iD.Provider,{value:h,children:e})})},fD=({children:e})=>nD()?(0,I.jsx)(dD,{children:e}):(0,I.jsx)(Eue,{children:(0,I.jsx)(dD,{children:e})});fD.displayName=`ComposerPrimitive.TriggerPopoverRoot`;var pD=/\s/u;function Mue(e,t,n){let r=e.slice(0,n);for(let e=r.length-1;e>=0;e--){let n=r[e];if(pD.test(n))return null;if(r.startsWith(t,e)){if(e>0&&!pD.test(r[e-1]))continue;return{query:r.slice(e+t.length),offset:e}}}return null}var Nue=Oh(function({text:e,triggerChar:t}){let[n,r]=bh(e.length),i=U(()=>Mue(e,t,Math.min(n,e.length)),[n,e,t]);return{trigger:i,query:i?.query??``,setCursorPosition:r}});function Pue(e){return`type`in e}var Fue=Oh(function({navigableList:e,isSearchMode:t,activeCategoryId:n,query:r,popoverId:i,open:a,selectItem:o,selectCategory:s,goBack:c,close:l}){let[u,d]=bh(0);Sh(()=>{d(0)},[e]),Sh(()=>{d(0)},[t,n]);let f=wh(t=>{t<0||t>=e.length||t!==u&&d(t)}),p=wh(t=>{if(!a)return!1;switch(t.key){case`ArrowDown`:return t.preventDefault(),d(t=>{let n=e.length;return n===0?0:t<n-1?t+1:0}),!0;case`ArrowUp`:return t.preventDefault(),d(t=>{let n=e.length;return n===0?0:t>0?t-1:n-1}),!0;case`Enter`:case`Tab`:{if(t.shiftKey)return!1;t.preventDefault();let n=e[u];return n&&(Pue(n)?o(n):s(n.id)),!0}case`Escape`:return t.preventDefault(),l(),!0;case`Backspace`:return n&&r===``?(t.preventDefault(),c(),!0):!1;default:return!1}}),m=e[u];return{highlightedIndex:u,highlightedItemId:a&&m?`${i}-option-${m.id}`:void 0,highlightIndex:f,handleKeyDown:p}});function mD(e,t){return e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)||(e.description?.toLowerCase().includes(t)??!1)}var Iue=Oh(function({adapter:e,query:t,open:n}){let[r,i]=bh(null);Sh(()=>{n||i(null)},[n]);let a=U(()=>!n||!e?[]:e.categories(),[n,e]),o=n?r:null,s=U(()=>!o||!e?[]:e.categoryItems(o),[o,e]),c=U(()=>{if(!n||!e||o||!t&&a.length>0)return null;if(e.search)return e.search(t);let r=[],i=t.toLowerCase();for(let t of a)for(let n of e.categoryItems(t.id))mD(n,i)&&r.push(n);return r},[n,e,t,o,a]),l=c!==null,u=U(()=>{if(l)return[];if(!t)return a;let e=t.toLowerCase();return a.filter(t=>t.label.toLowerCase().includes(e))},[a,t,l]),d=U(()=>{if(l)return c??[];if(!t)return s;let e=t.toLowerCase();return s.filter(t=>mD(t,e))},[s,t,l,c]);return{categories:u,items:d,isSearchMode:l,activeCategoryId:o,navigableList:U(()=>l?c??[]:o?d:u,[l,c,o,d,u]),selectCategory:wh(e=>{i(e)}),goBack:wh(()=>{i(null)})}}),Lue=Oh(function({behavior:e,trigger:t,aui:n,triggerChar:r,setCursorPosition:i,onSelected:a}){let o=xh(null),s=wh(e=>(o.current=e,()=>{o.current===e&&(o.current=null)}));return{selectItem:wh(i=>{if(!t||!e)return;if(o.current?.(i)){a();return}let s=n.composer().getState().text,c=s.slice(0,t.offset),l=s.slice(t.offset+r.length+t.query.length),u=()=>{let t=e.formatter.serialize(i);n.composer().setText(c+t+(l.startsWith(` `)?l:` ${l}`))};e.kind===`directive`?(u(),e.onInserted?.(i)):(e.removeOnExecute?n.composer().setText(c+(l.startsWith(` `)?l.slice(1):l)):u(),e.onExecute(i)),a()}),close:wh(()=>{a(),t&&i(t.offset)}),registerSelectItemOverride:s}}),Rue=Oh(function({adapter:e,text:t,triggerChar:n,behavior:r,aui:i,popoverId:a}){let o=Uh(Nue({text:t,triggerChar:n})),s=o.trigger!==null&&e!==void 0&&r!==void 0,c=Uh(Iue({adapter:e,query:o.query,open:s})),l=wh(()=>{c.goBack()}),u=Uh(Lue({behavior:r,trigger:o.trigger,aui:i,triggerChar:n,setCursorPosition:o.setCursorPosition,onSelected:l})),d=Uh(Fue({navigableList:c.navigableList,isSearchMode:c.isSearchMode,activeCategoryId:c.activeCategoryId,query:o.query,popoverId:a,open:s,selectItem:u.selectItem,selectCategory:c.selectCategory,goBack:c.goBack,close:u.close}));return{open:s,query:o.query,activeCategoryId:c.activeCategoryId,categories:c.categories,items:c.items,highlightedIndex:d.highlightedIndex,isSearchMode:c.isSearchMode,popoverId:a,highlightedItemId:d.highlightedItemId,selectCategory:c.selectCategory,goBack:c.goBack,selectItem:u.selectItem,close:u.close,highlightIndex:d.highlightIndex,handleKeyDown:d.handleKeyDown,setCursorPosition:o.setCursorPosition,registerSelectItemOverride:u.registerSelectItemOverride}}),hD=(0,H.createContext)(null),gD=()=>{let e=Eh(hD);if(!e)throw Error(`useTriggerPopoverScopeContext must be used within ComposerPrimitive.TriggerPopover`);return e},zue=()=>Eh(hD),_D=(0,H.createContext)(null),vD=()=>{let e=Eh(_D);if(!e)throw Error(`TriggerPopover.Directive / TriggerPopover.Action must be rendered inside ComposerPrimitive.TriggerPopover`);return e},yD=(0,H.forwardRef)(({char:e,adapter:t,"aria-label":n,children:r,...i},a)=>{let o=Dg(),s=G(e=>e.composer.text),c=(0,H.useId)(),l=xh(null),[u,d]=bh(null),f=xh(0),p=W(e=>(f.current+=1,l.current=e,d(e),()=>{f.current=Math.max(0,f.current-1),l.current===e&&(l.current=null,d(null))}),[e]),m=U(()=>({register:p}),[p]),h=Uh(Rue({adapter:t,text:s,triggerChar:e,behavior:u??void 0,aui:o,popoverId:c})),g=xh(h);g.current=h;let _=aD();Sh(()=>_.register({char:e,...u?{behavior:u}:{},resource:g.current}),[_,e,u]);let v=nD();Sh(()=>{if(v)return v.register(g.current)},[v]);let y=u!==null&&h.open,b=Due();return Sh(()=>{if(y)return()=>{b.setActiveAria(e,null)}},[b,e,y]),Sh(()=>{y&&b.setActiveAria(e,{popoverId:c,highlightedItemId:h.highlightedItemId})},[b,e,c,y,h.highlightedItemId]),(0,I.jsx)(_D.Provider,{value:m,children:(0,I.jsx)(hD.Provider,{value:h,children:y?(0,I.jsx)(Ay.div,{role:`listbox`,id:c,"aria-label":n??`Suggestions`,"aria-activedescendant":h.highlightedItemId,"data-state":`open`,...i,ref:a,children:r}):r})})});yD.displayName=`ComposerPrimitive.TriggerPopover`;var bD=()=>{let{disabled:e,send:t}=Qre(),n=W(()=>t(),[t]);return e?null:n},Bue=Ny(`ComposerPrimitive.Send`,bD),xD=(0,H.forwardRef)(({onSubmit:e,...t},n)=>{let r=bD(),i=e=>{e.preventDefault(),r&&r()};return(0,I.jsx)(Ay.form,{...t,ref:n,onSubmit:K(e,i)})});xD.displayName=`ComposerPrimitive.Root`;var SD=e=>{let t=Py(e),n=cy(e=>e.onScrollToBottom);Sh(()=>n(t),[n,t])},Vue=()=>!1,Hue=()=>{},Uue=e=>(0,H.useSyncExternalStore)(W(t=>{if(typeof window>`u`||e===null)return Hue;let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},[e]),W(()=>typeof window>`u`||e===null?!1:window.matchMedia(e).matches,[e]),Vue);function CD(){return CD=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},CD.apply(null,arguments)}function Wue(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 Gue=N.useLayoutEffect,Kue=function(e){var t=N.useRef(e);return Gue(function(){t.current=e}),t},wD=function(e,t){if(typeof e==`function`){e(t);return}e.current=t},que=function(e,t){var n=N.useRef();return N.useCallback(function(r){e.current=r,n.current&&wD(n.current,null),n.current=t,t&&wD(t,r)},[t])},TD={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`},ED=function(e){Object.keys(TD).forEach(function(t){e.style.setProperty(t,TD[t],`important`)})},DD=null,OD=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize};function Jue(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),DD||(DD=document.createElement(`textarea`),DD.setAttribute(`tabindex`,`-1`),DD.setAttribute(`aria-hidden`,`true`),ED(DD)),DD.parentNode===null&&document.body.appendChild(DD);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach(function(e){var t=e;DD.style[t]=o[t]}),ED(DD),DD.value=t;var c=OD(DD,e);DD.value=t,c=OD(DD,e),DD.value=`x`;var l=DD.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 kD=function(){},Yue=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},Xue=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],Zue=!!document.documentElement.currentStyle,Que=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n=Yue(Xue,t),r=n.boxSizing;return r===``?null:(Zue&&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 AD(e,t,n){var r=Kue(n);N.useLayoutEffect(function(){var n=function(e){return r.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var $ue=function(e,t){AD(document.body,`reset`,function(n){e.current.form===n.target&&t(n)})},ede=function(e){AD(window,`resize`,e)},tde=function(e){AD(document.fonts,`loadingdone`,e)},nde=[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`],rde=N.forwardRef(function(e,t){var n=e.cacheMeasurements,r=e.maxRows,i=e.minRows,a=e.onChange,o=a===void 0?kD:a,s=e.onHeightChange,c=s===void 0?kD:s,l=Wue(e,nde),u=l.value!==void 0,d=N.useRef(null),f=que(d,t),p=N.useRef(0),m=N.useRef(),h=function(){var e=d.current,t=n&&m.current?m.current:Que(e);if(t){m.current=t;var a=Jue(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 N.useLayoutEffect(h),$ue(d,function(){if(!u){var e=d.current.value;requestAnimationFrame(function(){var t=d.current;t&&e!==t.value&&h()})}}),ede(h),tde(h),N.createElement(`textarea`,CD({},l,{onChange:function(e){u||h(),o(e)},ref:f}))}),ide=`(pointer: coarse) and (not (any-pointer: fine))`,jD=(0,H.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=Dg(),y=nD(),b=jue(),x=l??(c===!1?`none`:`enter`),S=Uue(m?ide: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=xh(null),D=yy(_,E),O=xh(!1);Fy(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 ee=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())}}},te=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)}},k=e&&!T,A=W(()=>{let e=E.current;!e||!k||(e.focus({preventScroll:!0}),e.setSelectionRange(e.value.length,e.value.length))},[k]);Sh(()=>A(),[A]),SD(()=>{v.composer().getState().type===`thread`&&f&&A()}),Sh(()=>{if(!(v.composer().getState().type!==`thread`||!d))return v.on(`thread.runStart`,A)},[d,A,v]),Sh(()=>{if(!(v.composer().getState().type!==`thread`||!p))return v.on(`threadListItem.switchedTo`,A)},[p,A,v]);let j=b?{"aria-controls":b.popoverId,"aria-expanded":!0,"aria-haspopup":`listbox`,"aria-activedescendant":b.highlightedItemId}:{},ne={name:`input`,value:w,...g,...j,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(Mh(()=>{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,ee),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;Mh(()=>{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,te)};if(n&&(0,H.isValidElement)(n)){let e=g.children===void 0?n.props.children:g.children;return(0,I.jsx)(Cy,{...ne,children:(0,H.cloneElement)(n,void 0,e)})}return(0,I.jsx)(t?Cy:rde,{...ne})});jD.displayName=`ComposerPrimitive.Input`;var ade=Ny(`ComposerPrimitive.Cancel`,()=>{let{disabled:e,cancel:t}=$re();return e?null:t}),ode=Ny(`ComposerPrimitive.AddAttachment`,({multiple:e=!0}={})=>{let{disabled:t,addAttachment:n}=tie(),r=Dg(),i=W(()=>{let t=document.createElement(`input`);t.type=`file`,t.multiple=e,t.hidden=!0;let i=r.composer().getState().attachmentAccept;i!==`*`&&(t.accept=i),document.body.appendChild(t),t.onchange=e=>{let r=e.target.files;if(r){for(let e of r)n(e);document.body.removeChild(t)}},t.oncancel=()=>{(!t.files||t.files.length===0)&&document.body.removeChild(t)},t.click()},[r,e,n]);return t?null:i},[`multiple`]),MD=(0,H.forwardRef)(({disabled:e,asChild:t=!1,render:n,children:r,...i},a)=>{let[o,s]=bh(!1),c=Dg(),l=W(t=>{e||(t.preventDefault(),s(!0))},[e]),u=W(t=>{e||(t.preventDefault(),o||s(!0))},[e,o]),d=W(t=>{if(e)return;t.preventDefault();let n=t.relatedTarget;n&&t.currentTarget.contains(n)||s(!1)},[e]),f=W(async t=>{if(e)return;t.preventDefault(),s(!1);let n=Array.from(t.dataTransfer.files);await Promise.all(n.map(async e=>{try{await c.composer().addAttachment(e)}catch(e){console.error(`Failed to add attachment:`,e)}}))},[e,c]),p={...o?{"data-dragging":`true`}:null,...i,onDragEnterCapture:K(i.onDragEnterCapture,l),onDragOverCapture:K(i.onDragOverCapture,u),onDragLeaveCapture:K(i.onDragLeaveCapture,d),onDropCapture:K(i.onDropCapture,f),ref:a};if(n&&(0,H.isValidElement)(n)){let e=r===void 0?n.props.children:r;return(0,I.jsx)(Cy,{...p,children:(0,H.cloneElement)(n,void 0,e)})}return(0,I.jsx)(t?Cy:`div`,{...p,children:r})});MD.displayName=`ComposerPrimitive.AttachmentDropzone`;var sde=Ny(`ComposerPrimitive.Dictate`,()=>{let{disabled:e,startDictation:t}=eie();return e?null:t}),cde=Ny(`ComposerPrimitive.StopDictation`,()=>{let e=Dg(),t=G(e=>e.composer.dictation!=null),n=W(()=>{e.composer().stopDictation()},[e]);return t?n:null}),ND=(0,H.forwardRef)(({children:e,...t},n)=>{let r=G(e=>e.composer.dictation?.transcript);return r?(0,I.jsx)(Ay.span,{...t,ref:n,children:e??r}):null});ND.displayName=`ComposerPrimitive.DictationTranscript`;var PD=(0,H.forwardRef)((e,t)=>G(e=>e.composer.quote)?(0,I.jsx)(Ay.div,{...e,ref:t}):null);PD.displayName=`ComposerPrimitive.Quote`;var FD=(0,H.forwardRef)(({children:e,...t},n)=>{let r=G(e=>e.composer.quote?.text);return r?(0,I.jsx)(Ay.span,{...t,ref:n,children:e??r}):null});FD.displayName=`ComposerPrimitive.QuoteText`;var ID=(0,H.forwardRef)(({onClick:e,...t},n)=>{let r=Dg(),i=W(()=>{r.composer().setQuote(void 0)},[r]);return(0,I.jsx)(Ay.button,{type:`button`,...t,ref:n,onClick:K(e,i)})});ID.displayName=`ComposerPrimitive.QuoteDismiss`;var LD=(0,H.forwardRef)(({children:e,"aria-label":t,...n},r)=>{let{categories:i,activeCategoryId:a,isSearchMode:o,open:s}=gD();return!s||a||o?null:(0,I.jsx)(Ay.div,{role:`group`,"aria-label":t??`Categories`,...n,ref:r,children:e(i)})});LD.displayName=`ComposerPrimitive.TriggerPopoverCategories`;var RD=(0,H.forwardRef)(({categoryId:e,onClick:t,onMouseMove:n,...r},i)=>{let{selectCategory:a,highlightIndex:o,categories:s,highlightedIndex:c,activeCategoryId:l,isSearchMode:u,popoverId:d}=gD(),f=W(()=>{a(e)},[a,e]),p=s.findIndex(t=>t.id===e),m=!l&&!u&&p===c,h=W(()=>{o(p)},[o,p]);return(0,I.jsx)(Ay.button,{type:`button`,role:`option`,id:`${d}-option-${e}`,"aria-selected":m,"data-highlighted":m?``:void 0,...r,ref:i,onClick:K(t,f),onMouseMove:K(n,h)})});RD.displayName=`ComposerPrimitive.TriggerPopoverCategoryItem`;var zD=(0,H.forwardRef)(({children:e,"aria-label":t,...n},r)=>{let{items:i,activeCategoryId:a,isSearchMode:o,open:s}=gD();return!s||!a&&!o?null:(0,I.jsx)(Ay.div,{role:`group`,"aria-label":t??`Items`,...n,ref:r,children:e(i)})});zD.displayName=`ComposerPrimitive.TriggerPopoverItems`;var BD=(0,H.forwardRef)(({item:e,index:t,onClick:n,onMouseMove:r,...i},a)=>{let{selectItem:o,highlightIndex:s,items:c,highlightedIndex:l,activeCategoryId:u,isSearchMode:d,popoverId:f}=gD(),p=W(()=>{o(e)},[o,e]),m=t??c.findIndex(t=>t.id===e.id),h=(d||u!==null)&&m===l,g=W(()=>{s(m)},[s,m]);return(0,I.jsx)(Ay.button,{type:`button`,role:`option`,id:`${f}-option-${e.id}`,"aria-selected":h,"data-highlighted":h?``:void 0,...i,ref:a,onClick:K(n,p),onMouseMove:K(r,g)})});BD.displayName=`ComposerPrimitive.TriggerPopoverItem`;var VD=(0,H.forwardRef)(({onClick:e,...t},n)=>{let{activeCategoryId:r,isSearchMode:i,goBack:a,open:o}=gD();return!o||!r||i?null:(0,I.jsx)(Ay.button,{type:`button`,...t,ref:n,onClick:K(e,a)})});VD.displayName=`ComposerPrimitive.TriggerPopoverBack`;var HD=({formatter:e,onExecute:t,removeOnExecute:n})=>{let{register:r}=vD(),i=xh(t);return i.current=t,Sh(()=>r({kind:`action`,formatter:e??ay,onExecute:e=>i.current(e),...n===void 0?{}:{removeOnExecute:n}}),[r,e,n]),null};HD.displayName=`ComposerPrimitive.TriggerPopoverAction`;var UD=({formatter:e,onInserted:t})=>{let{register:n}=vD(),r=xh(t);return r.current=t,Sh(()=>n({kind:`directive`,formatter:e??ay,onInserted:e=>r.current?.(e)}),[n,e]),null};UD.displayName=`ComposerPrimitive.TriggerPopoverDirective`;var lde=Object.assign(yD,{Directive:UD,Action:HD}),WD=xy({AddAttachment:()=>ode,AttachmentByIndex:()=>Yv,AttachmentDropzone:()=>MD,Attachments:()=>Zv,Cancel:()=>ade,Dictate:()=>sde,DictationTranscript:()=>ND,If:()=>iy,Input:()=>jD,Queue:()=>Qv,Quote:()=>PD,QuoteDismiss:()=>ID,QuoteText:()=>FD,Root:()=>xD,Send:()=>Bue,StopDictation:()=>cde,Unstable_TriggerPopover:()=>lde,Unstable_TriggerPopoverBack:()=>VD,Unstable_TriggerPopoverCategories:()=>LD,Unstable_TriggerPopoverCategoryItem:()=>RD,Unstable_TriggerPopoverItem:()=>BD,Unstable_TriggerPopoverItems:()=>zD,Unstable_TriggerPopoverRoot:()=>fD,unstable_useTriggerPopoverRootContext:()=>aD,unstable_useTriggerPopoverRootContextOptional:()=>oD,unstable_useTriggerPopoverScopeContext:()=>gD,unstable_useTriggerPopoverScopeContextOptional:()=>zue,unstable_useTriggerPopoverTriggers:()=>Oue,unstable_useTriggerPopoverTriggersOptional:()=>Aue}),GD=()=>G(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}),ude=()=>G(e=>{if(e.part.type!==`image`)throw Error(`MessagePartImage can only be used inside image message parts.`);return e.part}),KD=(0,H.createContext)(null),dde=e=>({useSmoothStatus:zg(()=>e)}),fde=({children:e})=>{let t=qD({optional:!0}),n=Dg(),[r]=bh(()=>dde(n.part().getState().status));return t?e:(0,I.jsx)(KD.Provider,{value:r,children:e})},pde=e=>{let t=(0,H.forwardRef)((t,n)=>(0,I.jsx)(fde,{children:(0,I.jsx)(e,{...t,ref:n})}));return t.displayName=e.displayName,t};function qD(e){let t=Eh(KD);if(!e?.optional&&!t)throw Error(`This component must be used within a SmoothContextProvider.`);return t}var{useSmoothStatus:mde,useSmoothStatusStore:hde}=oy(qD,`useSmoothStatus`),gde=class{currentText;setText;animationFrameId=null;lastUpdateTime=Date.now();targetText=``;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(5,250/n),i=0;for(;t>=r&&i<n;)i++,t-=r;i===n?this.animationFrameId=null:this.animationFrameId=requestAnimationFrame(this.animate),i!==0&&(this.currentText=this.targetText.slice(0,this.currentText.length+i),this.lastUpdateTime=e-t,this.setText(this.currentText))}},JD=Object.freeze({type:`running`}),YD=(e,t=!1)=>{let{text:n}=e,[r,i]=bh(e.status.type===`running`?``:n),a=Dg(),o=G(()=>a.part()),[s,c]=bh(o);(o!==s||!n.startsWith(r))&&(c(o),i(e.status.type===`running`?``:n));let l=hde({optional:!0}),u=Py(t=>{if(i(t),l){let n=r!==t||e.status.type===`running`?JD:e.status;dy(l).setState(n,!0)}});Sh(()=>{if(l){let i=t&&(r!==n||e.status.type===`running`)?JD:e.status;dy(l).setState(i,!0)}},[l,t,n,r,e.status]);let[d]=bh(new gde(r,u)),f=xh(o);return Sh(()=>{if(!t){d.stop();return}let r=f.current!==o;if(f.current=o,r||!n.startsWith(d.targetText)){e.status.type===`running`?(d.currentText=``,d.targetText=n,d.start()):(d.currentText=n,d.targetText=n,d.stop());return}d.targetText=n,d.start()},[d,t,n,e.status.type,o]),Sh(()=>()=>{d.stop()},[d]),U(()=>t?{type:`text`,text:r,status:n===r?e.status:JD}:e,[t,r,e,n])},XD=(0,H.forwardRef)(({smooth:e=!0,component:t=`span`,...n},r)=>{let{text:i,status:a}=YD(GD(),e);return(0,I.jsx)(t,{"data-status":a.type,...n,ref:r,children:i})});XD.displayName=`MessagePartPrimitive.Text`;var ZD=(0,H.forwardRef)((e,t)=>{let{image:n}=ude();return(0,I.jsx)(Ay.img,{src:n,...e,ref:t})});ZD.displayName=`MessagePartPrimitive.Image`;var QD=e=>{let t=xh(void 0);return W(n=>{t.current&&=(t.current(),void 0),n&&(t.current=e(n))},[e])},$D=(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},_de=e=>e.dataset.messageId,vde=()=>{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},eO=(e,t)=>{let n=`${t}px`;return e.style.height===n?!1:(e.style.height=n,!0)},yde=e=>{let t=window.devicePixelRatio||1;return Math.round(e*t)/t},tO=()=>{let e=Dg(),t=G(()=>e.message());return QD(W(e=>{let n=()=>{t.setIsHovering(!0)},r=()=>{t.setIsHovering(!1)};return e.addEventListener(`mouseenter`,n),e.addEventListener(`mouseleave`,r),e.matches(`:hover`)&&queueMicrotask(()=>t.setIsHovering(!0)),()=>{e.removeEventListener(`mouseenter`,n),e.removeEventListener(`mouseleave`,r),t.setIsHovering(!1)}},[t]))},bde=()=>{let e=cy(e=>e.topAnchorTurn?.anchorId);return G(t=>t.message.role===`user`&&t.message.index>0&&t.message.index===t.thread.messages.length-2&&t.thread.messages.at(-1)?.role===`assistant`&&(t.message.id===e||t.thread.isRunning))},xde=()=>{let e=cy(e=>e.topAnchorTurn?.targetId);return G(t=>t.message.isLast&&t.message.role===`assistant`&&t.message.index>=1&&t.thread.messages.at(t.message.index-1)?.role===`user`&&(t.message.id===e||t.thread.isRunning))},Sde=(e,t)=>QD(W(n=>{if(e)return t.getState().registerAnchorElement(n)},[e,t])),Cde=({active:e,threadViewportStore:t})=>QD(W(n=>{if(!e)return;let r=t.getState(),i=r.topAnchorMessageClamp;return r.registerAnchorTargetElement(n,{tallerThan:$D(i.tallerThan,n),visibleHeight:$D(i.visibleHeight,n)})},[e,t])),wde=({forwardedRef:e,...t})=>{let n=yy(e,tO()),r=G(e=>e.message.id);return(0,I.jsx)(Ay.div,{...t,ref:n,"data-message-id":r})},Tde=({forwardedRef:e,threadViewportStore:t,...n})=>{let r=tO(),i=bde(),a=xde(),o=yy(e,r,Sde(i,t),Cde({active:a,threadViewportStore:t})),s=G(e=>e.message.id);return(0,I.jsx)(Ay.div,{...n,ref:o,"data-message-id":s,"data-aui-top-anchor-user":i?``:void 0,"data-aui-top-anchor-target":a?``:void 0})},nO=(0,H.forwardRef)((e,t)=>{let n=ly();return n.getState().turnAnchor===`top`?(0,I.jsx)(Tde,{...e,forwardedRef:t,threadViewportStore:n}):(0,I.jsx)(wde,{...e,forwardedRef:t})});nO.displayName=`MessagePrimitive.Root`;var rO={...jv,Text:()=>(0,I.jsxs)(`p`,{style:{whiteSpace:`pre-line`},children:[(0,I.jsx)(XD,{}),(0,I.jsx)($v,{children:(0,I.jsx)(`span`,{style:{fontFamily:`revert`},children:` ●`})})]}),Image:()=>(0,I.jsx)(ZD,{})},iO=e=>{if(`children`in e)return(0,I.jsx)(Rv,{children:e.children});let{components:t,...n}=e;return(0,I.jsx)(Rv,{components:t?{Text:t.Text??rO.Text,Image:t.Image??rO.Image,Reasoning:t.Reasoning??jv.Reasoning,Source:t.Source??jv.Source,File:t.File??jv.File,Unstable_Audio:t.Unstable_Audio??jv.Unstable_Audio,...`ChainOfThought`in t?{ChainOfThought:t.ChainOfThought}:{tools:t.tools,data:t.data,ToolGroup:t.ToolGroup??jv.ToolGroup,ReasoningGroup:t.ReasoningGroup??jv.ReasoningGroup},Empty:t.Empty,Quote:t.Quote,generativeUI:t.generativeUI}:rO,...n})};iO.displayName=`MessagePrimitive.Parts`;var aO=({children:e})=>uie()===void 0?null:e;aO.displayName=`MessagePrimitive.Error`;var Ede=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},Dde=e=>{let t=G(e=>e.message.parts);return U(()=>t.length===0?[]:e(t),[t,e])},Ode=({Fallback:e,...t})=>{let n=G(n=>{let r=n.tools.tools[t.toolName]??e;return Array.isArray(r)?r[0]??e:r});return n?(0,I.jsx)(n,{...t}):null},kde=({Fallback:e,...t})=>{let n=G(n=>{let r=n.dataRenderers.renderers[t.name]??e;return Array.isArray(r)?r[0]??e:r});return n?(0,I.jsx)(n,{...t}):null},oO={Text:()=>(0,I.jsxs)(`p`,{style:{whiteSpace:`pre-line`},children:[(0,I.jsx)(XD,{}),(0,I.jsx)($v,{children:(0,I.jsx)(`span`,{style:{fontFamily:`revert`},children:` ●`})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>(0,I.jsx)(ZD,{}),File:()=>null,Unstable_Audio:()=>null,Group:({children:e})=>e},Ade=({components:{Text:e=oO.Text,Reasoning:t=oO.Reasoning,Image:n=oO.Image,Source:r=oO.Source,File:i=oO.File,Unstable_Audio:a=oO.Unstable_Audio,tools:o={},data:s}={}})=>{let c=Dg(),l=G(e=>e.part),u=l.type;if(u===`tool-call`){let e=c.part().addToolResult,t=c.part().resumeToolCall,n=c.part().respondToToolApproval;if(`Override`in o)return(0,I.jsx)(o.Override,{...l,addResult:e,resume:t,respondToApproval:n});let r=o.by_name?.[l.toolName]??o.Fallback;return(0,I.jsx)(Ode,{...l,Fallback:r,addResult:e,resume:t,respondToApproval:n})}if(l.status?.type===`requires-action`)throw Error(`Encountered unexpected requires-action status`);switch(u){case`text`:return(0,I.jsx)(e,{...l});case`reasoning`:return(0,I.jsx)(t,{...l});case`source`:return(0,I.jsx)(r,{...l});case`image`:return(0,I.jsx)(n,{...l});case`file`:return(0,I.jsx)(i,{...l});case`audio`:return(0,I.jsx)(a,{...l});case`data`:{let e=s?.by_name?.[l.name]??s?.Fallback;return(0,I.jsx)(kde,{...l,Fallback:e})}default:return console.warn(`Unknown message part type: ${u}`),null}},jde=(0,H.memo)(({partIndex:e,components:t})=>(0,I.jsx)(o_,{index:e,children:(0,I.jsx)(Ade,{components:t})}),(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),Mde=({status:e,component:t})=>(0,I.jsx)(s_,{text:``,isRunning:e.type===`running`,children:(0,I.jsx)(t,{type:`text`,text:``,status:e})}),Nde=Object.freeze({type:`complete`}),Pde=(0,H.memo)(({components:e})=>{let t=G(e=>e.message.status??Nde);return e?.Empty?(0,I.jsx)(e.Empty,{status:t}):(0,I.jsx)(Mde,{status:t,component:e?.Text??oO.Text})},(e,t)=>e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),sO=({groupingFunction:e,components:t})=>{let n=G(e=>e.message.parts.length),r=Dde(e);return(0,I.jsx)(I.Fragment,{children:U(()=>n===0?(0,I.jsx)(Pde,{components:t}):r.map((e,n)=>(0,I.jsx)(t?.Group??oO.Group,{groupKey:e.groupKey,indices:e.indices,children:e.indices.map(e=>(0,I.jsx)(jde,{partIndex:e,components:t},e))},`group-${n}-${e.groupKey??`ungrouped`}`)),[r,t,n])})};sO.displayName=`MessagePrimitive.Unstable_PartsGrouped`;var cO=({components:e,...t})=>(0,I.jsx)(sO,{...t,components:e,groupingFunction:Ede});cO.displayName=`MessagePrimitive.Unstable_PartsGroupedByParentId`;var lO=xy({AttachmentByIndex:()=>Gv,Attachments:()=>qv,Content:()=>iO,Error:()=>aO,GenerativeUI:()=>wv,GroupedParts:()=>Hv,If:()=>eD,PartByIndex:()=>Mv,Parts:()=>iO,Quote:()=>Uv,Root:()=>nO,Unstable_PartsGrouped:()=>sO,Unstable_PartsGroupedByParentId:()=>cO}),Fde=e=>{let t=Py(e);return QD(W(e=>{let n=new ResizeObserver(()=>{t()}),r=new MutationObserver(e=>{e.some(e=>e.type!==`attributes`||e.attributeName!==`style`)&&t()});return n.observe(e),r.observe(e,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{n.disconnect(),r.disconnect()}},[t]))},Ide=({autoScroll:e,scrollToBottomOnRunStart:t=!0,scrollToBottomOnInitialize:n=!0,scrollToBottomOnThreadSwitch:r=!0})=>{let i=xh(null),a=G(e=>e.thread.messages.length>0),o=xh(!1),s=xh(null),c=ly();e===void 0&&(e=c.getState().turnAnchor!==`top`);let l=xh(0),u=xh(0),d=xh(0),f=xh(0),p=xh(null),m=W(e=>{let t=i.current;t&&(p.current=e,t.scrollTo({top:t.scrollHeight,behavior:e}))},[]),h=W(e=>{p.current=e,s.current!==null&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{s.current=null,m(e)})},[m]);Ch(()=>()=>{s.current!==null&&cancelAnimationFrame(s.current)},[]);let g=W(()=>{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&&dy(c).setState({isAtBottom:n})),l.current=e.scrollTop,u.current=e.scrollHeight},v=Fde(()=>{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=QD(e=>(e.addEventListener(`scroll`,_),()=>{e.removeEventListener(`scroll`,_)}));return Ch(()=>{if(n){if(!a){o.current=!1;return}o.current||(o.current=!0,p.current===null&&h(`instant`))}},[a,h,n]),SD(({behavior:e})=>{m(e)}),Ag(`thread.runStart`,()=>{t&&c.getState().turnAnchor!==`top`&&h(`auto`)}),Ag(`threadListItem.switchedTo`,()=>{r&&h(`instant`)}),yy(v,y,i)},uO=(0,H.forwardRef)((e,t)=>(0,I.jsx)(Ay.div,{...e,ref:t}));uO.displayName=`ThreadPrimitive.Root`;var dO=({children:e})=>G(e=>e.thread.isEmpty)?e:null;dO.displayName=`ThreadPrimitive.Empty`;var Lde=e=>G(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)),fO=({children:e,...t})=>Lde(t)?e:null;fO.displayName=`ThreadPrimitive.If`;var pO=(e,t)=>QD(W(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()}},[e,t])),mO=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},Rde=(e,t)=>{let n=0,r=e;for(;r&&r!==t;)n+=r.offsetTop,r=r.offsetParent;return r===t?n:mO(e)-mO(t)},hO=({viewport:e,anchor:t,tallerThan:n,visibleHeight:r})=>{let i=Rde(t,e),a=t.offsetHeight;return i+Math.max(0,a-(a<=n?a:r))},zde=({scrollHeight:e,...t})=>{let{viewport:n}=t,r=hO(t)+n.clientHeight;return Math.max(0,r-e)},Bde=({viewport:e,reserve:t,...n})=>zde({viewport:e,...n,scrollHeight:e.scrollHeight-t.offsetHeight}),Vde=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}},Hde=e=>{let t=null;return{schedule:()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))},cancel:()=>{t!==null&&(cancelAnimationFrame(t),t=null)}}},Ude=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&&(eO(t,0),t.remove());return}if(t??=vde(),(t.parentElement!==c.parentElement||t.previousElementSibling!==c)&&c.after(t),a.target(o,s,c),eO(t,Bde({viewport:o,anchor:s,reserve:t,...l}))){i.schedule();return}let u=_de(s);if(u!==void 0&&n===u)return;let d=yde(hO({viewport:o,anchor:s,...l}));Math.abs(o.scrollTop-d)>1&&o.scrollTo({top:d,behavior:`smooth`}),u!==void 0&&(n=u)}let i=Hde(r),a=Vde(i.schedule);i.schedule();let o=e.subscribe(i.schedule);return()=>{i.cancel(),o(),a.disconnect(),t?.remove()}},Wde=e=>{let t=ly();Ch(()=>{if(e)return Ude(t)},[e,t])},gO=({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}},Gde=e=>gO(e)?.anchorId,Kde=e=>gO(e)?.targetId,qde=()=>pO(cy(e=>e.registerViewport),W(e=>e.clientHeight,[])),Jde=()=>QD(cy(e=>e.registerViewportElement)),Yde=e=>{let t=ly(),n=G(t=>{if(e)return Gde(t.thread)}),r=G(t=>{if(e)return Kde(t.thread)}),i=U(()=>!n||!r?null:{anchorId:n,targetId:r},[n,r]);Ch(()=>{if(!i)return;let e=t.getState(),n=e.topAnchorTurn;n?.anchorId===i.anchorId&&n.targetId===i.targetId||e.setTopAnchorTurn(i)},[i,t]);let a=W(()=>{t.getState().setTopAnchorTurn(null)},[t]);Ag(`thread.initialize`,a),Ag(`threadListItem.switchedTo`,a)},_O=(0,H.forwardRef)(({autoScroll:e,scrollToBottomOnRunStart:t,scrollToBottomOnInitialize:n,scrollToBottomOnThreadSwitch:r,children:i,...a},o)=>{let s=Ide({autoScroll:e,scrollToBottomOnRunStart:t,scrollToBottomOnInitialize:n,scrollToBottomOnThreadSwitch:r}),c=qde(),l=Jde(),u=ly().getState().turnAnchor===`top`;Yde(u),Wde(u);let d=yy(o,s,c,l);return(0,I.jsx)(Ay.div,{...a,ref:d,children:i})});_O.displayName=`ThreadPrimitive.ViewportScrollable`;var vO=(0,H.forwardRef)(({turnAnchor:e,topAnchorMessageClamp:t,...n},r)=>(0,I.jsx)(fy,{options:{turnAnchor:e,topAnchorMessageClamp:t},children:(0,I.jsx)(_O,{...n,ref:r})}));vO.displayName=`ThreadPrimitive.Viewport`;var yO=(0,H.forwardRef)((e,t)=>{let n=yy(t,pO(cy(e=>e.registerContentInset),W(e=>{let t=parseFloat(getComputedStyle(e).marginTop)||0;return e.offsetHeight+t},[])));return(0,I.jsx)(Ay.div,{...e,ref:n})});yO.displayName=`ThreadPrimitive.ViewportFooter`;var Xde=Ny(`ThreadPrimitive.ScrollToBottom`,({behavior:e}={})=>{let t=cy(e=>e.isAtBottom),n=ly(),r=W(()=>{n.getState().scrollToBottom({behavior:e})},[n,e]);return t?null:r},[`behavior`]),Zde=Ny(`ThreadPrimitive.Suggestion`,({prompt:e,send:t,clearComposer:n,autoSend:r,method:i})=>{let{disabled:a,trigger:o}=lie({prompt:e,send:t??r??!1,clearComposer:n});return a?null:o},[`prompt`,`send`,`clearComposer`,`autoSend`,`method`]),bO=xy({Empty:()=>dO,If:()=>fO,MessageByIndex:()=>vv,Messages:()=>Sre,Root:()=>uO,ScrollToBottom:()=>Xde,Suggestion:()=>Zde,SuggestionByIndex:()=>ty,Suggestions:()=>Xre,Viewport:()=>vO,ViewportFooter:()=>yO,ViewportProvider:()=>fy}),Qde=xy({AssistantRuntimeImpl:()=>A_,BaseAssistantRuntimeCore:()=>j_,CompositeContextProvider:()=>Gh,DefaultThreadComposerRuntimeCore:()=>X_,MessageRepository:()=>H_,ThreadRuntimeImpl:()=>E_,fromThreadMessageLike:()=>z_,generateId:()=>F_,getAutoStatus:()=>L_,splitLocalRuntimeOptions:()=>die,useComposerInputPluginRegistryOptional:()=>nD,useSmooth:()=>YD,useSmoothStatus:()=>mde,withSmoothContextProvider:()=>pde}),xO=typeof window<`u`&&window.location?window.location.hostname:``,SO=e=>`oc.brand.${e}`;function $de(e){if(typeof e!=`object`||!e||Array.isArray(e)||!(`tokens`in e))return!1;let t=e.tokens;if(t===null)return!0;if(typeof t!=`object`)return!1;let n=t.colors;return typeof n==`object`&&!!n&&`light`in n&&`dark`in n}function efe(e){try{let t=localStorage.getItem(SO(e));if(!t)return null;let n=JSON.parse(t);return $de(n)?n:null}catch{return null}}function tfe(e,t){try{localStorage.setItem(SO(e),JSON.stringify(t))}catch{}}var nfe=`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(`.`),CO=[{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(CO.map(e=>e.key));function wO(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,N.useState)(n);return(0,N.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 rfe(e,t){let n=document.documentElement.style,r=e?.colors?.[t];for(let e of nfe){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 TO(e,t){(0,N.useEffect)(()=>{rfe(e??null,t)},[e,t])}var EO=new Map,DO={active:!1,percent:0,count:0},OO=new Set;function kO(){let e=0,t=0;for(let n of EO.values())e+=n.loaded,t+=n.total;let n=EO.size;DO={active:n>0,percent:t>0?Math.min(100,Math.round(e/t*100)):0,count:n};for(let e of OO)e()}var AO={subscribe(e){return OO.add(e),()=>OO.delete(e)},getSnapshot(){return DO},report(e,t,n){EO.set(e,{loaded:t,total:n}),kO()},clear(e){EO.delete(e)&&kO()}};function ife(e,t){if(!e)return null;let n=e.logoLightHasAlpha&&e.logoLightUrl||e.logoDarkHasAlpha&&e.logoDarkUrl||null;if(n)return{url:n,masked:!0};let r=jO(e,t);return r?{url:r,masked:!1}:null}function jO(e,t){return(t===`dark`?e?.logoDarkUrl:e?.logoLightUrl)??(t===`dark`?e?.logoLightUrl:e?.logoDarkUrl)??null}function MO(e){if(!e)return null;let t=/oklch\(\s*([0-9]*\.?[0-9]+)(%?)/i.exec(e);if(!t)return null;let n=parseFloat(t[1]);return Number.isFinite(n)?t[2]===`%`?n/100:n:null}function afe(e,t,n){let r=MO(e),i=MO(t);return r===null||i===null?n:i>r?`dark`:`light`}function ofe(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`?`:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function NO({className:e}){return(0,I.jsxs)(`svg`,{className:e,viewBox:`0 0 64 64`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M25 15H15V49H25`,stroke:`currentColor`,strokeWidth:`6.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`path`,{d:`M39 15H49V49H39`,stroke:`currentColor`,strokeWidth:`6.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`polyline`,{points:`20 33 26 33 29 25 33 41 37 29 41 33 44 33`,stroke:`currentColor`,strokeWidth:`3.4`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}var sfe={},PO=[`fr`,`en`],cfe=`PARAGLIDE_LOCALE`,FO=[`localStorage`,`baseLocale`],IO=[],LO,RO;function lfe(e){if(IO.length===0)return;let t=typeof e==`string`?e:e.href;if(LO===t)return RO;let n=new URL(t,`http://dummy.com`),r;for(let e of IO)if(new sfe(e.match,n.href).exec(n.href)){r=e;break}return LO=t,RO=r,r}function zO(e){let t=lfe(e);return t&&t.exclude!==!0&&Array.isArray(t.strategy)?t.strategy:FO}var BO=void 0;globalThis.__paraglide=globalThis.__paraglide??{},globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};var VO=!1,q=()=>{if(BO){let e=BO?.getStore()?.locale;if(e)return e}let e=FO;typeof window<`u`&&window.location?.href&&(e=zO(window.location.href));let t=ufe(e,typeof window<`u`?window.location?.href:void 0);if(t)return VO||(VO=!0,HO(t,{reload:!1})),t;throw Error(`No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found`)};function ufe(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(GO(t)&&WO.has(t)){let e=WO.get(t);if(e){let t=e.getLocale();if(t instanceof Promise)continue;if(t!==void 0)return ffe(t)}}let e=UO(n);if(e)return e}}var dfe=e=>{e?window.location.href=e:window.location.reload()},HO=(e,t)=>{let n={reload:!0,...t},r;try{r=q()}catch{}let i=[],a=FO;typeof window<`u`&&window.location?.href&&(a=zO(window.location.href));for(let t of a)if(t===`baseLocale`)continue;else if(t===`localStorage`&&typeof window<`u`)localStorage.setItem(cfe,e);else if(GO(t)&&WO.has(t)){let n=WO.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&&dfe(void 0)};if(i.length)return Promise.all(i).then(()=>{o()});o()};function UO(e){if(typeof e!=`string`)return;let t=e.toLowerCase();for(let e of PO)if(e.toLowerCase()===t)return e}function ffe(e){let t=UO(e);if(t)return t;throw Error(`Invalid locale: ${e}. Expected one of: ${PO.join(`, `)}`)}var WO=new Map;function GO(e){return typeof e==`string`&&/^custom-[A-Za-z0-9_-]+$/.test(e)}var pfe=e=>`Fichier trop volumineux (${e?.size} Mo, max ${e?.max} Mo). Réduisez-le (p. ex. compressez les images) et réessayez.`,mfe=e=>`File too large (${e?.size} MB, max ${e?.max} MB). Reduce it (e.g. compress images) and try again.`,hfe=((e,t={})=>(t.locale??q())===`fr`?pfe(e):mfe(e)),gfe=()=>`Chargement…`,_fe=()=>`Loading…`,KO=((e={},t={})=>(t.locale??q())===`fr`?gfe(e):_fe(e)),vfe=()=>`Thème`,yfe=()=>`Theme`,bfe=((e={},t={})=>(t.locale??q())===`fr`?vfe(e):yfe(e)),qO=()=>`Clair`,JO=()=>`Light`,YO=((e={},t={})=>(t.locale??q())===`fr`?qO(e):JO(e)),XO=()=>`Sombre`,ZO=()=>`Dark`,QO=((e={},t={})=>(t.locale??q())===`fr`?XO(e):ZO(e)),$O=()=>`Système`,ek=()=>`System`,tk=((e={},t={})=>(t.locale??q())===`fr`?$O(e):ek(e)),nk=()=>`Défaut de l’app`,rk=()=>`App default`,ik=((e={},t={})=>(t.locale??q())===`fr`?nk(e):rk(e)),ak=()=>`Se déconnecter`,ok=()=>`Sign out`,sk=((e={},t={})=>(t.locale??q())===`fr`?ak(e):ok(e)),ck=()=>`Préférences`,lk=()=>`Preferences`,uk=((e={},t={})=>(t.locale??q())===`fr`?ck(e):lk(e)),dk=()=>`Nom affiché`,fk=()=>`Display name`,pk=((e={},t={})=>(t.locale??q())===`fr`?dk(e):fk(e)),mk=()=>`Le nom et prénom affichés dans la liste des utilisateurs et le menu de compte. Vous pouvez le modifier à tout moment.`,hk=()=>`The name shown in the user list and the account menu. You can change it at any time.`,gk=((e={},t={})=>(t.locale??q())===`fr`?mk(e):hk(e)),_k=()=>`Votre nom et prénom`,vk=()=>`Your name`,yk=((e={},t={})=>(t.locale??q())===`fr`?_k(e):vk(e)),bk=()=>`Laissez vide pour n’afficher que votre email.`,xk=()=>`Leave empty to show only your email.`,Sk=((e={},t={})=>(t.locale??q())===`fr`?bk(e):xk(e)),Ck=()=>`Nom affiché mis à jour.`,wk=()=>`Display name updated.`,Tk=((e={},t={})=>(t.locale??q())===`fr`?Ck(e):wk(e)),Ek=()=>`Échec de la mise à jour du nom`,Dk=()=>`Failed to update the name`,Ok=((e={},t={})=>(t.locale??q())===`fr`?Ek(e):Dk(e)),kk=()=>`Langue`,Ak=()=>`Language`,jk=((e={},t={})=>(t.locale??q())===`fr`?kk(e):Ak(e)),Mk=()=>`Choisissez la langue de l’interface. « Défaut de l’app » suit le réglage de l’administrateur.`,Nk=()=>`Choose the interface language. “App default” follows the administrator setting.`,Pk=((e={},t={})=>(t.locale??q())===`fr`?Mk(e):Nk(e)),Fk=()=>`Le changement de langue recharge la page une fois.`,Ik=()=>`Changing the language reloads the page once.`,Lk=((e={},t={})=>(t.locale??q())===`fr`?Fk(e):Ik(e)),Rk=()=>`Interface`,zk=()=>`Interface`,Bk=((e={},t={})=>(t.locale??q())===`fr`?Rk(e):zk(e)),Vk=()=>`Activez ou masquez des éléments d’interface. Les options grisées sont verrouillées par l’administrateur.`,Hk=()=>`Enable or hide interface elements. Greyed options are locked by the administrator.`,Uk=((e={},t={})=>(t.locale??q())===`fr`?Vk(e):Hk(e)),Wk=()=>`Français`,Gk=()=>`French`,Kk=((e={},t={})=>(t.locale??q())===`fr`?Wk(e):Gk(e)),qk=()=>`Anglais`,Jk=()=>`English`,Yk=((e={},t={})=>(t.locale??q())===`fr`?qk(e):Jk(e)),Xk=()=>`Fichiers`,Zk=()=>`Files`,Qk=((e={},t={})=>(t.locale??q())===`fr`?Xk(e):Zk(e)),$k=()=>`Tous les fichiers échangés dans vos conversations (envoyés et reçus).`,eA=()=>`Every file exchanged across your conversations (sent and received).`,tA=((e={},t={})=>(t.locale??q())===`fr`?$k(e):eA(e)),nA=()=>`Sens`,rA=()=>`Direction`,iA=((e={},t={})=>(t.locale??q())===`fr`?nA(e):rA(e)),aA=()=>`Tous les sens`,oA=()=>`All directions`,sA=((e={},t={})=>(t.locale??q())===`fr`?aA(e):oA(e)),cA=()=>`Envoyé`,lA=()=>`Sent`,uA=((e={},t={})=>(t.locale??q())===`fr`?cA(e):lA(e)),dA=()=>`Reçu`,fA=()=>`Received`,pA=((e={},t={})=>(t.locale??q())===`fr`?dA(e):fA(e)),mA=()=>`Conversation`,hA=()=>`Conversation`,gA=((e={},t={})=>(t.locale??q())===`fr`?mA(e):hA(e)),_A=()=>`Toutes les conversations`,vA=()=>`All conversations`,yA=((e={},t={})=>(t.locale??q())===`fr`?_A(e):vA(e)),bA=()=>`Bridge`,xA=()=>`Bridge`,SA=((e={},t={})=>(t.locale??q())===`fr`?bA(e):xA(e)),CA=()=>`Tous les bridges`,wA=()=>`All bridges`,TA=((e={},t={})=>(t.locale??q())===`fr`?CA(e):wA(e)),EA=()=>`Type`,DA=()=>`Type`,OA=((e={},t={})=>(t.locale??q())===`fr`?EA(e):DA(e)),kA=()=>`Tous les types`,AA=()=>`All types`,jA=((e={},t={})=>(t.locale??q())===`fr`?kA(e):AA(e)),MA=()=>`Image`,NA=()=>`Image`,PA=((e={},t={})=>(t.locale??q())===`fr`?MA(e):NA(e)),FA=()=>`Audio`,IA=()=>`Audio`,LA=((e={},t={})=>(t.locale??q())===`fr`?FA(e):IA(e)),RA=()=>`Vidéo`,zA=()=>`Video`,BA=((e={},t={})=>(t.locale??q())===`fr`?RA(e):zA(e)),VA=()=>`PDF`,HA=()=>`PDF`,UA=((e={},t={})=>(t.locale??q())===`fr`?VA(e):HA(e)),WA=()=>`Document`,GA=()=>`Document`,KA=((e={},t={})=>(t.locale??q())===`fr`?WA(e):GA(e)),qA=()=>`Archive`,JA=()=>`Archive`,YA=((e={},t={})=>(t.locale??q())===`fr`?qA(e):JA(e)),XA=()=>`Autre`,ZA=()=>`Other`,QA=((e={},t={})=>(t.locale??q())===`fr`?XA(e):ZA(e)),$A=()=>`Nom`,ej=()=>`Name`,tj=((e={},t={})=>(t.locale??q())===`fr`?$A(e):ej(e)),nj=()=>`Type`,rj=()=>`Type`,ij=((e={},t={})=>(t.locale??q())===`fr`?nj(e):rj(e)),aj=()=>`Sens`,oj=()=>`Direction`,sj=((e={},t={})=>(t.locale??q())===`fr`?aj(e):oj(e)),cj=()=>`Conversation`,lj=()=>`Conversation`,uj=((e={},t={})=>(t.locale??q())===`fr`?cj(e):lj(e)),dj=()=>`Date`,fj=()=>`Date`,pj=((e={},t={})=>(t.locale??q())===`fr`?dj(e):fj(e)),mj=()=>`Action`,hj=()=>`Action`,gj=((e={},t={})=>(t.locale??q())===`fr`?mj(e):hj(e)),_j=()=>`Télécharger`,vj=()=>`Download`,yj=((e={},t={})=>(t.locale??q())===`fr`?_j(e):vj(e)),bj=()=>`Réinitialiser`,xj=()=>`Reset`,Sj=((e={},t={})=>(t.locale??q())===`fr`?bj(e):xj(e)),Cj=()=>`Actions`,wj=()=>`Actions`,Tj=((e={},t={})=>(t.locale??q())===`fr`?Cj(e):wj(e)),Ej=()=>`Supprimer`,Dj=()=>`Delete`,Oj=((e={},t={})=>(t.locale??q())===`fr`?Ej(e):Dj(e)),kj=()=>`Fichier supprimé`,Aj=()=>`File removed`,jj=((e={},t={})=>(t.locale??q())===`fr`?kj(e):Aj(e)),Mj=()=>`Échec de la suppression du fichier`,Nj=()=>`Could not remove the file`,Pj=((e={},t={})=>(t.locale??q())===`fr`?Mj(e):Nj(e)),Fj=()=>`Supprimer ce fichier ?`,Ij=()=>`Remove this file?`,Lj=((e={},t={})=>(t.locale??q())===`fr`?Fj(e):Ij(e)),Rj=()=>`Il sera retiré de vos fichiers. La conversation où il a été échangé n'est pas modifiée.`,zj=()=>`It will be removed from your files. The conversation where it was exchanged is unchanged.`,Bj=((e={},t={})=>(t.locale??q())===`fr`?Rj(e):zj(e)),Vj=()=>`Indisponible`,Hj=()=>`Unavailable`,Uj=((e={},t={})=>(t.locale??q())===`fr`?Vj(e):Hj(e)),Wj=()=>`Aucun fichier pour le moment.`,Gj=()=>`No files yet.`,Kj=((e={},t={})=>(t.locale??q())===`fr`?Wj(e):Gj(e)),qj=()=>`Aucun fichier ne correspond aux filtres.`,Jj=()=>`No files match the filters.`,Yj=((e={},t={})=>(t.locale??q())===`fr`?qj(e):Jj(e)),Xj=e=>`Affichage des ${e?.cap} fichiers les plus récents.`,Zj=e=>`Showing the ${e?.cap} most recent files.`,Qj=((e,t={})=>(t.locale??q())===`fr`?Xj(e):Zj(e)),$j=()=>`Apparence`,eM=()=>`Appearance`,tM=((e={},t={})=>(t.locale??q())===`fr`?$j(e):eM(e)),nM=()=>`Thème par défaut de l’application`,rM=()=>`Default app theme`,iM=((e={},t={})=>(t.locale??q())===`fr`?nM(e):rM(e)),aM=()=>`Appliqué aux utilisateurs sans préférence personnelle.`,oM=()=>`Applied to users without a personal preference.`,sM=((e={},t={})=>(t.locale??q())===`fr`?aM(e):oM(e)),cM=()=>`Langue par défaut de l’application`,lM=()=>`Default app language`,uM=((e={},t={})=>(t.locale??q())===`fr`?cM(e):lM(e)),dM=()=>`Langue des nouveaux utilisateurs qui n’ont pas encore choisi la leur.`,fM=()=>`Language for new users who haven’t picked their own yet.`,pM=((e={},t={})=>(t.locale??q())===`fr`?dM(e):fM(e)),mM=()=>`Si vous n’avez pas défini votre propre langue, changer ce défaut rechargera votre vue.`,hM=()=>`If you haven’t set your own language, changing this default will reload your view.`,gM=((e={},t={})=>(t.locale??q())===`fr`?mM(e):hM(e)),_M=()=>`Référence des composants (design)`,vM=()=>`Component reference (design)`,yM=((e={},t={})=>(t.locale??q())===`fr`?_M(e):vM(e)),bM=()=>`Administration de l’apparence`,xM=()=>`Appearance administration`,SM=((e={},t={})=>(t.locale??q())===`fr`?bM(e):xM(e)),CM=()=>`Réservé aux administrateurs. S’applique à toute l’organisation.`,wM=()=>`Admins only. Applies to the whole organization.`,TM=((e={},t={})=>(t.locale??q())===`fr`?CM(e):wM(e)),EM=()=>`Ma charte graphique`,DM=()=>`My graphic chart`,OM=((e={},t={})=>(t.locale??q())===`fr`?EM(e):DM(e)),kM=()=>`Choisissez la palette appliquée à votre interface, en clair comme en sombre.`,AM=()=>`Pick the palette applied to your interface, in light and dark.`,jM=((e={},t={})=>(t.locale??q())===`fr`?kM(e):AM(e)),MM=()=>`Défaut de l’application`,NM=()=>`Application default`,PM=((e={},t={})=>(t.locale??q())===`fr`?MM(e):NM(e)),FM=()=>`Suit le défaut de l’application.`,IM=()=>`Follows the application default.`,LM=((e={},t={})=>(t.locale??q())===`fr`?FM(e):IM(e)),RM=()=>`Commune`,zM=()=>`Common`,BM=((e={},t={})=>(t.locale??q())===`fr`?RM(e):zM(e)),VM=()=>`La vôtre`,HM=()=>`Yours`,UM=((e={},t={})=>(t.locale??q())===`fr`?VM(e):HM(e)),WM=e=>`Via le groupe ${e?.group}`,GM=e=>`Via group ${e?.group}`,KM=((e,t={})=>(t.locale??q())===`fr`?WM(e):GM(e)),qM=()=>`Aucune charte disponible pour le moment.`,JM=()=>`No chart available yet.`,YM=((e={},t={})=>(t.locale??q())===`fr`?qM(e):JM(e)),XM=()=>`Charte par défaut de l’application`,ZM=()=>`Application default chart`,QM=((e={},t={})=>(t.locale??q())===`fr`?XM(e):ZM(e)),$M=()=>`Appliquée aux utilisateurs sans charte personnelle.`,eN=()=>`Applied to users without a personal chart.`,tN=((e={},t={})=>(t.locale??q())===`fr`?$M(e):eN(e)),nN=()=>`Pools de chartes par groupe`,rN=()=>`Group chart pools`,iN=((e={},t={})=>(t.locale??q())===`fr`?nN(e):rN(e)),aN=()=>`Définissez le pool de chaque charte : les groupes qui PEUVENT la proposer. Un gestionnaire de groupe choisit ensuite dans son pool (onglet Groupes). Une charte reste commune tant qu’aucun groupe ne l’a sélectionnée.`,oN=()=>`Define each chart's pool: the groups that MAY offer it. A group manager then selects from its pool (Groups tab). A chart stays common until a group actually selects it.`,sN=((e={},t={})=>(t.locale??q())===`fr`?aN(e):oN(e)),cN=()=>`Charte par domaine`,lN=()=>`Chart by domain`,uN=((e={},t={})=>(t.locale??q())===`fr`?cN(e):lN(e)),dN=()=>`Associez un domaine à une charte publique (intégrée ou commune) : elle devient la charte par défaut sur cet hôte, page de connexion comprise.`,fN=()=>`Map a domain to a public chart (builtin or common): it becomes the default chart on that host, including the login page.`,pN=((e={},t={})=>(t.locale??q())===`fr`?dN(e):fN(e)),mN=()=>`Commune`,hN=()=>`Common`,gN=((e={},t={})=>(t.locale??q())===`fr`?mN(e):hN(e)),_N=()=>`Restreinte`,vN=()=>`Restricted`,yN=((e={},t={})=>(t.locale??q())===`fr`?_N(e):vN(e)),bN=()=>`Défaut`,xN=()=>`Default`,SN=((e={},t={})=>(t.locale??q())===`fr`?bN(e):xN(e)),CN=()=>`Aucun groupe à associer.`,wN=()=>`No group to attach.`,TN=((e={},t={})=>(t.locale??q())===`fr`?CN(e):wN(e)),EN=()=>`Disponible aux groupes (pool)`,DN=()=>`Available to groups (pool)`,ON=((e={},t={})=>(t.locale??q())===`fr`?EN(e):DN(e)),kN=()=>`Ajouter au pool d'un groupe…`,AN=()=>`Add to a group's pool…`,jN=((e={},t={})=>(t.locale??q())===`fr`?kN(e):AN(e)),MN=e=>`Retirer ${e?.group} du pool`,NN=e=>`Remove ${e?.group} from the pool`,PN=((e,t={})=>(t.locale??q())===`fr`?MN(e):NN(e)),FN=()=>`Importer une charte`,IN=()=>`Import a chart`,LN=((e={},t={})=>(t.locale??q())===`fr`?FN(e):IN(e)),RN=()=>`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.`,zN=()=>`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.`,BN=((e={},t={})=>(t.locale??q())===`fr`?RN(e):zN(e)),VN=()=>`Nom de la charte`,HN=()=>`Chart name`,UN=((e={},t={})=>(t.locale??q())===`fr`?VN(e):HN(e)),WN=()=>`Ma charte`,GN=()=>`My chart`,KN=((e={},t={})=>(t.locale??q())===`fr`?WN(e):GN(e)),qN=()=>`JSON des tokens`,JN=()=>`Tokens JSON`,YN=((e={},t={})=>(t.locale??q())===`fr`?qN(e):JN(e)),XN=()=>`Collez ici le JSON des tokens (colors.light / colors.dark en oklch, radius, fontSans, fontMono)…`,ZN=()=>`Paste the tokens JSON here (colors.light / colors.dark in oklch, radius, fontSans, fontMono)…`,QN=((e={},t={})=>(t.locale??q())===`fr`?XN(e):ZN(e)),$N=()=>`Charger un fichier .json`,eP=()=>`Load a .json file`,tP=((e={},t={})=>(t.locale??q())===`fr`?$N(e):eP(e)),nP=()=>`Importer`,rP=()=>`Import`,iP=((e={},t={})=>(t.locale??q())===`fr`?nP(e):rP(e)),aP=()=>`JSON invalide : impossible d’analyser le contenu.`,oP=()=>`Invalid JSON: could not parse the content.`,sP=((e={},t={})=>(t.locale??q())===`fr`?aP(e):oP(e)),cP=()=>`Charte importée.`,lP=()=>`Chart imported.`,uP=((e={},t={})=>(t.locale??q())===`fr`?cP(e):lP(e)),dP=()=>`Indiquez un nom de charte.`,fP=()=>`Please provide a chart name.`,pP=((e={},t={})=>(t.locale??q())===`fr`?dP(e):fP(e)),mP=()=>`Mes chartes`,hP=()=>`My charts`,gP=((e={},t={})=>(t.locale??q())===`fr`?mP(e):hP(e)),_P=()=>`Les chartes que vous avez importées. Vous pouvez les renommer, modifier leurs tokens, les associer à vos groupes ou les supprimer.`,vP=()=>`The charts you have imported. You can rename them, edit their tokens, associate them with your groups, or delete them.`,yP=((e={},t={})=>(t.locale??q())===`fr`?_P(e):vP(e)),bP=()=>`Vous n’avez pas encore importé de charte.`,xP=()=>`You haven't imported any chart yet.`,SP=((e={},t={})=>(t.locale??q())===`fr`?bP(e):xP(e)),CP=()=>`Modifier`,wP=()=>`Edit`,TP=((e={},t={})=>(t.locale??q())===`fr`?CP(e):wP(e)),EP=()=>`Supprimer`,DP=()=>`Delete`,OP=((e={},t={})=>(t.locale??q())===`fr`?EP(e):DP(e)),kP=()=>`Logo de marque`,AP=()=>`Brand logo`,jP=((e={},t={})=>(t.locale??q())===`fr`?kP(e):AP(e)),MP=()=>`Mode clair`,NP=()=>`Light mode`,PP=((e={},t={})=>(t.locale??q())===`fr`?MP(e):NP(e)),FP=()=>`Mode sombre`,IP=()=>`Dark mode`,LP=((e={},t={})=>(t.locale??q())===`fr`?FP(e):IP(e)),RP=()=>`Téléverser`,zP=()=>`Upload`,BP=((e={},t={})=>(t.locale??q())===`fr`?RP(e):zP(e)),VP=()=>`Remplacer`,HP=()=>`Replace`,UP=((e={},t={})=>(t.locale??q())===`fr`?VP(e):HP(e)),WP=()=>`Retirer`,GP=()=>`Remove`,KP=((e={},t={})=>(t.locale??q())===`fr`?WP(e):GP(e)),qP=()=>`Générer depuis l’autre mode`,JP=()=>`Generate from the other mode`,YP=((e={},t={})=>(t.locale??q())===`fr`?qP(e):JP(e)),XP=()=>`Traitement…`,ZP=()=>`Processing…`,QP=((e={},t={})=>(t.locale??q())===`fr`?XP(e):ZP(e)),$P=()=>`Le fichier doit être une image.`,eF=()=>`The file must be an image.`,tF=((e={},t={})=>(t.locale??q())===`fr`?$P(e):eF(e)),nF=()=>`Image trop volumineuse (max 12 Mo).`,rF=()=>`Image too large (max 12 MB).`,iF=((e={},t={})=>(t.locale??q())===`fr`?nF(e):rF(e)),aF=()=>`Format d’image non pris en charge.`,oF=()=>`Unsupported image format.`,sF=((e={},t={})=>(t.locale??q())===`fr`?aF(e):oF(e)),cF=()=>`Traitement de l’image impossible.`,lF=()=>`Could not process the image.`,uF=((e={},t={})=>(t.locale??q())===`fr`?cF(e):lF(e)),dF=()=>`Encodage de l’image impossible.`,fF=()=>`Could not encode the image.`,pF=((e={},t={})=>(t.locale??q())===`fr`?dF(e):fF(e)),mF=()=>`Domaines (admin)`,hF=()=>`Domains (admin)`,gF=((e={},t={})=>(t.locale??q())===`fr`?mF(e):hF(e)),_F=()=>`Quand Atrium est ouvert sur ce domaine, cette charte s’applique par défaut (page de connexion incluse). Ex. chat.acme.com ou *.acme.com.`,vF=()=>`When Atrium is opened on this domain, this chart applies by default (including the login page). E.g. chat.acme.com or *.acme.com.`,yF=((e={},t={})=>(t.locale??q())===`fr`?_F(e):vF(e)),bF=()=>`chat.acme.com ou *.acme.com`,xF=()=>`chat.acme.com or *.acme.com`,SF=((e={},t={})=>(t.locale??q())===`fr`?bF(e):xF(e)),CF=()=>`Ajouter`,wF=()=>`Add`,TF=((e={},t={})=>(t.locale??q())===`fr`?CF(e):wF(e)),EF=()=>`Aucun domaine.`,DF=()=>`No domain.`,OF=((e={},t={})=>(t.locale??q())===`fr`?EF(e):DF(e)),kF=e=>`Retirer ${e?.domain}`,AF=e=>`Remove ${e?.domain}`,jF=((e,t={})=>(t.locale??q())===`fr`?kF(e):AF(e)),MF=()=>`Enregistrer`,NF=()=>`Save`,PF=((e={},t={})=>(t.locale??q())===`fr`?MF(e):NF(e)),FF=()=>`Annuler`,IF=()=>`Cancel`,LF=((e={},t={})=>(t.locale??q())===`fr`?FF(e):IF(e)),RF=()=>`Nom`,zF=()=>`Name`,BF=((e={},t={})=>(t.locale??q())===`fr`?RF(e):zF(e)),VF=()=>`Tokens (JSON)`,HF=()=>`Tokens (JSON)`,UF=((e={},t={})=>(t.locale??q())===`fr`?VF(e):HF(e)),WF=()=>`Supprimer définitivement cette charte ?`,GF=()=>`Permanently delete this chart?`,KF=((e={},t={})=>(t.locale??q())===`fr`?WF(e):GF(e)),qF=()=>`Chartes personnalisées`,JF=()=>`Custom charts`,YF=((e={},t={})=>(t.locale??q())===`fr`?qF(e):JF(e)),XF=()=>`Gérez les chartes importées par les utilisateurs : promouvoir en commune (offerte à tous) ou supprimer.`,ZF=()=>`Manage charts imported by users: promote to common (offered to everyone) or delete.`,QF=((e={},t={})=>(t.locale??q())===`fr`?XF(e):ZF(e)),$F=e=>`Propriétaire : ${e?.owner}`,eI=e=>`Owner: ${e?.owner}`,tI=((e,t={})=>(t.locale??q())===`fr`?$F(e):eI(e)),nI=()=>`Personnelle`,rI=()=>`Personal`,iI=((e={},t={})=>(t.locale??q())===`fr`?nI(e):rI(e)),aI=()=>`Commune`,oI=()=>`Common`,sI=((e={},t={})=>(t.locale??q())===`fr`?aI(e):oI(e)),cI=()=>`Promouvoir en commune`,lI=()=>`Promote to common`,uI=((e={},t={})=>(t.locale??q())===`fr`?cI(e):lI(e)),dI=()=>`Supprimer`,fI=()=>`Delete`,pI=((e={},t={})=>(t.locale??q())===`fr`?dI(e):fI(e)),mI=()=>`Aucune charte personnalisée pour le moment.`,hI=()=>`No custom chart yet.`,gI=((e={},t={})=>(t.locale??q())===`fr`?mI(e):hI(e)),_I=()=>`Messages`,vI=()=>`Messages`,yI=((e={},t={})=>(t.locale??q())===`fr`?_I(e):vI(e)),bI=()=>`Composeur`,xI=()=>`Composer`,SI=((e={},t={})=>(t.locale??q())===`fr`?bI(e):xI(e)),CI=()=>`Barre latérale`,wI=()=>`Sidebar`,TI=((e={},t={})=>(t.locale??q())===`fr`?CI(e):wI(e)),EI=()=>`Autre`,DI=()=>`Other`,OI=((e={},t={})=>(t.locale??q())===`fr`?EI(e):DI(e)),kI=()=>`Vue source des messages`,AI=()=>`Message source view`,jI=((e={},t={})=>(t.locale??q())===`fr`?kI(e):AI(e)),MI=()=>`Le bouton </> qui montre le texte brut exact d’un message.`,NI=()=>`The </> button that shows a message’s exact raw text.`,PI=((e={},t={})=>(t.locale??q())===`fr`?MI(e):NI(e)),FI=()=>`Signaler un problème`,II=()=>`Report a problem`,LI=((e={},t={})=>(t.locale??q())===`fr`?FI(e):II(e)),RI=()=>`Le drapeau qui envoie un signalement (feedback) sur un message.`,zI=()=>`The flag that sends feedback about a message.`,BI=((e={},t={})=>(t.locale??q())===`fr`?RI(e):zI(e)),VI=()=>`Copier les réponses de l’IA`,HI=()=>`Copy AI replies`,UI=((e={},t={})=>(t.locale??q())===`fr`?VI(e):HI(e)),WI=()=>`Copier vos messages`,GI=()=>`Copy your messages`,KI=((e={},t={})=>(t.locale??q())===`fr`?WI(e):GI(e)),qI=()=>`Supprimer un message`,JI=()=>`Delete a message`,YI=((e={},t={})=>(t.locale??q())===`fr`?qI(e):JI(e)),XI=()=>`Activité des outils`,ZI=()=>`Tool activity`,QI=((e={},t={})=>(t.locale??q())===`fr`?XI(e):ZI(e)),$I=()=>`Affiche l’activité des outils et les sources dans la conversation (vue d’analyse, avec détail dépliable). Désactivé : vue épurée centrée sur le contenu — le signal « traitement en cours » reste visible.`,eL=()=>`Shows tool activity and sources in the conversation (analysis view, with expandable detail). Off: a clean, content-focused view — the “processing in progress” signal stays visible.`,tL=((e={},t={})=>(t.locale??q())===`fr`?$I(e):eL(e)),nL=()=>`Saisie vocale (micro)`,rL=()=>`Voice input (mic)`,iL=((e={},t={})=>(t.locale??q())===`fr`?nL(e):rL(e)),aL=()=>`Le bouton micro dans le composeur.`,oL=()=>`The mic button in the composer.`,sL=((e={},t={})=>(t.locale??q())===`fr`?aL(e):oL(e)),cL=()=>`Âge des conversations`,lL=()=>`Conversation age`,uL=((e={},t={})=>(t.locale??q())===`fr`?cL(e):lL(e)),dL=()=>`Afficher l’ancienneté de chaque conversation (ex. « 3j », « 2sem ») dans la liste à gauche.`,fL=()=>`Show each conversation’s age (e.g. “3d”, “2w”) in the left list.`,pL=((e={},t={})=>(t.locale??q())===`fr`?dL(e):fL(e)),mL=()=>`Bridge des conversations`,hL=()=>`Conversation bridge`,gL=((e={},t={})=>(t.locale??q())===`fr`?mL(e):hL(e)),_L=()=>`Marquer le bridge (OpenClaw / Hermes) de chaque conversation dans la liste à gauche. Apparaît uniquement si vos conversations utilisent plusieurs bridges.`,vL=()=>`Tag each conversation’s bridge (OpenClaw / Hermes) in the left list. Shown only if your conversations use more than one bridge.`,yL=((e={},t={})=>(t.locale??q())===`fr`?_L(e):vL(e)),bL=()=>`Filtrer les préférences…`,xL=()=>`Filter preferences…`,SL=((e={},t={})=>(t.locale??q())===`fr`?bL(e):xL(e)),CL=()=>`Aucune préférence ne correspond.`,wL=()=>`No preference matches.`,TL=((e={},t={})=>(t.locale??q())===`fr`?CL(e):wL(e)),EL=()=>`Non activé`,DL=()=>`Not enabled`,OL=((e={},t={})=>(t.locale??q())===`fr`?EL(e):DL(e)),kL=()=>`défaut`,AL=()=>`default`,jL=((e={},t={})=>(t.locale??q())===`fr`?kL(e):AL(e)),ML=()=>`Réinitialiser`,NL=()=>`Reset`,PL=((e={},t={})=>(t.locale??q())===`fr`?ML(e):NL(e)),FL=()=>`Gérer les défauts et verrous`,IL=()=>`Manage defaults and locks`,LL=((e={},t={})=>(t.locale??q())===`fr`?FL(e):IL(e)),RL=()=>`Défaut admin`,zL=()=>`Admin default`,BL=((e={},t={})=>(t.locale??q())===`fr`?RL(e):zL(e)),VL=()=>`Fonctionnalité activée (système)`,HL=()=>`Feature enabled (system)`,UL=((e={},t={})=>(t.locale??q())===`fr`?VL(e):HL(e)),WL=()=>`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).`,GL=()=>`Configure the interface: enable system features and set the defaults users inherit (each can then override them in their own preferences).`,KL=((e={},t={})=>(t.locale??q())===`fr`?WL(e):GL(e)),qL=()=>`Une fonctionnalité non activée ici ne peut pas être activée par les utilisateurs (option grisée).`,JL=()=>`A feature not enabled here cannot be turned on by users (greyed out).`,YL=((e={},t={})=>(t.locale??q())===`fr`?qL(e):JL(e)),XL=()=>`Active le pipeline vocal. Tant que c’est désactivé, l’option reste grisée et non activable par les utilisateurs.`,ZL=()=>`Enables the voice pipeline. While off, the option stays greyed and users can’t turn it on.`,QL=((e={},t={})=>(t.locale??q())===`fr`?XL(e):ZL(e)),$L=()=>`« Hérité » = la valeur intégrée par défaut de l’application.`,eR=()=>`“Inherited” = the app’s built-in default value.`,tR=((e={},t={})=>(t.locale??q())===`fr`?$L(e):eR(e)),nR=()=>`Activé`,rR=()=>`On`,iR=((e={},t={})=>(t.locale??q())===`fr`?nR(e):rR(e)),aR=()=>`Désactivé`,oR=()=>`Off`,sR=((e={},t={})=>(t.locale??q())===`fr`?aR(e):oR(e)),cR=()=>`Hérité`,lR=()=>`Inherited`,uR=((e={},t={})=>(t.locale??q())===`fr`?cR(e):lR(e)),dR=()=>`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.`,fR=()=>`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.`,pR=((e={},t={})=>(t.locale??q())===`fr`?dR(e):fR(e)),mR=()=>`Rechercher un compte`,hR=()=>`Search an account`,gR=((e={},t={})=>(t.locale??q())===`fr`?mR(e):hR(e)),_R=()=>`Rôle`,vR=()=>`Role`,yR=((e={},t={})=>(t.locale??q())===`fr`?_R(e):vR(e)),bR=()=>`Tous les rôles`,xR=()=>`All roles`,SR=((e={},t={})=>(t.locale??q())===`fr`?bR(e):xR(e)),CR=()=>`Tous les statuts`,wR=()=>`All statuses`,TR=((e={},t={})=>(t.locale??q())===`fr`?CR(e):wR(e)),ER=()=>`actif`,DR=()=>`active`,OR=((e={},t={})=>(t.locale??q())===`fr`?ER(e):DR(e)),kR=()=>`désactivé`,AR=()=>`disabled`,jR=((e={},t={})=>(t.locale??q())===`fr`?kR(e):AR(e)),MR=()=>`Comptes de service`,NR=()=>`Service accounts`,PR=((e={},t={})=>(t.locale??q())===`fr`?MR(e):NR(e)),FR=()=>`Ajouter un compte`,IR=()=>`Add an account`,LR=((e={},t={})=>(t.locale??q())===`fr`?FR(e):IR(e)),RR=()=>`Aucun compte de service.`,zR=()=>`No service account.`,BR=((e={},t={})=>(t.locale??q())===`fr`?RR(e):zR(e)),VR=()=>`Générer une clé API`,HR=()=>`Generate an API key`,UR=((e={},t={})=>(t.locale??q())===`fr`?VR(e):HR(e)),WR=()=>`Masquer les clés`,GR=()=>`Hide keys`,KR=((e={},t={})=>(t.locale??q())===`fr`?WR(e):GR(e)),qR=()=>`Afficher les clés`,JR=()=>`Show keys`,YR=((e={},t={})=>(t.locale??q())===`fr`?qR(e):JR(e)),XR=()=>`Modifier`,ZR=()=>`Edit`,QR=((e={},t={})=>(t.locale??q())===`fr`?XR(e):ZR(e)),$R=()=>`Supprimer le compte`,ez=()=>`Delete account`,tz=((e={},t={})=>(t.locale??q())===`fr`?$R(e):ez(e)),nz=()=>`Replier`,rz=()=>`Collapse`,iz=((e={},t={})=>(t.locale??q())===`fr`?nz(e):rz(e)),az=()=>`Déplier`,oz=()=>`Expand`,sz=((e={},t={})=>(t.locale??q())===`fr`?az(e):oz(e)),cz=()=>`Nom`,lz=()=>`Name`,uz=((e={},t={})=>(t.locale??q())===`fr`?cz(e):lz(e)),dz=()=>`Rôle`,fz=()=>`Role`,pz=((e={},t={})=>(t.locale??q())===`fr`?dz(e):fz(e)),mz=()=>`Statut`,hz=()=>`Status`,gz=((e={},t={})=>(t.locale??q())===`fr`?mz(e):hz(e)),_z=()=>`Expiration de la prochaine clé`,vz=()=>`Next key expiry`,yz=((e={},t={})=>(t.locale??q())===`fr`?_z(e):vz(e)),bz=()=>`Clés`,xz=()=>`Keys`,Sz=((e={},t={})=>(t.locale??q())===`fr`?bz(e):xz(e)),Cz=()=>`génération…`,wz=()=>`generating…`,Tz=((e={},t={})=>(t.locale??q())===`fr`?Cz(e):wz(e)),Ez=e=>`${e?.count} active(s)`,Dz=e=>`${e?.count} active`,Oz=((e,t={})=>(t.locale??q())===`fr`?Ez(e):Dz(e)),kz=()=>`Modifier le compte de service`,Az=()=>`Edit service account`,jz=((e={},t={})=>(t.locale??q())===`fr`?kz(e):Az(e)),Mz=()=>`Modifier le nom, le rôle et la description.`,Nz=()=>`Update the name, role and description.`,Pz=((e={},t={})=>(t.locale??q())===`fr`?Mz(e):Nz(e)),Fz=()=>`Enregistrer`,Iz=()=>`Save`,Lz=((e={},t={})=>(t.locale??q())===`fr`?Fz(e):Iz(e)),Rz=()=>`Nouveau compte de service`,zz=()=>`New service account`,Bz=((e={},t={})=>(t.locale??q())===`fr`?Rz(e):zz(e)),Vz=()=>`Principal authentifié par clé API (jamais un humain).`,Hz=()=>`Principal authenticated by API key (never a human).`,Uz=((e={},t={})=>(t.locale??q())===`fr`?Vz(e):Hz(e)),Wz=()=>`Ajouter`,Gz=()=>`Add`,Kz=((e={},t={})=>(t.locale??q())===`fr`?Wz(e):Gz(e)),qz=()=>`Nom`,Jz=()=>`Name`,Yz=((e={},t={})=>(t.locale??q())===`fr`?qz(e):Jz(e)),Xz=()=>`Rôle`,Zz=()=>`Role`,Qz=((e={},t={})=>(t.locale??q())===`fr`?Xz(e):Zz(e)),$z=()=>`Choisir un rôle`,eB=()=>`Choose a role`,tB=((e={},t={})=>(t.locale??q())===`fr`?$z(e):eB(e)),nB=()=>`Description (optionnel)`,rB=()=>`Description (optional)`,iB=((e={},t={})=>(t.locale??q())===`fr`?nB(e):rB(e)),aB=()=>`Échec de la création du compte`,oB=()=>`Failed to create the account`,sB=((e={},t={})=>(t.locale??q())===`fr`?aB(e):oB(e)),cB=()=>`Échec de la modification du compte`,lB=()=>`Failed to update the account`,uB=((e={},t={})=>(t.locale??q())===`fr`?cB(e):lB(e)),dB=()=>`Compte de service mis à jour.`,fB=()=>`Service account updated.`,pB=((e={},t={})=>(t.locale??q())===`fr`?dB(e):fB(e)),mB=()=>`Échec de la génération de la clé`,hB=()=>`Failed to generate the key`,gB=((e={},t={})=>(t.locale??q())===`fr`?mB(e):hB(e)),_B=()=>`Supprimer ce compte de service ?`,vB=()=>`Delete this service account?`,yB=((e={},t={})=>(t.locale??q())===`fr`?_B(e):vB(e)),bB=()=>`Le compte`,xB=()=>`The account`,SB=((e={},t={})=>(t.locale??q())===`fr`?bB(e):xB(e)),CB=()=>`et`,wB=()=>`and`,TB=((e={},t={})=>(t.locale??q())===`fr`?CB(e):wB(e)),EB=()=>`toutes ses clés API`,DB=()=>`all its API keys`,OB=((e={},t={})=>(t.locale??q())===`fr`?EB(e):DB(e)),kB=()=>`seront supprimés définitivement. Cette action est irréversible. Tapez le nom du compte pour confirmer.`,AB=()=>`will be permanently deleted. This action is irreversible. Type the account name to confirm.`,jB=((e={},t={})=>(t.locale??q())===`fr`?kB(e):AB(e)),MB=()=>`Supprimer`,NB=()=>`Delete`,PB=((e={},t={})=>(t.locale??q())===`fr`?MB(e):NB(e)),FB=()=>`Compte de service supprimé`,IB=()=>`Service account deleted`,LB=((e={},t={})=>(t.locale??q())===`fr`?FB(e):IB(e)),RB=()=>`Échec de la suppression du compte`,zB=()=>`Failed to delete the account`,BB=((e={},t={})=>(t.locale??q())===`fr`?RB(e):zB(e)),VB=()=>`Révoquer cette clé API ?`,HB=()=>`Revoke this API key?`,UB=((e={},t={})=>(t.locale??q())===`fr`?VB(e):HB(e)),WB=()=>`La clé`,GB=()=>`The key`,KB=((e={},t={})=>(t.locale??q())===`fr`?WB(e):GB(e)),qB=()=>`sera désactivée immédiatement et ne pourra plus authentifier de requêtes. Cette action est irréversible.`,JB=()=>`will be disabled immediately and will no longer be able to authenticate requests. This action is irreversible.`,YB=((e={},t={})=>(t.locale??q())===`fr`?qB(e):JB(e)),XB=()=>`Révoquer`,ZB=()=>`Revoke`,QB=((e={},t={})=>(t.locale??q())===`fr`?XB(e):ZB(e)),$B=()=>`Échec de la révocation`,eV=()=>`Failed to revoke`,tV=((e={},t={})=>(t.locale??q())===`fr`?$B(e):eV(e)),nV=()=>`Clés de`,rV=()=>`Keys of`,iV=((e={},t={})=>(t.locale??q())===`fr`?nV(e):rV(e)),aV=()=>`Aucune clé pour ce compte.`,oV=()=>`No key for this account.`,sV=((e={},t={})=>(t.locale??q())===`fr`?aV(e):oV(e)),cV=()=>`Clé`,lV=()=>`Key`,uV=((e={},t={})=>(t.locale??q())===`fr`?cV(e):lV(e)),dV=()=>`Rôle`,fV=()=>`Role`,pV=((e={},t={})=>(t.locale??q())===`fr`?dV(e):fV(e)),mV=()=>`Créée`,hV=()=>`Created`,gV=((e={},t={})=>(t.locale??q())===`fr`?mV(e):hV(e)),_V=()=>`Dernier usage`,vV=()=>`Last used`,yV=((e={},t={})=>(t.locale??q())===`fr`?_V(e):vV(e)),bV=()=>`Expiration`,xV=()=>`Expiry`,SV=((e={},t={})=>(t.locale??q())===`fr`?bV(e):xV(e)),CV=()=>`Statut`,wV=()=>`Status`,TV=((e={},t={})=>(t.locale??q())===`fr`?CV(e):wV(e)),EV=()=>`Révocation…`,DV=()=>`Revoking…`,OV=((e={},t={})=>(t.locale??q())===`fr`?EV(e):DV(e)),kV=()=>`Révoquer`,AV=()=>`Revoke`,jV=((e={},t={})=>(t.locale??q())===`fr`?kV(e):AV(e)),MV=()=>`Clé API créée`,NV=()=>`API key created`,PV=((e={},t={})=>(t.locale??q())===`fr`?MV(e):NV(e)),FV=e=>`Pour le compte « ${e?.name} ». Copiez-la maintenant.`,IV=e=>`For the account « ${e?.name} ». Copy it now.`,LV=((e,t={})=>(t.locale??q())===`fr`?FV(e):IV(e)),RV=()=>`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.`,zV=()=>`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.`,BV=((e={},t={})=>(t.locale??q())===`fr`?RV(e):zV(e)),VV=()=>`Copier la clé`,HV=()=>`Copy the key`,UV=((e={},t={})=>(t.locale??q())===`fr`?VV(e):HV(e)),WV=()=>`Copié`,GV=()=>`Copied`,KV=((e={},t={})=>(t.locale??q())===`fr`?WV(e):GV(e)),qV=()=>`Copier`,JV=()=>`Copy`,YV=((e={},t={})=>(t.locale??q())===`fr`?qV(e):JV(e)),XV=()=>`J’ai copié la clé`,ZV=()=>`I have copied the key`,QV=((e={},t={})=>(t.locale??q())===`fr`?XV(e):ZV(e)),$V=()=>`Jamais`,eH=()=>`Never`,tH=((e={},t={})=>(t.locale??q())===`fr`?$V(e):eH(e)),nH=()=>`30 jours`,rH=()=>`30 days`,iH=((e={},t={})=>(t.locale??q())===`fr`?nH(e):rH(e)),aH=()=>`90 jours`,oH=()=>`90 days`,sH=((e={},t={})=>(t.locale??q())===`fr`?aH(e):oH(e)),cH=()=>`Jamais`,lH=()=>`Never`,uH=((e={},t={})=>(t.locale??q())===`fr`?cH(e):lH(e)),dH=()=>`révoquée`,fH=()=>`revoked`,pH=((e={},t={})=>(t.locale??q())===`fr`?dH(e):fH(e)),mH=()=>`expirée`,hH=()=>`expired`,gH=((e={},t={})=>(t.locale??q())===`fr`?mH(e):hH(e)),_H=()=>`active`,vH=()=>`active`,yH=((e={},t={})=>(t.locale??q())===`fr`?_H(e):vH(e)),bH=()=>`Sélectionnez ou créez une conversation pour commencer.`,xH=()=>`Select or create a chat to begin.`,SH=((e={},t={})=>(t.locale??q())===`fr`?bH(e):xH(e)),CH=()=>`Conversation introuvable`,wH=()=>`Conversation not found`,TH=((e={},t={})=>(t.locale??q())===`fr`?CH(e):wH(e)),EH=()=>`Ce lien ne correspond à aucune conversation. Elle a peut-être été supprimée, ou l’adresse est incomplète.`,DH=()=>`This link does not match any conversation. It may have been deleted, or the address is incomplete.`,OH=((e={},t={})=>(t.locale??q())===`fr`?EH(e):DH(e)),kH=()=>`Nouvelle conversation`,AH=()=>`New conversation`,jH=((e={},t={})=>(t.locale??q())===`fr`?kH(e):AH(e)),MH=()=>`Derniers messages`,NH=()=>`Latest messages`,PH=((e={},t={})=>(t.locale??q())===`fr`?MH(e):NH(e)),FH=()=>`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.`,IH=()=>`The chat service is temporarily unavailable. Sending messages is suspended — try again in a moment. If this persists, contact your administrator.`,LH=((e={},t={})=>(t.locale??q())===`fr`?FH(e):IH(e)),RH=()=>`Ce chat est en lecture seule : l’agent associé ne t’est plus disponible (ton accès aux agents a été modifié). Démarre un nouveau chat avec un agent disponible.`,zH=()=>`This chat is read-only: its agent is no longer available to you (your agent access was changed). Start a new chat with an available agent.`,BH=((e={},t={})=>(t.locale??q())===`fr`?RH(e):zH(e)),VH=()=>`Réponse reçue.`,HH=()=>`Reply received.`,UH=((e={},t={})=>(t.locale??q())===`fr`?VH(e):HH(e)),WH=()=>`Comment puis-je aider ?`,GH=()=>`How can I help?`,KH=((e={},t={})=>(t.locale??q())===`fr`?WH(e):GH(e)),qH=()=>`Conversation`,JH=()=>`Conversation`,YH=((e={},t={})=>(t.locale??q())===`fr`?qH(e):JH(e)),XH=e=>`Agent de cette conversation : ${e?.name}`,ZH=e=>`Agent for this conversation: ${e?.name}`,QH=((e,t={})=>(t.locale??q())===`fr`?XH(e):ZH(e)),$H=()=>` (agent par défaut)`,eU=()=>` (default agent)`,tU=((e={},t={})=>(t.locale??q())===`fr`?$H(e):eU(e)),nU=()=>` — cet agent n’existe plus sur la gateway`,rU=()=>` — this agent no longer exists on the gateway`,iU=((e={},t={})=>(t.locale??q())===`fr`?nU(e):rU(e)),aU=()=>` — état non confirmé (gateway injoignable)`,oU=()=>` — state not confirmed (gateway unreachable)`,sU=((e={},t={})=>(t.locale??q())===`fr`?aU(e):oU(e)),cU=e=>`Instance : ${e?.instance}`,lU=e=>`Instance: ${e?.instance}`,uU=((e,t={})=>(t.locale??q())===`fr`?cU(e):lU(e)),dU=()=>`Modèle`,fU=()=>`Model`,pU=((e={},t={})=>(t.locale??q())===`fr`?dU(e):fU(e)),mU=e=>`Modèle · ${e?.provider}`,hU=e=>`Model · ${e?.provider}`,gU=((e,t={})=>(t.locale??q())===`fr`?mU(e):hU(e)),_U=()=>`Niveau de réflexion hérité de l’agent`,vU=()=>`Thinking level inherited from the agent`,yU=((e={},t={})=>(t.locale??q())===`fr`?_U(e):vU(e)),bU=()=>`Niveau de réflexion (spécifique à ce chat)`,xU=()=>`Thinking level (specific to this chat)`,SU=((e={},t={})=>(t.locale??q())===`fr`?bU(e):xU(e)),CU=()=>`Réflexion`,wU=()=>`Thinking`,TU=((e={},t={})=>(t.locale??q())===`fr`?CU(e):wU(e)),EU=()=>`héritée`,DU=()=>`inherited`,OU=((e={},t={})=>(t.locale??q())===`fr`?EU(e):DU(e)),kU=e=>`Contexte utilisé : ${e?.pct}% (${e?.used} / ${e?.total} tokens)`,AU=e=>`Context used: ${e?.pct}% (${e?.used} / ${e?.total} tokens)`,jU=((e,t={})=>(t.locale??q())===`fr`?kU(e):AU(e)),MU=()=>`Contexte`,NU=()=>`Context`,PU=((e={},t={})=>(t.locale??q())===`fr`?MU(e):NU(e)),FU=()=>`Exporter la conversation`,IU=()=>`Export the conversation`,LU=((e={},t={})=>(t.locale??q())===`fr`?FU(e):IU(e)),RU=()=>`Exporter`,zU=()=>`Export`,BU=((e={},t={})=>(t.locale??q())===`fr`?RU(e):zU(e)),VU=()=>`Markdown (.md)`,HU=()=>`Markdown (.md)`,UU=((e={},t={})=>(t.locale??q())===`fr`?VU(e):HU(e)),WU=()=>`JSON (.json)`,GU=()=>`JSON (.json)`,KU=((e={},t={})=>(t.locale??q())===`fr`?WU(e):GU(e)),qU=()=>`Réglages avancés (réflexion, modèle)`,JU=()=>`Advanced settings (thinking, model)`,YU=((e={},t={})=>(t.locale??q())===`fr`?qU(e):JU(e)),XU=()=>`Avancé`,ZU=()=>`Advanced`,QU=((e={},t={})=>(t.locale??q())===`fr`?XU(e):ZU(e)),$U=()=>`Supprimer et régénérer cette réponse ?`,eW=()=>`Delete and regenerate this reply?`,tW=((e={},t={})=>(t.locale??q())===`fr`?$U(e):eW(e)),nW=()=>`Cette réponse sera supprimée, puis régénérée à partir de votre dernier message.`,rW=()=>`This reply will be deleted, then regenerated from your last message.`,iW=((e={},t={})=>(t.locale??q())===`fr`?nW(e):rW(e)),aW=()=>`Régénérer`,oW=()=>`Regenerate`,sW=((e={},t={})=>(t.locale??q())===`fr`?aW(e):oW(e)),cW=()=>`Annuler`,lW=()=>`Cancel`,uW=((e={},t={})=>(t.locale??q())===`fr`?cW(e):lW(e)),dW=()=>`Supprimer ce message et les suivants ?`,fW=()=>`Delete this message and the following ones?`,pW=((e={},t={})=>(t.locale??q())===`fr`?dW(e):fW(e)),mW=()=>`Ce message et tous les messages qui le suivent seront supprimés de la conversation. Cette action est irréversible.`,hW=()=>`This message and all messages following it will be deleted from the conversation. This action is irreversible.`,gW=((e={},t={})=>(t.locale??q())===`fr`?mW(e):hW(e)),_W=()=>`Supprimer`,vW=()=>`Delete`,yW=((e={},t={})=>(t.locale??q())===`fr`?_W(e):vW(e)),bW=()=>`Supprimer et régénérer la réponse`,xW=()=>`Delete and regenerate the reply`,SW=((e={},t={})=>(t.locale??q())===`fr`?bW(e):xW(e)),CW=()=>`Supprimer ce message et les suivants`,wW=()=>`Delete this message and the following ones`,TW=((e={},t={})=>(t.locale??q())===`fr`?CW(e):wW(e)),EW=()=>`Supprimer le message`,DW=()=>`Delete the message`,OW=((e={},t={})=>(t.locale??q())===`fr`?EW(e):DW(e)),kW=()=>`La suppression a échoué`,AW=()=>`Delete failed`,jW=((e={},t={})=>(t.locale??q())===`fr`?kW(e):AW(e)),MW=()=>`Sources`,NW=()=>`Sources`,PW=((e={},t={})=>(t.locale??q())===`fr`?MW(e):NW(e)),FW=()=>`1 souvenir`,IW=()=>`1 memory`,LW=((e={},t={})=>(t.locale??q())===`fr`?FW(e):IW(e)),RW=e=>`${e?.count} souvenirs`,zW=e=>`${e?.count} memories`,BW=((e,t={})=>(t.locale??q())===`fr`?RW(e):zW(e)),VW=()=>`1 document`,HW=()=>`1 document`,UW=((e={},t={})=>(t.locale??q())===`fr`?VW(e):HW(e)),WW=e=>`${e?.count} documents`,GW=e=>`${e?.count} documents`,KW=((e,t={})=>(t.locale??q())===`fr`?WW(e):GW(e)),qW=()=>`Mémoire conversationnelle`,JW=()=>`Conversational memory`,YW=((e={},t={})=>(t.locale??q())===`fr`?qW(e):JW(e)),XW=()=>`Documents`,ZW=()=>`Documents`,QW=((e={},t={})=>(t.locale??q())===`fr`?XW(e):ZW(e)),$W=()=>`Contexte`,eG=()=>`Context`,tG=((e={},t={})=>(t.locale??q())===`fr`?$W(e):eG(e)),nG=()=>`1 contexte`,rG=()=>`1 context`,iG=((e={},t={})=>(t.locale??q())===`fr`?nG(e):rG(e)),aG=e=>`${e?.count} contextes`,oG=e=>`${e?.count} contexts`,sG=((e,t={})=>(t.locale??q())===`fr`?aG(e):oG(e)),cG=()=>`Contexte du graphe de connaissances`,lG=()=>`Knowledge-graph context`,uG=((e={},t={})=>(t.locale??q())===`fr`?cG(e):lG(e)),dG=e=>`score ${e?.score}`,fG=e=>`score ${e?.score}`,pG=((e,t={})=>(t.locale??q())===`fr`?dG(e):fG(e)),mG=()=>`(sans titre)`,hG=()=>`(untitled)`,gG=((e={},t={})=>(t.locale??q())===`fr`?mG(e):hG(e)),_G=()=>`Sources de la réponse`,vG=()=>`Sources of the reply`,yG=((e={},t={})=>(t.locale??q())===`fr`?_G(e):vG(e)),bG=()=>`Voir les sources de la réponse`,xG=()=>`View the sources of the reply`,SG=((e={},t={})=>(t.locale??q())===`fr`?bG(e):xG(e)),CG=()=>`Rechercher dans les sources…`,wG=()=>`Search the sources…`,TG=((e={},t={})=>(t.locale??q())===`fr`?CG(e):wG(e)),EG=()=>`Aucune source ne correspond à votre recherche.`,DG=()=>`No source matches your search.`,OG=((e={},t={})=>(t.locale??q())===`fr`?EG(e):DG(e)),kG=()=>`Tout sélectionner`,AG=()=>`Select all`,jG=((e={},t={})=>(t.locale??q())===`fr`?kG(e):AG(e)),MG=e=>`${e?.count} document(s) sélectionné(s)`,NG=e=>`${e?.count} document(s) selected`,PG=((e,t={})=>(t.locale??q())===`fr`?MG(e):NG(e)),FG=()=>`Joindre les documents`,IG=()=>`Attach the documents`,LG=((e={},t={})=>(t.locale??q())===`fr`?FG(e):IG(e)),RG=()=>`Récupère les fichiers sources des documents cochés en liens téléchargeables (slot « Source d'origine »).`,zG=()=>`Fetches the checked documents' source files as downloadable links (the "Original source" slot).`,BG=((e={},t={})=>(t.locale??q())===`fr`?RG(e):zG(e)),VG=e=>`${e?.count} document(s) joint(s) téléchargeable(s) — ouvrir le panneau Sources`,HG=e=>`${e?.count} attached document(s) available for download — open the Sources panel`,UG=((e,t={})=>(t.locale??q())===`fr`?VG(e):HG(e)),WG=()=>`Source d'origine`,GG=()=>`Original source`,KG=((e={},t={})=>(t.locale??q())===`fr`?WG(e):GG(e)),qG=()=>`Aucun agent documentaire configuré`,JG=()=>`No documentary agent configured`,YG=((e={},t={})=>(t.locale??q())===`fr`?qG(e):JG(e)),XG=()=>`Récupération des documents en cours…`,ZG=()=>`Fetching the documents…`,QG=((e={},t={})=>(t.locale??q())===`fr`?XG(e):ZG(e)),$G=()=>`Récupération des documents lancée — voir le panneau Sources`,eK=()=>`Document fetch started — see the Sources panel`,tK=((e={},t={})=>(t.locale??q())===`fr`?$G(e):eK(e)),nK=()=>`Impossible de lancer la récupération des documents`,rK=()=>`Could not start the document fetch`,iK=((e={},t={})=>(t.locale??q())===`fr`?nK(e):rK(e)),aK=()=>`Récupération…`,oK=()=>`Fetching…`,sK=((e={},t={})=>(t.locale??q())===`fr`?aK(e):oK(e)),cK=()=>`Télécharger la source`,lK=()=>`Download the source`,uK=((e={},t={})=>(t.locale??q())===`fr`?cK(e):lK(e)),dK=()=>`Source introuvable`,fK=()=>`Source not found`,pK=((e={},t={})=>(t.locale??q())===`fr`?dK(e):fK(e)),mK=()=>`Voir plus`,hK=()=>`Show more`,gK=((e={},t={})=>(t.locale??q())===`fr`?mK(e):hK(e)),_K=()=>`Voir moins`,vK=()=>`Show less`,yK=((e={},t={})=>(t.locale??q())===`fr`?_K(e):vK(e)),bK=()=>`Fermer le panneau des sources`,xK=()=>`Close the sources panel`,SK=((e={},t={})=>(t.locale??q())===`fr`?bK(e):xK(e)),CK=()=>`Redimensionner le panneau des sources`,wK=()=>`Resize the sources panel`,TK=((e={},t={})=>(t.locale??q())===`fr`?CK(e):wK(e)),EK=e=>`Source · texte brut exact · ${e?.count} caractère`,DK=e=>`Source · exact raw text · ${e?.count} character`,OK=((e,t={})=>(t.locale??q())===`fr`?EK(e):DK(e)),kK=e=>`Source · texte brut exact · ${e?.count} caractères`,AK=e=>`Source · exact raw text · ${e?.count} characters`,jK=((e,t={})=>(t.locale??q())===`fr`?kK(e):AK(e)),MK=()=>`Copier la source exacte`,NK=()=>`Copy the exact source`,PK=((e={},t={})=>(t.locale??q())===`fr`?MK(e):NK(e)),FK=()=>`(aucun texte)`,IK=()=>`(no text)`,LK=((e={},t={})=>(t.locale??q())===`fr`?FK(e):IK(e)),RK=()=>`Afficher le message rendu`,zK=()=>`Show the rendered message`,BK=((e={},t={})=>(t.locale??q())===`fr`?RK(e):zK(e)),VK=()=>`Afficher la source (texte brut exact)`,HK=()=>`Show the source (exact raw text)`,UK=((e={},t={})=>(t.locale??q())===`fr`?VK(e):HK(e)),WK=()=>`Afficher la source du message`,GK=()=>`Show the message source`,KK=((e={},t={})=>(t.locale??q())===`fr`?WK(e):GK(e)),qK=()=>`Copier le message`,JK=()=>`Copy the message`,YK=((e={},t={})=>(t.locale??q())===`fr`?qK(e):JK(e)),XK=()=>`Envoi…`,ZK=()=>`Sending…`,QK=((e={},t={})=>(t.locale??q())===`fr`?XK(e):ZK(e)),$K=e=>`${e?.name} traite votre message…`,eq=e=>`${e?.name} is processing your message…`,tq=((e,t={})=>(t.locale??q())===`fr`?$K(e):eq(e)),nq=e=>`L'agent ${e?.name} traite votre message…`,rq=e=>`The agent ${e?.name} is processing your message…`,iq=((e,t={})=>(t.locale??q())===`fr`?nq(e):rq(e)),aq=()=>`Copier la réponse`,oq=()=>`Copy the reply`,sq=((e={},t={})=>(t.locale??q())===`fr`?aq(e):oq(e)),cq=()=>`Chat indisponible…`,lq=()=>`Chat unavailable…`,uq=((e={},t={})=>(t.locale??q())===`fr`?cq(e):lq(e)),dq=()=>`Message OpenClaw…`,fq=()=>`Message OpenClaw…`,pq=((e={},t={})=>(t.locale??q())===`fr`?dq(e):fq(e)),mq=()=>`Joindre un fichier`,hq=()=>`Attach a file`,gq=((e={},t={})=>(t.locale??q())===`fr`?mq(e):hq(e)),_q=()=>`échec`,vq=()=>`failed`,yq=((e={},t={})=>(t.locale??q())===`fr`?_q(e):vq(e)),bq=e=>`Téléversement du fichier… ${e?.percent}%`,xq=e=>`Uploading file… ${e?.percent}%`,Sq=((e,t={})=>(t.locale??q())===`fr`?bq(e):xq(e)),Cq=e=>`Téléversement de ${e?.count} fichiers… ${e?.percent}%`,wq=e=>`Uploading ${e?.count} files… ${e?.percent}%`,Tq=((e,t={})=>(t.locale??q())===`fr`?Cq(e):wq(e)),Eq=()=>`Retirer la pièce jointe`,Dq=()=>`Remove attachment`,Oq=((e={},t={})=>(t.locale??q())===`fr`?Eq(e):Dq(e)),kq=()=>`Masquer l'activité des outils et revenir à la vue épurée`,Aq=()=>`Hide tool activity and return to the clean view`,jq=((e={},t={})=>(t.locale??q())===`fr`?kq(e):Aq(e)),Mq=()=>`Afficher l'activité des outils (traitements réalisés et en cours)`,Nq=()=>`Show tool activity (completed and in-progress processing)`,Pq=((e={},t={})=>(t.locale??q())===`fr`?Mq(e):Nq(e)),Fq=()=>`Outils`,Iq=()=>`Tools`,Lq=((e={},t={})=>(t.locale??q())===`fr`?Fq(e):Iq(e)),Rq=e=>`${e?.count} appel d'outil`,zq=e=>`${e?.count} tool call`,Bq=((e,t={})=>(t.locale??q())===`fr`?Rq(e):zq(e)),Vq=e=>`${e?.count} appels d'outils`,Hq=e=>`${e?.count} tool calls`,Uq=((e,t={})=>(t.locale??q())===`fr`?Vq(e):Hq(e)),Wq=()=>`Terminé`,Gq=()=>`Done`,Kq=((e={},t={})=>(t.locale??q())===`fr`?Wq(e):Gq(e)),qq=()=>`Échec`,Jq=()=>`Failed`,Yq=((e={},t={})=>(t.locale??q())===`fr`?qq(e):Jq(e)),Xq=e=>`exit ${e?.code}`,Zq=e=>`exit ${e?.code}`,Qq=((e,t={})=>(t.locale??q())===`fr`?Xq(e):Zq(e)),$q=e=>`${e?.ms} ms`,eJ=e=>`${e?.ms} ms`,tJ=((e,t={})=>(t.locale??q())===`fr`?$q(e):eJ(e)),nJ=()=>`Sortie non transmise par la passerelle`,rJ=()=>`Output not transmitted by the gateway`,iJ=((e={},t={})=>(t.locale??q())===`fr`?nJ(e):rJ(e)),aJ=()=>`en cours`,oJ=()=>`running`,sJ=((e={},t={})=>(t.locale??q())===`fr`?aJ(e):oJ(e)),cJ=()=>`terminé`,lJ=()=>`done`,uJ=((e={},t={})=>(t.locale??q())===`fr`?cJ(e):lJ(e)),dJ=()=>`Afficher le détail des appels d'outils`,fJ=()=>`Show tool call details`,pJ=((e={},t={})=>(t.locale??q())===`fr`?dJ(e):fJ(e)),mJ=()=>`Masquer le détail des appels d'outils`,hJ=()=>`Hide tool call details`,gJ=((e={},t={})=>(t.locale??q())===`fr`?mJ(e):hJ(e)),_J=()=>`Dictée vocale — bientôt disponible`,vJ=()=>`Voice dictation — coming soon`,yJ=((e={},t={})=>(t.locale??q())===`fr`?_J(e):vJ(e)),bJ=()=>`Dictée vocale (bientôt disponible)`,xJ=()=>`Voice dictation (coming soon)`,SJ=((e={},t={})=>(t.locale??q())===`fr`?bJ(e):xJ(e)),CJ=()=>`Envoi indisponible (service de chat hors ligne)`,wJ=()=>`Sending unavailable (chat service offline)`,TJ=((e={},t={})=>(t.locale??q())===`fr`?CJ(e):wJ(e)),EJ=()=>`Envoyer`,DJ=()=>`Send`,OJ=((e={},t={})=>(t.locale??q())===`fr`?EJ(e):DJ(e)),kJ=()=>`Réponse en cours…`,AJ=()=>`Response in progress…`,jJ=((e={},t={})=>(t.locale??q())===`fr`?kJ(e):AJ(e)),MJ=()=>`Mettre en file (envoyé après la réponse en cours)`,NJ=()=>`Queue (sent after the current reply)`,PJ=((e={},t={})=>(t.locale??q())===`fr`?MJ(e):NJ(e)),FJ=()=>`Envoyer après la réponse en cours`,IJ=()=>`Send after the current reply`,LJ=((e={},t={})=>(t.locale??q())===`fr`?FJ(e):IJ(e)),RJ=()=>`Trop de messages en attente. Patientez la fin de la réponse en cours.`,zJ=()=>`Too many messages waiting. Wait for the current reply to finish.`,BJ=((e={},t={})=>(t.locale??q())===`fr`?RJ(e):zJ(e)),VJ=()=>`Impossible de mettre le message en file. Réessayez.`,HJ=()=>`Could not queue the message. Try again.`,UJ=((e={},t={})=>(t.locale??q())===`fr`?VJ(e):HJ(e)),WJ=()=>`Chargement…`,GJ=()=>`Loading…`,KJ=((e={},t={})=>(t.locale??q())===`fr`?WJ(e):GJ(e)),qJ=()=>`Configuration des intégrations.`,JJ=()=>`Integrations configuration.`,YJ=((e={},t={})=>(t.locale??q())===`fr`?qJ(e):JJ(e)),XJ=()=>`Aucune clé API ici`,ZJ=()=>`No API key here`,QJ=((e={},t={})=>(t.locale??q())===`fr`?XJ(e):ZJ(e)),$J=()=>`— 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.`,eY=()=>`— 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.`,tY=((e={},t={})=>(t.locale??q())===`fr`?$J(e):eY(e)),nY=()=>`actif`,rY=()=>`active`,iY=((e={},t={})=>(t.locale??q())===`fr`?nY(e):rY(e)),aY=()=>`en pause`,oY=()=>`paused`,sY=((e={},t={})=>(t.locale??q())===`fr`?aY(e):oY(e)),cY=()=>`clé manquante (env)`,lY=()=>`key missing (env)`,uY=((e={},t={})=>(t.locale??q())===`fr`?cY(e):lY(e)),dY=()=>`appliqué par le bridge (à venir)`,fY=()=>`applied by the bridge (coming soon)`,pY=((e={},t={})=>(t.locale??q())===`fr`?dY(e):fY(e)),mY=()=>`Export des traces. Clés : LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY (env).`,hY=()=>`Trace export. Keys: LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY (env).`,gY=((e={},t={})=>(t.locale??q())===`fr`?mY(e):hY(e)),_Y=()=>`Export des traces. Clé : OPIK_API_KEY (env).`,vY=()=>`Trace export. Key: OPIK_API_KEY (env).`,yY=((e={},t={})=>(t.locale??q())===`fr`?_Y(e):vY(e)),bY=()=>`Host`,xY=()=>`Host`,SY=((e={},t={})=>(t.locale??q())===`fr`?bY(e):xY(e)),CY=()=>`Base URL`,wY=()=>`Base URL`,TY=((e={},t={})=>(t.locale??q())===`fr`?CY(e):wY(e)),EY=()=>`Workspace`,DY=()=>`Workspace`,OY=((e={},t={})=>(t.locale??q())===`fr`?EY(e):DY(e)),kY=()=>`(défaut serveur)`,AY=()=>`(server default)`,jY=((e={},t={})=>(t.locale??q())===`fr`?kY(e):AY(e)),MY=()=>`Activé (expédition des traces)`,NY=()=>`Enabled (trace shipping)`,PY=((e={},t={})=>(t.locale??q())===`fr`?MY(e):NY(e)),FY=()=>`Synthèse vocale (TTS)`,IY=()=>`Text-to-speech (TTS)`,LY=((e={},t={})=>(t.locale??q())===`fr`?FY(e):IY(e)),RY=()=>`Lecture audio des réponses. Clé du provider via env (ex. OPENAI_API_KEY, ELEVENLABS_API_KEY).`,zY=()=>`Audio playback of replies. Provider key via env (e.g. OPENAI_API_KEY, ELEVENLABS_API_KEY).`,BY=((e={},t={})=>(t.locale??q())===`fr`?RY(e):zY(e)),VY=()=>`Mode auto`,HY=()=>`Auto mode`,UY=((e={},t={})=>(t.locale??q())===`fr`?VY(e):HY(e)),WY=()=>`Désactivé`,GY=()=>`Disabled`,KY=((e={},t={})=>(t.locale??q())===`fr`?WY(e):GY(e)),qY=()=>`Toujours`,JY=()=>`Always`,YY=((e={},t={})=>(t.locale??q())===`fr`?qY(e):JY(e)),XY=()=>`Après un message vocal`,ZY=()=>`After a voice message`,QY=((e={},t={})=>(t.locale??q())===`fr`?XY(e):ZY(e)),$Y=()=>`Sur directive [[tts:…]]`,eX=()=>`On [[tts:…]] directive`,tX=((e={},t={})=>(t.locale??q())===`fr`?$Y(e):eX(e)),nX=()=>`Provider`,rX=()=>`Provider`,iX=((e={},t={})=>(t.locale??q())===`fr`?nX(e):rX(e)),aX=()=>`Microsoft (sans clé)`,oX=()=>`Microsoft (no key)`,sX=((e={},t={})=>(t.locale??q())===`fr`?aX(e):oX(e)),cX=()=>`Modèle`,lX=()=>`Model`,uX=((e={},t={})=>(t.locale??q())===`fr`?cX(e):lX(e)),dX=()=>`Voix`,fX=()=>`Voice`,pX=((e={},t={})=>(t.locale??q())===`fr`?dX(e):fX(e)),mX=()=>`speakerVoiceId / nom de voix`,hX=()=>`speakerVoiceId / voice name`,gX=((e={},t={})=>(t.locale??q())===`fr`?mX(e):hX(e)),_X=()=>`Mode conversation (Talk / STS)`,vX=()=>`Conversation mode (Talk / STS)`,yX=((e={},t={})=>(t.locale??q())===`fr`?_X(e):vX(e)),bX=()=>`OpenAI realtime : OPENAI_API_KEY présent (env). Le navigateur recevra un jeton éphémère minté côté serveur — jamais la clé brute.`,xX=()=>`OpenAI realtime: OPENAI_API_KEY present (env). The browser will receive an ephemeral token minted server-side — never the raw key.`,SX=((e={},t={})=>(t.locale??q())===`fr`?bX(e):xX(e)),CX=()=>`OpenAI realtime : OPENAI_API_KEY ABSENT (env). À définir côté déploiement pour activer gpt-realtime.`,wX=()=>`OpenAI realtime: OPENAI_API_KEY ABSENT (env). To be set on the deployment side to enable gpt-realtime.`,TX=((e={},t={})=>(t.locale??q())===`fr`?CX(e):wX(e)),EX=()=>`Activer le mode conversation`,DX=()=>`Enable conversation mode`,OX=((e={},t={})=>(t.locale??q())===`fr`?EX(e):DX(e)),kX=()=>`Provider realtime`,AX=()=>`Realtime provider`,jX=((e={},t={})=>(t.locale??q())===`fr`?kX(e):AX(e)),MX=()=>`Modèle realtime`,NX=()=>`Realtime model`,PX=((e={},t={})=>(t.locale??q())===`fr`?MX(e):NX(e)),FX=()=>`Transport`,IX=()=>`Transport`,LX=((e={},t={})=>(t.locale??q())===`fr`?FX(e):IX(e)),RX=()=>`WebRTC (navigateur)`,zX=()=>`WebRTC (browser)`,BX=((e={},t={})=>(t.locale??q())===`fr`?RX(e):zX(e)),VX=()=>`Locale`,HX=()=>`Locale`,UX=((e={},t={})=>(t.locale??q())===`fr`?VX(e):HX(e)),WX=()=>`Interrompre la lecture quand l'utilisateur parle`,GX=()=>`Interrupt playback when the user speaks`,KX=((e={},t={})=>(t.locale??q())===`fr`?WX(e):GX(e)),qX=()=>`Voice wake (mot d'activation)`,JX=()=>`Voice wake (wake word)`,YX=((e={},t={})=>(t.locale??q())===`fr`?qX(e):JX(e)),XX=()=>`non câblable dans le navigateur`,ZX=()=>`not wireable in the browser`,QX=((e={},t={})=>(t.locale??q())===`fr`?XX(e):ZX(e)),$X=()=>`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`,eZ=()=>`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`,tZ=((e={},t={})=>(t.locale??q())===`fr`?$X(e):eZ(e)),nZ=()=>`Curseurs d'expédition`,rZ=()=>`Shipping cursors`,iZ=((e={},t={})=>(t.locale??q())===`fr`?nZ(e):rZ(e)),aZ=()=>`Aucun curseur — aucune trace n'a encore été expédiée.`,oZ=()=>`No cursor — no trace has been shipped yet.`,sZ=((e={},t={})=>(t.locale??q())===`fr`?aZ(e):oZ(e)),cZ=()=>`Vendeur`,lZ=()=>`Vendor`,uZ=((e={},t={})=>(t.locale??q())===`fr`?cZ(e):lZ(e)),dZ=()=>`Dernier envoi`,fZ=()=>`Last send`,pZ=((e={},t={})=>(t.locale??q())===`fr`?dZ(e):fZ(e)),mZ=()=>`Échecs consécutifs`,hZ=()=>`Consecutive failures`,gZ=((e={},t={})=>(t.locale??q())===`fr`?mZ(e):hZ(e)),_Z=()=>`Dernier statut HTTP`,vZ=()=>`Last HTTP status`,yZ=((e={},t={})=>(t.locale??q())===`fr`?_Z(e):vZ(e)),bZ=()=>`Dernière erreur`,xZ=()=>`Last error`,SZ=((e={},t={})=>(t.locale??q())===`fr`?bZ(e):xZ(e)),CZ=()=>`Mots modifiés / altérés`,wZ=()=>`Modified / altered words`,TZ=((e={},t={})=>(t.locale??q())===`fr`?CZ(e):wZ(e)),EZ=()=>`Réponse incorrecte`,DZ=()=>`Incorrect answer`,OZ=((e={},t={})=>(t.locale??q())===`fr`?EZ(e):DZ(e)),kZ=()=>`Incohérence`,AZ=()=>`Inconsistency`,jZ=((e={},t={})=>(t.locale??q())===`fr`?kZ(e):AZ(e)),MZ=()=>`Formatage`,NZ=()=>`Formatting`,PZ=((e={},t={})=>(t.locale??q())===`fr`?MZ(e):NZ(e)),FZ=()=>`Latence`,IZ=()=>`Latency`,LZ=((e={},t={})=>(t.locale??q())===`fr`?FZ(e):IZ(e)),RZ=()=>`Erreur API`,zZ=()=>`API error`,BZ=((e={},t={})=>(t.locale??q())===`fr`?RZ(e):zZ(e)),xfe=()=>`Autre`,Sfe=()=>`Other`,Cfe=((e={},t={})=>(t.locale??q())===`fr`?xfe(e):Sfe(e)),wfe=()=>`reçu = stocké`,Tfe=()=>`received = stored`,Efe=((e={},t={})=>(t.locale??q())===`fr`?wfe(e):Tfe(e)),Dfe=()=>`affichage fidèle ✓`,Ofe=()=>`faithful display ✓`,kfe=((e={},t={})=>(t.locale??q())===`fr`?Dfe(e):Ofe(e)),Afe=()=>`écart ⚠`,jfe=()=>`mismatch ⚠`,Mfe=((e={},t={})=>(t.locale??q())===`fr`?Afe(e):jfe(e)),Nfe=()=>`régénération`,Pfe=()=>`regeneration`,Ffe=((e={},t={})=>(t.locale??q())===`fr`?Nfe(e):Pfe(e)),Ife=()=>`Commentaire du rapporteur`,Lfe=()=>`Reporter's comment`,Rfe=((e={},t={})=>(t.locale??q())===`fr`?Ife(e):Lfe(e)),zfe=()=>`Échange avec l'utilisateur`,Bfe=()=>`Exchange with the user`,Vfe=((e={},t={})=>(t.locale??q())===`fr`?zfe(e):Bfe(e)),Hfe=()=>`Administrateur`,Ufe=()=>`Administrator`,Wfe=((e={},t={})=>(t.locale??q())===`fr`?Hfe(e):Ufe(e)),Gfe=()=>`Utilisateur`,Kfe=()=>`User`,qfe=((e={},t={})=>(t.locale??q())===`fr`?Gfe(e):Kfe(e)),Jfe=()=>`Aucune réponse envoyée.`,Yfe=()=>`No reply sent.`,Xfe=((e={},t={})=>(t.locale??q())===`fr`?Jfe(e):Yfe(e)),Zfe=()=>`Répondre à l'utilisateur (visible dans sa zone de notification)…`,Qfe=()=>`Reply to the user (visible in their notification area)…`,$fe=((e={},t={})=>(t.locale??q())===`fr`?Zfe(e):Qfe(e)),epe=()=>`Envoi…`,tpe=()=>`Sending…`,npe=((e={},t={})=>(t.locale??q())===`fr`?epe(e):tpe(e)),rpe=()=>`Répondre`,ipe=()=>`Reply`,ape=((e={},t={})=>(t.locale??q())===`fr`?rpe(e):ipe(e)),ope=()=>`Texte stocké (serveur, autoritatif)`,spe=()=>`Stored text (server, authoritative)`,cpe=((e={},t={})=>(t.locale??q())===`fr`?ope(e):spe(e)),lpe=()=>`(vide)`,upe=()=>`(empty)`,VZ=((e={},t={})=>(t.locale??q())===`fr`?lpe(e):upe(e)),dpe=()=>`Texte affiché (navigateur, au signalement)`,fpe=()=>`Displayed text (browser, at report time)`,ppe=((e={},t={})=>(t.locale??q())===`fr`?dpe(e):fpe(e)),mpe=()=>`Prompt générateur`,hpe=()=>`Generator prompt`,gpe=((e={},t={})=>(t.locale??q())===`fr`?mpe(e):hpe(e)),_pe=e=>`Contexte figé (${e?.count} tours${e?.truncated})`,vpe=e=>`Frozen context (${e?.count} turns${e?.truncated})`,ype=((e,t={})=>(t.locale??q())===`fr`?_pe(e):vpe(e)),bpe=()=>`, tronqué`,xpe=()=>`, truncated`,Spe=((e={},t={})=>(t.locale??q())===`fr`?bpe(e):xpe(e)),Cpe=()=>`Payload dispatché (outbox)`,wpe=()=>`Dispatched payload (outbox)`,Tpe=((e={},t={})=>(t.locale??q())===`fr`?Cpe(e):wpe(e)),Epe=()=>`Extensions de correction détectées (peuvent altérer le texte)`,Dpe=()=>`Correction extensions detected (may alter the text)`,Ope=((e={},t={})=>(t.locale??q())===`fr`?Epe(e):Dpe(e)),kpe=()=>`Environnement client`,Ape=()=>`Client environment`,jpe=((e={},t={})=>(t.locale??q())===`fr`?kpe(e):Ape(e)),Mpe=e=>`thème ${e?.theme}`,Npe=e=>`theme ${e?.theme}`,Ppe=((e,t={})=>(t.locale??q())===`fr`?Mpe(e):Npe(e)),Fpe=()=>`Plugins :`,Ipe=()=>`Plugins:`,Lpe=((e={},t={})=>(t.locale??q())===`fr`?Fpe(e):Ipe(e)),Rpe=()=>`(navigator.plugins — neutralisé/partiel dans les navigateurs modernes)`,zpe=()=>`(navigator.plugins — neutralized/partial in modern browsers)`,Bpe=((e={},t={})=>(t.locale??q())===`fr`?Rpe(e):zpe(e)),Vpe=()=>`Signalements « Report Feedback » enregistrés. La liste est en métadonnées ; ouvrir le détail lit le contenu figé et`,Hpe=()=>`Recorded "Report Feedback" reports. The list shows metadata; opening the detail reads the frozen content and`,Upe=((e={},t={})=>(t.locale??q())===`fr`?Vpe(e):Hpe(e)),Wpe=()=>`trace cet accès dans l'Audit`,Gpe=()=>`traces this access in the Audit`,Kpe=((e={},t={})=>(t.locale??q())===`fr`?Wpe(e):Gpe(e)),qpe=()=>`(lecture de contenu d'un autre utilisateur). Fenêtre récente bornée.`,Jpe=()=>`(reading another user's content). Bounded recent window.`,Ype=((e={},t={})=>(t.locale??q())===`fr`?qpe(e):Jpe(e)),Xpe=()=>`Signalements`,Zpe=()=>`Reports`,Qpe=((e={},t={})=>(t.locale??q())===`fr`?Xpe(e):Zpe(e)),$pe=()=>`Aucun signalement pour l'instant.`,eme=()=>`No reports yet.`,tme=((e={},t={})=>(t.locale??q())===`fr`?$pe(e):eme(e)),nme=()=>`Quand`,rme=()=>`When`,ime=((e={},t={})=>(t.locale??q())===`fr`?nme(e):rme(e)),ame=()=>`Catégorie`,ome=()=>`Category`,sme=((e={},t={})=>(t.locale??q())===`fr`?ame(e):ome(e)),cme=()=>`Type`,lme=()=>`Type`,ume=((e={},t={})=>(t.locale??q())===`fr`?cme(e):lme(e)),dme=()=>`user`,fme=()=>`user`,pme=((e={},t={})=>(t.locale??q())===`fr`?dme(e):fme(e)),mme=()=>`AI`,hme=()=>`AI`,gme=((e={},t={})=>(t.locale??q())===`fr`?mme(e):hme(e)),_me=()=>`Rapporteur`,vme=()=>`Reporter`,yme=((e={},t={})=>(t.locale??q())===`fr`?_me(e):vme(e)),bme=e=>`(via ${e?.operator})`,xme=e=>`(via ${e?.operator})`,Sme=((e,t={})=>(t.locale??q())===`fr`?bme(e):xme(e)),Cme=()=>`Fidélité`,wme=()=>`Fidelity`,Tme=((e={},t={})=>(t.locale??q())===`fr`?Cme(e):wme(e)),Eme=()=>`Note`,Dme=()=>`Note`,Ome=((e={},t={})=>(t.locale??q())===`fr`?Eme(e):Dme(e)),kme=()=>`Statut`,Ame=()=>`Status`,jme=((e={},t={})=>(t.locale??q())===`fr`?kme(e):Ame(e)),Mme=()=>`Répondu`,Nme=()=>`Answered`,Pme=((e={},t={})=>(t.locale??q())===`fr`?Mme(e):Nme(e)),Fme=()=>`En attente`,Ime=()=>`Pending`,Lme=((e={},t={})=>(t.locale??q())===`fr`?Fme(e):Ime(e)),Rme=()=>`Clos par l'utilisateur`,zme=()=>`Closed by user`,Bme=((e={},t={})=>(t.locale??q())===`fr`?Rme(e):zme(e)),Vme=()=>`Raison de clôture`,Hme=()=>`Close reason`,Ume=((e={},t={})=>(t.locale??q())===`fr`?Vme(e):Hme(e)),Wme=()=>`Masquer`,Gme=()=>`Hide`,Kme=((e={},t={})=>(t.locale??q())===`fr`?Wme(e):Gme(e)),qme=()=>`Voir le détail`,Jme=()=>`View detail`,Yme=((e={},t={})=>(t.locale??q())===`fr`?qme(e):Jme(e)),Xme=()=>`Supprimer`,Zme=()=>`Delete`,Qme=((e={},t={})=>(t.locale??q())===`fr`?Xme(e):Zme(e)),$me=()=>`Supprimer ce signalement ?`,ehe=()=>`Delete this report?`,the=((e={},t={})=>(t.locale??q())===`fr`?$me(e):ehe(e)),nhe=()=>`L'instantané forensique figé sera définitivement supprimé. Cette action est irréversible.`,rhe=()=>`The frozen forensic snapshot will be permanently deleted. This action is irreversible.`,ihe=((e={},t={})=>(t.locale??q())===`fr`?nhe(e):rhe(e)),ahe=()=>`Supprimer`,ohe=()=>`Delete`,she=((e={},t={})=>(t.locale??q())===`fr`?ahe(e):ohe(e)),che=()=>`Aucun onglet`,lhe=()=>`No tabs`,uhe=((e={},t={})=>(t.locale??q())===`fr`?che(e):lhe(e)),dhe=e=>`${e?.count} onglets`,fhe=e=>`${e?.count} tabs`,phe=((e,t={})=>(t.locale??q())===`fr`?dhe(e):fhe(e)),mhe=()=>`Onglets Settings autorisés`,hhe=()=>`Allowed Settings tabs`,ghe=((e={},t={})=>(t.locale??q())===`fr`?mhe(e):hhe(e)),_he=()=>`Changement de rôle refusé`,vhe=()=>`Role change refused`,yhe=((e={},t={})=>(t.locale??q())===`fr`?_he(e):vhe(e)),bhe=()=>`Mise à jour des permissions refusée`,xhe=()=>`Permission update refused`,She=((e={},t={})=>(t.locale??q())===`fr`?bhe(e):xhe(e)),Che=()=>`Rechercher (email, nom)`,whe=()=>`Search (email, name)`,The=((e={},t={})=>(t.locale??q())===`fr`?Che(e):whe(e)),Ehe=()=>`Tous les rôles`,Dhe=()=>`All roles`,Ohe=((e={},t={})=>(t.locale??q())===`fr`?Ehe(e):Dhe(e)),khe=()=>`Utilisateurs`,Ahe=()=>`Users`,jhe=((e={},t={})=>(t.locale??q())===`fr`?khe(e):Ahe(e)),Mhe=()=>`Aucun utilisateur.`,Nhe=()=>`No users.`,Phe=((e={},t={})=>(t.locale??q())===`fr`?Mhe(e):Nhe(e)),Fhe=()=>`Voir comme cet utilisateur`,Ihe=()=>`View as this user`,Lhe=((e={},t={})=>(t.locale??q())===`fr`?Fhe(e):Ihe(e)),Rhe=()=>`Supprimer l’utilisateur`,zhe=()=>`Delete user`,Bhe=((e={},t={})=>(t.locale??q())===`fr`?Rhe(e):zhe(e)),Vhe=()=>`Supprimer cet utilisateur ?`,Hhe=()=>`Delete this user?`,Uhe=((e={},t={})=>(t.locale??q())===`fr`?Vhe(e):Hhe(e)),Whe=e=>`« ${e?.user} » et toutes ses données (conversations, fichiers, accès) seront définitivement supprimés. Cette action est irréversible.`,Ghe=e=>`“${e?.user}” and all their data (conversations, files, access) will be permanently deleted. This action cannot be undone.`,Khe=((e,t={})=>(t.locale??q())===`fr`?Whe(e):Ghe(e)),qhe=()=>`SUPPRIMER`,Jhe=()=>`DELETE`,Yhe=((e={},t={})=>(t.locale??q())===`fr`?qhe(e):Jhe(e)),Xhe=()=>`Supprimer définitivement`,Zhe=()=>`Delete permanently`,Qhe=((e={},t={})=>(t.locale??q())===`fr`?Xhe(e):Zhe(e)),$he=()=>`Suppression de l’utilisateur refusée`,ege=()=>`User deletion refused`,tge=((e={},t={})=>(t.locale??q())===`fr`?$he(e):ege(e)),nge=e=>`Utilisateur « ${e?.user} » supprimé.`,rge=e=>`User “${e?.user}” deleted.`,ige=((e,t={})=>(t.locale??q())===`fr`?nge(e):rge(e)),age=()=>`Renommer`,oge=()=>`Rename`,sge=((e={},t={})=>(t.locale??q())===`fr`?age(e):oge(e)),cge=()=>`Renommer l’utilisateur`,lge=()=>`Rename user`,uge=((e={},t={})=>(t.locale??q())===`fr`?cge(e):lge(e)),dge=e=>`Nom affiché pour « ${e?.user} »`,fge=e=>`Display name for “${e?.user}”`,pge=((e,t={})=>(t.locale??q())===`fr`?dge(e):fge(e)),mge=()=>`Nom et prénom`,hge=()=>`Name`,gge=((e={},t={})=>(t.locale??q())===`fr`?mge(e):hge(e)),_ge=()=>`Nom mis à jour.`,vge=()=>`Name updated.`,yge=((e={},t={})=>(t.locale??q())===`fr`?_ge(e):vge(e)),bge=()=>`Renommage refusé`,xge=()=>`Rename refused`,Sge=((e={},t={})=>(t.locale??q())===`fr`?bge(e):xge(e)),Cge=()=>`Utilisateur`,wge=()=>`User`,Tge=((e={},t={})=>(t.locale??q())===`fr`?Cge(e):wge(e)),Ege=()=>`Rôle`,Dge=()=>`Role`,Oge=((e={},t={})=>(t.locale??q())===`fr`?Ege(e):Dge(e)),kge=()=>`Accès Settings`,Age=()=>`Settings access`,jge=((e={},t={})=>(t.locale??q())===`fr`?kge(e):Age(e)),Mge=()=>`Tous (admin)`,Nge=()=>`All (admin)`,Pge=((e={},t={})=>(t.locale??q())===`fr`?Mge(e):Nge(e)),Fge=()=>`Agents`,Ige=()=>`Agents`,HZ=((e={},t={})=>(t.locale??q())===`fr`?Fge(e):Ige(e)),Lge=()=>`Gérer les agents`,Rge=()=>`Manage agents`,UZ=((e={},t={})=>(t.locale??q())===`fr`?Lge(e):Rge(e)),zge=()=>`Échec de l’enregistrement de l’instance`,Bge=()=>`Failed to save instance`,Vge=((e={},t={})=>(t.locale??q())===`fr`?zge(e):Bge(e)),Hge=()=>`Les agents sont `,Uge=()=>`Agents are `,Wge=((e={},t={})=>(t.locale??q())===`fr`?Hge(e):Uge(e)),Gge=()=>`découverts par le bridge`,Kge=()=>`discovered by the bridge`,qge=((e={},t={})=>(t.locale??q())===`fr`?Gge(e):Kge(e)),Jge=()=>` (jamais saisis à la main). Les identifiants gateway (token, device, clé API) se configurent par instance via « Identifiants » — chiffrés au repos.`,Yge=()=>` (never entered by hand). Gateway credentials (token, device identity, API key) are set per instance via “Credentials” — encrypted at rest.`,Xge=((e={},t={})=>(t.locale??q())===`fr`?Jge(e):Yge(e)),Zge=()=>`Instances`,Qge=()=>`Instances`,$ge=((e={},t={})=>(t.locale??q())===`fr`?Zge(e):Qge(e)),e_e=()=>`Ajouter une instance`,t_e=()=>`Add instance`,n_e=((e={},t={})=>(t.locale??q())===`fr`?e_e(e):t_e(e)),r_e=()=>`Aucune instance.`,i_e=()=>`No instances.`,a_e=((e={},t={})=>(t.locale??q())===`fr`?r_e(e):i_e(e)),o_e=()=>`Nom`,s_e=()=>`Name`,c_e=((e={},t={})=>(t.locale??q())===`fr`?o_e(e):s_e(e)),l_e=()=>`Bridge`,u_e=()=>`Bridge`,d_e=((e={},t={})=>(t.locale??q())===`fr`?l_e(e):u_e(e)),f_e=()=>`Gateway URL`,p_e=()=>`Gateway URL`,m_e=((e={},t={})=>(t.locale??q())===`fr`?f_e(e):p_e(e)),h_e=()=>`Affichage`,g_e=()=>`Display`,__e=((e={},t={})=>(t.locale??q())===`fr`?h_e(e):g_e(e)),v_e=()=>`Configurer le bridge`,y_e=()=>`Configure bridge`,b_e=((e={},t={})=>(t.locale??q())===`fr`?v_e(e):y_e(e)),x_e=()=>`Supprimer`,S_e=()=>`Delete`,WZ=((e={},t={})=>(t.locale??q())===`fr`?x_e(e):S_e(e)),C_e=()=>`Nouvelle instance`,w_e=()=>`New instance`,T_e=((e={},t={})=>(t.locale??q())===`fr`?C_e(e):w_e(e)),E_e=()=>`Modifier`,D_e=()=>`Edit`,O_e=((e={},t={})=>(t.locale??q())===`fr`?E_e(e):D_e(e)),k_e=()=>`Modifier l'instance`,A_e=()=>`Edit instance`,j_e=((e={},t={})=>(t.locale??q())===`fr`?k_e(e):A_e(e)),M_e=()=>`Le nom est la clé de routage et ne peut pas être modifié après création.`,N_e=()=>`The name is the routing key and can't be changed after creation.`,P_e=((e={},t={})=>(t.locale??q())===`fr`?M_e(e):N_e(e)),F_e=()=>`Métadonnées non-secrètes.`,I_e=()=>`Non-secret metadata.`,L_e=((e={},t={})=>(t.locale??q())===`fr`?F_e(e):I_e(e)),R_e=()=>`Enregistrer`,z_e=()=>`Save`,GZ=((e={},t={})=>(t.locale??q())===`fr`?R_e(e):z_e(e)),B_e=()=>`Nom de l’instance (ex. main)`,V_e=()=>`Instance name (e.g. main)`,H_e=((e={},t={})=>(t.locale??q())===`fr`?B_e(e):V_e(e)),U_e=()=>`Technologie (bridge)`,W_e=()=>`Technology (bridge)`,G_e=((e={},t={})=>(t.locale??q())===`fr`?U_e(e):W_e(e)),K_e=()=>`Gateway URL (ws(s)://)`,q_e=()=>`Gateway URL (ws(s)://)`,J_e=((e={},t={})=>(t.locale??q())===`fr`?K_e(e):q_e(e)),Y_e=()=>`URL du bridge`,X_e=()=>`Bridge URL`,Z_e=((e={},t={})=>(t.locale??q())===`fr`?Y_e(e):X_e(e)),Q_e=()=>`http://bridge-host:8787 — sinon le BRIDGE_URL du déploiement`,$_e=()=>`http://bridge-host:8787 — else the deployment BRIDGE_URL`,eve=((e={},t={})=>(t.locale??q())===`fr`?Q_e(e):$_e(e)),tve=()=>`Nom affiché (optionnel)`,nve=()=>`Display name (optional)`,rve=((e={},t={})=>(t.locale??q())===`fr`?tve(e):nve(e)),ive=()=>`Version de la gateway (optionnel)`,ave=()=>`Gateway version (optional)`,ove=((e={},t={})=>(t.locale??q())===`fr`?ive(e):ave(e)),sve=()=>`ex. 2026.6.5 — repli de compatibilité`,cve=()=>`e.g. 2026.6.5 — compat fallback`,lve=((e={},t={})=>(t.locale??q())===`fr`?sve(e):cve(e)),uve=()=>`URL HTTP média (optionnel)`,dve=()=>`Media HTTP URL (optional)`,fve=((e={},t={})=>(t.locale??q())===`fr`?uve(e):dve(e)),pve=()=>`Seulement si le média est servi sur un autre hôte/port`,mve=()=>`Only if media is served on another host/port`,hve=((e={},t={})=>(t.locale??q())===`fr`?pve(e):mve(e)),gve=()=>`Identifiants`,_ve=()=>`Credentials`,vve=((e={},t={})=>(t.locale??q())===`fr`?gve(e):_ve(e)),yve=e=>`Identifiants de la gateway — instance « ${e?.instance} »`,bve=e=>`Gateway credentials — instance « ${e?.instance} »`,xve=((e,t={})=>(t.locale??q())===`fr`?yve(e):bve(e)),Sve=()=>`Stockés chiffrés au repos. En écriture seule : une valeur n'est jamais réaffichée — définissez-la, remplacez-la ou effacez-la.`,Cve=()=>`Stored encrypted at rest. Write-only: a value is never shown again — set or replace it, or clear it.`,wve=((e={},t={})=>(t.locale??q())===`fr`?Sve(e):Cve(e)),Tve=()=>`Jeton opérateur`,Eve=()=>`Operator token`,Dve=((e={},t={})=>(t.locale??q())===`fr`?Tve(e):Eve(e)),Ove=()=>`Identité d'appareil (JSON Ed25519)`,kve=()=>`Device identity (Ed25519 JSON)`,Ave=((e={},t={})=>(t.locale??q())===`fr`?Ove(e):kve(e)),jve=()=>`Clé API`,Mve=()=>`API key`,Nve=((e={},t={})=>(t.locale??q())===`fr`?jve(e):Mve(e)),Pve=()=>`Configuré`,Fve=()=>`Configured`,KZ=((e={},t={})=>(t.locale??q())===`fr`?Pve(e):Fve(e)),Ive=()=>`Non défini`,Lve=()=>`Not set`,qZ=((e={},t={})=>(t.locale??q())===`fr`?Ive(e):Lve(e)),Rve=()=>`Saisir la valeur…`,zve=()=>`Enter value…`,Bve=((e={},t={})=>(t.locale??q())===`fr`?Rve(e):zve(e)),Vve=()=>`Remplacer la valeur…`,Hve=()=>`Replace value…`,Uve=((e={},t={})=>(t.locale??q())===`fr`?Vve(e):Hve(e)),Wve=()=>`Définir`,Gve=()=>`Set`,Kve=((e={},t={})=>(t.locale??q())===`fr`?Wve(e):Gve(e)),qve=()=>`Effacer`,Jve=()=>`Clear`,Yve=((e={},t={})=>(t.locale??q())===`fr`?qve(e):Jve(e)),Xve=()=>`Identifiant enregistré`,Zve=()=>`Credential saved`,Qve=((e={},t={})=>(t.locale??q())===`fr`?Xve(e):Zve(e)),$ve=()=>`Impossible d'enregistrer l'identifiant`,eye=()=>`Could not save the credential`,JZ=((e={},t={})=>(t.locale??q())===`fr`?$ve(e):eye(e)),tye=()=>`Identifiant effacé`,nye=()=>`Credential cleared`,rye=((e={},t={})=>(t.locale??q())===`fr`?tye(e):nye(e)),iye=()=>`Générer`,aye=()=>`Generate`,oye=((e={},t={})=>(t.locale??q())===`fr`?iye(e):aye(e)),sye=()=>`Crée une identité Ed25519 côté serveur (la clé privée ne touche jamais le navigateur) et l'enregistre. Vous l'appairerez ensuite sur la gateway.`,cye=()=>`Mints an Ed25519 identity server-side (the private key never reaches the browser) and saves it. You'll then pair it on the gateway.`,lye=((e={},t={})=>(t.locale??q())===`fr`?sye(e):cye(e)),uye=()=>`Identité générée et enregistrée`,dye=()=>`Device identity generated and saved`,YZ=((e={},t={})=>(t.locale??q())===`fr`?uye(e):dye(e)),fye=()=>`Appairez cet appareil sur votre gateway avec :`,pye=()=>`Pair this device on your gateway with:`,mye=((e={},t={})=>(t.locale??q())===`fr`?fye(e):pye(e)),hye=()=>`Impossible de générer l'identité d'appareil`,gye=()=>`Could not generate the device identity`,_ye=((e={},t={})=>(t.locale??q())===`fr`?hye(e):gye(e)),vye=()=>`Synchroniser maintenant`,yye=()=>`Sync now`,bye=((e={},t={})=>(t.locale??q())===`fr`?vye(e):yye(e)),xye=()=>`Synchronisation…`,Sye=()=>`Syncing…`,Cye=((e={},t={})=>(t.locale??q())===`fr`?xye(e):Sye(e)),wye=()=>`Synchronisation effectuée`,Tye=()=>`Synced`,Eye=((e={},t={})=>(t.locale??q())===`fr`?wye(e):Tye(e)),Dye=()=>`Échec de la synchronisation`,Oye=()=>`Sync failed`,kye=((e={},t={})=>(t.locale??q())===`fr`?Dye(e):Oye(e)),Aye=()=>`Aucun agent récupéré — appairez l'appareil sur la gateway (ou vérifiez la configuration de l'instance), puis re-synchronisez`,jye=()=>`No agents retrieved — pair the device on the gateway (or check the instance configuration), then sync again`,Mye=((e={},t={})=>(t.locale??q())===`fr`?Aye(e):jye(e)),Nye=()=>`Aucun bridge ne sert cette instance — définissez son « Bridge URL » dans Settings → Agents → Instances.`,Pye=()=>`No bridge serves this instance — set its “Bridge URL” in Settings → Agents → Instances.`,Fye=((e={},t={})=>(t.locale??q())===`fr`?Nye(e):Pye(e)),Iye=()=>`Configuration Convex incomplète : BRIDGE_SHARED_SECRET manquant sur le déploiement.`,Lye=()=>`Convex deployment is misconfigured: BRIDGE_SHARED_SECRET is missing.`,Rye=((e={},t={})=>(t.locale??q())===`fr`?Iye(e):Lye(e)),zye=()=>`Bridge injoignable — vérifiez qu'il tourne et que son URL est correcte.`,Bye=()=>`Bridge unreachable — check it is running and its URL is correct.`,Vye=((e={},t={})=>(t.locale??q())===`fr`?zye(e):Bye(e)),Hye=()=>`Le bridge a rejeté l'authentification — BRIDGE_SHARED_SECRET désynchronisé entre Convex et le bridge.`,Uye=()=>`The bridge rejected authentication — BRIDGE_SHARED_SECRET is out of sync between Convex and the bridge.`,Wye=((e={},t={})=>(t.locale??q())===`fr`?Hye(e):Uye(e)),Gye=()=>`Le bridge ne sert pas cette instance — son secret doit figurer dans BRIDGE_INSTANCE_SECRETS et ses identifiants doivent être valides.`,Kye=()=>`The bridge does not serve this instance — its secret must be in BRIDGE_INSTANCE_SECRETS and its credentials must be valid.`,qye=((e={},t={})=>(t.locale??q())===`fr`?Gye(e):Kye(e)),Jye=()=>`Force le bridge à prendre en compte les identifiants et à récupérer les agents depuis la gateway maintenant (sinon ~2 min via le cron). Déclenche aussi l'appairage si l'appareil n'est pas encore appairé.`,Yye=()=>`Forces the bridge to take the credentials into account and fetch the agents from the gateway now (otherwise ~2 min via the cron). Also triggers pairing if the device is not yet paired.`,Xye=((e={},t={})=>(t.locale??q())===`fr`?Jye(e):Yye(e)),Zye=()=>`Secret du bridge (bridge → Convex)`,Qye=()=>`Bridge secret (bridge → Convex)`,$ye=((e={},t={})=>(t.locale??q())===`fr`?Zye(e):Qye(e)),ebe=()=>`Authentifie CE bridge auprès de Convex et le lie à cette instance, afin que le bridge ne puisse lire que les secrets de cette gateway. À définir dans l'environnement du bridge. Affiché une seule fois à la génération.`,tbe=()=>`Authenticates THIS bridge to Convex and ties it to this instance, so the bridge can only ever read this gateway's secrets. Set it in the bridge's environment. Shown once at generation.`,nbe=((e={},t={})=>(t.locale??q())===`fr`?ebe(e):tbe(e)),rbe=()=>`Générer`,ibe=()=>`Generate`,abe=((e={},t={})=>(t.locale??q())===`fr`?rbe(e):ibe(e)),obe=()=>`Régénérer`,sbe=()=>`Regenerate`,cbe=((e={},t={})=>(t.locale??q())===`fr`?obe(e):sbe(e)),lbe=()=>`Révoquer`,ube=()=>`Revoke`,dbe=((e={},t={})=>(t.locale??q())===`fr`?lbe(e):ube(e)),fbe=()=>`Secret du bridge révoqué`,pbe=()=>`Bridge secret revoked`,mbe=((e={},t={})=>(t.locale??q())===`fr`?fbe(e):pbe(e)),hbe=()=>`Impossible de générer le secret du bridge`,gbe=()=>`Could not generate the bridge secret`,XZ=((e={},t={})=>(t.locale??q())===`fr`?hbe(e):gbe(e)),_be=()=>`Copiez ce secret maintenant — il ne sera plus jamais affiché. Placez-le dans la variable d'environnement du bridge.`,vbe=()=>`Copy this secret now — it is never shown again. Put it in the bridge's environment variable.`,ybe=((e={},t={})=>(t.locale??q())===`fr`?_be(e):vbe(e)),bbe=()=>`J'ai copié le secret`,xbe=()=>`I've copied the secret`,ZZ=((e={},t={})=>(t.locale??q())===`fr`?bbe(e):xbe(e)),Sbe=e=>`Agents — instance « ${e?.name} »`,Cbe=e=>`Agents — instance « ${e?.name} »`,wbe=((e,t={})=>(t.locale??q())===`fr`?Sbe(e):Cbe(e)),Tbe=()=>`Les agents sont découverts par le bridge. Coche ceux à rendre disponibles en aval (assignables aux groupes/users), et choisis un défaut. Un agent désactivé reste listé mais grisé.`,Ebe=()=>`Agents are discovered by the bridge. Tick the ones to make available downstream (assignable to groups/users), and pick one default. A disabled agent stays listed but greyed.`,Dbe=((e={},t={})=>(t.locale??q())===`fr`?Tbe(e):Ebe(e)),Obe=()=>`Impossible de mettre à jour l’agent`,kbe=()=>`Could not update the agent`,QZ=((e={},t={})=>(t.locale??q())===`fr`?Obe(e):kbe(e)),Abe=()=>`Types`,jbe=()=>`Types`,Mbe=((e={},t={})=>(t.locale??q())===`fr`?Abe(e):jbe(e)),Nbe=()=>`Gérer`,Pbe=()=>`Manage`,Fbe=((e={},t={})=>(t.locale??q())===`fr`?Nbe(e):Pbe(e)),Ibe=()=>`Types de l'agent`,Lbe=()=>`Agent types`,Rbe=((e={},t={})=>(t.locale??q())===`fr`?Ibe(e):Lbe(e)),zbe=()=>`Un agent peut avoir plusieurs types. Chaque type indique à Atrium comment l'agent peut être utilisé.`,Bbe=()=>`An agent may hold several types. Each type tells Atrium how the agent can be used.`,Vbe=((e={},t={})=>(t.locale??q())===`fr`?zbe(e):Bbe(e)),Hbe=()=>`Conversationnel`,Ube=()=>`Conversational`,Wbe=((e={},t={})=>(t.locale??q())===`fr`?Hbe(e):Ube(e)),Gbe=()=>`Agent de chat standard — répond aux messages des utilisateurs dans une conversation.`,Kbe=()=>`Standard chat agent — answers users' messages in a conversation.`,qbe=((e={},t={})=>(t.locale??q())===`fr`?Gbe(e):Kbe(e)),Jbe=()=>`Source documentaire`,Ybe=()=>`Documentary source`,Xbe=((e={},t={})=>(t.locale??q())===`fr`?Jbe(e):Ybe(e)),Zbe=()=>`Agent spécialisé appelé par une action Atrium dédiée pour exploiter une source documentaire — pas de chat direct.`,Qbe=()=>`Specialised agent invoked by a dedicated Atrium action to exploit a documentary source — not used for direct chat.`,$be=((e={},t={})=>(t.locale??q())===`fr`?Zbe(e):Qbe(e)),exe=()=>`Définir par défaut`,txe=()=>`Set as default`,nxe=((e={},t={})=>(t.locale??q())===`fr`?exe(e):txe(e)),rxe=()=>`Retirer`,ixe=()=>`Remove`,axe=((e={},t={})=>(t.locale??q())===`fr`?rxe(e):ixe(e)),oxe=e=>`Retirer ${e?.name} ?`,sxe=e=>`Remove ${e?.name}?`,cxe=((e,t={})=>(t.locale??q())===`fr`?oxe(e):sxe(e)),lxe=()=>`Cet agent n’existe plus sur le gateway. Le retirer le supprime aussi de la liste d’agents de chaque groupe et utilisateur. Action irréversible.`,uxe=()=>`This agent no longer exists on the gateway. Removing it also removes it from every group's and user's agent list. This cannot be undone.`,dxe=((e={},t={})=>(t.locale??q())===`fr`?lxe(e):uxe(e)),fxe=()=>`Retirer`,pxe=()=>`Remove`,mxe=((e={},t={})=>(t.locale??q())===`fr`?fxe(e):pxe(e)),hxe=()=>`Agent retiré`,gxe=()=>`Agent removed`,_xe=((e={},t={})=>(t.locale??q())===`fr`?hxe(e):gxe(e)),vxe=()=>`Chargement…`,yxe=()=>`Loading…`,bxe=((e={},t={})=>(t.locale??q())===`fr`?vxe(e):yxe(e)),xxe=()=>`Jamais sondé.`,Sxe=()=>`Never polled.`,Cxe=((e={},t={})=>(t.locale??q())===`fr`?xxe(e):Sxe(e)),wxe=()=>`Découverte OK.`,Txe=()=>`Discovery OK.`,Exe=((e={},t={})=>(t.locale??q())===`fr`?wxe(e):Txe(e)),Dxe=e=>`Hors-ligne (${e?.error}) — dernier bon résultat servi.`,Oxe=e=>`Offline (${e?.error}) — last good result served.`,kxe=((e,t={})=>(t.locale??q())===`fr`?Dxe(e):Oxe(e)),Axe=()=>`Aucun agent découvert.`,jxe=()=>`No agent discovered.`,Mxe=((e={},t={})=>(t.locale??q())===`fr`?Axe(e):jxe(e)),Nxe=()=>`défaut`,Pxe=()=>`default`,$Z=((e={},t={})=>(t.locale??q())===`fr`?Nxe(e):Pxe(e)),Fxe=()=>`supprimé`,Ixe=()=>`removed`,Lxe=((e={},t={})=>(t.locale??q())===`fr`?Fxe(e):Ixe(e)),Rxe=()=>`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é.`,zxe=()=>`Trace of actions performed under impersonation: who really acted (real actor) and on behalf of which user. Message content is never recorded.`,Bxe=((e={},t={})=>(t.locale??q())===`fr`?Rxe(e):zxe(e)),Vxe=()=>`Fenêtre récente bornée — une plage antérieure peut être partielle.`,Hxe=()=>`Bounded recent window — an earlier range may be partial.`,Uxe=((e={},t={})=>(t.locale??q())===`fr`?Vxe(e):Hxe(e)),Wxe=()=>`Rechercher (action, acteur, ressource)`,Gxe=()=>`Search (action, actor, resource)`,Kxe=((e={},t={})=>(t.locale??q())===`fr`?Wxe(e):Gxe(e)),qxe=()=>`Action`,Jxe=()=>`Action`,eQ=((e={},t={})=>(t.locale??q())===`fr`?qxe(e):Jxe(e)),Yxe=()=>`Toutes les actions`,Xxe=()=>`All actions`,Zxe=((e={},t={})=>(t.locale??q())===`fr`?Yxe(e):Xxe(e)),Qxe=()=>`Usurpation : toutes`,$xe=()=>`Impersonation: all`,eSe=((e={},t={})=>(t.locale??q())===`fr`?Qxe(e):$xe(e)),tSe=()=>`Sous usurpation`,nSe=()=>`Under impersonation`,rSe=((e={},t={})=>(t.locale??q())===`fr`?tSe(e):nSe(e)),iSe=()=>`Sans usurpation`,aSe=()=>`Without impersonation`,oSe=((e={},t={})=>(t.locale??q())===`fr`?iSe(e):aSe(e)),sSe=()=>`Ressource`,cSe=()=>`Resource`,tQ=((e={},t={})=>(t.locale??q())===`fr`?sSe(e):cSe(e)),lSe=()=>`Toutes les ressources`,uSe=()=>`All resources`,dSe=((e={},t={})=>(t.locale??q())===`fr`?lSe(e):uSe(e)),fSe=()=>`Audit`,pSe=()=>`Audit`,mSe=((e={},t={})=>(t.locale??q())===`fr`?fSe(e):pSe(e)),hSe=()=>`Aucune action tracée pour l’instant.`,gSe=()=>`No action traced yet.`,_Se=((e={},t={})=>(t.locale??q())===`fr`?hSe(e):gSe(e)),vSe=()=>`Quand`,ySe=()=>`When`,bSe=((e={},t={})=>(t.locale??q())===`fr`?vSe(e):ySe(e)),xSe=()=>`Acteur réel`,SSe=()=>`Real actor`,CSe=((e={},t={})=>(t.locale??q())===`fr`?xSe(e):SSe(e)),wSe=()=>`Au nom de`,TSe=()=>`On behalf of`,ESe=((e={},t={})=>(t.locale??q())===`fr`?wSe(e):TSe(e)),DSe=()=>`Traces`,OSe=()=>`Traces`,kSe=((e={},t={})=>(t.locale??q())===`fr`?DSe(e):OSe(e)),ASe=()=>`KPI`,jSe=()=>`KPI`,MSe=((e={},t={})=>(t.locale??q())===`fr`?ASe(e):jSe(e)),NSe=()=>`OpenClaw / Anomalies`,PSe=()=>`OpenClaw / Anomalies`,FSe=((e={},t={})=>(t.locale??q())===`fr`?NSe(e):PSe(e)),ISe=()=>`Chats`,LSe=()=>`Chats`,RSe=((e={},t={})=>(t.locale??q())===`fr`?ISe(e):LSe(e)),zSe=()=>`Admin`,BSe=()=>`Admin`,VSe=((e={},t={})=>(t.locale??q())===`fr`?zSe(e):BSe(e)),HSe=()=>`Lire`,USe=()=>`Read`,nQ=((e={},t={})=>(t.locale??q())===`fr`?HSe(e):USe(e)),WSe=()=>`Contenu`,GSe=()=>`Content`,KSe=((e={},t={})=>(t.locale??q())===`fr`?WSe(e):GSe(e)),qSe=()=>`Écrire`,JSe=()=>`Write`,rQ=((e={},t={})=>(t.locale??q())===`fr`?qSe(e):JSe(e)),YSe=()=>`Requête`,XSe=()=>`Query`,ZSe=((e={},t={})=>(t.locale??q())===`fr`?YSe(e):XSe(e)),QSe=()=>`Anomalies`,$Se=()=>`Anomalies`,eCe=((e={},t={})=>(t.locale??q())===`fr`?QSe(e):$Se(e)),tCe=()=>`Signaler`,nCe=()=>`Report`,rCe=((e={},t={})=>(t.locale??q())===`fr`?tCe(e):nCe(e)),iCe=()=>`Gérer`,aCe=()=>`Manage`,oCe=((e={},t={})=>(t.locale??q())===`fr`?iCe(e):aCe(e)),sCe=()=>`Auto-correction`,cCe=()=>`Self-heal`,lCe=((e={},t={})=>(t.locale??q())===`fr`?sCe(e):cCe(e)),uCe=e=>`${e?.key} — accès au contenu brut (PHI), à accorder avec prudence`,dCe=e=>`${e?.key} — access to raw content (PHI), grant with caution`,fCe=((e,t={})=>(t.locale??q())===`fr`?uCe(e):dCe(e)),pCe=()=>`Échec de l’initialisation des rôles`,mCe=()=>`Failed to initialize roles`,hCe=((e={},t={})=>(t.locale??q())===`fr`?pCe(e):mCe(e)),gCe=e=>`Modifier le rôle intégré « ${e?.name} » ?`,_Ce=e=>`Edit the built-in role “${e?.name}”?`,vCe=((e,t={})=>(t.locale??q())===`fr`?gCe(e):_Ce(e)),yCe=()=>`Les rôles intégrés sont la base du modèle de permissions. Les modifier peut affecter les comptes existants. Continuer ?`,bCe=()=>`Built-in roles are the foundation of the permission model. Editing them may affect existing accounts. Continue?`,xCe=((e={},t={})=>(t.locale??q())===`fr`?yCe(e):bCe(e)),SCe=()=>`Modifier`,CCe=()=>`Edit`,wCe=((e={},t={})=>(t.locale??q())===`fr`?SCe(e):CCe(e)),TCe=()=>`Échec de la mise à jour des permissions`,ECe=()=>`Failed to update permissions`,DCe=((e={},t={})=>(t.locale??q())===`fr`?TCe(e):ECe(e)),OCe=()=>`Échec de la création du rôle`,kCe=()=>`Failed to create role`,ACe=((e={},t={})=>(t.locale??q())===`fr`?OCe(e):kCe(e)),jCe=()=>`Matrice de permissions. Lignes = rôles (intégrés + personnalisés), colonnes = clés de permission. Le rôle`,MCe=()=>`Permission matrix. Rows = roles (built-in + custom), columns = permission keys. The`,NCe=((e={},t={})=>(t.locale??q())===`fr`?jCe(e):MCe(e)),PCe=()=>`détient le joker « * » (toutes les permissions) et est verrouillé. La colonne`,FCe=()=>`role holds the “*” wildcard (all permissions) and is locked. The`,ICe=((e={},t={})=>(t.locale??q())===`fr`?PCe(e):FCe(e)),LCe=()=>`donne accès au contenu brut (PHI) — à n’accorder qu’à bon escient.`,RCe=()=>`column grants access to raw content (PHI) — grant only when justified.`,zCe=((e={},t={})=>(t.locale??q())===`fr`?LCe(e):RCe(e)),BCe=()=>`Rôles`,VCe=()=>`Roles`,HCe=((e={},t={})=>(t.locale??q())===`fr`?BCe(e):VCe(e)),UCe=()=>`Ajouter un rôle`,WCe=()=>`Add a role`,GCe=((e={},t={})=>(t.locale??q())===`fr`?UCe(e):WCe(e)),KCe=()=>`Chargement…`,qCe=()=>`Loading…`,JCe=((e={},t={})=>(t.locale??q())===`fr`?KCe(e):qCe(e)),YCe=()=>`Initialisation des rôles…`,XCe=()=>`Initializing roles…`,ZCe=((e={},t={})=>(t.locale??q())===`fr`?YCe(e):XCe(e)),QCe=()=>`Rôle`,$Ce=()=>`Role`,ewe=((e={},t={})=>(t.locale??q())===`fr`?QCe(e):$Ce(e)),twe=()=>`intégré`,nwe=()=>`built-in`,rwe=((e={},t={})=>(t.locale??q())===`fr`?twe(e):nwe(e)),iwe=()=>`personnalisé`,awe=()=>`custom`,owe=((e={},t={})=>(t.locale??q())===`fr`?iwe(e):awe(e)),swe=()=>`Authentifié mais pas encore approuvé — l’accès est bloqué tant qu’un administrateur n’a pas validé le compte.`,cwe=()=>`Authenticated but not yet approved — access is blocked until an admin approves the account.`,lwe=((e={},t={})=>(t.locale??q())===`fr`?swe(e):cwe(e)),uwe=()=>`Personne approuvée, avec accès au chat.`,dwe=()=>`Approved person with chat access.`,fwe=((e={},t={})=>(t.locale??q())===`fr`?uwe(e):dwe(e)),pwe=()=>`Accès total (superset) : gère les utilisateurs, rôles, agents, instances et l’observabilité.`,mwe=()=>`Full access (superset): manages users, roles, agents, instances and observability.`,hwe=((e={},t={})=>(t.locale??q())===`fr`?pwe(e):mwe(e)),gwe=()=>`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.`,_we=()=>`READ-ONLY service account for monitoring: views traces, KPIs, anomalies and bridge/version status through the API. Cannot write or trigger anything.`,vwe=((e={},t={})=>(t.locale??q())===`fr`?gwe(e):_we(e)),ywe=()=>`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.`,bwe=()=>`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.`,xwe=((e={},t={})=>(t.locale??q())===`fr`?ywe(e):bwe(e)),Swe=()=>`Accordé via « * » (toutes les permissions)`,Cwe=()=>`Granted via “*” (all permissions)`,wwe=((e={},t={})=>(t.locale??q())===`fr`?Swe(e):Cwe(e)),Twe=()=>`Écriture en cours…`,Ewe=()=>`Writing…`,Dwe=((e={},t={})=>(t.locale??q())===`fr`?Twe(e):Ewe(e)),Owe=()=>`Nouveau rôle`,kwe=()=>`New role`,Awe=((e={},t={})=>(t.locale??q())===`fr`?Owe(e):kwe(e)),jwe=()=>`Rôle personnalisé. Ajustez les permissions dans la matrice après création.`,Mwe=()=>`Custom role. Adjust the permissions in the matrix after creation.`,Nwe=((e={},t={})=>(t.locale??q())===`fr`?jwe(e):Mwe(e)),Pwe=()=>`Créer`,Fwe=()=>`Create`,Iwe=((e={},t={})=>(t.locale??q())===`fr`?Pwe(e):Fwe(e)),Lwe=()=>`Clé (identifiant stable)`,Rwe=()=>`Key (stable identifier)`,zwe=((e={},t={})=>(t.locale??q())===`fr`?Lwe(e):Rwe(e)),Bwe=()=>`ex. analyst`,Vwe=()=>`e.g. analyst`,Hwe=((e={},t={})=>(t.locale??q())===`fr`?Bwe(e):Vwe(e)),Uwe=()=>`Nom affiché`,Wwe=()=>`Display name`,Gwe=((e={},t={})=>(t.locale??q())===`fr`?Uwe(e):Wwe(e)),Kwe=()=>`Description (optionnel)`,qwe=()=>`Description (optional)`,Jwe=((e={},t={})=>(t.locale??q())===`fr`?Kwe(e):qwe(e)),Ywe=()=>`Ouvertes`,Xwe=()=>`Open`,Zwe=((e={},t={})=>(t.locale??q())===`fr`?Ywe(e):Xwe(e)),Qwe=()=>`En sourdine`,$we=()=>`Muted`,eTe=((e={},t={})=>(t.locale??q())===`fr`?Qwe(e):$we(e)),tTe=()=>`Résolues`,nTe=()=>`Resolved`,rTe=((e={},t={})=>(t.locale??q())===`fr`?tTe(e):nTe(e)),iTe=()=>`Résoudre cette anomalie ?`,aTe=()=>`Resolve this anomaly?`,oTe=((e={},t={})=>(t.locale??q())===`fr`?iTe(e):aTe(e)),sTe=()=>`L’anomalie`,cTe=()=>`The anomaly`,lTe=((e={},t={})=>(t.locale??q())===`fr`?sTe(e):cTe(e)),uTe=()=>`sera marquée comme`,dTe=()=>`will be marked as`,fTe=((e={},t={})=>(t.locale??q())===`fr`?uTe(e):dTe(e)),pTe=()=>`résolue`,mTe=()=>`resolved`,hTe=((e={},t={})=>(t.locale??q())===`fr`?pTe(e):mTe(e)),gTe=()=>`Elle sortira du décompte des anomalies ouvertes (signal de self-repair OpenClaw).`,_Te=()=>`It will be removed from the open anomalies count (OpenClaw self-repair signal).`,vTe=((e={},t={})=>(t.locale??q())===`fr`?gTe(e):_Te(e)),yTe=()=>`Résoudre`,bTe=()=>`Resolve`,xTe=((e={},t={})=>(t.locale??q())===`fr`?yTe(e):bTe(e)),STe=()=>`Anomalie résolue`,CTe=()=>`Anomaly resolved`,wTe=((e={},t={})=>(t.locale??q())===`fr`?STe(e):CTe(e)),TTe=()=>`Échec de la résolution`,ETe=()=>`Resolution failed`,DTe=((e={},t={})=>(t.locale??q())===`fr`?TTe(e):ETe(e)),OTe=()=>`Anomalie acquittée`,kTe=()=>`Anomaly acknowledged`,ATe=((e={},t={})=>(t.locale??q())===`fr`?OTe(e):kTe(e)),jTe=()=>`Échec de l’acquittement`,MTe=()=>`Acknowledgement failed`,NTe=((e={},t={})=>(t.locale??q())===`fr`?jTe(e):MTe(e)),PTe=()=>`Anomalies détectées (cron) ou signalées par les agents OpenClaw. Données non-PHI uniquement (type, sévérité, message, corrélation).`,FTe=()=>`Anomalies detected (cron) or reported by OpenClaw agents. Non-PHI data only (type, severity, message, correlation).`,ITe=((e={},t={})=>(t.locale??q())===`fr`?PTe(e):FTe(e)),LTe=()=>`Ouverte`,RTe=()=>`Open`,zTe=((e={},t={})=>(t.locale??q())===`fr`?LTe(e):RTe(e)),BTe=()=>`= active, elle alerte et compte dans le heartbeat.`,VTe=()=>`= active, it alerts and counts in the heartbeat.`,HTe=((e={},t={})=>(t.locale??q())===`fr`?BTe(e):VTe(e)),UTe=()=>`En sourdine`,WTe=()=>`Muted`,GTe=((e={},t={})=>(t.locale??q())===`fr`?UTe(e):WTe(e)),KTe=()=>`= vue, plus d'alerte, mais pas forcément corrigée (les admins sont notifiés des nouvelles anomalies).`,qTe=()=>`= seen, no more alerts, but not necessarily fixed (admins are notified of new anomalies).`,JTe=((e={},t={})=>(t.locale??q())===`fr`?KTe(e):qTe(e)),YTe=()=>`Résolue`,XTe=()=>`Resolved`,ZTe=((e={},t={})=>(t.locale??q())===`fr`?YTe(e):XTe(e)),QTe=()=>`= le problème est réglé (le détecteur résout automatiquement quand la condition cesse). Les deux la sortent du décompte heartbeat.`,$Te=()=>`= the problem is fixed (the detector resolves automatically when the condition clears). Both remove it from the heartbeat count.`,eEe=((e={},t={})=>(t.locale??q())===`fr`?QTe(e):$Te(e)),tEe=()=>`La plage temporelle filtre la fenêtre récente — une plage antérieure peut être partielle.`,nEe=()=>`The time range filters the recent window — an earlier range may be partial.`,rEe=((e={},t={})=>(t.locale??q())===`fr`?tEe(e):nEe(e)),iEe=()=>`Rechercher (message, type, corrélation)`,aEe=()=>`Search (message, type, correlation)`,oEe=((e={},t={})=>(t.locale??q())===`fr`?iEe(e):aEe(e)),sEe=()=>`Tous les statuts`,cEe=()=>`All statuses`,lEe=((e={},t={})=>(t.locale??q())===`fr`?sEe(e):cEe(e)),uEe=()=>`Sévérité`,dEe=()=>`Severity`,iQ=((e={},t={})=>(t.locale??q())===`fr`?uEe(e):dEe(e)),fEe=()=>`Toutes sévérités`,pEe=()=>`All severities`,mEe=((e={},t={})=>(t.locale??q())===`fr`?fEe(e):pEe(e)),hEe=()=>`Source`,gEe=()=>`Source`,aQ=((e={},t={})=>(t.locale??q())===`fr`?hEe(e):gEe(e)),_Ee=()=>`Toutes sources`,vEe=()=>`All sources`,yEe=((e={},t={})=>(t.locale??q())===`fr`?_Ee(e):vEe(e)),bEe=()=>`Type`,xEe=()=>`Type`,oQ=((e={},t={})=>(t.locale??q())===`fr`?bEe(e):xEe(e)),SEe=()=>`Tous les types`,CEe=()=>`All types`,wEe=((e={},t={})=>(t.locale??q())===`fr`?SEe(e):CEe(e)),TEe=()=>`Anomalies`,EEe=()=>`Anomalies`,DEe=((e={},t={})=>(t.locale??q())===`fr`?TEe(e):EEe(e)),OEe=()=>`Aucune anomalie ouverte. 🎉`,kEe=()=>`No open anomalies. 🎉`,AEe=((e={},t={})=>(t.locale??q())===`fr`?OEe(e):kEe(e)),jEe=()=>`Aucune anomalie enregistrée.`,MEe=()=>`No anomalies recorded.`,NEe=((e={},t={})=>(t.locale??q())===`fr`?jEe(e):MEe(e)),PEe=()=>`Résoudre (corrigé)`,FEe=()=>`Resolve (fixed)`,IEe=((e={},t={})=>(t.locale??q())===`fr`?PEe(e):FEe(e)),LEe=()=>`Marquer comme vue (sourdine)`,REe=()=>`Mark as seen (mute)`,zEe=((e={},t={})=>(t.locale??q())===`fr`?LEe(e):REe(e)),BEe=()=>`Quand`,VEe=()=>`When`,HEe=((e={},t={})=>(t.locale??q())===`fr`?BEe(e):VEe(e)),UEe=()=>`Statut`,WEe=()=>`Status`,GEe=((e={},t={})=>(t.locale??q())===`fr`?UEe(e):WEe(e)),KEe=()=>`Message`,qEe=()=>`Message`,JEe=((e={},t={})=>(t.locale??q())===`fr`?KEe(e):qEe(e)),YEe=()=>`Cause & correctif`,XEe=()=>`Cause & fix`,ZEe=((e={},t={})=>(t.locale??q())===`fr`?YEe(e):XEe(e)),QEe=()=>`Corrélation`,$Ee=()=>`Correlation`,eDe=((e={},t={})=>(t.locale??q())===`fr`?QEe(e):$Ee(e)),tDe=()=>`Voir la trace`,nDe=()=>`View trace`,rDe=((e={},t={})=>(t.locale??q())===`fr`?tDe(e):nDe(e)),iDe=()=>`ouverte`,aDe=()=>`open`,oDe=((e={},t={})=>(t.locale??q())===`fr`?iDe(e):aDe(e)),sDe=()=>`en sourdine`,cDe=()=>`muted`,lDe=((e={},t={})=>(t.locale??q())===`fr`?sDe(e):cDe(e)),uDe=()=>`résolue`,dDe=()=>`resolved`,fDe=((e={},t={})=>(t.locale??q())===`fr`?uDe(e):dDe(e)),pDe=()=>`Réponse incorrecte`,mDe=()=>`Incorrect response`,hDe=((e={},t={})=>(t.locale??q())===`fr`?pDe(e):mDe(e)),gDe=()=>`Incohérence`,_De=()=>`Inconsistency`,vDe=((e={},t={})=>(t.locale??q())===`fr`?gDe(e):_De(e)),yDe=()=>`Mots / orthographe erronés`,bDe=()=>`Wrong words / spelling`,xDe=((e={},t={})=>(t.locale??q())===`fr`?yDe(e):bDe(e)),SDe=()=>`Formatage`,CDe=()=>`Formatting`,wDe=((e={},t={})=>(t.locale??q())===`fr`?SDe(e):CDe(e)),TDe=()=>`Latence`,EDe=()=>`Latency`,DDe=((e={},t={})=>(t.locale??q())===`fr`?TDe(e):EDe(e)),ODe=()=>`Erreur API`,kDe=()=>`API error`,ADe=((e={},t={})=>(t.locale??q())===`fr`?ODe(e):kDe(e)),jDe=()=>`Autre`,MDe=()=>`Other`,sQ=((e={},t={})=>(t.locale??q())===`fr`?jDe(e):MDe(e)),NDe=()=>`Mots modifiés à l'envoi`,PDe=()=>`Words altered on send`,FDe=((e={},t={})=>(t.locale??q())===`fr`?NDe(e):PDe(e)),IDe=()=>`Caractères / mise en forme altérés`,LDe=()=>`Characters / formatting altered`,RDe=((e={},t={})=>(t.locale??q())===`fr`?IDe(e):LDe(e)),zDe=()=>`Signaler un problème`,BDe=()=>`Report an issue`,VDe=((e={},t={})=>(t.locale??q())===`fr`?zDe(e):BDe(e)),HDe=()=>`Merci. Un instantané complet de ce message a été figé pour analyse.`,UDe=()=>`Thank you. A complete snapshot of this message has been frozen for analysis.`,WDe=((e={},t={})=>(t.locale??q())===`fr`?HDe(e):UDe(e)),GDe=()=>`Signalez un problème avec votre message tel qu'il a été envoyé. Un instantané forensique exact est enregistré.`,KDe=()=>`Report an issue with your message as it was sent. An exact forensic snapshot is recorded.`,qDe=((e={},t={})=>(t.locale??q())===`fr`?GDe(e):KDe(e)),JDe=()=>`Signalez un problème avec cette réponse. Un instantané forensique exact est enregistré au moment de l'envoi.`,YDe=()=>`Report an issue with this response. An exact forensic snapshot is recorded at send time.`,XDe=((e={},t={})=>(t.locale??q())===`fr`?JDe(e):YDe(e)),ZDe=()=>`✓ 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.`,QDe=()=>`✓ The displayed text (source view) matches exactly, character for character, the text stored on the server. The comparison is frozen as evidence.`,$De=((e={},t={})=>(t.locale??q())===`fr`?ZDe(e):QDe(e)),eOe=()=>`⚠ Écart détecté entre le texte affiché (vue source) et le texte stocké. L'instantané a figé les deux versions.`,tOe=()=>`⚠ Discrepancy detected between the displayed text (source view) and the stored text. The snapshot has frozen both versions.`,nOe=((e={},t={})=>(t.locale??q())===`fr`?eOe(e):tOe(e)),rOe=()=>`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.`,iOe=()=>`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.`,aOe=((e={},t={})=>(t.locale??q())===`fr`?rOe(e):iOe(e)),oOe=()=>`Catégorie`,sOe=()=>`Category`,cOe=((e={},t={})=>(t.locale??q())===`fr`?oOe(e):sOe(e)),lOe=()=>`Choisir une catégorie`,uOe=()=>`Choose a category`,dOe=((e={},t={})=>(t.locale??q())===`fr`?lOe(e):uOe(e)),fOe=()=>`Commentaire`,pOe=()=>`Comment`,mOe=((e={},t={})=>(t.locale??q())===`fr`?fOe(e):pOe(e)),hOe=()=>`Décrivez le problème…`,gOe=()=>`Describe the issue…`,_Oe=((e={},t={})=>(t.locale??q())===`fr`?hOe(e):gOe(e)),vOe=()=>`Fermer`,yOe=()=>`Close`,bOe=((e={},t={})=>(t.locale??q())===`fr`?vOe(e):yOe(e)),xOe=()=>`Annuler`,SOe=()=>`Cancel`,COe=((e={},t={})=>(t.locale??q())===`fr`?xOe(e):SOe(e)),wOe=()=>`Envoi…`,TOe=()=>`Sending…`,EOe=((e={},t={})=>(t.locale??q())===`fr`?wOe(e):TOe(e)),DOe=()=>`Envoyer`,OOe=()=>`Send`,kOe=((e={},t={})=>(t.locale??q())===`fr`?DOe(e):OOe(e)),AOe=()=>`Problème signalé`,jOe=()=>`Issue reported`,MOe=((e={},t={})=>(t.locale??q())===`fr`?AOe(e):jOe(e)),NOe=()=>`Signaler un problème`,POe=()=>`Report an issue`,FOe=((e={},t={})=>(t.locale??q())===`fr`?NOe(e):POe(e)),IOe=()=>`Signaler un problème avec ce message`,LOe=()=>`Report an issue with this message`,ROe=((e={},t={})=>(t.locale??q())===`fr`?IOe(e):LOe(e)),zOe=()=>`Événements récents (fenêtre bornée, plus récents d’abord). Toutes les traces sont des métadonnées `,BOe=()=>`Recent events (bounded window, newest first). All traces are redacted metadata `,VOe=((e={},t={})=>(t.locale??q())===`fr`?zOe(e):BOe(e)),HOe=()=>`expurgées`,UOe=()=>`redacted`,WOe=((e={},t={})=>(t.locale??q())===`fr`?HOe(e):UOe(e)),GOe=()=>` : aucun contenu de message, pièce jointe ou jeton n’est stocké — uniquement des longueurs, codes et indicateurs.`,KOe=()=>`: no message content, attachment or token is stored — only lengths, codes and flags.`,qOe=((e={},t={})=>(t.locale??q())===`fr`?GOe(e):KOe(e)),JOe=()=>`La plage temporelle filtre la fenêtre récente — une plage antérieure peut être partielle.`,YOe=()=>`The time range filters the recent window — an older range may be partial.`,XOe=((e={},t={})=>(t.locale??q())===`fr`?JOe(e):YOe(e)),ZOe=()=>`Rechercher (kind, principal, rôle, route, correlationId)`,QOe=()=>`Search (kind, principal, role, route, correlationId)`,$Oe=((e={},t={})=>(t.locale??q())===`fr`?ZOe(e):QOe(e)),eke=()=>`Statut`,tke=()=>`Status`,nke=((e={},t={})=>(t.locale??q())===`fr`?eke(e):tke(e)),rke=()=>`Tous statuts`,ike=()=>`All statuses`,ake=((e={},t={})=>(t.locale??q())===`fr`?rke(e):ike(e)),oke=()=>`Principal`,ske=()=>`Principal`,cke=((e={},t={})=>(t.locale??q())===`fr`?oke(e):ske(e)),lke=()=>`Tous principaux`,uke=()=>`All principals`,dke=((e={},t={})=>(t.locale??q())===`fr`?lke(e):uke(e)),fke=()=>`Direction`,pke=()=>`Direction`,mke=((e={},t={})=>(t.locale??q())===`fr`?fke(e):pke(e)),hke=()=>`Toutes directions`,gke=()=>`All directions`,_ke=((e={},t={})=>(t.locale??q())===`fr`?hke(e):gke(e)),vke=()=>`Rôle`,yke=()=>`Role`,bke=((e={},t={})=>(t.locale??q())===`fr`?vke(e):yke(e)),xke=()=>`Tous les rôles`,Ske=()=>`All roles`,Cke=((e={},t={})=>(t.locale??q())===`fr`?xke(e):Ske(e)),wke=()=>`Tous les kinds`,Tke=()=>`All kinds`,Eke=((e={},t={})=>(t.locale??q())===`fr`?wke(e):Tke(e)),Dke=()=>`tous les kinds`,Oke=()=>`all kinds`,kke=((e={},t={})=>(t.locale??q())===`fr`?Dke(e):Oke(e)),Ake=e=>`${e?.count} lignes`,jke=e=>`${e?.count} rows`,Mke=((e,t={})=>(t.locale??q())===`fr`?Ake(e):jke(e)),Nke=()=>`Effacer le filtre de corrélation`,Pke=()=>`Clear correlation filter`,Fke=((e={},t={})=>(t.locale??q())===`fr`?Nke(e):Pke(e)),Ike=()=>`filtre: correlationId=`,Lke=()=>`filter: correlationId=`,Rke=((e={},t={})=>(t.locale??q())===`fr`?Ike(e):Lke(e)),zke=()=>`Effacer`,Bke=()=>`Clear`,Vke=((e={},t={})=>(t.locale??q())===`fr`?zke(e):Bke(e)),Hke=()=>`Traces`,Uke=()=>`Traces`,Wke=((e={},t={})=>(t.locale??q())===`fr`?Hke(e):Uke(e)),Gke=()=>`Aucun événement pour cette corrélation dans la fenêtre.`,Kke=()=>`No event for this correlation in the window.`,qke=((e={},t={})=>(t.locale??q())===`fr`?Gke(e):Kke(e)),Jke=()=>`Aucun événement tracé pour l’instant.`,Yke=()=>`No traced event yet.`,Xke=((e={},t={})=>(t.locale??q())===`fr`?Jke(e):Yke(e)),Zke=()=>`Quand`,Qke=()=>`When`,$ke=((e={},t={})=>(t.locale??q())===`fr`?Zke(e):Qke(e)),eAe=()=>`Kind`,tAe=()=>`Kind`,nAe=((e={},t={})=>(t.locale??q())===`fr`?eAe(e):tAe(e)),rAe=()=>`Résultat`,iAe=()=>`Result`,aAe=((e={},t={})=>(t.locale??q())===`fr`?rAe(e):iAe(e)),oAe=()=>`ok`,sAe=()=>`ok`,cAe=((e={},t={})=>(t.locale??q())===`fr`?oAe(e):sAe(e)),lAe=()=>`Direction`,uAe=()=>`Direction`,dAe=((e={},t={})=>(t.locale??q())===`fr`?lAe(e):uAe(e)),fAe=()=>`Principal`,pAe=()=>`Principal`,mAe=((e={},t={})=>(t.locale??q())===`fr`?fAe(e):pAe(e)),hAe=()=>`Rôle`,gAe=()=>`Role`,_Ae=((e={},t={})=>(t.locale??q())===`fr`?hAe(e):gAe(e)),vAe=()=>`Route`,yAe=()=>`Route`,bAe=((e={},t={})=>(t.locale??q())===`fr`?vAe(e):yAe(e)),xAe=()=>`Statut`,SAe=()=>`Status`,CAe=((e={},t={})=>(t.locale??q())===`fr`?xAe(e):SAe(e)),wAe=()=>`Latence`,TAe=()=>`Latency`,EAe=((e={},t={})=>(t.locale??q())===`fr`?wAe(e):TAe(e)),DAe=()=>`Corrélation`,OAe=()=>`Correlation`,kAe=((e={},t={})=>(t.locale??q())===`fr`?DAe(e):OAe(e)),AAe=()=>`Suivre ce tour (filtrer par correlationId)`,jAe=()=>`Follow this turn (filter by correlationId)`,MAe=((e={},t={})=>(t.locale??q())===`fr`?AAe(e):jAe(e)),NAe=()=>`Meta`,PAe=()=>`Meta`,FAe=((e={},t={})=>(t.locale??q())===`fr`?NAe(e):PAe(e)),IAe=()=>`Voir`,LAe=()=>`View`,RAe=((e={},t={})=>(t.locale??q())===`fr`?IAe(e):LAe(e)),zAe=()=>`Meta ·`,BAe=()=>`Meta ·`,VAe=((e={},t={})=>(t.locale??q())===`fr`?zAe(e):BAe(e)),HAe=()=>`expurgé`,UAe=()=>`redacted`,WAe=((e={},t={})=>(t.locale??q())===`fr`?HAe(e):UAe(e)),GAe=()=>`Métadonnées non-PHI uniquement (longueurs, codes, indicateurs). Aucun contenu de message n’est stocké.`,KAe=()=>`Non-PHI metadata only (lengths, codes, flags). No message content is stored.`,qAe=((e={},t={})=>(t.locale??q())===`fr`?GAe(e):KAe(e)),JAe=()=>`Chargement…`,YAe=()=>`Loading…`,cQ=((e={},t={})=>(t.locale??q())===`fr`?JAe(e):YAe(e)),XAe=()=>`Connexion refusée. Le domaine de ce compte n’est pas autorisé.`,ZAe=()=>`Sign-in refused. This account’s email domain is not allowed.`,QAe=((e={},t={})=>(t.locale??q())===`fr`?XAe(e):ZAe(e)),$Ae=()=>`Bon retour`,eje=()=>`Welcome back`,tje=((e={},t={})=>(t.locale??q())===`fr`?$Ae(e):eje(e)),nje=()=>`Connectez-vous pour continuer`,rje=()=>`Sign in to continue`,ije=((e={},t={})=>(t.locale??q())===`fr`?nje(e):rje(e)),aje=()=>`Se connecter avec Google`,oje=()=>`Sign in with Google`,sje=((e={},t={})=>(t.locale??q())===`fr`?aje(e):oje(e)),cje=()=>`Aucun mode de connexion configuré.`,lje=()=>`No sign-in method configured.`,uje=((e={},t={})=>(t.locale??q())===`fr`?cje(e):lje(e)),dje=()=>`Continuer (dev, sans compte)`,fje=()=>`Continue (dev, no account)`,pje=((e={},t={})=>(t.locale??q())===`fr`?dje(e):fje(e)),mje=()=>`Compte`,hje=()=>`Account`,gje=((e={},t={})=>(t.locale??q())===`fr`?mje(e):hje(e)),_je=()=>`En attente d’approbation`,vje=()=>`Awaiting approval`,yje=((e={},t={})=>(t.locale??q())===`fr`?_je(e):vje(e)),bje=()=>`Ton compte est créé mais doit être approuvé par un administrateur avant d’accéder au chat.`,xje=()=>`Your account has been created but must be approved by an administrator before you can access the chat.`,Sje=((e={},t={})=>(t.locale??q())===`fr`?bje(e):xje(e)),Cje=()=>`Vous explorez l’application en tant que`,wje=()=>`You are exploring the application as`,Tje=((e={},t={})=>(t.locale??q())===`fr`?Cje(e):wje(e)),Eje=()=>`. Toute action est exécutée et tracée en votre nom (`,Dje=()=>`. Every action is executed and traced in your name (`,Oje=((e={},t={})=>(t.locale??q())===`fr`?Eje(e):Dje(e)),kje=()=>`).`,Aje=()=>`).`,jje=((e={},t={})=>(t.locale??q())===`fr`?kje(e):Aje(e)),Mje=()=>`Quitter`,Nje=()=>`Exit`,Pje=((e={},t={})=>(t.locale??q())===`fr`?Mje(e):Nje(e)),Fje=()=>`Afficher la barre latérale`,Ije=()=>`Show sidebar`,Lje=((e={},t={})=>(t.locale??q())===`fr`?Fje(e):Ije(e)),Rje=()=>`Réduire la barre latérale`,zje=()=>`Collapse sidebar`,Bje=((e={},t={})=>(t.locale??q())===`fr`?Rje(e):zje(e)),Vje=()=>`Paramètres`,Hje=()=>`Settings`,Uje=((e={},t={})=>(t.locale??q())===`fr`?Vje(e):Hje(e)),Wje=()=>`Redimensionner la barre latérale`,Gje=()=>`Resize sidebar`,Kje=((e={},t={})=>(t.locale??q())===`fr`?Wje(e):Gje(e)),qje=()=>`Accès non autorisé`,Jje=()=>`Access denied`,Yje=((e={},t={})=>(t.locale??q())===`fr`?qje(e):Jje(e)),Xje=()=>`Vous n’avez pas la permission de consulter cet onglet. Choisissez un onglet disponible dans le menu, ou contactez votre administrateur.`,Zje=()=>`You do not have permission to view this tab. Choose an available tab from the menu, or contact your administrator.`,Qje=((e={},t={})=>(t.locale??q())===`fr`?Xje(e):Zje(e)),$je=()=>`Une erreur est survenue`,eMe=()=>`Something went wrong`,tMe=((e={},t={})=>(t.locale??q())===`fr`?$je(e):eMe(e)),nMe=()=>`Cette page n’a pas pu être affichée. Réessayez, ou revenez à l’accueil. Si le problème persiste, contactez votre administrateur.`,rMe=()=>`This page could not be displayed. Try again, or return home. If the problem persists, contact your administrator.`,iMe=((e={},t={})=>(t.locale??q())===`fr`?nMe(e):rMe(e)),aMe=()=>`Réessayer`,oMe=()=>`Retry`,sMe=((e={},t={})=>(t.locale??q())===`fr`?aMe(e):oMe(e)),cMe=()=>`Accueil`,lMe=()=>`Home`,lQ=((e={},t={})=>(t.locale??q())===`fr`?cMe(e):lMe(e)),uMe=()=>`Page introuvable`,dMe=()=>`Page not found`,fMe=((e={},t={})=>(t.locale??q())===`fr`?uMe(e):dMe(e)),pMe=()=>`Cette adresse ne correspond à aucune page de l’application.`,mMe=()=>`This address does not match any page in the application.`,hMe=((e={},t={})=>(t.locale??q())===`fr`?pMe(e):mMe(e)),gMe=e=>`Agents de ${e?.user}`,_Me=e=>`${e?.user}'s agents`,vMe=((e,t={})=>(t.locale??q())===`fr`?gMe(e):_Me(e)),yMe=()=>`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.`,bMe=()=>`Assign the discovered agents (per instance) and designate the default agent. At least one agent is required to create conversations.`,xMe=((e={},t={})=>(t.locale??q())===`fr`?yMe(e):bMe(e)),SMe=()=>`Agents des groupes du membre. Cochez pour restreindre à une sélection ; sans coche, le membre voit tous ces agents.`,CMe=()=>`The member's group agents. Check to restrict to a selection; with none checked, the member sees all of them.`,wMe=((e={},t={})=>(t.locale??q())===`fr`?SMe(e):CMe(e)),TMe=()=>`Le membre n'appartient à aucun groupe : il voit tous les agents. Cochez pour restreindre à une sélection.`,EMe=()=>`The member belongs to no group, so they see every agent. Check to restrict to a selection.`,DMe=((e={},t={})=>(t.locale??q())===`fr`?TMe(e):EMe(e)),OMe=()=>`Chargement…`,kMe=()=>`Loading…`,AMe=((e={},t={})=>(t.locale??q())===`fr`?OMe(e):kMe(e)),jMe=()=>`Mise à jour de l'accès refusée`,MMe=()=>`Access update denied`,NMe=((e={},t={})=>(t.locale??q())===`fr`?jMe(e):MMe(e)),PMe=()=>`Définition de l'agent par défaut refusée`,FMe=()=>`Setting the default agent was denied`,IMe=((e={},t={})=>(t.locale??q())===`fr`?PMe(e):FMe(e)),LMe=()=>`Aucun agent découvert.`,RMe=()=>`No agent discovered.`,zMe=((e={},t={})=>(t.locale??q())===`fr`?LMe(e):RMe(e)),BMe=e=>`Assigner ${e?.name}`,VMe=e=>`Assign ${e?.name}`,HMe=((e,t={})=>(t.locale??q())===`fr`?BMe(e):VMe(e)),UMe=()=>`supprimé`,WMe=()=>`removed`,GMe=((e={},t={})=>(t.locale??q())===`fr`?UMe(e):WMe(e)),KMe=()=>`hors groupe`,qMe=()=>`outside group`,JMe=((e={},t={})=>(t.locale??q())===`fr`?KMe(e):qMe(e)),YMe=()=>`Agent par défaut`,XMe=()=>`Default agent`,uQ=((e={},t={})=>(t.locale??q())===`fr`?YMe(e):XMe(e)),ZMe=()=>`Définir comme agent par défaut`,QMe=()=>`Set as default agent`,dQ=((e={},t={})=>(t.locale??q())===`fr`?ZMe(e):QMe(e)),$Me=e=>`Configurer l'instance « ${e?.instance} »`,eNe=e=>`Configure instance « ${e?.instance} »`,tNe=((e,t={})=>(t.locale??q())===`fr`?$Me(e):eNe(e)),nNe=()=>`Configurer`,rNe=()=>`Configure`,fQ=((e={},t={})=>(t.locale??q())===`fr`?nNe(e):rNe(e)),iNe=()=>`Config non-secrète du bridge, appliquée à chaud au message suivant (sans redémarrage). Les secrets (tokens, device identity) vivent dans l’environnement du bridge, jamais ici.`,aNe=()=>`Non-secret bridge config, applied hot on the next message (no restart). Secrets (tokens, device identity) live in the bridge environment, never here.`,oNe=((e={},t={})=>(t.locale??q())===`fr`?iNe(e):aNe(e)),sNe=()=>`Aucune instance — ajoutez-en une dans Agents › Instances d’abord.`,cNe=()=>`No instances yet — add one under Agents › Instances first.`,lNe=((e={},t={})=>(t.locale??q())===`fr`?sNe(e):cNe(e)),uNe=()=>`Mode média sortant`,dNe=()=>`Outbound media mode`,fNe=((e={},t={})=>(t.locale??q())===`fr`?uNe(e):dNe(e)),pNe=()=>`Mode média entrant`,mNe=()=>`Inbound media mode`,hNe=((e={},t={})=>(t.locale??q())===`fr`?pNe(e):mNe(e)),gNe=()=>`Taille média max (Mo)`,_Ne=()=>`Max media size (MB)`,vNe=((e={},t={})=>(t.locale??q())===`fr`?gNe(e):_Ne(e)),yNe=()=>`Ré-hydratation de session`,bNe=()=>`Session re-hydration`,xNe=((e={},t={})=>(t.locale??q())===`fr`?yNe(e):bNe(e)),SNe=()=>`Enregistrer`,CNe=()=>`Save`,wNe=((e={},t={})=>(t.locale??q())===`fr`?SNe(e):CNe(e)),TNe=()=>`Impossible d’enregistrer la configuration`,ENe=()=>`Could not save the configuration`,DNe=((e={},t={})=>(t.locale??q())===`fr`?TNe(e):ENe(e)),ONe=()=>`Comment le bridge récupère les fichiers SORTANTS (générés par l’agent) pour les héberger : gateway-http (via HTTP depuis la gateway — aucun système de fichiers partagé requis, défaut portable), shared-fs (lit un volume partagé monté), ou off (aucune pièce jointe sortante).`,kNe=()=>`How the bridge fetches OUTBOUND (agent-generated) files to host them: gateway-http (over HTTP from the gateway — no shared filesystem needed, the portable default), shared-fs (read a mounted shared volume), or off (no outbound attachments).`,ANe=((e={},t={})=>(t.locale??q())===`fr`?ONe(e):kNe(e)),jNe=()=>`Comment les fichiers téléversés atteignent l’agent : inline (base64 dans la trame du chat — plafonné par la taille de trame de la gateway), ou shared-fs (streamé vers un volume partagé et référencé par chemin — toute taille, pour les grosses vidéos/audio/docs).`,MNe=()=>`How user-uploaded files reach the agent: inline (base64 in the chat frame — capped by the gateway frame size), or shared-fs (streamed to a shared volume and referenced by path — any size, for large videos/audio/docs).`,NNe=((e={},t={})=>(t.locale??q())===`fr`?jNe(e):MNe(e)),PNe=()=>`Plafond de taille par fichier (Mo). En mode shared-fs il peut être élevé (les fichiers sont streamés sur disque) ; pour l’inline, la vraie limite est la taille de trame de la gateway.`,FNe=()=>`Per-file size cap (MB). In shared-fs mode this can be large (files stream to disk); for inline files the gateway frame size is the real limit.`,INe=((e={},t={})=>(t.locale??q())===`fr`?PNe(e):FNe(e)),LNe=()=>`Sur une session gateway fraîche/réinitialisée, renvoie les tours précédents pour que le contexte du modèle corresponde au fil visible. Désactiver pour n’envoyer que le message courant.`,RNe=()=>`On a fresh/rolled gateway session, re-send prior turns so the model's context matches the visible thread. Disable to always send only the current message.`,zNe=((e={},t={})=>(t.locale??q())===`fr`?LNe(e):RNe(e)),BNe=()=>`Chemin entrant (vu par l’agent)`,VNe=()=>`Inbound path (agent view)`,HNe=((e={},t={})=>(t.locale??q())===`fr`?BNe(e):VNe(e)),UNe=()=>`Le chemin DANS le conteneur de la gateway où l’agent LIT les fichiers entrants déposés — le montage du volume partagé côté gateway (ex. /home/node/.openclaw/media/inbound). Doit correspondre à ton montage de volume Docker.`,WNe=()=>`The path INSIDE the gateway container where the agent READS staged inbound files — the gateway's mount of the shared volume (e.g. /home/node/.openclaw/media/inbound). Must match your Docker volume mount.`,GNe=((e={},t={})=>(t.locale??q())===`fr`?UNe(e):WNe(e)),KNe=()=>`Chemin sortant (vu par l’agent)`,qNe=()=>`Outbound path (agent view)`,JNe=((e={},t={})=>(t.locale??q())===`fr`?KNe(e):qNe(e)),YNe=()=>`Le chemin DANS le conteneur de la gateway où l’agent ÉCRIT un fichier généré avant d’émettre MEDIA:<chemin> (ex. /home/node/.openclaw/media/outbound). Doit être accessible en écriture par l’agent dans le conteneur.`,XNe=()=>`The path INSIDE the gateway container where the agent WRITES a generated file before emitting MEDIA:<path> (e.g. /home/node/.openclaw/media/outbound). Must be writable by the agent in the container.`,ZNe=((e={},t={})=>(t.locale??q())===`fr`?YNe(e):XNe(e)),QNe=()=>`Vérifier les chemins`,$Ne=()=>`Check paths`,ePe=((e={},t={})=>(t.locale??q())===`fr`?QNe(e):$Ne(e)),tPe=()=>`Vérification…`,nPe=()=>`Checking…`,rPe=((e={},t={})=>(t.locale??q())===`fr`?tPe(e):nPe(e)),iPe=()=>`Échec de la vérification des chemins`,aPe=()=>`Path check failed`,oPe=((e={},t={})=>(t.locale??q())===`fr`?iPe(e):aPe(e)),sPe=()=>`Vérifie l’accès du BRIDGE aux dossiers partagés. Le montage côté agent (dans le conteneur de la gateway) est à vérifier séparément.`,cPe=()=>`Checks the BRIDGE's access to the shared dirs. The agent-side mount (inside the gateway container) must be verified separately.`,lPe=((e={},t={})=>(t.locale??q())===`fr`?sPe(e):cPe(e)),uPe=()=>`Entrant (écriture bridge)`,dPe=()=>`Inbound (bridge write)`,fPe=((e={},t={})=>(t.locale??q())===`fr`?uPe(e):dPe(e)),pPe=()=>`Sortant (lecture bridge)`,mPe=()=>`Outbound (bridge read)`,hPe=((e={},t={})=>(t.locale??q())===`fr`?pPe(e):mPe(e)),gPe=()=>`Accessible`,_Pe=()=>`Accessible`,vPe=((e={},t={})=>(t.locale??q())===`fr`?gPe(e):_Pe(e)),yPe=()=>`Non concerné (pas shared-fs)`,bPe=()=>`Not applicable (not shared-fs)`,xPe=((e={},t={})=>(t.locale??q())===`fr`?yPe(e):bPe(e)),SPe=()=>`Bridge injoignable — vérification impossible`,CPe=()=>`Bridge unreachable — could not check`,wPe=((e={},t={})=>(t.locale??q())===`fr`?SPe(e):CPe(e)),TPe=e=>`Bridge joignable mais la vérification a échoué (${e?.reason})`,EPe=e=>`Bridge reachable but the check failed (${e?.reason})`,DPe=((e,t={})=>(t.locale??q())===`fr`?TPe(e):EPe(e)),OPe=()=>`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.`,kPe=()=>`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.`,APe=((e={},t={})=>(t.locale??q())===`fr`?OPe(e):kPe(e)),jPe=()=>`Chargement…`,MPe=()=>`Loading…`,pQ=((e={},t={})=>(t.locale??q())===`fr`?jPe(e):MPe(e)),NPe=()=>`Aucun relevé pour l’instant — le sondage tourne chaque minute. Reviens dans un moment.`,PPe=()=>`No reading yet — the poll runs every minute. Check back in a moment.`,FPe=((e={},t={})=>(t.locale??q())===`fr`?NPe(e):PPe(e)),IPe=()=>`Bridge opérationnel`,LPe=()=>`Bridge operational`,RPe=((e={},t={})=>(t.locale??q())===`fr`?IPe(e):LPe(e)),zPe=()=>`Bridge injoignable`,BPe=()=>`Bridge unreachable`,VPe=((e={},t={})=>(t.locale??q())===`fr`?zPe(e):BPe(e)),HPe=e=>`Bridge : ${e?.count} connexion(s) en erreur`,UPe=e=>`Bridge: ${e?.count} connection(s) in error`,WPe=((e,t={})=>(t.locale??q())===`fr`?HPe(e):UPe(e)),GPe=e=>`Vérifié à ${e?.time}`,KPe=e=>`Checked at ${e?.time}`,qPe=((e,t={})=>(t.locale??q())===`fr`?GPe(e):KPe(e)),JPe=e=>`· Bridge démarré le ${e?.time}`,YPe=e=>`· Bridge started on ${e?.time}`,XPe=((e,t={})=>(t.locale??q())===`fr`?JPe(e):YPe(e)),ZPe=()=>`↗ Anomalies`,QPe=()=>`↗ Anomalies`,$Pe=((e={},t={})=>(t.locale??q())===`fr`?ZPe(e):QPe(e)),eFe=e=>`Connexions (${e?.count})`,tFe=e=>`Connections (${e?.count})`,nFe=((e,t={})=>(t.locale??q())===`fr`?eFe(e):tFe(e)),rFe=()=>`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).`,iFe=()=>`No connection tested yet. A connection's state appears as soon as a message exercises it (the bridge connects on demand).`,aFe=((e={},t={})=>(t.locale??q())===`fr`?rFe(e):iFe(e)),oFe=e=>`${e?.ok} OK · ${e?.errors} échec(s) · ${e?.attempts} tentative(s)`,sFe=e=>`${e?.ok} OK · ${e?.errors} failure(s) · ${e?.attempts} attempt(s)`,cFe=((e,t={})=>(t.locale??q())===`fr`?oFe(e):sFe(e)),lFe=e=>`Rejeté par la passerelle : ${e?.label} — pas une défaillance du bridge.`,uFe=e=>`Rejected by the gateway: ${e?.label} — not a bridge fault.`,dFe=((e,t={})=>(t.locale??q())===`fr`?lFe(e):uFe(e)),fFe=()=>`Filtrer par cible ou hôte…`,pFe=()=>`Filter by target or host…`,mFe=((e={},t={})=>(t.locale??q())===`fr`?fFe(e):pFe(e)),hFe=()=>`Tous`,gFe=()=>`All`,mQ=((e={},t={})=>(t.locale??q())===`fr`?hFe(e):gFe(e)),_Fe=()=>`État`,vFe=()=>`State`,yFe=((e={},t={})=>(t.locale??q())===`fr`?_Fe(e):vFe(e)),bFe=()=>`Instance`,xFe=()=>`Instance`,SFe=((e={},t={})=>(t.locale??q())===`fr`?bFe(e):xFe(e)),CFe=()=>`Version`,wFe=()=>`Version`,TFe=((e={},t={})=>(t.locale??q())===`fr`?CFe(e):wFe(e)),EFe=()=>`Aucune connexion ne correspond aux filtres.`,DFe=()=>`No connection matches the filters.`,OFe=((e={},t={})=>(t.locale??q())===`fr`?EFe(e):DFe(e)),kFe=()=>`Cible`,AFe=()=>`Target`,jFe=((e={},t={})=>(t.locale??q())===`fr`?kFe(e):AFe(e)),MFe=()=>`État`,NFe=()=>`State`,PFe=((e={},t={})=>(t.locale??q())===`fr`?MFe(e):NFe(e)),FFe=()=>`Instance`,IFe=()=>`Instance`,LFe=((e={},t={})=>(t.locale??q())===`fr`?FFe(e):IFe(e)),RFe=()=>`Hôte passerelle`,zFe=()=>`Gateway host`,BFe=((e={},t={})=>(t.locale??q())===`fr`?RFe(e):zFe(e)),VFe=()=>`Version`,HFe=()=>`Version`,UFe=((e={},t={})=>(t.locale??q())===`fr`?VFe(e):HFe(e)),WFe=()=>`Stats`,GFe=()=>`Stats`,KFe=((e={},t={})=>(t.locale??q())===`fr`?WFe(e):GFe(e)),qFe=()=>`Dernier OK`,JFe=()=>`Last OK`,YFe=((e={},t={})=>(t.locale??q())===`fr`?qFe(e):JFe(e)),XFe=()=>`connectée`,ZFe=()=>`connected`,hQ=((e={},t={})=>(t.locale??q())===`fr`?XFe(e):ZFe(e)),QFe=()=>`erreur`,$Fe=()=>`error`,gQ=((e={},t={})=>(t.locale??q())===`fr`?QFe(e):$Fe(e)),eIe=()=>`inactive`,tIe=()=>`inactive`,_Q=((e={},t={})=>(t.locale??q())===`fr`?eIe(e):tIe(e)),nIe=()=>`5 dernières minutes`,rIe=()=>`Last 5 minutes`,iIe=((e={},t={})=>(t.locale??q())===`fr`?nIe(e):rIe(e)),aIe=()=>`15 dernières minutes`,oIe=()=>`Last 15 minutes`,sIe=((e={},t={})=>(t.locale??q())===`fr`?aIe(e):oIe(e)),cIe=()=>`30 dernières minutes`,lIe=()=>`Last 30 minutes`,uIe=((e={},t={})=>(t.locale??q())===`fr`?cIe(e):lIe(e)),dIe=()=>`Dernière heure`,fIe=()=>`Last hour`,pIe=((e={},t={})=>(t.locale??q())===`fr`?dIe(e):fIe(e)),mIe=()=>`3 dernières heures`,hIe=()=>`Last 3 hours`,gIe=((e={},t={})=>(t.locale??q())===`fr`?mIe(e):hIe(e)),_Ie=()=>`6 dernières heures`,vIe=()=>`Last 6 hours`,yIe=((e={},t={})=>(t.locale??q())===`fr`?_Ie(e):vIe(e)),bIe=()=>`12 dernières heures`,xIe=()=>`Last 12 hours`,SIe=((e={},t={})=>(t.locale??q())===`fr`?bIe(e):xIe(e)),CIe=()=>`Dernières 24 heures`,wIe=()=>`Last 24 hours`,TIe=((e={},t={})=>(t.locale??q())===`fr`?CIe(e):wIe(e)),EIe=()=>`2 derniers jours`,DIe=()=>`Last 2 days`,OIe=((e={},t={})=>(t.locale??q())===`fr`?EIe(e):DIe(e)),kIe=()=>`7 derniers jours`,AIe=()=>`Last 7 days`,jIe=((e={},t={})=>(t.locale??q())===`fr`?kIe(e):AIe(e)),MIe=()=>`30 derniers jours`,NIe=()=>`Last 30 days`,PIe=((e={},t={})=>(t.locale??q())===`fr`?MIe(e):NIe(e)),FIe=()=>`90 derniers jours`,IIe=()=>`Last 90 days`,LIe=((e={},t={})=>(t.locale??q())===`fr`?FIe(e):IIe(e)),RIe=()=>`Appels API`,zIe=()=>`API calls`,BIe=((e={},t={})=>(t.locale??q())===`fr`?RIe(e):zIe(e)),VIe=()=>`Erreurs API`,HIe=()=>`API errors`,UIe=((e={},t={})=>(t.locale??q())===`fr`?VIe(e):HIe(e)),WIe=()=>`Latence moyenne`,GIe=()=>`Average latency`,KIe=((e={},t={})=>(t.locale??q())===`fr`?WIe(e):GIe(e)),qIe=()=>`Ingestion OpenClaw`,JIe=()=>`OpenClaw ingest`,YIe=((e={},t={})=>(t.locale??q())===`fr`?qIe(e):JIe(e)),XIe=()=>`Messages envoyés`,ZIe=()=>`Messages sent`,QIe=((e={},t={})=>(t.locale??q())===`fr`?XIe(e):ZIe(e)),$Ie=()=>`Erreurs de stream`,eLe=()=>`Stream errors`,tLe=((e={},t={})=>(t.locale??q())===`fr`?$Ie(e):eLe(e)),nLe=()=>`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.`,rLe=()=>`Hourly aggregated indicators from redacted traces (non-PHI metadata only). Live updates (useQuery) — the rollup runs every hour.`,iLe=((e={},t={})=>(t.locale??q())===`fr`?nLe(e):rLe(e)),aLe=()=>`La plage filtre l’historique des rollups — une plage antérieure peut être partielle.`,oLe=()=>`The range filters the rollup history — an earlier range may be partial.`,sLe=((e={},t={})=>(t.locale??q())===`fr`?aLe(e):oLe(e)),cLe=()=>`Chargement des KPI…`,lLe=()=>`Loading KPIs…`,uLe=((e={},t={})=>(t.locale??q())===`fr`?cLe(e):lLe(e)),dLe=()=>`Aucune donnée KPI — le rollup tourne chaque heure ; lance-le ou attends.`,fLe=()=>`No KPI data — the rollup runs every hour; run it or wait.`,pLe=((e={},t={})=>(t.locale??q())===`fr`?dLe(e):fLe(e)),mLe=e=>`dernier : ${e?.value}`,hLe=e=>`latest: ${e?.value}`,gLe=((e,t={})=>(t.locale??q())===`fr`?mLe(e):hLe(e)),_Le=()=>`aucune donnée`,vLe=()=>`no data`,yLe=((e={},t={})=>(t.locale??q())===`fr`?_Le(e):vLe(e)),bLe=e=>`${e?.count} h`,xLe=e=>`${e?.count} h`,SLe=((e,t={})=>(t.locale??q())===`fr`?bLe(e):xLe(e)),CLe=e=>`Série horaire (max ${e?.max} ${e?.unit})`,wLe=e=>`Hourly series (max ${e?.max} ${e?.unit})`,TLe=((e,t={})=>(t.locale??q())===`fr`?CLe(e):wLe(e)),ELe=()=>`Mode dev — comptes & rôles`,DLe=()=>`Dev mode — accounts & roles`,OLe=((e={},t={})=>(t.locale??q())===`fr`?ELe(e):DLe(e)),kLe=()=>`Mode dev — comptes & rôles`,ALe=()=>`Dev mode — accounts & roles`,jLe=((e={},t={})=>(t.locale??q())===`fr`?kLe(e):ALe(e)),MLe=()=>`Change de rôle et « agis en tant que » pour tester plusieurs utilisateurs sans CLI. Visible uniquement en dev.`,NLe=()=>`Change roles and “act as” to test multiple users without the CLI. Visible in dev only.`,PLe=((e={},t={})=>(t.locale??q())===`fr`?MLe(e):NLe(e)),FLe=e=>`Moi — ${e?.canonical}`,ILe=e=>`Me — ${e?.canonical}`,LLe=((e,t={})=>(t.locale??q())===`fr`?FLe(e):ILe(e)),RLe=()=>`Devenir admin`,zLe=()=>`Become admin`,BLe=((e={},t={})=>(t.locale??q())===`fr`?RLe(e):zLe(e)),VLe=()=>`Devenir user`,HLe=()=>`Become user`,ULe=((e={},t={})=>(t.locale??q())===`fr`?VLe(e):HLe(e)),WLe=()=>`Devenir pending`,GLe=()=>`Become pending`,KLe=((e={},t={})=>(t.locale??q())===`fr`?WLe(e):GLe(e)),qLe=()=>`Tu agis en tant que`,JLe=()=>`You are acting as`,YLe=((e={},t={})=>(t.locale??q())===`fr`?qLe(e):JLe(e)),XLe=()=>`Arrêter`,ZLe=()=>`Stop`,QLe=((e={},t={})=>(t.locale??q())===`fr`?XLe(e):ZLe(e)),$Le=()=>`Aucun autre compte. Déconnecte-toi puis reconnecte-toi (nouvelle identité anonyme) — elle sera active immédiatement.`,eRe=()=>`No other account. Sign out then sign back in (new anonymous identity) — it will be active immediately.`,tRe=((e={},t={})=>(t.locale??q())===`fr`?$Le(e):eRe(e)),nRe=()=>`Deviens admin d'abord`,rRe=()=>`Become admin first`,iRe=((e={},t={})=>(t.locale??q())===`fr`?nRe(e):rRe(e)),aRe=()=>`Un compte pending ne peut pas être impersonné`,oRe=()=>`A pending account cannot be impersonated`,sRe=((e={},t={})=>(t.locale??q())===`fr`?aRe(e):oRe(e)),cRe=()=>`Agir en tant que cet utilisateur`,lRe=()=>`Act as this user`,uRe=((e={},t={})=>(t.locale??q())===`fr`?cRe(e):lRe(e)),dRe=()=>`Agir en tant que`,fRe=()=>`Act as`,pRe=((e={},t={})=>(t.locale??q())===`fr`?dRe(e):fRe(e)),mRe=()=>`Nouveau chat`,hRe=()=>`New chat`,gRe=((e={},t={})=>(t.locale??q())===`fr`?mRe(e):hRe(e)),_Re=()=>`Nouveau projet`,vRe=()=>`New project`,vQ=((e={},t={})=>(t.locale??q())===`fr`?_Re(e):vRe(e)),yRe=()=>`Nom du projet`,bRe=()=>`Project name`,xRe=((e={},t={})=>(t.locale??q())===`fr`?yRe(e):bRe(e)),SRe=()=>`ex. Travail`,CRe=()=>`e.g. Work`,wRe=((e={},t={})=>(t.locale??q())===`fr`?SRe(e):CRe(e)),TRe=()=>`Créer`,ERe=()=>`Create`,DRe=((e={},t={})=>(t.locale??q())===`fr`?TRe(e):ERe(e)),ORe=()=>`Épinglés`,kRe=()=>`Pinned`,ARe=((e={},t={})=>(t.locale??q())===`fr`?ORe(e):kRe(e)),jRe=()=>`Glissez un chat ici`,MRe=()=>`Drop a chat here`,NRe=((e={},t={})=>(t.locale??q())===`fr`?jRe(e):MRe(e)),PRe=()=>`Chats`,FRe=()=>`Chats`,IRe=((e={},t={})=>(t.locale??q())===`fr`?PRe(e):FRe(e)),LRe=()=>`Sans titre`,RRe=()=>`Untitled`,yQ=((e={},t={})=>(t.locale??q())===`fr`?LRe(e):RRe(e)),zRe=()=>`Lecture seule — l'agent associé ne t'est plus disponible`,BRe=()=>`Read-only — its agent is no longer available to you`,bQ=((e={},t={})=>(t.locale??q())===`fr`?zRe(e):BRe(e)),VRe=()=>`Supprimer le projet`,HRe=()=>`Delete project`,xQ=((e={},t={})=>(t.locale??q())===`fr`?VRe(e):HRe(e)),URe=e=>`Supprimer le projet « ${e?.name} » ?`,WRe=e=>`Delete project "${e?.name}"?`,GRe=((e,t={})=>(t.locale??q())===`fr`?URe(e):WRe(e)),KRe=e=>`Cette action est irréversible : elle supprimera aussi définitivement ${e?.count} conversation(s) et tous leurs messages.`,qRe=e=>`This action is irreversible: it will also permanently delete ${e?.count} conversation(s) and all their messages.`,JRe=((e,t={})=>(t.locale??q())===`fr`?KRe(e):qRe(e)),YRe=()=>`Cette action est irréversible.`,XRe=()=>`This action is irreversible.`,ZRe=((e={},t={})=>(t.locale??q())===`fr`?YRe(e):XRe(e)),QRe=()=>`Supprimer`,$Re=()=>`Delete`,SQ=((e={},t={})=>(t.locale??q())===`fr`?QRe(e):$Re(e)),eze=()=>`Déplacer / réordonner`,tze=()=>`Move / reorder`,nze=((e={},t={})=>(t.locale??q())===`fr`?eze(e):tze(e)),rze=()=>`Actions`,ize=()=>`Actions`,aze=((e={},t={})=>(t.locale??q())===`fr`?rze(e):ize(e)),oze=()=>`Renommer`,sze=()=>`Rename`,cze=((e={},t={})=>(t.locale??q())===`fr`?oze(e):sze(e)),lze=()=>`Désépingler`,uze=()=>`Unpin`,dze=((e={},t={})=>(t.locale??q())===`fr`?lze(e):uze(e)),fze=()=>`Épingler`,pze=()=>`Pin`,mze=((e={},t={})=>(t.locale??q())===`fr`?fze(e):pze(e)),hze=()=>`Couleur`,gze=()=>`Color`,_ze=((e={},t={})=>(t.locale??q())===`fr`?hze(e):gze(e)),vze=()=>`Aucune couleur`,yze=()=>`No color`,bze=((e={},t={})=>(t.locale??q())===`fr`?vze(e):yze(e)),xze=()=>`Supprimer ce chat ?`,Sze=()=>`Delete this chat?`,Cze=((e={},t={})=>(t.locale??q())===`fr`?xze(e):Sze(e)),wze=()=>`Cette action est irréversible et supprimera ses messages.`,Tze=()=>`This action is irreversible and will delete its messages.`,Eze=((e={},t={})=>(t.locale??q())===`fr`?wze(e):Tze(e)),Dze=e=>`Bridge : ${e?.provider}`,Oze=e=>`Bridge: ${e?.provider}`,kze=((e,t={})=>(t.locale??q())===`fr`?Dze(e):Oze(e)),Aze=()=>`Renommer le chat`,jze=()=>`Rename chat`,Mze=((e={},t={})=>(t.locale??q())===`fr`?Aze(e):jze(e)),Nze=()=>`Titre`,Pze=()=>`Title`,Fze=((e={},t={})=>(t.locale??q())===`fr`?Nze(e):Pze(e)),Ize=()=>`Réflexion…`,Lze=()=>`Thinking…`,Rze=((e={},t={})=>(t.locale??q())===`fr`?Ize(e):Lze(e)),zze=()=>`Génération…`,Bze=()=>`Generating…`,Vze=((e={},t={})=>(t.locale??q())===`fr`?zze(e):Bze(e)),Hze=()=>`Erreur`,Uze=()=>`Error`,Wze=((e={},t={})=>(t.locale??q())===`fr`?Hze(e):Uze(e)),Gze=()=>`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.`,Kze=()=>`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.`,qze=((e={},t={})=>(t.locale??q())===`fr`?Gze(e):Kze(e)),Jze=()=>`Interrompu`,Yze=()=>`Stopped`,Xze=((e={},t={})=>(t.locale??q())===`fr`?Jze(e):Yze(e)),Zze=()=>`contient`,Qze=()=>`contains`,$ze=((e={},t={})=>(t.locale??q())===`fr`?Zze(e):Qze(e)),eBe=()=>`Filtre avancé`,tBe=()=>`Advanced filter`,nBe=((e={},t={})=>(t.locale??q())===`fr`?eBe(e):tBe(e)),rBe=()=>`Aucun critère. Ajoutez une condition (toutes les conditions sont cumulées avec ET).`,iBe=()=>`No criteria. Add a condition (all conditions are combined with AND).`,aBe=((e={},t={})=>(t.locale??q())===`fr`?rBe(e):iBe(e)),oBe=()=>`Champ`,sBe=()=>`Field`,cBe=((e={},t={})=>(t.locale??q())===`fr`?oBe(e):sBe(e)),lBe=()=>`Valeur`,uBe=()=>`Value`,dBe=((e={},t={})=>(t.locale??q())===`fr`?lBe(e):uBe(e)),fBe=()=>`Supprimer la condition`,pBe=()=>`Remove condition`,mBe=((e={},t={})=>(t.locale??q())===`fr`?fBe(e):pBe(e)),hBe=()=>`Ajouter une condition`,gBe=()=>`Add condition`,_Be=((e={},t={})=>(t.locale??q())===`fr`?hBe(e):gBe(e)),vBe=()=>`Bridge : pas encore de relevé (sondage chaque minute)`,yBe=()=>`Bridge: no reading yet (polled every minute)`,bBe=((e={},t={})=>(t.locale??q())===`fr`?vBe(e):yBe(e)),xBe=()=>`Bridge opérationnel`,SBe=()=>`Bridge operational`,CBe=((e={},t={})=>(t.locale??q())===`fr`?xBe(e):SBe(e)),wBe=e=>` · vérifié à ${e?.time}`,TBe=e=>` · verified at ${e?.time}`,EBe=((e,t={})=>(t.locale??q())===`fr`?wBe(e):TBe(e)),DBe=e=>`Bridge indisponible (${e?.reason}) — ouvre l’onglet Bridge pour le détail`,OBe=e=>`Bridge unavailable (${e?.reason}) — open the Bridge tab for details`,kBe=((e,t={})=>(t.locale??q())===`fr`?DBe(e):OBe(e)),ABe=()=>`Utilisateur`,jBe=()=>`User`,MBe=((e={},t={})=>(t.locale??q())===`fr`?ABe(e):jBe(e)),NBe=()=>`Système`,PBe=()=>`System`,FBe=((e={},t={})=>(t.locale??q())===`fr`?NBe(e):PBe(e)),IBe=()=>`[Export limité aux 200 messages les plus récents de cette conversation]`,LBe=()=>`[Export limited to the 200 most recent messages of this conversation]`,RBe=((e={},t={})=>(t.locale??q())===`fr`?IBe(e):LBe(e)),zBe=()=>`Conversation`,BBe=()=>`Conversation`,CQ=((e={},t={})=>(t.locale??q())===`fr`?zBe(e):BBe(e)),VBe=e=>`Exporté le ${e?.date}`,HBe=e=>`Exported on ${e?.date}`,UBe=((e,t={})=>(t.locale??q())===`fr`?VBe(e):HBe(e)),WBe=e=>`[fichier : ${e?.name}]`,GBe=e=>`[file: ${e?.name}]`,KBe=((e,t={})=>(t.locale??q())===`fr`?WBe(e):GBe(e)),qBe=()=>`Rechercher dans les conversations`,JBe=()=>`Search conversations`,YBe=((e={},t={})=>(t.locale??q())===`fr`?qBe(e):JBe(e)),XBe=()=>`Rechercher…`,ZBe=()=>`Search…`,QBe=((e={},t={})=>(t.locale??q())===`fr`?XBe(e):ZBe(e)),$Be=()=>`Rechercher dans les conversations`,eVe=()=>`Search conversations`,tVe=((e={},t={})=>(t.locale??q())===`fr`?$Be(e):eVe(e)),nVe=()=>`Rechercher dans toutes les conversations…`,rVe=()=>`Search across all conversations…`,iVe=((e={},t={})=>(t.locale??q())===`fr`?nVe(e):rVe(e)),aVe=()=>`Recherche`,oVe=()=>`Search`,sVe=((e={},t={})=>(t.locale??q())===`fr`?aVe(e):oVe(e)),cVe=e=>`Tapez au moins ${e?.count} caractères pour rechercher.`,lVe=e=>`Type at least ${e?.count} characters to search.`,uVe=((e,t={})=>(t.locale??q())===`fr`?cVe(e):lVe(e)),dVe=()=>`Recherche…`,fVe=()=>`Searching…`,pVe=((e={},t={})=>(t.locale??q())===`fr`?dVe(e):fVe(e)),mVe=e=>`Aucune conversation ne correspond à « ${e?.term} ».`,hVe=e=>`No conversation matches “${e?.term}”.`,gVe=((e,t={})=>(t.locale??q())===`fr`?mVe(e):hVe(e)),_Ve=()=>`Nouveau chat`,vVe=()=>`New chat`,yVe=((e={},t={})=>(t.locale??q())===`fr`?_Ve(e):vVe(e)),bVe=()=>`Titre`,xVe=()=>`Title`,SVe=((e={},t={})=>(t.locale??q())===`fr`?bVe(e):xVe(e)),CVe=()=>`Message`,wVe=()=>`Message`,TVe=((e={},t={})=>(t.locale??q())===`fr`?CVe(e):wVe(e)),EVe=()=>`naviguer`,DVe=()=>`navigate`,OVe=((e={},t={})=>(t.locale??q())===`fr`?EVe(e):DVe(e)),kVe=()=>`ouvrir`,AVe=()=>`open`,jVe=((e={},t={})=>(t.locale??q())===`fr`?kVe(e):AVe(e)),MVe=()=>`Échap`,NVe=()=>`Esc`,PVe=((e={},t={})=>(t.locale??q())===`fr`?MVe(e):NVe(e)),FVe=()=>`fermer`,IVe=()=>`close`,LVe=((e={},t={})=>(t.locale??q())===`fr`?FVe(e):IVe(e)),RVe=()=>`Choisir un agent`,zVe=()=>`Choose an agent`,BVe=((e={},t={})=>(t.locale??q())===`fr`?RVe(e):zVe(e)),VVe=()=>`Sélectionnez l’agent (et l’instance) pour cette conversation.`,HVe=()=>`Select the agent (and instance) for this conversation.`,UVe=((e={},t={})=>(t.locale??q())===`fr`?VVe(e):HVe(e)),WVe=()=>`Chargement…`,GVe=()=>`Loading…`,KVe=((e={},t={})=>(t.locale??q())===`fr`?WVe(e):GVe(e)),qVe=()=>`Aucun agent ne vous est assigné. Contactez votre administrateur pour qu’il vous en attribue un.`,JVe=()=>`No agent is assigned to you. Contact your administrator to have one assigned.`,YVe=((e={},t={})=>(t.locale??q())===`fr`?qVe(e):JVe(e)),XVe=()=>`Rechercher un agent…`,ZVe=()=>`Search for an agent…`,QVe=((e={},t={})=>(t.locale??q())===`fr`?XVe(e):ZVe(e)),$Ve=()=>`Rechercher un agent`,eHe=()=>`Search for an agent`,tHe=((e={},t={})=>(t.locale??q())===`fr`?$Ve(e):eHe(e)),nHe=()=>`Cet agent n’existe plus sur la gateway`,rHe=()=>`This agent no longer exists on the gateway`,iHe=((e={},t={})=>(t.locale??q())===`fr`?nHe(e):rHe(e)),aHe=()=>`Agent par défaut`,oHe=()=>`Default agent`,sHe=((e={},t={})=>(t.locale??q())===`fr`?aHe(e):oHe(e)),cHe=()=>`Rechercher`,lHe=()=>`Search`,uHe=((e={},t={})=>(t.locale??q())===`fr`?cHe(e):lHe(e)),dHe=()=>`Réinitialiser`,fHe=()=>`Reset`,pHe=((e={},t={})=>(t.locale??q())===`fr`?dHe(e):fHe(e)),mHe=()=>`Ajouter`,hHe=()=>`Add`,gHe=((e={},t={})=>(t.locale??q())===`fr`?mHe(e):hHe(e)),_He=()=>`Aucun élément.`,vHe=()=>`No items.`,yHe=((e={},t={})=>(t.locale??q())===`fr`?_He(e):vHe(e)),bHe=()=>`Chargement…`,xHe=()=>`Loading…`,SHe=((e={},t={})=>(t.locale??q())===`fr`?bHe(e):xHe(e)),CHe=()=>`Tout sélectionner`,wHe=()=>`Select all`,THe=((e={},t={})=>(t.locale??q())===`fr`?CHe(e):wHe(e)),EHe=()=>`Sélectionner la ligne`,DHe=()=>`Select row`,OHe=((e={},t={})=>(t.locale??q())===`fr`?EHe(e):DHe(e)),kHe=()=>`Actions`,AHe=()=>`Actions`,jHe=((e={},t={})=>(t.locale??q())===`fr`?kHe(e):AHe(e)),MHe=e=>`Trier par ${e?.column}`,NHe=e=>`Sort by ${e?.column}`,PHe=((e,t={})=>(t.locale??q())===`fr`?MHe(e):NHe(e)),FHe=()=>`Agent introuvable`,IHe=()=>`Agent not found`,LHe=((e={},t={})=>(t.locale??q())===`fr`?FHe(e):IHe(e)),RHe=()=>`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).`,zHe=()=>`The configured agent no longer exists on the gateway. Check OPENCLAW_AGENT_ID in the bridge .env (it must match a real gateway agent).`,BHe=((e={},t={})=>(t.locale??q())===`fr`?RHe(e):zHe(e)),VHe=()=>`Authentification refusée`,HHe=()=>`Authentication refused`,UHe=((e={},t={})=>(t.locale??q())===`fr`?VHe(e):HHe(e)),WHe=()=>`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.`,GHe=()=>`The operator token does not match the paired device. Re-pair a dedicated bridge device on the gateway and report its token + device identity.`,KHe=((e={},t={})=>(t.locale??q())===`fr`?WHe(e):GHe(e)),qHe=()=>`Signature device impossible`,JHe=()=>`Device signing failed`,YHe=((e={},t={})=>(t.locale??q())===`fr`?qHe(e):JHe(e)),XHe=()=>`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.`,ZHe=()=>`The device identity private key won’t decode. Check OPENCLAW_DEVICE_IDENTITY (JSON format, single \\n) — see fix-devid.mjs.`,QHe=((e={},t={})=>(t.locale??q())===`fr`?XHe(e):ZHe(e)),$He=()=>`Portée insuffisante`,eUe=()=>`Insufficient scope`,tUe=((e={},t={})=>(t.locale??q())===`fr`?$He(e):eUe(e)),nUe=()=>`Le pairing du device n’a pas la portée requise (operator.admin). Approuvez/élevez la portée du device sur la passerelle.`,rUe=()=>`The device pairing lacks the required scope (operator.admin). Approve/elevate the device scope on the gateway.`,iUe=((e={},t={})=>(t.locale??q())===`fr`?nUe(e):rUe(e)),aUe=()=>`Délai dépassé`,oUe=()=>`Timed out`,sUe=((e={},t={})=>(t.locale??q())===`fr`?aUe(e):oUe(e)),cUe=()=>`La passerelle n’a pas répondu à temps. Vérifiez qu’elle est démarrée et joignable (OPENCLAW_GATEWAY_URL).`,lUe=()=>`The gateway did not respond in time. Check it’s started and reachable (OPENCLAW_GATEWAY_URL).`,uUe=((e={},t={})=>(t.locale??q())===`fr`?cUe(e):lUe(e)),dUe=()=>`Passerelle déconnectée`,fUe=()=>`Gateway disconnected`,pUe=((e={},t={})=>(t.locale??q())===`fr`?dUe(e):fUe(e)),mUe=()=>`La connexion à la passerelle a été coupée. Vérifiez l’état du conteneur OpenClaw et l’URL/port de la passerelle.`,hUe=()=>`The connection to the gateway dropped. Check the OpenClaw container state and the gateway URL/port.`,gUe=((e={},t={})=>(t.locale??q())===`fr`?mUe(e):hUe(e)),_Ue=()=>`Bridge injoignable`,vUe=()=>`Bridge unreachable`,yUe=((e={},t={})=>(t.locale??q())===`fr`?_Ue(e):vUe(e)),bUe=()=>`Convex n’a pas pu joindre le bridge. Vérifiez que le conteneur bridge tourne et BRIDGE_URL (http://<ip-hôte>:8787).`,xUe=()=>`Convex could not reach the bridge. Check the bridge container is running and BRIDGE_URL (http://<host-ip>:8787).`,SUe=((e={},t={})=>(t.locale??q())===`fr`?bUe(e):xUe(e)),CUe=()=>`Pièce jointe trop volumineuse`,wUe=()=>`Attachment too large`,TUe=((e={},t={})=>(t.locale??q())===`fr`?CUe(e):wUe(e)),EUe=()=>`La passerelle a refusé la pièce jointe car elle dépasse la taille qu’elle accepte (limite de mise en sandbox de l’agent). Réduisez la taille du fichier, ou retirez la pièce jointe et envoyez le texte seul.`,DUe=()=>`The gateway refused the attachment because it exceeds the size it accepts (the agent's sandbox staging limit). Use a smaller file, or remove the attachment and send the text alone.`,OUe=((e={},t={})=>(t.locale??q())===`fr`?EUe(e):DUe(e)),kUe=()=>`Pièce jointe non traitée`,AUe=()=>`Attachment could not be processed`,jUe=((e={},t={})=>(t.locale??q())===`fr`?kUe(e):AUe(e)),MUe=()=>`La passerelle n’a pas pu analyser/préparer la pièce jointe. Bug connu de la passerelle (le validateur base64 déborde sur les gros fichiers, RangeError) — à corriger côté passerelle (isValidBase64). En attendant : un fichier plus petit passe, ou envoyez le texte sans pièce jointe.`,NUe=()=>`The gateway could not parse/stage the attachment. Known gateway bug (its base64 validator overflows on large files — RangeError); fix it gateway-side (isValidBase64). Meanwhile: a smaller file works, or send the text without the attachment.`,PUe=((e={},t={})=>(t.locale??q())===`fr`?MUe(e):NUe(e)),FUe=()=>`Requête invalide`,IUe=()=>`Invalid request`,LUe=((e={},t={})=>(t.locale??q())===`fr`?FUe(e):IUe(e)),RUe=()=>`La passerelle a rejeté la requête. Consultez les logs du bridge pour le détail brut.`,zUe=()=>`The gateway rejected the request. Check the bridge logs for the raw detail.`,BUe=((e={},t={})=>(t.locale??q())===`fr`?RUe(e):zUe(e)),VUe=()=>`Bridge non configuré`,HUe=()=>`Bridge not configured`,UUe=((e={},t={})=>(t.locale??q())===`fr`?VUe(e):HUe(e)),WUe=()=>`BRIDGE_URL / BRIDGE_SHARED_SECRET ne sont pas définis côté Convex (npx convex env set).`,GUe=()=>`BRIDGE_URL / BRIDGE_SHARED_SECRET are not set on the Convex side (npx convex env set).`,KUe=((e={},t={})=>(t.locale??q())===`fr`?WUe(e):GUe(e)),qUe=()=>`Utilisateur non routé`,JUe=()=>`User not routed`,YUe=((e={},t={})=>(t.locale??q())===`fr`?qUe(e):JUe(e)),XUe=()=>`Ce compte n’est rattaché à aucune instance. Settings → Users → Override instance, ou affectez un groupe.`,ZUe=()=>`This account is not attached to any instance. Settings → Users → Override instance, or assign a group.`,QUe=((e={},t={})=>(t.locale??q())===`fr`?XUe(e):ZUe(e)),$Ue=()=>`Erreur passerelle`,eWe=()=>`Gateway error`,tWe=((e={},t={})=>(t.locale??q())===`fr`?$Ue(e):eWe(e)),nWe=()=>`Cause non catégorisée. Consultez les logs du bridge pour le message brut.`,rWe=()=>`Uncategorized cause. Check the bridge logs for the raw message.`,iWe=((e={},t={})=>(t.locale??q())===`fr`?nWe(e):rWe(e)),aWe=()=>`Cause inconnue`,oWe=()=>`Unknown cause`,sWe=((e={},t={})=>(t.locale??q())===`fr`?aWe(e):oWe(e)),cWe=()=>`Aucun code de cause n’a été remonté (bridge antérieur à cette version ?). Consultez les logs du bridge.`,lWe=()=>`No cause code was reported (bridge older than this version?). Check the bridge logs.`,uWe=((e={},t={})=>(t.locale??q())===`fr`?cWe(e):lWe(e)),dWe=()=>`Cause non répertoriée — voir les logs du bridge.`,fWe=()=>`Cause not catalogued — see the bridge logs.`,pWe=((e={},t={})=>(t.locale??q())===`fr`?dWe(e):fWe(e)),mWe=e=>`Notifications (${e?.count} non lues)`,hWe=e=>`Notifications (${e?.count} unread)`,gWe=((e,t={})=>(t.locale??q())===`fr`?mWe(e):hWe(e)),_We=()=>`Notifications`,vWe=()=>`Notifications`,yWe=((e={},t={})=>(t.locale??q())===`fr`?_We(e):vWe(e)),bWe=()=>`Notifications`,xWe=()=>`Notifications`,SWe=((e={},t={})=>(t.locale??q())===`fr`?bWe(e):xWe(e)),CWe=()=>`Tout lu`,wWe=()=>`Mark all read`,TWe=((e={},t={})=>(t.locale??q())===`fr`?CWe(e):wWe(e)),EWe=()=>`Tout effacer`,DWe=()=>`Clear all`,OWe=((e={},t={})=>(t.locale??q())===`fr`?EWe(e):DWe(e)),kWe=()=>`Aucune notification.`,AWe=()=>`No notifications.`,jWe=((e={},t={})=>(t.locale??q())===`fr`?kWe(e):AWe(e)),MWe=()=>`Marquer comme lue`,NWe=()=>`Mark as read`,wQ=((e={},t={})=>(t.locale??q())===`fr`?MWe(e):NWe(e)),PWe=()=>`Effacer la notification`,FWe=()=>`Clear notification`,TQ=((e={},t={})=>(t.locale??q())===`fr`?PWe(e):FWe(e)),IWe=()=>`Mes signalements`,LWe=()=>`My reports`,RWe=((e={},t={})=>(t.locale??q())===`fr`?IWe(e):LWe(e)),zWe=()=>`Répondu`,BWe=()=>`Answered`,VWe=((e={},t={})=>(t.locale??q())===`fr`?zWe(e):BWe(e)),HWe=()=>`En attente`,UWe=()=>`Pending`,WWe=((e={},t={})=>(t.locale??q())===`fr`?HWe(e):UWe(e)),GWe=()=>`Administrateur`,KWe=()=>`Administrator`,qWe=((e={},t={})=>(t.locale??q())===`fr`?GWe(e):KWe(e)),JWe=()=>`Vous`,YWe=()=>`You`,XWe=((e={},t={})=>(t.locale??q())===`fr`?JWe(e):YWe(e)),ZWe=()=>`Voir la conversation`,QWe=()=>`View the conversation`,$We=((e={},t={})=>(t.locale??q())===`fr`?ZWe(e):QWe(e)),eGe=()=>`Message signalé`,tGe=()=>`Reported message`,nGe=((e={},t={})=>(t.locale??q())===`fr`?eGe(e):tGe(e)),rGe=()=>`Clore le signalement`,iGe=()=>`Close report`,EQ=((e={},t={})=>(t.locale??q())===`fr`?rGe(e):iGe(e)),aGe=()=>`Pourquoi clore ce signalement ? (facultatif)`,oGe=()=>`Why close this report? (optional)`,sGe=((e={},t={})=>(t.locale??q())===`fr`?aGe(e):oGe(e)),cGe=()=>`Clore`,lGe=()=>`Close`,uGe=((e={},t={})=>(t.locale??q())===`fr`?cGe(e):lGe(e)),dGe=()=>`Annuler`,fGe=()=>`Cancel`,pGe=((e={},t={})=>(t.locale??q())===`fr`?dGe(e):fGe(e)),mGe=()=>`Réponse à votre signalement`,hGe=()=>`Reply to your report`,gGe=((e={},t={})=>(t.locale??q())===`fr`?mGe(e):hGe(e)),_Ge=()=>`Un administrateur a répondu à un signalement que vous avez envoyé.`,vGe=()=>`An administrator replied to a report you sent.`,yGe=((e={},t={})=>(t.locale??q())===`fr`?_Ge(e):vGe(e)),bGe=()=>`Mots modifiés / altérés`,xGe=()=>`Modified / altered words`,SGe=((e={},t={})=>(t.locale??q())===`fr`?bGe(e):xGe(e)),CGe=()=>`Réponse incorrecte`,wGe=()=>`Incorrect answer`,TGe=((e={},t={})=>(t.locale??q())===`fr`?CGe(e):wGe(e)),EGe=()=>`Incohérence`,DGe=()=>`Incoherence`,OGe=((e={},t={})=>(t.locale??q())===`fr`?EGe(e):DGe(e)),kGe=()=>`Formatage`,AGe=()=>`Formatting`,jGe=((e={},t={})=>(t.locale??q())===`fr`?kGe(e):AGe(e)),MGe=()=>`Latence`,NGe=()=>`Latency`,PGe=((e={},t={})=>(t.locale??q())===`fr`?MGe(e):NGe(e)),FGe=()=>`Erreur API`,IGe=()=>`API error`,LGe=((e={},t={})=>(t.locale??q())===`fr`?FGe(e):IGe(e)),RGe=()=>`Autre`,zGe=()=>`Other`,BGe=((e={},t={})=>(t.locale??q())===`fr`?RGe(e):zGe(e)),VGe=()=>`Utilisateurs`,HGe=()=>`Users`,UGe=((e={},t={})=>(t.locale??q())===`fr`?VGe(e):HGe(e)),WGe=()=>`Instances`,GGe=()=>`Instances`,KGe=((e={},t={})=>(t.locale??q())===`fr`?WGe(e):GGe(e)),qGe=()=>`Bridge`,JGe=()=>`Bridge`,YGe=((e={},t={})=>(t.locale??q())===`fr`?qGe(e):JGe(e)),XGe=()=>`Comptes de service`,ZGe=()=>`Service accounts`,QGe=((e={},t={})=>(t.locale??q())===`fr`?XGe(e):ZGe(e)),$Ge=()=>`Rôles`,eKe=()=>`Roles`,tKe=((e={},t={})=>(t.locale??q())===`fr`?$Ge(e):eKe(e)),nKe=()=>`Traces`,rKe=()=>`Traces`,iKe=((e={},t={})=>(t.locale??q())===`fr`?nKe(e):rKe(e)),aKe=()=>`KPI`,oKe=()=>`KPI`,sKe=((e={},t={})=>(t.locale??q())===`fr`?aKe(e):oKe(e)),cKe=()=>`Anomalies`,lKe=()=>`Anomalies`,uKe=((e={},t={})=>(t.locale??q())===`fr`?cKe(e):lKe(e)),dKe=()=>`Intégrations`,fKe=()=>`Integrations`,pKe=((e={},t={})=>(t.locale??q())===`fr`?dKe(e):fKe(e)),mKe=()=>`Audit`,hKe=()=>`Audit`,gKe=((e={},t={})=>(t.locale??q())===`fr`?mKe(e):hKe(e)),_Ke=()=>`Feedbacks`,vKe=()=>`Feedbacks`,yKe=((e={},t={})=>(t.locale??q())===`fr`?_Ke(e):vKe(e)),bKe=()=>`Groupes`,xKe=()=>`Groups`,SKe=((e={},t={})=>(t.locale??q())===`fr`?bKe(e):xKe(e)),CKe=()=>`Accès`,wKe=()=>`Access`,TKe=((e={},t={})=>(t.locale??q())===`fr`?CKe(e):wKe(e)),EKe=()=>`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.`,DKe=()=>`Inspect a user’s access: their groups, the agents and charts available to them (with provenance), and their effective permissions. Read-only.`,OKe=((e={},t={})=>(t.locale??q())===`fr`?EKe(e):DKe(e)),kKe=()=>`Choisir un utilisateur`,AKe=()=>`Pick a user`,DQ=((e={},t={})=>(t.locale??q())===`fr`?kKe(e):AKe(e)),jKe=()=>`Sélectionnez un utilisateur pour voir ses accès.`,MKe=()=>`Select a user to see their access.`,NKe=((e={},t={})=>(t.locale??q())===`fr`?jKe(e):MKe(e)),PKe=()=>`Identité`,FKe=()=>`Identity`,IKe=((e={},t={})=>(t.locale??q())===`fr`?PKe(e):FKe(e)),LKe=()=>`Groupes`,RKe=()=>`Groups`,zKe=((e={},t={})=>(t.locale??q())===`fr`?LKe(e):RKe(e)),BKe=()=>`Agents disponibles`,VKe=()=>`Available agents`,HKe=((e={},t={})=>(t.locale??q())===`fr`?BKe(e):VKe(e)),UKe=()=>`Chartes disponibles`,WKe=()=>`Available charts`,GKe=((e={},t={})=>(t.locale??q())===`fr`?UKe(e):WKe(e)),KKe=()=>`Permissions effectives`,qKe=()=>`Effective permissions`,JKe=((e={},t={})=>(t.locale??q())===`fr`?KKe(e):qKe(e)),YKe=()=>`Aucun`,XKe=()=>`None`,OQ=((e={},t={})=>(t.locale??q())===`fr`?YKe(e):XKe(e)),ZKe=()=>`Défaut`,QKe=()=>`Default`,$Ke=((e={},t={})=>(t.locale??q())===`fr`?ZKe(e):QKe(e)),eqe=()=>`Direct`,tqe=()=>`Direct`,nqe=((e={},t={})=>(t.locale??q())===`fr`?eqe(e):tqe(e)),rqe=()=>`Tous les agents (aucun groupe)`,iqe=()=>`All agents (no group)`,aqe=((e={},t={})=>(t.locale??q())===`fr`?rqe(e):iqe(e)),oqe=e=>`Groupe : ${e?.group}`,sqe=e=>`Group: ${e?.group}`,kQ=((e,t={})=>(t.locale??q())===`fr`?oqe(e):sqe(e)),cqe=()=>`Commune`,lqe=()=>`Common`,uqe=((e={},t={})=>(t.locale??q())===`fr`?cqe(e):lqe(e)),dqe=()=>`Perso`,fqe=()=>`Personal`,pqe=((e={},t={})=>(t.locale??q())===`fr`?dqe(e):fqe(e)),mqe=()=>`Groupes`,hqe=()=>`Groups`,gqe=((e={},t={})=>(t.locale??q())===`fr`?mqe(e):hqe(e)),_qe=()=>`Regroupez des utilisateurs et partagez des agents par groupe. Chaque membre hérite des agents du groupe en plus de ses agents directs.`,vqe=()=>`Group users and share agents by group. Each member inherits the group's agents on top of their direct agents.`,yqe=((e={},t={})=>(t.locale??q())===`fr`?_qe(e):vqe(e)),bqe=()=>`Nouveau groupe`,xqe=()=>`New group`,Sqe=((e={},t={})=>(t.locale??q())===`fr`?bqe(e):xqe(e)),Cqe=()=>`Aucun groupe pour le moment.`,wqe=()=>`No groups yet.`,Tqe=((e={},t={})=>(t.locale??q())===`fr`?Cqe(e):wqe(e)),Eqe=()=>`Nom`,Dqe=()=>`Name`,Oqe=((e={},t={})=>(t.locale??q())===`fr`?Eqe(e):Dqe(e)),kqe=()=>`Membres`,Aqe=()=>`Members`,jqe=((e={},t={})=>(t.locale??q())===`fr`?kqe(e):Aqe(e)),Mqe=()=>`Agents`,Nqe=()=>`Agents`,Pqe=((e={},t={})=>(t.locale??q())===`fr`?Mqe(e):Nqe(e)),Fqe=()=>`Chartes`,Iqe=()=>`Charts`,Lqe=((e={},t={})=>(t.locale??q())===`fr`?Fqe(e):Iqe(e)),Rqe=()=>`Filtrer les groupes (nom, membre, agent, charte)…`,zqe=()=>`Filter groups (name, member, agent, chart)…`,Bqe=((e={},t={})=>(t.locale??q())===`fr`?Rqe(e):zqe(e)),Vqe=()=>`Gérer`,Hqe=()=>`Manage`,Uqe=((e={},t={})=>(t.locale??q())===`fr`?Vqe(e):Hqe(e)),Wqe=()=>`Renommer`,Gqe=()=>`Rename`,Kqe=((e={},t={})=>(t.locale??q())===`fr`?Wqe(e):Gqe(e)),qqe=()=>`Supprimer`,Jqe=()=>`Delete`,Yqe=((e={},t={})=>(t.locale??q())===`fr`?qqe(e):Jqe(e)),Xqe=()=>`Enregistrer`,Zqe=()=>`Save`,Qqe=((e={},t={})=>(t.locale??q())===`fr`?Xqe(e):Zqe(e)),$qe=()=>`Annuler`,eJe=()=>`Cancel`,tJe=((e={},t={})=>(t.locale??q())===`fr`?$qe(e):eJe(e)),nJe=()=>`Nouveau groupe`,rJe=()=>`New group`,iJe=((e={},t={})=>(t.locale??q())===`fr`?nJe(e):rJe(e)),aJe=()=>`Renommer le groupe`,oJe=()=>`Rename group`,sJe=((e={},t={})=>(t.locale??q())===`fr`?aJe(e):oJe(e)),cJe=()=>`Le nom est libre ; un identifiant stable est généré automatiquement.`,lJe=()=>`The name is free-form; a stable identifier is generated automatically.`,uJe=((e={},t={})=>(t.locale??q())===`fr`?cJe(e):lJe(e)),dJe=()=>`Nom`,fJe=()=>`Name`,pJe=((e={},t={})=>(t.locale??q())===`fr`?dJe(e):fJe(e)),mJe=()=>`Description`,hJe=()=>`Description`,gJe=((e={},t={})=>(t.locale??q())===`fr`?mJe(e):hJe(e)),_Je=e=>`Supprimer le groupe « ${e?.name} » ?`,vJe=e=>`Delete group "${e?.name}"?`,yJe=((e,t={})=>(t.locale??q())===`fr`?_Je(e):vJe(e)),bJe=()=>`Cette action supprime le groupe, ses adhésions et les agents partagés. Elle est irréversible.`,xJe=()=>`This deletes the group, its memberships and shared agents. It cannot be undone.`,SJe=((e={},t={})=>(t.locale??q())===`fr`?bJe(e):xJe(e)),CJe=()=>`Supprimer le groupe`,wJe=()=>`Delete group`,TJe=((e={},t={})=>(t.locale??q())===`fr`?CJe(e):wJe(e)),EJe=e=>`Gérer « ${e?.name} »`,DJe=e=>`Manage "${e?.name}"`,OJe=((e,t={})=>(t.locale??q())===`fr`?EJe(e):DJe(e)),kJe=()=>`Ajoutez ou retirez des membres et partagez des agents découverts avec ce groupe.`,AJe=()=>`Add or remove members and share discovered agents with this group.`,jJe=((e={},t={})=>(t.locale??q())===`fr`?kJe(e):AJe(e)),MJe=()=>`Membres`,NJe=()=>`Members`,PJe=((e={},t={})=>(t.locale??q())===`fr`?MJe(e):NJe(e)),FJe=()=>`Rechercher un utilisateur…`,IJe=()=>`Search a user…`,LJe=((e={},t={})=>(t.locale??q())===`fr`?FJe(e):IJe(e)),RJe=()=>`Agents partagés`,zJe=()=>`Shared agents`,BJe=((e={},t={})=>(t.locale??q())===`fr`?RJe(e):zJe(e)),VJe=()=>`Rechercher un agent…`,HJe=()=>`Search an agent…`,UJe=((e={},t={})=>(t.locale??q())===`fr`?VJe(e):HJe(e)),WJe=()=>`Aucun résultat.`,GJe=()=>`No results.`,KJe=((e={},t={})=>(t.locale??q())===`fr`?WJe(e):GJe(e)),qJe=()=>`Tout sélectionner`,JJe=()=>`Select all`,AQ=((e={},t={})=>(t.locale??q())===`fr`?qJe(e):JJe(e)),YJe=()=>`Précédent`,XJe=()=>`Previous`,ZJe=((e={},t={})=>(t.locale??q())===`fr`?YJe(e):XJe(e)),QJe=()=>`Suivant`,$Je=()=>`Next`,eYe=((e={},t={})=>(t.locale??q())===`fr`?QJe(e):$Je(e)),tYe=e=>`Page ${e?.page} sur ${e?.pages}`,nYe=e=>`Page ${e?.page} of ${e?.pages}`,rYe=((e,t={})=>(t.locale??q())===`fr`?tYe(e):nYe(e)),iYe=()=>`Administrateur`,aYe=()=>`Admin`,oYe=((e={},t={})=>(t.locale??q())===`fr`?iYe(e):aYe(e)),sYe=()=>`Utilisateur`,cYe=()=>`User`,lYe=((e={},t={})=>(t.locale??q())===`fr`?sYe(e):cYe(e)),uYe=()=>`En attente`,dYe=()=>`Pending`,fYe=((e={},t={})=>(t.locale??q())===`fr`?uYe(e):dYe(e)),pYe=e=>`Basculer l'adhésion de ${e?.user}`,mYe=e=>`Toggle membership of ${e?.user}`,hYe=((e,t={})=>(t.locale??q())===`fr`?pYe(e):mYe(e)),gYe=e=>`Partager l'agent ${e?.name}`,_Ye=e=>`Share agent ${e?.name}`,vYe=((e,t={})=>(t.locale??q())===`fr`?gYe(e):_Ye(e)),yYe=()=>`Chargement…`,bYe=()=>`Loading…`,jQ=((e={},t={})=>(t.locale??q())===`fr`?yYe(e):bYe(e)),xYe=()=>`Chargement des agents…`,SYe=()=>`Loading agents…`,CYe=((e={},t={})=>(t.locale??q())===`fr`?xYe(e):SYe(e)),wYe=()=>`Aucun utilisateur.`,TYe=()=>`No users.`,EYe=((e={},t={})=>(t.locale??q())===`fr`?wYe(e):TYe(e)),DYe=()=>`Aucune instance configurée.`,OYe=()=>`No instances configured.`,kYe=((e={},t={})=>(t.locale??q())===`fr`?DYe(e):OYe(e)),AYe=()=>`Aucun agent découvert.`,jYe=()=>`No discovered agents.`,MYe=((e={},t={})=>(t.locale??q())===`fr`?AYe(e):jYe(e)),NYe=()=>`Instance hors ligne ; agents indisponibles.`,PYe=()=>`Instance offline; agents unavailable.`,FYe=((e={},t={})=>(t.locale??q())===`fr`?NYe(e):PYe(e)),IYe=()=>`hors ligne`,LYe=()=>`offline`,RYe=((e={},t={})=>(t.locale??q())===`fr`?IYe(e):LYe(e)),zYe=()=>`retiré`,BYe=()=>`removed`,VYe=((e={},t={})=>(t.locale??q())===`fr`?zYe(e):BYe(e)),HYe=()=>`Agent par défaut de l'instance`,UYe=()=>`Instance default agent`,MQ=((e={},t={})=>(t.locale??q())===`fr`?HYe(e):UYe(e)),WYe=()=>`Chartes`,GYe=()=>`Charts`,KYe=((e={},t={})=>(t.locale??q())===`fr`?WYe(e):GYe(e)),qYe=()=>`Aucune charte disponible pour ce groupe pour l'instant. Demandez à un administrateur d'ajouter des chartes au pool de ce groupe.`,JYe=()=>`No charts available for this group yet. Ask an admin to add charts to this group's pool.`,YYe=((e={},t={})=>(t.locale??q())===`fr`?qYe(e):JYe(e)),XYe=()=>`Ajoutez des chartes au pool de ce groupe ci-dessous, puis sélectionnez celles que le groupe propose.`,ZYe=()=>`Add charts to this group's pool below, then select which ones the group offers.`,QYe=((e={},t={})=>(t.locale??q())===`fr`?XYe(e):ZYe(e)),$Ye=()=>`Ajouter une charte au pool…`,eXe=()=>`Add a chart to the pool…`,tXe=((e={},t={})=>(t.locale??q())===`fr`?$Ye(e):eXe(e)),nXe=e=>`Retirer ${e?.name} du pool`,rXe=e=>`Remove ${e?.name} from the pool`,NQ=((e,t={})=>(t.locale??q())===`fr`?nXe(e):rXe(e)),iXe=e=>`Proposer la charte ${e?.name} à ce groupe`,aXe=e=>`Offer chart ${e?.name} to this group`,oXe=((e,t={})=>(t.locale??q())===`fr`?iXe(e):aXe(e)),sXe=()=>`Charte par défaut du groupe`,cXe=()=>`Group default chart`,PQ=((e={},t={})=>(t.locale??q())===`fr`?sXe(e):cXe(e)),lXe=()=>`Définir par défaut`,uXe=()=>`Set as default`,dXe=((e={},t={})=>(t.locale??q())===`fr`?lXe(e):uXe(e)),fXe=()=>`Gestionnaire`,pXe=()=>`Manager`,FQ=((e={},t={})=>(t.locale??q())===`fr`?fXe(e):pXe(e)),mXe=()=>`Promouvoir gestionnaire`,hXe=()=>`Promote to manager`,IQ=((e={},t={})=>(t.locale??q())===`fr`?mXe(e):hXe(e)),gXe=()=>`Retirer gestionnaire`,_Xe=()=>`Remove manager`,LQ=((e={},t={})=>(t.locale??q())===`fr`?gXe(e):_Xe(e)),vXe=()=>`Changement de gestionnaire refusé`,yXe=()=>`Manager change rejected`,bXe=((e={},t={})=>(t.locale??q())===`fr`?vXe(e):yXe(e)),xXe=()=>`Mise à jour de la charte refusée`,SXe=()=>`Chart update rejected`,RQ=((e={},t={})=>(t.locale??q())===`fr`?xXe(e):SXe(e)),CXe=()=>`Enregistrement du groupe refusé`,wXe=()=>`Group save rejected`,TXe=((e={},t={})=>(t.locale??q())===`fr`?CXe(e):wXe(e)),EXe=()=>`Suppression du groupe refusée`,DXe=()=>`Group deletion rejected`,OXe=((e={},t={})=>(t.locale??q())===`fr`?EXe(e):DXe(e)),kXe=()=>`Mise à jour de l'adhésion refusée`,AXe=()=>`Membership update rejected`,zQ=((e={},t={})=>(t.locale??q())===`fr`?kXe(e):AXe(e)),jXe=()=>`Partage de l'agent refusé`,MXe=()=>`Agent sharing rejected`,BQ=((e={},t={})=>(t.locale??q())===`fr`?jXe(e):MXe(e)),NXe=()=>`Réordonner cet onglet`,PXe=()=>`Reorder this tab`,FXe=((e={},t={})=>(t.locale??q())===`fr`?NXe(e):PXe(e)),IXe=()=>`Réglages`,LXe=()=>`Settings`,RXe=((e={},t={})=>(t.locale??q())===`fr`?IXe(e):LXe(e)),zXe=()=>`← Retour au chat`,BXe=()=>`← Back to chat`,VXe=((e={},t={})=>(t.locale??q())===`fr`?zXe(e):BXe(e)),HXe=()=>`Réglages`,UXe=()=>`Settings`,WXe=((e={},t={})=>(t.locale??q())===`fr`?HXe(e):UXe(e)),GXe=()=>`Personnel`,KXe=()=>`Personal`,qXe=((e={},t={})=>(t.locale??q())===`fr`?GXe(e):KXe(e)),JXe=()=>`Agents`,YXe=()=>`Agents`,XXe=((e={},t={})=>(t.locale??q())===`fr`?JXe(e):YXe(e)),ZXe=()=>`Accès & utilisateurs`,QXe=()=>`Access & users`,$Xe=((e={},t={})=>(t.locale??q())===`fr`?ZXe(e):QXe(e)),eZe=()=>`Observabilité`,tZe=()=>`Observability`,nZe=((e={},t={})=>(t.locale??q())===`fr`?eZe(e):tZe(e)),rZe=()=>`Fermer`,iZe=()=>`Close`,VQ=((e={},t={})=>(t.locale??q())===`fr`?rZe(e):iZe(e)),aZe=()=>`héritée`,oZe=()=>`inherited`,sZe=((e={},t={})=>(t.locale??q())===`fr`?aZe(e):oZe(e)),cZe=()=>`Revenir à la valeur héritée`,lZe=()=>`Back to the inherited value`,HQ=((e={},t={})=>(t.locale??q())===`fr`?cZe(e):lZe(e)),uZe=()=>`Application…`,dZe=()=>`Applying…`,UQ=((e={},t={})=>(t.locale??q())===`fr`?uZe(e):dZe(e)),fZe=()=>`Échec de l’application.`,pZe=()=>`Failed to apply.`,mZe=((e={},t={})=>(t.locale??q())===`fr`?fZe(e):pZe(e)),hZe=()=>`Réessayer`,gZe=()=>`Retry`,WQ=((e={},t={})=>(t.locale??q())===`fr`?hZe(e):gZe(e)),_Ze=()=>`Réflexion`,vZe=()=>`Reasoning`,yZe=((e={},t={})=>(t.locale??q())===`fr`?_Ze(e):vZe(e)),bZe=()=>`Vitesse`,xZe=()=>`Speed`,SZe=((e={},t={})=>(t.locale??q())===`fr`?bZe(e):xZe(e)),CZe=()=>`Hérité`,wZe=()=>`Inherited`,TZe=((e={},t={})=>(t.locale??q())===`fr`?CZe(e):wZe(e)),EZe=()=>`Rapide`,DZe=()=>`Fast`,GQ=((e={},t={})=>(t.locale??q())===`fr`?EZe(e):DZe(e)),OZe=()=>`Standard`,kZe=()=>`Standard`,KQ=((e={},t={})=>(t.locale??q())===`fr`?OZe(e):kZe(e)),AZe=()=>`Tous les réglages de session`,jZe=()=>`All session settings`,MZe=((e={},t={})=>(t.locale??q())===`fr`?AZe(e):jZe(e)),NZe=()=>`Réglages de session`,PZe=()=>`Session settings`,FZe=((e={},t={})=>(t.locale??q())===`fr`?NZe(e):PZe(e)),IZe=()=>`Réglages appliqués à cette conversation.`,LZe=()=>`Settings applied to this conversation.`,RZe=((e={},t={})=>(t.locale??q())===`fr`?IZe(e):LZe(e)),zZe=()=>`Génération`,BZe=()=>`Generation`,VZe=((e={},t={})=>(t.locale??q())===`fr`?zZe(e):BZe(e)),HZe=()=>`Session`,UZe=()=>`Session`,WZe=((e={},t={})=>(t.locale??q())===`fr`?HZe(e):UZe(e)),GZe=()=>`Agent`,KZe=()=>`Agent`,qZe=((e={},t={})=>(t.locale??q())===`fr`?GZe(e):KZe(e)),JZe=()=>`Actions`,YZe=()=>`Actions`,XZe=((e={},t={})=>(t.locale??q())===`fr`?JZe(e):YZe(e)),ZZe=()=>`Contexte`,QZe=()=>`Context`,$Ze=((e={},t={})=>(t.locale??q())===`fr`?ZZe(e):QZe(e)),eQe=e=>`${e?.pct} % · ${e?.used} / ${e?.total} jetons`,tQe=e=>`${e?.pct}% · ${e?.used} / ${e?.total} tokens`,nQe=((e,t={})=>(t.locale??q())===`fr`?eQe(e):tQe(e)),rQe=()=>`Verbosité`,iQe=()=>`Verbosity`,aQe=((e={},t={})=>(t.locale??q())===`fr`?rQe(e):iQe(e)),oQe=e=>`${e?.level} · fixée`,sQe=e=>`${e?.level} · pinned`,cQe=((e,t={})=>(t.locale??q())===`fr`?oQe(e):sQe(e)),lQe=()=>`Fixée par la passerelle pour un streaming complet.`,uQe=()=>`Pinned by the bridge for complete streaming.`,dQe=((e={},t={})=>(t.locale??q())===`fr`?lQe(e):uQe(e)),fQe=()=>`Coût / jetons`,pQe=()=>`Cost / tokens`,mQe=((e={},t={})=>(t.locale??q())===`fr`?fQe(e):pQe(e)),hQe=e=>`~${e?.cost} $ · ${e?.tokens} jetons`,gQe=e=>`~$${e?.cost} · ${e?.tokens} tokens`,_Qe=((e,t={})=>(t.locale??q())===`fr`?hQe(e):gQe(e)),vQe=e=>`~${e?.cost} $`,yQe=e=>`~$${e?.cost}`,bQe=((e,t={})=>(t.locale??q())===`fr`?vQe(e):yQe(e)),xQe=e=>`${e?.tokens} jetons`,SQe=e=>`${e?.tokens} tokens`,CQe=((e,t={})=>(t.locale??q())===`fr`?xQe(e):SQe(e)),wQe=()=>`Compacter le contexte`,TQe=()=>`Compact the context`,EQe=((e={},t={})=>(t.locale??q())===`fr`?wQe(e):TQe(e)),DQe=()=>`Compacter le contexte ?`,OQe=()=>`Compact the context?`,kQe=((e={},t={})=>(t.locale??q())===`fr`?DQe(e):OQe(e)),AQe=()=>`L’agent résume la conversation pour libérer de l’espace dans la fenêtre de contexte. Les messages restent visibles ici.`,jQe=()=>`The agent summarizes the conversation to free space in the context window. Messages stay visible here.`,MQe=((e={},t={})=>(t.locale??q())===`fr`?AQe(e):jQe(e)),NQe=()=>`Compacter`,PQe=()=>`Compact`,FQe=((e={},t={})=>(t.locale??q())===`fr`?NQe(e):PQe(e)),IQe=()=>`Réinitialiser la session`,LQe=()=>`Reset the session`,RQe=((e={},t={})=>(t.locale??q())===`fr`?IQe(e):LQe(e)),zQe=()=>`Réinitialiser la session ?`,BQe=()=>`Reset the session?`,VQe=((e={},t={})=>(t.locale??q())===`fr`?zQe(e):BQe(e)),HQe=()=>`La session de l’agent repart à zéro et se réhydrate depuis la conversation au prochain message. Aucun message n’est supprimé.`,UQe=()=>`The agent session starts fresh and re-hydrates from the conversation on the next message. No message is deleted.`,WQe=((e={},t={})=>(t.locale??q())===`fr`?HQe(e):UQe(e)),GQe=()=>`Réinitialiser`,KQe=()=>`Reset`,qQe=((e={},t={})=>(t.locale??q())===`fr`?GQe(e):KQe(e)),JQe=()=>`Demande envoyée à l’agent.`,YQe=()=>`Request sent to the agent.`,XQe=((e={},t={})=>(t.locale??q())===`fr`?JQe(e):YQe(e)),ZQe=()=>`Échec de l’action.`,QQe=()=>`Action failed.`,$Qe=((e={},t={})=>(t.locale??q())===`fr`?ZQe(e):QQe(e)),e$e=()=>`Fichiers d’agent`,t$e=()=>`Agent files`,n$e=((e={},t={})=>(t.locale??q())===`fr`?e$e(e):t$e(e)),r$e=()=>`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.`,i$e=()=>`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.`,a$e=((e={},t={})=>(t.locale??q())===`fr`?r$e(e):i$e(e)),o$e=()=>`Instance`,s$e=()=>`Instance`,qQ=((e={},t={})=>(t.locale??q())===`fr`?o$e(e):s$e(e)),c$e=()=>`Agent`,l$e=()=>`Agent`,u$e=((e={},t={})=>(t.locale??q())===`fr`?c$e(e):l$e(e)),d$e=()=>`Aucun agent disponible.`,f$e=()=>`No agent available.`,p$e=((e={},t={})=>(t.locale??q())===`fr`?d$e(e):f$e(e)),m$e=()=>`Aucun fichier.`,h$e=()=>`No files.`,g$e=((e={},t={})=>(t.locale??q())===`fr`?m$e(e):h$e(e)),_$e=()=>`Bridge injoignable — impossible de lister les fichiers.`,v$e=()=>`Bridge unreachable — cannot list the files.`,y$e=((e={},t={})=>(t.locale??q())===`fr`?_$e(e):v$e(e)),b$e=()=>`absent`,x$e=()=>`missing`,S$e=((e={},t={})=>(t.locale??q())===`fr`?b$e(e):x$e(e)),C$e=e=>`${e?.size} ko`,w$e=e=>`${e?.size} kB`,T$e=((e,t={})=>(t.locale??q())===`fr`?C$e(e):w$e(e)),E$e=e=>`${e?.pct} %`,D$e=e=>`${e?.pct}%`,O$e=((e,t={})=>(t.locale??q())===`fr`?E$e(e):D$e(e)),k$e=()=>`Proche de la limite bootstrap`,A$e=()=>`Near the bootstrap limit`,j$e=((e={},t={})=>(t.locale??q())===`fr`?k$e(e):A$e(e)),M$e=e=>`Budget total : ${e?.used} ko / ${e?.total} ko (${e?.pct} %)`,N$e=e=>`Total budget: ${e?.used} kB / ${e?.total} kB (${e?.pct}%)`,P$e=((e,t={})=>(t.locale??q())===`fr`?M$e(e):N$e(e)),F$e=()=>`Éditer`,I$e=()=>`Edit`,L$e=((e={},t={})=>(t.locale??q())===`fr`?F$e(e):I$e(e)),R$e=()=>`Consulter`,z$e=()=>`View`,B$e=((e={},t={})=>(t.locale??q())===`fr`?R$e(e):z$e(e)),V$e=e=>`${e?.name}`,H$e=e=>`${e?.name}`,JQ=((e,t={})=>(t.locale??q())===`fr`?V$e(e):H$e(e)),U$e=e=>`Agent ${e?.agent} · instance ${e?.instance}`,W$e=e=>`Agent ${e?.agent} · instance ${e?.instance}`,G$e=((e,t={})=>(t.locale??q())===`fr`?U$e(e):W$e(e)),K$e=()=>`lecture seule`,q$e=()=>`read-only`,J$e=((e={},t={})=>(t.locale??q())===`fr`?K$e(e):q$e(e)),Y$e=()=>`Source markdown brute — l’aperçu rendu n’est pas disponible ici.`,X$e=()=>`Raw markdown source — a rendered preview is not available here.`,Z$e=((e={},t={})=>(t.locale??q())===`fr`?Y$e(e):X$e(e)),Q$e=e=>`${e?.count} / ${e?.max} caractères`,$$e=e=>`${e?.count} / ${e?.max} characters`,e1e=((e,t={})=>(t.locale??q())===`fr`?Q$e(e):$$e(e)),t1e=()=>`Enregistrer`,n1e=()=>`Save`,r1e=((e={},t={})=>(t.locale??q())===`fr`?t1e(e):n1e(e)),i1e=e=>`${e?.name} enregistré.`,a1e=e=>`${e?.name} saved.`,o1e=((e,t={})=>(t.locale??q())===`fr`?i1e(e):a1e(e)),s1e=()=>`Échec de l’enregistrement.`,c1e=()=>`Save failed.`,l1e=((e={},t={})=>(t.locale??q())===`fr`?s1e(e):c1e(e)),u1e=()=>`Impossible de charger le fichier.`,d1e=()=>`Could not load the file.`,f1e=((e={},t={})=>(t.locale??q())===`fr`?u1e(e):d1e(e)),p1e=()=>`Le fichier a changé depuis le chargement. Rechargez avant d’enregistrer (vos modifications sont conservées).`,m1e=()=>`The file changed since it was loaded. Reload before saving (your edits are kept).`,h1e=((e={},t={})=>(t.locale??q())===`fr`?p1e(e):m1e(e)),g1e=()=>`Recharger`,_1e=()=>`Reload`,v1e=((e={},t={})=>(t.locale??q())===`fr`?g1e(e):_1e(e)),y1e=e=>`Écrire ${e?.name} ?`,b1e=e=>`Write ${e?.name}?`,x1e=((e,t={})=>(t.locale??q())===`fr`?y1e(e):b1e(e)),S1e=e=>`Le fichier sera écrit sur l’agent ${e?.agent}. Une révision complète avant/après est conservée.`,C1e=e=>`The file will be written to agent ${e?.agent}. A full before/after revision is kept.`,w1e=((e,t={})=>(t.locale??q())===`fr`?S1e(e):C1e(e)),T1e=e=>`${e?.added} ligne(s) ajoutée(s) · ${e?.removed} ligne(s) retirée(s)`,E1e=e=>`${e?.added} line(s) added · ${e?.removed} line(s) removed`,D1e=((e,t={})=>(t.locale??q())===`fr`?T1e(e):E1e(e)),O1e=()=>`Ajoutées (extrait) :`,k1e=()=>`Added (sample):`,A1e=((e={},t={})=>(t.locale??q())===`fr`?O1e(e):k1e(e)),j1e=()=>`Retirées (extrait) :`,M1e=()=>`Removed (sample):`,N1e=((e={},t={})=>(t.locale??q())===`fr`?j1e(e):M1e(e)),P1e=()=>`Écrire le fichier`,F1e=()=>`Write the file`,I1e=((e={},t={})=>(t.locale??q())===`fr`?P1e(e):F1e(e)),L1e=()=>`Défauts de chat`,R1e=()=>`Chat defaults`,z1e=((e={},t={})=>(t.locale??q())===`fr`?L1e(e):R1e(e)),B1e=()=>`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.`,V1e=()=>`Default settings for new chat sessions, read from the gateway’s global configuration. Per-chat and per-agent settings keep precedence.`,H1e=((e={},t={})=>(t.locale??q())===`fr`?B1e(e):V1e(e)),U1e=()=>`Réflexion par défaut`,W1e=()=>`Default thinking`,G1e=((e={},t={})=>(t.locale??q())===`fr`?U1e(e):W1e(e)),K1e=()=>`Niveau de raisonnement appliqué quand un chat ne définit pas le sien.`,q1e=()=>`Reasoning level applied when a chat does not set its own.`,J1e=((e={},t={})=>(t.locale??q())===`fr`?K1e(e):q1e(e)),Y1e=()=>`Vitesse par défaut`,X1e=()=>`Default speed`,Z1e=((e={},t={})=>(t.locale??q())===`fr`?Y1e(e):X1e(e)),Q1e=()=>`Mode rapide ou standard appliqué quand un chat ne définit pas le sien.`,$1e=()=>`Fast or standard mode applied when a chat does not set its own.`,e0e=((e={},t={})=>(t.locale??q())===`fr`?Q1e(e):$1e(e)),t0e=()=>`Bridge injoignable — impossible de lire les défauts globaux.`,n0e=()=>`Bridge unreachable — cannot read the global defaults.`,r0e=((e={},t={})=>(t.locale??q())===`fr`?t0e(e):n0e(e)),i0e=()=>`Enregistrer`,a0e=()=>`Save`,o0e=((e={},t={})=>(t.locale??q())===`fr`?i0e(e):a0e(e)),s0e=()=>`Défauts globaux enregistrés.`,c0e=()=>`Global defaults saved.`,l0e=((e={},t={})=>(t.locale??q())===`fr`?s0e(e):c0e(e)),u0e=()=>`Échec de l’écriture des défauts globaux.`,d0e=()=>`Failed to write the global defaults.`,f0e=((e={},t={})=>(t.locale??q())===`fr`?u0e(e):d0e(e)),p0e=()=>`Ces valeurs sont écrites dans openclaw.json, la configuration globale de l’instance — elles s’appliquent à tous les utilisateurs.`,m0e=()=>`These values are written to openclaw.json, the instance’s global configuration — they apply to every user.`,h0e=((e={},t={})=>(t.locale??q())===`fr`?p0e(e):m0e(e)),g0e=()=>`Modifier les défauts globaux ?`,_0e=()=>`Change the global defaults?`,v0e=((e={},t={})=>(t.locale??q())===`fr`?g0e(e):_0e(e)),y0e=()=>`Cette écriture modifie openclaw.json pour toute l’instance : tous les chats qui héritent du défaut changeront de comportement.`,b0e=()=>`This write changes openclaw.json for the whole instance: every chat inheriting the default will change behavior.`,x0e=((e={},t={})=>(t.locale??q())===`fr`?y0e(e):b0e(e)),S0e=()=>`Modifier`,C0e=()=>`Change`,w0e=((e={},t={})=>(t.locale??q())===`fr`?S0e(e):C0e(e)),T0e=()=>`Compatibilité`,E0e=()=>`Compatibility`,D0e=((e={},t={})=>(t.locale??q())===`fr`?T0e(e):E0e(e)),O0e=()=>`Aucun relevé de compatibilité pour l’instant — le sondage tourne toutes les 5 minutes.`,k0e=()=>`No compatibility reading yet — the poll runs every 5 minutes.`,A0e=((e={},t={})=>(t.locale??q())===`fr`?O0e(e):k0e(e)),j0e=()=>`Protocole :`,M0e=()=>`Protocol:`,N0e=((e={},t={})=>(t.locale??q())===`fr`?j0e(e):M0e(e)),P0e=()=>`inconnue`,F0e=()=>`unknown`,YQ=((e={},t={})=>(t.locale??q())===`fr`?P0e(e):F0e(e)),I0e=()=>`Dernier sondage en échec — affichage du dernier relevé valide.`,L0e=()=>`Last poll failed — showing the last good reading.`,R0e=((e={},t={})=>(t.locale??q())===`fr`?I0e(e):L0e(e)),z0e=()=>`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.`,B0e=()=>`This bridge does not publish a compatibility manifest (older version) — legacy policy: only model and reasoning are offered.`,V0e=((e={},t={})=>(t.locale??q())===`fr`?z0e(e):B0e(e)),H0e=()=>`OpenClaw supporté :`,U0e=()=>`OpenClaw supported:`,W0e=((e={},t={})=>(t.locale??q())===`fr`?H0e(e):U0e(e)),G0e=e=>`de ${e?.min} à ${e?.max} (validé)`,K0e=e=>`from ${e?.min} to ${e?.max} (validated)`,q0e=((e,t={})=>(t.locale??q())===`fr`?G0e(e):K0e(e)),J0e=()=>`1 version validée`,Y0e=()=>`1 validated version`,X0e=((e={},t={})=>(t.locale??q())===`fr`?J0e(e):Y0e(e)),Z0e=e=>`${e?.count} versions validées`,Q0e=e=>`${e?.count} validated versions`,$0e=((e,t={})=>(t.locale??q())===`fr`?Z0e(e):Q0e(e)),e2e=()=>`Validées au banc`,t2e=()=>`Bench-validated`,n2e=((e={},t={})=>(t.locale??q())===`fr`?e2e(e):t2e(e)),r2e=()=>`Aucune connexion connue du relevé de compatibilité.`,i2e=()=>`No connection known to the compatibility reading.`,a2e=((e={},t={})=>(t.locale??q())===`fr`?r2e(e):i2e(e)),o2e=()=>`✓ dans le support`,s2e=()=>`✓ within support`,c2e=((e={},t={})=>(t.locale??q())===`fr`?o2e(e):s2e(e)),l2e=()=>`⚠ au-delà du validé`,u2e=()=>`⚠ beyond validated`,d2e=((e={},t={})=>(t.locale??q())===`fr`?l2e(e):u2e(e)),f2e=()=>`? inconnue`,p2e=()=>`? unknown`,m2e=((e={},t={})=>(t.locale??q())===`fr`?f2e(e):p2e(e)),h2e=()=>`Hermes : adaptateur à venir.`,g2e=()=>`Hermes: adapter coming.`,_2e=((e={},t={})=>(t.locale??q())===`fr`?h2e(e):g2e(e)),v2e=e=>`Non supporté par cette instance (version gateway ${e?.version}).`,y2e=e=>`Not supported by this instance (gateway version ${e?.version}).`,b2e=((e,t={})=>(t.locale??q())===`fr`?v2e(e):y2e(e)),x2e=()=>`Non supporté par cette instance (version gateway inconnue).`,S2e=()=>`Not supported by this instance (unknown gateway version).`,C2e=((e={},t={})=>(t.locale??q())===`fr`?x2e(e):S2e(e)),XQ=(0,N.createContext)({label:`Atrium`,logoUrl:null,logoMasked:!1,isDefault:!0,initials:`A`,agentName:null,agentEmoji:null});function ZQ(){return(0,N.useContext)(XQ)}function w2e(e){return e.agentName??e.label}function T2e(e){return e.agentName?iq({name:e.agentName}):tq({name:e.label})}var E2e={user:MBe(),assistant:`OpenClaw`,system:FBe()},D2e=RBe();function QQ(e){return new Date(e).toISOString().slice(0,16).replace(`T`,` `)+` UTC`}function $Q(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 O2e(e,t={}){let n=[];n.push(`# ${t.title?.trim()||CQ()}`),t.exportedAt!=null&&(n.push(``),n.push(`_${UBe({date:QQ(t.exportedAt)})}_`)),t.truncated&&(n.push(``),n.push(D2e));for(let t of e){n.push(``),n.push(`## ${E2e[t.role]} · ${QQ(t.createdAt)}`);let e=t.text.trim();e.length>0&&(n.push(``),n.push(e));for(let e of $Q(t.parts))n.push(``),n.push(KBe({name:e}))}return n.join(`
|
|
128
|
+
`)+`
|
|
129
|
+
`}function k2e(e,t={}){let n={title:t.title?.trim()||CQ(),exportedAt:t.exportedAt??null,truncated:!!t.truncated,messageCount:e.length,messages:e.map(e=>({role:e.role,createdAt:e.createdAt,text:e.text,attachments:$Q(e.parts)}))};return JSON.stringify(n,null,2)+`
|
|
130
|
+
`}function A2e(e){return((e??``).trim()||`conversation`).toLowerCase().normalize(`NFD`).replace(/[̀-ͯ]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,60)||`conversation`}function e$(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=e$(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function t$(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=e$(e))&&(r&&(r+=` `),r+=t);return r}var j2e=(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},M2e=(e,t)=>({classGroupId:e,validator:t}),n$=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),r$=`-`,i$=[],N2e=`arbitrary..`,P2e=e=>{let t=I2e(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return F2e(e);let n=e.split(r$);return a$(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?j2e(i,t):t:i||i$}return n[e]||i$}}},a$=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=a$(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(r$):e.slice(t).join(r$),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},F2e=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?N2e+r:void 0})(),I2e=e=>{let{theme:t,classGroups:n}=e;return L2e(n,t)},L2e=(e,t)=>{let n=n$();for(let r in e){let i=e[r];o$(i,n,r,t)}return n},o$=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];R2e(i,t,n,r)}},R2e=(e,t,n,r)=>{if(typeof e==`string`){z2e(e,t,n);return}if(typeof e==`function`){B2e(e,t,n,r);return}V2e(e,t,n,r)},z2e=(e,t,n)=>{let r=e===``?t:s$(t,e);r.classGroupId=n},B2e=(e,t,n,r)=>{if(H2e(e)){o$(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(M2e(n,e))},V2e=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];o$(o,s$(t,a),n,r)}},s$=(e,t)=>{let n=e,r=t.split(r$),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=n$(),n.nextPart.set(t,i)),n=i}return n},H2e=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,U2e=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)}}},c$=`!`,l$=`:`,W2e=[],u$=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),G2e=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===l$){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(c$)?(c=s.slice(0,-1),l=!0):s.startsWith(c$)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return u$(t,l,c,u)};if(t){let e=t+l$,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):u$(W2e,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},K2e=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}},q2e=e=>({cache:U2e(e.cacheSize),parseClassName:G2e(e),sortModifiers:K2e(e),postfixLookupClassGroupIds:J2e(e),...P2e(e)}),J2e=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},Y2e=/\s+/,X2e=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Y2e),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?_+c$:_,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},Z2e=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=d$(n))&&(i&&(i+=` `),i+=r);return i},d$=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=d$(e[r]))&&(n&&(n+=` `),n+=t);return n},Q2e=(e,...t)=>{let n,r,i,a,o=o=>(n=q2e(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=X2e(e,n);return i(e,a),a};return a=o,(...e)=>a(Z2e(...e))},$2e=[],f$=e=>{let t=t=>t[e]||$2e;return t.isThemeGetter=!0,t},p$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,m$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,e4e=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,t4e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,n4e=/\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$/,r4e=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,i4e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a4e=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,h$=e=>e4e.test(e),g$=e=>!!e&&!Number.isNaN(Number(e)),_$=e=>!!e&&Number.isInteger(Number(e)),v$=e=>e.endsWith(`%`)&&g$(e.slice(0,-1)),y$=e=>t4e.test(e),b$=()=>!0,o4e=e=>n4e.test(e)&&!r4e.test(e),x$=()=>!1,s4e=e=>i4e.test(e),c4e=e=>a4e.test(e),l4e=e=>!J(e)&&!Y(e),u4e=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)),d4e=e=>k$(e,N$,x$),J=e=>p$.test(e),S$=e=>k$(e,P$,o4e),C$=e=>k$(e,y4e,g$),f4e=e=>k$(e,I$,b$),p4e=e=>k$(e,F$,x$),w$=e=>k$(e,j$,x$),m4e=e=>k$(e,M$,c4e),T$=e=>k$(e,L$,s4e),Y=e=>m$.test(e),E$=e=>A$(e,P$),h4e=e=>A$(e,F$),D$=e=>A$(e,j$),g4e=e=>A$(e,N$),_4e=e=>A$(e,M$),O$=e=>A$(e,L$,!0),v4e=e=>A$(e,I$,!0),k$=(e,t,n)=>{let r=p$.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},A$=(e,t,n=!1)=>{let r=m$.exec(e);return r?r[1]?t(r[1]):n:!1},j$=e=>e===`position`||e===`percentage`,M$=e=>e===`image`||e===`url`,N$=e=>e===`length`||e===`size`||e===`bg-size`,P$=e=>e===`length`,y4e=e=>e===`number`,F$=e=>e===`family-name`,I$=e=>e===`number`||e===`weight`,L$=e=>e===`shadow`,b4e=Q2e(()=>{let e=f$(`color`),t=f$(`font`),n=f$(`text`),r=f$(`font-weight`),i=f$(`tracking`),a=f$(`leading`),o=f$(`breakpoint`),s=f$(`container`),c=f$(`spacing`),l=f$(`radius`),u=f$(`shadow`),d=f$(`inset-shadow`),f=f$(`text-shadow`),p=f$(`drop-shadow`),m=f$(`blur`),h=f$(`perspective`),g=f$(`aspect`),_=f$(`ease`),v=f$(`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=()=>[h$,`full`,`auto`,...w()],E=()=>[_$,`none`,`subgrid`,Y,J],D=()=>[`auto`,{span:[`full`,_$,Y,J]},_$,Y,J],O=()=>[_$,`auto`,Y,J],ee=()=>[`auto`,`min`,`max`,`fr`,Y,J],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[h$,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[h$,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[h$,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,Y,J],ie=()=>[...b(),D$,w$,{position:[Y,J]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,g4e,d4e,{size:[Y,J]}],se=()=>[v$,E$,S$],ce=()=>[``,`none`,`full`,l,Y,J],le=()=>[``,g$,E$,S$],ue=()=>[`solid`,`dashed`,`dotted`,`double`],de=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],fe=()=>[g$,v$,D$,w$],pe=()=>[``,`none`,m,Y,J],me=()=>[`none`,g$,Y,J],he=()=>[`none`,g$,Y,J],ge=()=>[g$,Y,J],_e=()=>[h$,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[y$],breakpoint:[y$],color:[b$],container:[y$],"drop-shadow":[y$],ease:[`in`,`out`,`in-out`],font:[l4e],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[y$],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[y$],shadow:[y$],spacing:[`px`,g$],text:[y$],"text-shadow":[y$],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,h$,J,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,J]}],"container-named":[u4e],columns:[{columns:[g$,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:[_$,`auto`,Y,J]}],basis:[{basis:[h$,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[g$,h$,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,g$,Y,J]}],shrink:[{shrink:[``,g$,Y,J]}],order:[{order:[_$,`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":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],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:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,E$,S$]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,v4e,f4e]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,v$,J]}],"font-family":[{font:[h4e,p4e,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":[g$,`none`,Y,C$]}],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:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ue(),`wavy`]}],"text-decoration-thickness":[{decoration:[g$,`from-font`,`auto`,Y,S$]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[g$,`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:[_$,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:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},_$,Y,J],radial:[``,Y,J],conic:[_$,Y,J]},_4e,m4e]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":le()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ue(),`hidden`,`none`]}],"divide-style":[{divide:[...ue(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...ue(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[g$,Y,J]}],"outline-w":[{outline:[``,g$,E$,S$]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`none`,u,O$,T$]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,O$,T$]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:le()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[g$,S$]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,O$,T$]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[g$,Y,J]}],"mix-blend":[{"mix-blend":[...de(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":de()}],"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":[g$]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"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":[g$]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:pe()}],brightness:[{brightness:[g$,Y,J]}],contrast:[{contrast:[g$,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,O$,T$]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,g$,Y,J]}],"hue-rotate":[{"hue-rotate":[g$,Y,J]}],invert:[{invert:[``,g$,Y,J]}],saturate:[{saturate:[g$,Y,J]}],sepia:[{sepia:[``,g$,Y,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,J]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[g$,Y,J]}],"backdrop-contrast":[{"backdrop-contrast":[g$,Y,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,g$,Y,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g$,Y,J]}],"backdrop-invert":[{"backdrop-invert":[``,g$,Y,J]}],"backdrop-opacity":[{"backdrop-opacity":[g$,Y,J]}],"backdrop-saturate":[{"backdrop-saturate":[g$,Y,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,g$,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:[g$,`initial`,Y,J]}],ease:[{ease:[`linear`,`initial`,_,Y,J]}],delay:[{delay:[g$,Y,J]}],animate:[{animate:[`none`,v,Y,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":[`scale-3d`],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Y,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":[`translate-none`],zoom:[{zoom:[_$,Y,J]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"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":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"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`,...M()]}],"stroke-w":[{stroke:[g$,E$,S$,C$]}],stroke:[{stroke:[`none`,...M()]}],"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 R$(...e){return b4e(t$(e))}function z$(e){return(0,I.jsx)(nle,{"data-slot":`dropdown-menu`,...e})}function B$(e){return(0,I.jsx)(rle,{"data-slot":`dropdown-menu-trigger`,...e})}function V$({className:e,sideOffset:t=4,...n}){return(0,I.jsx)(ile,{children:(0,I.jsx)(ale,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:R$(`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 H$({className:e,inset:t,variant:n=`default`,...r}){return(0,I.jsx)(sle,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:R$(`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 U$({className:e,inset:t,...n}){return(0,I.jsx)(ole,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:R$(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function W$({className:e,...t}){return(0,I.jsx)(dle,{"data-slot":`dropdown-menu-separator`,className:R$(`bg-border -mx-1 my-1 h-px`,e),...t})}function x4e(e){return(0,I.jsx)(cle,{"data-slot":`dropdown-menu-radio-group`,...e})}function G$({className:e,children:t,...n}){return(0,I.jsxs)(lle,{"data-slot":`dropdown-menu-radio-item`,className:R$(`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,I.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(ule,{children:(0,I.jsx)(Cee,{className:`size-2 fill-current`})})}),t]})}function K$({...e}){return(0,I.jsx)(CT,{"data-slot":`popover`,...e})}function q$({...e}){return(0,I.jsx)(wT,{"data-slot":`popover-trigger`,...e})}function J$({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,I.jsx)(TT,{children:(0,I.jsx)(ET,{"data-slot":`popover-content`,align:t,sideOffset:n,className:R$(`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 Y$=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,X$=t$,Z$=(e,t)=>n=>{if(t?.variants==null)return X$(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=Y$(t)||Y$(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 X$(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)},Q$=Z$(`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,I.jsx)(r?Cy:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:R$(Q$({variant:t,size:n,className:e})),...i})}function $$({className:e,type:t,...n}){return(0,I.jsx)(`input`,{type:t,"data-slot":`input`,className:R$(`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 e1({...e}){return(0,I.jsx)(Wx,{"data-slot":`alert-dialog`,...e})}function S4e({...e}){return(0,I.jsx)(Gx,{"data-slot":`alert-dialog-portal`,...e})}function C4e({className:e,...t}){return(0,I.jsx)(Kx,{"data-slot":`alert-dialog-overlay`,className:R$(`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 t1({className:e,...t}){return(0,I.jsxs)(S4e,{children:[(0,I.jsx)(C4e,{}),(0,I.jsx)(qx,{"data-slot":`alert-dialog-content`,className:R$(`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 n1({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:R$(`flex flex-col gap-1.5`,e),...t})}function r1({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:R$(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function i1({className:e,...t}){return(0,I.jsx)(Xx,{"data-slot":`alert-dialog-title`,className:R$(`text-base font-medium text-foreground`,e),...t})}function a1({className:e,...t}){return(0,I.jsx)(Zx,{"data-slot":`alert-dialog-description`,className:R$(`text-sm text-muted-foreground`,e),...t})}function o1({className:e,...t}){return(0,I.jsx)(Jx,{className:R$(Q$(),e),...t})}function s1({className:e,...t}){return(0,I.jsx)(Yx,{className:R$(Q$({variant:`outline`}),e),...t})}function c1({...e}){return(0,I.jsx)(xx,{"data-slot":`dialog`,...e})}function w4e({...e}){return(0,I.jsx)(Sx,{"data-slot":`dialog-portal`,...e})}function T4e({className:e,...t}){return(0,I.jsx)(Cx,{"data-slot":`dialog-overlay`,className:R$(`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 l1({className:e,children:t,showCloseButton:n=!0,...r}){return(0,I.jsxs)(w4e,{children:[(0,I.jsx)(T4e,{}),(0,I.jsxs)(wx,{"data-slot":`dialog-content`,className:R$(`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,I.jsx)(Dx,{"data-slot":`dialog-close`,asChild:!0,children:(0,I.jsxs)(X,{variant:`ghost`,size:`icon-sm`,className:`absolute top-3 right-3`,children:[(0,I.jsx)(Gm,{}),(0,I.jsx)(`span`,{className:`sr-only`,children:VQ()})]})})]})]})}function u1({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`dialog-header`,className:R$(`flex flex-col gap-1.5 pr-6`,e),...t})}function d1({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`dialog-footer`,className:R$(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function f1({className:e,...t}){return(0,I.jsx)(Tx,{"data-slot":`dialog-title`,className:R$(`text-base font-medium text-foreground`,e),...t})}function p1({className:e,...t}){return(0,I.jsx)(Ex,{"data-slot":`dialog-description`,className:R$(`text-sm text-muted-foreground`,e),...t})}var m1=N.createContext(null);function E4e({children:e}){let[t,n]=N.useState(null),r=N.useRef(null),i=N.useRef(null),[a,o]=N.useState(``),s=N.useCallback(e=>{let t=r.current;r.current=null,n(null),t&&t(e)},[]),c=N.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,I.jsxs)(m1.Provider,{value:c,children:[e,(0,I.jsx)(e1,{open:l,onOpenChange:e=>{e||s(!1)},children:l?(0,I.jsxs)(t1,{onOpenAutoFocus:d?m:void 0,...t.opts.description?{}:{"aria-describedby":void 0},children:[(0,I.jsxs)(n1,{children:[(0,I.jsx)(i1,{children:t.opts.title}),t.opts.description?(0,I.jsx)(a1,{children:t.opts.description}):null]}),d?(0,I.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[`Pour confirmer, saisissez`,` `,(0,I.jsxs)(`span`,{className:`font-medium text-foreground`,children:[`« `,d,` »`]}),` `,`ci-dessous.`]}),(0,I.jsx)($$,{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,I.jsxs)(r1,{children:[(0,I.jsx)(s1,{onClick:()=>s(!1),children:t.opts.cancelLabel??`Annuler`}),(0,I.jsx)(X,{variant:t.opts.destructive?`destructive`:`default`,disabled:!f,onClick:()=>s(!0),children:t.opts.confirmLabel??`Supprimer`})]})]}):null}),(0,I.jsx)(c1,{open:u,onOpenChange:e=>{e||s(null)},children:u?(0,I.jsxs)(l1,{onOpenAutoFocus:m,...t.opts.description?{}:{"aria-describedby":void 0},children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:t.opts.title}),t.opts.description?(0,I.jsx)(p1,{children:t.opts.description}):null]}),(0,I.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[t.opts.label?(0,I.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t.opts.label}):null,(0,I.jsx)($$,{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,I.jsxs)(d1,{children:[(0,I.jsx)(X,{variant:`outline`,onClick:()=>s(null),children:t.opts.cancelLabel??`Annuler`}),(0,I.jsx)(X,{disabled:!p,onClick:()=>s(a.trim()),children:t.opts.confirmLabel??`Valider`})]})]}):null})]})}function h1(){let e=N.useContext(m1);if(!e)throw Error(`useConfirm/usePrompt must be used within <DialogsProvider>`);return e}function g1(){return h1().confirm}function _1(){return h1().prompt}var v1=N.createContext(null),D4e=6e3;function y1(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return String(e)}catch{return`Erreur inconnue`}}function O4e({children:e}){let[t,n]=N.useState([]),r=N.useRef(0),i=N.useRef(new Map),a=N.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=N.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),D4e);i.current.set(t,s)},[a]);N.useEffect(()=>{let e=i.current;return()=>{for(let t of e.values())window.clearTimeout(t);e.clear()}},[]);let s=N.useMemo(()=>({toast:o,error:(e,t)=>o({variant:`error`,title:e,description:t===void 0?void 0:y1(t)}),success:(e,t)=>o({variant:`success`,title:e,description:t})}),[o]);return(0,I.jsxs)(v1.Provider,{value:s,children:[e,(0,I.jsx)(`div`,{className:`oc-toast__viewport`,role:`region`,"aria-label":`Notifications`,children:t.map(e=>(0,I.jsxs)(`div`,{className:R$(`oc-toast`,`oc-toast--${e.variant}`),role:e.variant===`error`?`alert`:`status`,children:[(0,I.jsxs)(`div`,{className:`oc-toast__body`,children:[(0,I.jsx)(`div`,{className:`oc-toast__title`,children:e.title}),e.description?(0,I.jsx)(`div`,{className:`oc-toast__desc`,children:e.description}):null]}),(0,I.jsx)(`button`,{type:`button`,className:`oc-toast__close`,"aria-label":`Fermer`,onClick:()=>a(e.id),children:(0,I.jsx)(Gm,{"aria-hidden":!0})})]},e.id))})]})}function b1(){let e=N.useContext(v1);if(!e)throw Error(`useToast must be used within <ToastProvider>`);return e}function k4e(e){return e.kind===`tool`}function A4e(e){return e.kind===`media`}function j4e(e){return e.kind===`file`}function M4e(e){return e.kind===`reasoning`}var N4e=/---[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?=\.[^.]+$|$)/i;function P4e(e){return e.replace(N4e,``)}function F4e(e,t){let n=e.runId??`norun`;return`${e._id}:${n}:${t}`}function I4e(e,t,n){return{toolCallId:F4e(e,t),toolName:n.name,args:n.input??{},result:n.output,argsText:n.input===void 0?void 0:z4e(n.input),phase:typeof n.phase==`string`?n.phase:void 0}}function L4e(e){return e&&P4e(e)}function R4e(e){return e.url?{type:`file`,mimeType:e.mimeType,data:e.url,filename:L4e(e.filename)}:null}function z4e(e){try{return typeof e==`string`?e:JSON.stringify(e,null,2)}catch{return String(e)}}function B4e(e){let t=[],n=[],r=[];return e.parts.forEach((i,a)=>{M4e(i)?t.push({type:`reasoning`,text:i.text}):k4e(i)?n.push(I4e(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(A4e(e)||j4e(e)){let n=R4e(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,attachedDocCount:e.attachedDocCount??0,rawText:e.text}}}}function V4e(e){return typeof e==`string`&&e.toLowerCase().startsWith(`image/`)}var H4e=128*1024;function U4e(e){let t=e-H4e;return t<=0?0:Math.floor(t/4)*3}function W4e(){return`att_${Math.random().toString(36).slice(2)}_${Date.now()}`}function G4e(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 K4e(e,t,n){return{accept:`*`,async add({file:r}){let i=null;try{i=(await e.query(V.bridgeHealth.getBridgeAvailability,n?{chatId:n}:{}))?.maxInboundBytes??null}catch{}let a=i??U4e(26214400);if(n&&!V4e(r.type))try{let t=await e.query(V.bridge.getChatInboundPolicy,{chatId:n});t?.inboundMediaMode===`shared-fs`&&(a=t.sharedFsMaxBytes)}catch{}if(r.size>a){let e=e=>Math.floor(e/1024/1024),n=hfe({size:e(r.size),max:e(a)});throw t?.(n),Error(n)}return{id:W4e(),type:q4e(r.type),name:r.name,contentType:r.type||`application/octet-stream`,file:r,status:{type:`running`,reason:`uploading`,progress:0}}},async send(t){let n=t.file;AO.report(t.id,0,n.size||1);try{let r;try{r=await e.mutation(V.chats.generateUploadUrl,{})}catch(e){throw console.error(`[attach] generateUploadUrl failed:`,e),e}let i=await new Promise((e,i)=>{let a=new XMLHttpRequest;a.open(`POST`,r),a.setRequestHeader(`Content-Type`,n.type||`application/octet-stream`),a.upload.onprogress=e=>{e.lengthComputable&&AO.report(t.id,e.loaded,e.total)},a.onload=()=>{if(a.status>=200&&a.status<300)try{e(JSON.parse(a.responseText).storageId)}catch(e){i(e)}else i(Error(`Upload failed (${a.status})`))},a.onerror=()=>{console.error(`[attach] upload POST failed (network/CORS/CSP)`),i(Error(`Upload failed (network)`))},a.send(n)});return await e.mutation(V.uploads.registerUpload,{storageId:i}),{id:t.id,type:t.type,name:t.name,contentType:t.contentType,status:{type:`complete`},content:[{type:`text`,text:n.name}],convex:{storageId:i,filename:n.name,mimeType:n.type||`application/octet-stream`}}}finally{AO.clear(t.id)}},async remove(){}}}function q4e(e){return e.startsWith(`image/`)?`image`:`document`}function J4e({chatId:e}){let t=Zn(),n=b1(),r=F(V.send.sendMessage).withOptimisticUpdate((e,t)=>{let n={chatId:t.chatId},r=e.getQuery(V.messages.listByChat,n)??[],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,errorCode:void 0,attachedDocCount:void 0,text:t.text,updatedAt:a,parts:[]};e.setQuery(V.messages.listByChat,n,[...r,o])}),i=P(V.messages.listByChat,e?{chatId:e}:`skip`),a=P(V.messages.getStreamingText,e?{chatId:e}:`skip`),o=(0,N.useMemo)(()=>K4e(t,e=>n.error(e),e),[t,n,e]),s=(0,N.useMemo)(()=>{let e=i??[];if(!a||a.length===0)return e;let t=new Map(a.map(e=>[e.messageId,e.text]));return e.map(e=>e.status===`streaming`&&t.has(e._id)?{...e,text:t.get(e._id)}:e)},[i,a]),c=s.length>0?s[s.length-1].role:null,l=s.some(e=>e.status===`streaming`),[u,d]=(0,N.useState)(null);(0,N.useEffect)(()=>{d(null)},[e]),(0,N.useEffect)(()=>{c===`assistant`&&d(null)},[c,s]),(0,N.useEffect)(()=>{if(u===null)return;let e=window.setTimeout(()=>d(null),12e4);return()=>window.clearTimeout(e)},[u]);let f=u!==null||l,p=(0,N.useMemo)(()=>({messages:s,isRunning:f,convertMessage:B4e,onNew:async t=>{if(!e)throw Error(`No chat selected`);let n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(``),i=G4e(t.attachments).map(e=>({storageId:e.storageId,filename:e.filename,mimeType:e.mimeType}));d(Date.now());try{await r({chatId:e,text:n,clientMessageId:crypto.randomUUID(),attachments:i})}catch(e){throw d(null),e}},adapters:{attachments:o}}),[s,f,e,r,o]),m=(0,N.useMemo)(()=>({begin:()=>d(Date.now()),cancel:()=>d(null)}),[]),h=(0,N.useCallback)(async t=>{let i=t.trim();if(!e||i===``)return!1;try{return await r({chatId:e,text:t,clientMessageId:crypto.randomUUID()}),!0}catch(e){return n.error(e?.message?.includes(`QUEUE_FULL`)?BJ():UJ()),!1}},[e,r,n]);return{runtime:hv(p),turnGate:m,queueSend:h}}function x1(e,{key:t,value:n}){let r=e.getQuery(V.me.getMe,{host:xO});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(V.me.getMe,{host:xO},{...r,ui:{...r.ui,effective:i,userOverrides:a}})}function Y4e(e,{messageId:t}){for(let{args:n,value:r}of e.getAllQueries(V.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(V.messages.listByChat,n,r.filter(e=>e._creationTime<a))}}function X4e(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 Z4e(e){return e?e.some(e=>e?.type===`text`&&typeof e.text==`string`&&e.text.trim().length>0):!1}var Q4e={thinking:Rze,generating:Vze,error:Wze,aborted:Xze};function $4e(e,t){let n=X4e(e,t);return n===null?null:{kind:n,label:Q4e[n]()}}var e3e=Z4e;function t3e(e){return e===`stream_orphaned`?qze():e}function n3e(){let e=ZQ(),t=gy(e=>e.metadata?.custom?.status),n=gy(e=>e.metadata?.custom?.runId),r=gy(e=>e.metadata?.custom?.error),i=$4e(t,gy(e=>e3e(e.content))),a=i?.kind===`thinking`,[o,s]=(0,N.useState)(!1);return(0,N.useEffect)(()=>{if(!a){s(!1);return}let e=window.setTimeout(()=>s(!0),6e3);return()=>window.clearTimeout(e)},[a]),i?i.kind===`error`?(0,I.jsxs)(`div`,{className:`oc-error-card`,role:`alert`,title:n?`run ${n}`:void 0,children:[(0,I.jsx)(hm,{size:18,className:`oc-error-card__icon`,"aria-hidden":!0}),(0,I.jsxs)(`div`,{className:`oc-error-card__body`,children:[(0,I.jsx)(`span`,{className:`oc-error-card__title`,children:i.label}),r?(0,I.jsx)(`span`,{className:`oc-error-card__msg`,children:t3e(r)}):null]})]}):(0,I.jsxs)(`div`,{className:`oc-run-status oc-run-status--${i.kind}`,role:`status`,title:n?`run ${n}`:void 0,children:[i.kind===`thinking`?(0,I.jsxs)(`span`,{className:`oc-dots`,"aria-hidden":!0,children:[(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{})]}):i.kind===`generating`?(0,I.jsx)(`span`,{className:`oc-run-status__pulse`,"aria-hidden":!0}):(0,I.jsx)(zee,{size:13,"aria-hidden":!0}),(0,I.jsx)(`span`,{className:`oc-run-status__label`,children:i.kind===`thinking`&&o?T2e(e):i.label})]}):null}var r3e=new Set([`status`,`exitCode`,`durationMs`]);function i3e(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function a3e(e){if(typeof e==`string`)return{kind:`text`,text:e};if(typeof e==`object`&&e&&!Array.isArray(e)){let t=e,n=Object.keys(t);if(typeof t.exitCode==`number`&&n.every(e=>r3e.has(e)))return{kind:`outcome`,status:typeof t.status==`string`?t.status:null,exitCode:t.exitCode,durationMs:typeof t.durationMs==`number`?t.durationMs:null}}return{kind:`json`,text:i3e(e)}}function o3e(e){let t=[(e.exitCode===null?e.status===`completed`:e.exitCode===0)?Kq():Yq()];return e.exitCode!==null&&t.push(Qq({code:e.exitCode})),e.durationMs!==null&&t.push(tJ({ms:e.durationMs})),t.join(` · `)}var s3e=new Set([`complete`,`error`,`aborted`]),c3e=new Set([`completed`,`error`]);function l3e(e,t){if(e.length===0)return!1;if(t===`streaming`)return!0;if(t!==void 0&&s3e.has(t))return!1;let n=e[e.length-1];return n.phase!==void 0&&c3e.has(n.phase)?!1:n.result===void 0||n.result===null}var u3e=[`command`,`query`,`url`,`path`,`pattern`,`file`,`cmd`,`prompt`];function d3e(e,t){let n=``;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e;for(let e of u3e){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 f3e(e,t){let n=e.length,r=n===1?Bq({count:n}):Uq({count:n});return{count:n,running:l3e(e,t),label:r}}function S1({text:e}){let[t,n]=(0,N.useState)(!1);return(0,I.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,I.jsx)(um,{size:13,"aria-hidden":!0}):(0,I.jsx)(_m,{size:13,"aria-hidden":!0})})}function p3e(e,t){let n=typeof e==`string`?e:void 0;return n===`error`?`error`:t||n===`completed`?`completed`:`running`}function m3e(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function h3e({toolName:e,args:t,argsText:n,result:r,status:i}){let a=r!=null,o=p3e(i?.type,a),s=n??m3e(t),c=d3e(t,n),l=a?a3e(r):null,u=o===`running`?Cm:o===`error`?hm:xee;return(0,I.jsxs)(`details`,{className:`oc-tool oc-tool--${o}`,children:[(0,I.jsxs)(`summary`,{className:`oc-tool__header`,children:[(0,I.jsx)(u,{className:`oc-tool__status${o===`running`?` oc-tool__status--spin`:``}`,size:14,"aria-hidden":!0}),(0,I.jsx)(`span`,{className:`oc-tool__name`,children:e}),c?(0,I.jsx)(`span`,{className:`oc-tool__preview`,title:c,children:c}):null,(0,I.jsx)(`span`,{className:`oc-tool__phase`,children:o}),(0,I.jsx)(fm,{size:15,className:`oc-tool__chevron`,"aria-hidden":!0})]}),(0,I.jsxs)(`div`,{className:`oc-tool__body`,children:[s?(0,I.jsxs)(`details`,{className:`oc-tool__io`,children:[(0,I.jsx)(`summary`,{children:`input`}),(0,I.jsxs)(`div`,{className:`oc-tool__prewrap`,children:[(0,I.jsx)(`pre`,{className:`oc-tool__pre`,children:s}),(0,I.jsx)(S1,{text:s})]})]}):null,l&&l.kind===`outcome`?(0,I.jsxs)(`div`,{className:`oc-tool__outcome`,children:[(0,I.jsx)(`span`,{className:`oc-tool__outcome-label`,children:o3e(l)}),(0,I.jsx)(`span`,{className:`oc-tool__outcome-note`,children:iJ()})]}):l?(0,I.jsxs)(`details`,{className:`oc-tool__io`,open:!0,children:[(0,I.jsx)(`summary`,{children:`output`}),(0,I.jsxs)(`div`,{className:`oc-tool__prewrap`,children:[(0,I.jsx)(`pre`,{className:`oc-tool__pre`,children:l.text}),(0,I.jsx)(S1,{text:l.text})]})]}):null]})]})}function g3e(){let e=gy(e=>e.metadata?.custom?.toolParts),t=gy(e=>e.metadata?.custom?.status),[n,r]=(0,N.useState)(!1);if(!e||e.length===0)return null;let i=n,a=f3e(e,t);return(0,I.jsxs)(`div`,{className:`oc-toolact${i?` is-open`:``}`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`oc-toolact__summary`,"aria-expanded":i,title:i?gJ():pJ(),onClick:()=>r(!i),children:[(0,I.jsx)(Wm,{size:13,className:`oc-toolact__icon`,"aria-hidden":!0}),(0,I.jsx)(`span`,{className:`oc-toolact__label`,children:a.label}),a.running?(0,I.jsxs)(`span`,{className:`oc-toolact__state`,children:[(0,I.jsx)(Cm,{size:12,className:`oc-toolact__spin`,"aria-hidden":!0}),sJ()]}):(0,I.jsxs)(`span`,{className:`oc-toolact__state oc-toolact__state--done`,children:[(0,I.jsx)(um,{size:12,"aria-hidden":!0}),(0,I.jsx)(`span`,{className:`oc-sr-only`,children:uJ()})]}),(0,I.jsx)(fm,{size:14,className:`oc-toolact__chevron`,"aria-hidden":!0})]}),i?(0,I.jsx)(`div`,{className:`oc-toolact__detail`,children:e.map(e=>(0,I.jsx)(h3e,{toolName:e.toolName,args:e.args,argsText:e.argsText,result:e.result,status:e.phase?{type:e.phase}:void 0},e.toolCallId))}):null]})}function C1({className:e,...t}){return(0,I.jsx)(sS,{"data-slot":`checkbox`,className:R$(`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,I.jsx)(lS,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center text-current`,children:t.checked===`indeterminate`?(0,I.jsx)(Om,{className:`size-3.5`}):(0,I.jsx)(um,{className:`size-3.5`})})})}function w1(e,t){return t===`memory`?`memory`:e.context===!0||!e.file_name?`context`:`document`}function T1(e){let t={memory:0,documents:0,context:0};for(let n of e)for(let e of n.items){let r=w1(e,n.group);r===`memory`?t.memory+=1:r===`document`?t.documents+=1:t.context+=1}return t}function _3e(e){return e.memory+e.documents+e.context>0}function E1(e){let t=[];return e.memory>0&&t.push(e.memory===1?LW():BW({count:e.memory})),e.documents>0&&t.push(e.documents===1?UW():KW({count:e.documents})),e.context>0&&t.push(e.context===1?iG():sG({count:e.context})),t.join(` · `)}function D1(e){return e.title??e.file_name??e.id??e.type??gG()}function O1(e){return e.title&&e.file_name?e.file_name:void 0}function v3e(e){return e.file_name??D1(e)}function k1(e){let t=[];return e.type&&D1(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(pG({score:e.score.toFixed(2)})),t}function A1(e,t){let n=[];return e.forEach((e,r)=>{e.group===t&&e.items.forEach((t,i)=>{n.push({key:`${e.pluginId}|${e.group}|${t.id??t.file_name??`?`}|${r}.${i}`,group:e.group,pluginId:e.pluginId,source:e.source,item:t})})}),n.sort((e,t)=>(t.item.score??0)-(e.item.score??0))}function j1(e,t){let n=t.trim().toLowerCase();return n===``?!0:[P1(e),e.item.file_name??``,e.item.text??``,...k1(e.item)].join(` `).toLowerCase().includes(n)}function M1(e){return w1(e.item,e.group)===`document`}function N1(e){return w1(e.item,e.group)===`context`}function P1(e){return N1(e)?uG():D1(e.item)}var F1=(0,N.createContext)(null),y3e=[];function b3e(){let e=gy(e=>e.metadata?.custom?.provenanceParts??y3e),t=gy(e=>e.metadata?.custom?.messageId),n=gy(e=>e.metadata?.custom?.attachedDocCount??0),r=(0,N.useContext)(F1),i=T1(e);if(e.length===0||!_3e(i))return null;let a=r?.activeMessageId===t&&t!==void 0;return(0,I.jsxs)(`button`,{type:`button`,className:`oc-sources-trigger${a?` is-active`:``}`,onClick:()=>t&&r?.openFor(t),"aria-haspopup":`dialog`,"aria-expanded":a,"aria-label":SG(),children:[(0,I.jsx)(bm,{size:13,className:`oc-sources-trigger__icon`,"aria-hidden":!0}),(0,I.jsx)(`span`,{className:`oc-sources-trigger__label`,children:PW()}),(0,I.jsx)(`span`,{className:`oc-sources-trigger__counts`,children:E1(i)}),n>0?(0,I.jsxs)(`span`,{className:`oc-sources-trigger__attached`,title:UG({count:n}),children:[(0,I.jsx)(vm,{size:12,"aria-hidden":!0}),n]}):null,(0,I.jsx)(fm,{size:14,className:`oc-sources-trigger__chev`,"aria-hidden":!0})]})}function I1({messageId:e,onClose:t}){let n=P(V.messages.getProvenanceParts,{messageId:e}),r=(0,N.useMemo)(()=>n??[],[n]),i=P(V.agents.documentaryAvailable,{}),a=P(V.documentAttachments.getDocumentAttachments,{sourceMessageId:e}),o=F(V.documentAttachments.attachDocuments),s=b1(),c=(0,N.useMemo)(()=>{let e=new Map;for(let t of a??[])e.set(t.entryKey,t);return e},[a]),l=(a??[]).some(e=>e.status===`pending`),[u,d]=(0,N.useState)(``),[f,p]=(0,N.useState)(!1),[m,h]=(0,N.useState)(!1),[g,_]=(0,N.useState)(!1),[v,y]=(0,N.useState)(new Set);(0,N.useEffect)(()=>{d(``),p(!1),h(!1),_(!1),y(new Set)},[e]);let b=(0,N.useMemo)(()=>A1(r,`documents`).filter(e=>M1(e)&&j1(e,u)),[r,u]),x=(0,N.useMemo)(()=>A1(r,`documents`).filter(e=>N1(e)&&j1(e,u)),[r,u]),S=(0,N.useMemo)(()=>A1(r,`memory`).filter(e=>j1(e,u)),[r,u]),C=T1(r),w=e=>y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=(e,t)=>y(n=>{let r=new Set(n);for(let n of e)t?r.add(n):r.delete(n);return r}),E=(0,N.useMemo)(()=>A1(r,`documents`).filter(e=>M1(e)&&v.has(e.key)),[r,v]),D=i!=null&&E.length>0&&!l;async function O(){if(D)try{await o({sourceMessageId:e,items:E.map(e=>({entryKey:e.key,reference:v3e(e.item)}))}),s.success(tK())}catch(e){let t=y1(e);t.includes(`fetch_in_flight`)?s.error(QG()):t.includes(`no_documentary_agent`)?s.error(YG()):s.error(iK(),e)}}let ee=n===void 0;return(0,I.jsxs)(`div`,{className:`oc-sources-panel`,children:[(0,I.jsxs)(`div`,{className:`oc-sources-panel__head`,children:[(0,I.jsxs)(`div`,{className:`oc-sources-panel__heading`,children:[(0,I.jsx)(`h2`,{className:`oc-sources-panel__title`,children:yG()}),(0,I.jsx)(`p`,{className:`oc-sources-panel__sub`,children:E1(C)})]}),(0,I.jsx)(`button`,{type:`button`,className:`oc-iconbtn`,onClick:t,"aria-label":SK(),title:SK(),children:(0,I.jsx)(Gm,{size:16,"aria-hidden":!0})})]}),(0,I.jsxs)(`div`,{className:`oc-sources-panel__search`,children:[(0,I.jsx)(Fm,{size:15,"aria-hidden":!0}),(0,I.jsx)($$,{value:u,onChange:e=>d(e.target.value),placeholder:TG(),"aria-label":TG()})]}),(0,I.jsx)(`div`,{className:`oc-sources-panel__body`,children:ee?(0,I.jsx)(`p`,{className:`oc-sources-panel__empty`,children:(0,I.jsx)(Cm,{size:14,className:`oc-iconbtn__spin`,"aria-hidden":!0})}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(L1,{icon:(0,I.jsx)(bm,{size:14,"aria-hidden":!0}),label:QW(),count:b.length,expanded:f,onToggle:()=>p(e=>!e),entries:b,selectable:!0,selected:v,onToggle1:w,onToggleAll:e=>T(b.map(e=>e.key),e),attachmentByKey:c}),(0,I.jsx)(L1,{icon:(0,I.jsx)(jm,{size:14,"aria-hidden":!0}),label:tG(),count:x.length,expanded:m,onToggle:()=>h(e=>!e),entries:x,selectable:!1,selected:v,onToggle1:w,onToggleAll:e=>T(x.map(e=>e.key),e),attachmentByKey:c}),(0,I.jsx)(L1,{icon:(0,I.jsx)(yee,{size:14,"aria-hidden":!0}),label:YW(),count:S.length,expanded:g,onToggle:()=>_(e=>!e),entries:S,selectable:!1,selected:v,onToggle1:w,onToggleAll:e=>T(S.map(e=>e.key),e),attachmentByKey:c}),b.length===0&&x.length===0&&S.length===0?(0,I.jsx)(`p`,{className:`oc-sources-panel__empty`,children:OG()}):null]})}),E.length>0?(0,I.jsxs)(`div`,{className:`oc-sources-panel__actions`,children:[(0,I.jsxs)(`div`,{className:`oc-sources-panel__actrow`,children:[(0,I.jsx)(`span`,{className:`oc-sources-panel__selcount`,children:PG({count:E.length})}),(0,I.jsxs)(X,{variant:`outline`,size:`sm`,disabled:!D,onClick:()=>void O(),children:[l?(0,I.jsx)(Cm,{size:14,className:`oc-iconbtn__spin`,"aria-hidden":!0}):(0,I.jsx)(Ree,{size:14,"aria-hidden":!0}),LG()]})]}),(0,I.jsx)(`p`,{className:`oc-sources-panel__acthint`,children:i==null?YG():l?QG():BG()})]}):null]})}function L1({icon:e,label:t,count:n,expanded:r,onToggle:i,entries:a,selectable:o,selected:s,onToggle1:c,onToggleAll:l,attachmentByKey:u}){if(n===0)return null;let d=a.every(e=>s.has(e.key));return(0,I.jsxs)(`section`,{className:`oc-srcsec${r?` is-open`:``}`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`oc-srcsec__head`,"aria-expanded":r,onClick:i,children:[r?(0,I.jsx)(dm,{size:14,"aria-hidden":!0}):(0,I.jsx)(fm,{size:14,"aria-hidden":!0}),e,(0,I.jsx)(`span`,{className:`oc-srcsec__label`,children:t}),(0,I.jsx)(`span`,{className:`oc-srcsec__count`,children:n})]}),r?(0,I.jsxs)(`div`,{className:`oc-srcsec__body`,children:[o?(0,I.jsxs)(`label`,{className:`oc-srcsec__all`,children:[(0,I.jsx)(C1,{checked:d,onCheckedChange:e=>l(e===!0)}),(0,I.jsx)(`span`,{children:jG()})]}):null,a.map(e=>(0,I.jsx)(x3e,{entry:e,selectable:o,selected:s.has(e.key),onToggle:()=>c(e.key),attachment:u.get(e.key)},e.key))]}):null]})}function x3e({entry:e,selectable:t,selected:n,onToggle:r,attachment:i}){let[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),[c,l]=(0,N.useState)(!1),{item:u}=e;(0,N.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>l(e.scrollHeight>e.clientHeight+1);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[u.text]);let d=k1(u),f=typeof u.score==`number`?Math.max(0,Math.min(1,u.score)):null,p=M1(e);return(0,I.jsxs)(`div`,{className:`oc-srccard${t&&n?` is-selected`:``}`,children:[t?(0,I.jsx)(`label`,{className:`oc-srccard__pick`,children:(0,I.jsx)(C1,{checked:n,onCheckedChange:r})}):null,(0,I.jsxs)(`div`,{className:`oc-srccard__body`,children:[(0,I.jsx)(`div`,{className:`oc-srccard__title`,children:P1(e)}),p&&O1(e.item)?(0,I.jsx)(`div`,{className:`oc-srccard__subid`,title:O1(e.item),children:O1(e.item)}):null,d.length>0||f!==null?(0,I.jsxs)(`div`,{className:`oc-srccard__meta`,children:[d.map(e=>(0,I.jsx)(`span`,{className:`oc-srccard__chip`,children:e},e)),f===null?null:(0,I.jsx)(`span`,{className:`oc-srccard__relev`,title:pG({score:f.toFixed(2)}),children:(0,I.jsx)(`span`,{className:`oc-srccard__relev-track`,"aria-hidden":!0,children:(0,I.jsx)(`span`,{className:`oc-srccard__relev-fill`,style:{width:`${Math.round(f*100)}%`}})})})]}):null,u.text?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`blockquote`,{ref:s,className:`oc-srccard__excerpt${a?` is-full`:``}`,children:u.text}),c||a?(0,I.jsx)(`button`,{type:`button`,className:`oc-srccard__more`,onClick:()=>o(e=>!e),children:a?yK():gK()}):null]}):null,p?(0,I.jsx)(S3e,{attachment:i}):null]})]})}function S3e({attachment:e}){if(e?.status===`ready`&&e.url){let t=e.filename??uK();return(0,I.jsxs)(`a`,{className:`oc-srccard__origin oc-srccard__origin--ready`,href:e.url,download:e.filename??void 0,target:`_blank`,rel:`noreferrer`,title:uK(),children:[(0,I.jsx)(vm,{size:13,"aria-hidden":!0}),(0,I.jsx)(`span`,{className:`oc-srccard__origin-name`,children:t})]})}return e?.status===`pending`?(0,I.jsxs)(`div`,{className:`oc-srccard__origin oc-srccard__origin--pending`,children:[(0,I.jsx)(Cm,{size:13,"aria-hidden":!0}),sK()]}):e?.status===`not_found`||e?.status===`failed`?(0,I.jsxs)(`div`,{className:`oc-srccard__origin oc-srccard__origin--missing`,"aria-disabled":!0,children:[(0,I.jsx)(Gm,{size:13,"aria-hidden":!0}),pK()]}):(0,I.jsxs)(`div`,{className:`oc-srccard__origin`,"aria-disabled":!0,children:[(0,I.jsx)(vm,{size:13,"aria-hidden":!0}),KG()]})}var C3e=`oc.sidebar.width`,R1=`oc.sidebar.collapsed`,z1=200,B1=520,w3e=260,V1=`(max-width: 767px)`;function H1(){let[e,t]=(0,N.useState)(()=>typeof window<`u`&&window.matchMedia(V1).matches);return(0,N.useEffect)(()=>{let e=window.matchMedia(V1),n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function U1(e){let{storageKey:t,defaultWidth:n,min:r,max:i,edge:a}=e,o=(0,N.useCallback)(e=>Math.min(i,Math.max(r,e)),[r,i]),[s,c]=(0,N.useState)(()=>{let e=Number(localStorage.getItem(t));return e?Math.min(i,Math.max(r,e)):n});(0,N.useEffect)(()=>{localStorage.setItem(t,String(s))},[t,s]);let l=(0,N.useRef)(!1);return{width:s,startResize:(0,N.useCallback)(e=>{e.preventDefault(),l.current=!0;let t=e.clientX,n=s,r=a===`left`?1:-1,i=e=>{l.current&&c(o(n+r*(e.clientX-t)))},u=()=>{l.current=!1,window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[s,a,o]),setWidth:c}}function T3e(){let{width:e,startResize:t}=U1({storageKey:C3e,defaultWidth:w3e,min:z1,max:B1,edge:`left`}),[n,r]=(0,N.useState)(()=>localStorage.getItem(R1)===`1`),i=H1();return(0,N.useEffect)(()=>{localStorage.setItem(R1,n?`1`:`0`)},[n]),(0,N.useEffect)(()=>{i&&r(!0)},[i]),{width:e,collapsed:n,toggleCollapsed:(0,N.useCallback)(()=>r(e=>!e),[]),collapse:(0,N.useCallback)(()=>r(!0),[]),startResize:t,isMobile:i,MIN_WIDTH:z1,MAX_WIDTH:B1}}function W1({...e}){return(0,I.jsx)(xx,{"data-slot":`sheet`,...e})}function E3e({...e}){return(0,I.jsx)(Sx,{"data-slot":`sheet-portal`,...e})}function D3e({className:e,...t}){return(0,I.jsx)(Cx,{"data-slot":`sheet-overlay`,className:R$(`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 G1({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,I.jsxs)(E3e,{children:[(0,I.jsx)(D3e,{}),(0,I.jsxs)(wx,{"data-slot":`sheet-content`,"data-side":n,className:R$(`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,I.jsx)(Dx,{"data-slot":`sheet-close`,asChild:!0,children:(0,I.jsxs)(X,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,I.jsx)(Gm,{}),(0,I.jsx)(`span`,{className:`sr-only`,children:VQ()})]})})]})]})}function K1({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`sheet-header`,className:R$(`flex flex-col gap-0.5 p-4`,e),...t})}function q1({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`sheet-footer`,className:R$(`mt-auto flex flex-col gap-2 p-4`,e),...t})}function J1({className:e,...t}){return(0,I.jsx)(Tx,{"data-slot":`sheet-title`,className:R$(`font-heading text-base font-medium text-foreground`,e),...t})}function Y1({className:e,...t}){return(0,I.jsx)(Ex,{"data-slot":`sheet-description`,className:R$(`text-sm text-muted-foreground`,e),...t})}function O3e({mimeType:e,data:t,filename:n}){let r=e??``,i=t??``,a=n??`attachment`;return i?r.startsWith(`audio/`)?(0,I.jsxs)(`div`,{className:`oc-media oc-media--audio`,children:[(0,I.jsx)(`audio`,{controls:!0,preload:`metadata`,src:i,className:`oc-media__audio`,children:(0,I.jsx)(`a`,{href:i,download:a,children:`Download audio`})}),(0,I.jsx)(`span`,{className:`oc-media__name`,children:a})]}):r.startsWith(`image/`)?(0,I.jsxs)(`figure`,{className:`oc-media oc-media--image`,children:[(0,I.jsx)(`img`,{src:i,alt:a,className:`oc-media__img`,loading:`lazy`}),(0,I.jsx)(`figcaption`,{className:`oc-media__name`,children:a})]}):r.startsWith(`video/`)?(0,I.jsxs)(`div`,{className:`oc-media oc-media--video`,children:[(0,I.jsx)(`video`,{controls:!0,preload:`metadata`,src:i,className:`oc-media__video`}),(0,I.jsx)(`span`,{className:`oc-media__name`,children:a})]}):(0,I.jsxs)(`a`,{className:`oc-media oc-media--file`,href:i,target:`_blank`,rel:`noopener noreferrer`,children:[(0,I.jsx)(`span`,{className:`oc-media__icon`,"aria-hidden":!0,children:`⬇`}),(0,I.jsx)(`span`,{className:`oc-media__name`,children:a})]}):null}var k3e=(e,t)=>typeof e==`string`?e===t:JSON.stringify(e)===JSON.stringify(t),A3e=(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))&&k3e(e.children,t.children)},X1=(e,t)=>A3e(e.node,t.node),j3e=(e={})=>Object.fromEntries(Object.entries(e??{}).map(([e,t])=>{if(!t)return[e,t];let n=t;return[e,(0,N.memo)(({node:e,...t})=>(0,I.jsx)(n,{...t}),X1)]})),Z1=(0,N.createContext)(null),M3e=()=>(0,N.useContext)(Z1)!==null,N3e=(0,N.memo)(({children:e,...t})=>(0,I.jsx)(Z1.Provider,{value:t,children:e}),X1),P3e=({node:e,...t})=>(0,I.jsx)(`pre`,{...t}),F3e=({node:e,...t})=>(0,I.jsx)(`code`,{...t}),Q1=({node:e,components:{Pre:t,Code:n},code:r})=>(0,I.jsx)(t,{children:(0,I.jsx)(n,{node:e,children:r})}),I3e=()=>null,L3e=({node:e,components:{Pre:t,Code:n,SyntaxHighlighter:r,CodeHeader:i},language:a,code:o})=>{let s=(0,N.useMemo)(()=>({Pre:t,Code:n}),[t,n]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(i,{node:e,language:a,code:o}),(0,I.jsx)(a?r:Q1,{node:e,components:s,language:a??`unknown`,code:o})]})},$1=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),e0=({className:e,...t})=>({className:n,...r})=>({className:(0,$1.default)(e,n),...t,...r}),R3e=({node:e,components:{Pre:t,Code:n,SyntaxHighlighter:r,CodeHeader:i},componentsByLanguage:a={},children:o,...s})=>{let c=e0((0,N.useContext)(Z1)),l=Py(e=>(0,I.jsx)(t,{...c(e)})),u=e0(s),d=Py(e=>(0,I.jsx)(n,{...u(e)})),f=/language-(\w+)/.exec(s.className||``)?.[1]??``;return typeof o==`string`?(0,I.jsx)(L3e,{node:e,components:{Pre:l,Code:d,SyntaxHighlighter:a[f]?.SyntaxHighlighter??r,CodeHeader:a[f]?.CodeHeader??i},language:f||`unknown`,code:o}):(0,I.jsx)(Q1,{node:e,components:{Pre:l,Code:d},code:o})},z3e=(0,N.memo)(({node:e,components:t,componentsByLanguage:n,...r})=>M3e()?(0,I.jsx)(R3e,{node:e,components:t,componentsByLanguage:n,...r}):(0,I.jsx)(t.Code,{...r}),(e,t)=>e.components===t.components&&e.componentsByLanguage===t.componentsByLanguage&&X1(e,t));function B3e(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var V3e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,H3e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,U3e={};function t0(e,t){return((t||U3e).jsx?H3e:V3e).test(e)}var W3e=/[ \t\n\f\r]/g;function G3e(e){return typeof e==`object`?e.type===`text`?n0(e.value):!1:n0(e)}function n0(e){return e.replace(W3e,``)===``}var r0=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};r0.prototype.normal={},r0.prototype.property={},r0.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 r0(n,r,t)}function a0(e){return e.toLowerCase()}var o0=class{constructor(e,t){this.attribute=t,this.property=e}};o0.prototype.attribute=``,o0.prototype.booleanish=!1,o0.prototype.boolean=!1,o0.prototype.commaOrSpaceSeparated=!1,o0.prototype.commaSeparated=!1,o0.prototype.defined=!1,o0.prototype.mustUseProperty=!1,o0.prototype.number=!1,o0.prototype.overloadedBoolean=!1,o0.prototype.property=``,o0.prototype.spaceSeparated=!1,o0.prototype.space=void 0;var s0=s({boolean:()=>c0,booleanish:()=>l0,commaOrSpaceSeparated:()=>p0,commaSeparated:()=>f0,number:()=>Z,overloadedBoolean:()=>u0,spaceSeparated:()=>d0}),K3e=0,c0=m0(),l0=m0(),u0=m0(),Z=m0(),d0=m0(),f0=m0(),p0=m0();function m0(){return 2**++K3e}var h0=Object.keys(s0),g0=class extends o0{constructor(e,t,n,r){let i=-1;if(super(e,t),_0(this,`space`,r),typeof n==`number`)for(;++i<h0.length;){let e=h0[i];_0(this,h0[i],(n&s0[e])===s0[e])}}};g0.prototype.defined=!0;function _0(e,t,n){n&&(e[t]=n)}function v0(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new g0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[a0(r)]=r,n[a0(a.attribute)]=r}return new r0(t,n,e.space)}var y0=v0({properties:{ariaActiveDescendant:null,ariaAtomic:l0,ariaAutoComplete:null,ariaBusy:l0,ariaChecked:l0,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:d0,ariaCurrent:null,ariaDescribedBy:d0,ariaDetails:null,ariaDisabled:l0,ariaDropEffect:d0,ariaErrorMessage:null,ariaExpanded:l0,ariaFlowTo:d0,ariaGrabbed:l0,ariaHasPopup:null,ariaHidden:l0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:d0,ariaLevel:Z,ariaLive:null,ariaModal:l0,ariaMultiLine:l0,ariaMultiSelectable:l0,ariaOrientation:null,ariaOwns:d0,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:l0,ariaReadOnly:l0,ariaRelevant:null,ariaRequired:l0,ariaRoleDescription:d0,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:l0,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 b0(e,t){return t in e?e[t]:t}function x0(e,t){return b0(e,t.toLowerCase())}var q3e=v0({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:f0,acceptCharset:d0,accessKey:d0,action:null,allow:null,allowFullScreen:c0,allowPaymentRequest:c0,allowUserMedia:c0,alpha:c0,alt:null,as:null,async:c0,autoCapitalize:null,autoComplete:d0,autoFocus:c0,autoPlay:c0,blocking:d0,capture:null,charSet:null,checked:c0,cite:null,className:d0,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:l0,controls:c0,controlsList:d0,coords:Z|f0,crossOrigin:null,data:null,dateTime:null,decoding:null,default:c0,defer:c0,dir:null,dirName:null,disabled:c0,download:u0,draggable:l0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:c0,formTarget:null,headers:d0,height:Z,hidden:u0,high:Z,href:null,hrefLang:null,htmlFor:d0,httpEquiv:d0,id:null,imageSizes:null,imageSrcSet:null,inert:c0,inputMode:null,integrity:null,is:null,isMap:c0,itemId:null,itemProp:d0,itemRef:d0,itemScope:c0,itemType:d0,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:c0,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:c0,muted:c0,name:null,nonce:null,noModule:c0,noValidate:c0,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:c0,optimum:Z,pattern:null,ping:d0,placeholder:null,playsInline:c0,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:c0,referrerPolicy:null,rel:d0,required:c0,reversed:c0,rows:Z,rowSpan:Z,sandbox:d0,scope:null,scoped:c0,seamless:c0,selected:c0,shadowRootClonable:c0,shadowRootCustomElementRegistry:c0,shadowRootDelegatesFocus:c0,shadowRootMode:null,shadowRootSerializable:c0,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:l0,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:c0,useMap:null,value:l0,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:d0,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:c0,declare:c0,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:c0,noHref:c0,noShade:c0,noWrap:c0,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:l0,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:c0,disablePictureInPicture:c0,disableRemotePlayback:c0,exportParts:f0,part:d0,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:x0}),J3e=v0({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:p0,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:d0,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:c0,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:f0,g2:f0,glyphName:f0,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:p0,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:d0,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:p0,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:p0,rev:p0,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:p0,requiredFeatures:p0,requiredFonts:p0,requiredFormats:p0,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:p0,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:p0,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:p0,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:b0}),S0=v0({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()}}),C0=v0({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:x0}),w0=v0({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Y3e={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`},X3e=/[A-Z]/g,T0=/-[a-z]/g,Z3e=/^data[-\w.:]+$/i;function Q3e(e,t){let n=a0(t),r=t,i=o0;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Z3e.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(T0,e6e);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!T0.test(e)){let n=e.replace(X3e,$3e);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=g0}return new i(r,t)}function $3e(e){return`-`+e.toLowerCase()}function e6e(e){return e.charAt(1).toUpperCase()}var t6e=i0([y0,q3e,S0,C0,w0],`html`),E0=i0([y0,J3e,S0,C0,w0],`svg`);function n6e(e){return e.join(` `).trim()}var r6e=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=`
|
|
131
|
+
`,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})),i6e=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(r6e());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}})),a6e=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))}})),o6e=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(i6e()),r=a6e();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})),D0=k0(`end`),O0=k0(`start`);function k0(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 s6e(e){let t=O0(e),n=D0(e);if(t&&n)return{start:t,end:n}}function A0(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?M0(e.position):`start`in e||`end`in e?M0(e):`line`in e||`column`in e?j0(e):``}function j0(e){return N0(e&&e.line)+`:`+N0(e&&e.column)}function M0(e){return j0(e&&e.start)+`-`+j0(e&&e.end)}function N0(e){return e&&typeof e==`number`?e:1}var P0=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=A0(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}};P0.prototype.file=``,P0.prototype.name=``,P0.prototype.reason=``,P0.prototype.message=``,P0.prototype.stack=``,P0.prototype.column=void 0,P0.prototype.line=void 0,P0.prototype.ancestors=void 0,P0.prototype.cause=void 0,P0.prototype.fatal=void 0,P0.prototype.place=void 0,P0.prototype.ruleId=void 0,P0.prototype.source=void 0;var c6e=u(o6e(),1),F0={}.hasOwnProperty,l6e=new Map,u6e=/[A-Z]/g,d6e=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),f6e=new Set([`td`,`th`]);function p6e(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=x6e(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=b6e(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`?E0:t6e,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=I0(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function I0(e,t,n){if(t.type===`element`)return m6e(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return h6e(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return _6e(e,t,n);if(t.type===`mdxjsEsm`)return g6e(e,t);if(t.type===`root`)return v6e(e,t,n);if(t.type===`text`)return y6e(e,t)}function m6e(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=E0,e.schema=i),e.ancestors.push(t);let a=B0(e,t.tagName,!1),o=S6e(e,t),s=z0(e,t);return d6e.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!G3e(e):!0})),L0(e,o,a,t),R0(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function h6e(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)}V0(e,t.position)}function g6e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);V0(e,t.position)}function _6e(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=E0,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:B0(e,t.name,!0),o=C6e(e,t),s=z0(e,t);return L0(e,o,a,t),R0(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function v6e(e,t,n){let r={};return R0(r,z0(e,t)),e.create(t,e.Fragment,r,n)}function y6e(e,t){return t.value}function L0(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function R0(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function b6e(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 x6e(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=O0(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 S6e(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&F0.call(t.properties,i)){let a=w6e(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&f6e.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 C6e(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 V0(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 V0(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function z0(e,t){let n=[],r=-1,i=e.passKeys?new Map:l6e;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=I0(e,a,o);s!==void 0&&n.push(s)}return n}function w6e(e,t,n){let r=Q3e(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?B3e(n):n6e(n)),r.property===`style`){let t=typeof n==`object`?n:T6e(e,String(n));return e.stylePropertyNameCase===`css`&&(t=E6e(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Y3e[r.property]||r.property:r.attribute,n]}}function T6e(e,t){try{return(0,c6e.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new P0("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 B0(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=t0(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=t0(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return F0.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);V0(e)}function V0(e,t){let n=new P0("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 E6e(e){let t={},n;for(n in e)F0.call(e,n)&&(t[D6e(n)]=e[n]);return t}function D6e(e){let t=e.replace(u6e,O6e);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function O6e(e){return`-`+e.toLowerCase()}var H0={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`]},k6e={};function U0(e,t){let n=t||k6e;return W0(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function W0(e,t,n){if(A6e(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 G0(e.children,t,n)}return Array.isArray(e)?G0(e,t,n):``}function G0(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=W0(e[i],t,n);return r.join(``)}function A6e(e){return!!(e&&typeof e==`object`)}var K0=document.createElement(`i`);function q0(e){let t=`&`+e+`;`;K0.innerHTML=t;let n=K0.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function J0(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 Y0(e,t){return e.length>0?(J0(e,e.length,0,t),e):t}var X0={}.hasOwnProperty;function Z0(e){let t={},n=-1;for(;++n<e.length;)j6e(t,e[n]);return t}function j6e(e,t){let n;for(n in t){let r=(X0.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){X0.call(r,a)||(r[a]=[]);let e=i[a];M6e(r[a],Array.isArray(e)?e:e?[e]:[])}}}function M6e(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);J0(e,0,0,r)}function Q0(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 $0(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var e2=l2(/[A-Za-z]/),t2=l2(/[\dA-Za-z]/),N6e=l2(/[#-'*+\--9=?A-Z^-~]/);function n2(e){return e!==null&&(e<32||e===127)}var r2=l2(/\d/),P6e=l2(/[\dA-Fa-f]/),F6e=l2(/[!-/:-@[-`{-~]/);function i2(e){return e!==null&&e<-2}function a2(e){return e!==null&&(e<0||e===32)}function o2(e){return e===-2||e===-1||e===32}var s2=l2(/\p{P}|\p{S}/u),c2=l2(/\s/);function l2(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function u2(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&t2(e.charCodeAt(n+1))&&t2(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 d2(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return o2(r)?(e.enter(n),s(r)):t(r)}function s(r){return o2(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var I6e={tokenize:L6e};function L6e(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`),d2(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 R6e={tokenize:z6e},f2={tokenize:B6e};function z6e(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 J0(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(f2,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(f2,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++;J0(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 B6e(e,t,n){return d2(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function p2(e){if(e===null||a2(e)||c2(e))return 1;if(s2(e))return 2}function m2(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 h2={name:`attention`,resolveAll:V6e,tokenize:H6e};function V6e(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};g2(d,-c),g2(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=Y0(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Y0(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Y0(l,m2(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Y0(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=Y0(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,J0(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 H6e(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=p2(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=p2(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 g2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var U6e={name:`autolink`,tokenize:W6e};function W6e(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 e2(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||t2(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||t2(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||n2(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):N6e(t)?(e.consume(t),l):n(t)}function u(e){return t2(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||t2(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var _2={partial:!0,tokenize:G6e};function G6e(e,t,n){return r;function r(t){return o2(t)?d2(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||i2(e)?t(e):n(e)}}var v2={continuation:{tokenize:q6e},exit:J6e,name:`blockQuote`,tokenize:K6e};function K6e(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 o2(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function q6e(e,t,n){let r=this;return i;function i(t){return o2(t)?d2(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(v2,t,n)(r)}}function J6e(e){e.exit(`blockQuote`)}var y2={name:`characterEscape`,tokenize:Y6e};function Y6e(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 F6e(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var b2={name:`characterReference`,tokenize:X6e};function X6e(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=t2,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=P6e,u):(e.enter(`characterReferenceValue`),a=7,o=r2,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===t2&&!q0(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 x2={partial:!0,tokenize:Q6e},S2={concrete:!0,name:`codeFenced`,tokenize:Z6e};function Z6e(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`),o2(t)?d2(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||i2(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(x2,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)):o2(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d2(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&&o2(t)?d2(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||i2(t)?e.check(x2,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`),o2(t)?d2(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`),o2(t)?d2(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||i2(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Q6e(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 C2={name:`codeIndented`,tokenize:e8e},$6e={partial:!0,tokenize:t8e};function e8e(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),d2(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($6e,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 t8e(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):d2(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 n8e={name:`codeText`,previous:i8e,resolve:r8e,tokenize:a8e};function r8e(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 i8e(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function a8e(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 o8e=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&&w2(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),w2(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),w2(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);w2(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);w2(this.left,t.reverse())}}};function w2(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 T2(e){let t={},n=-1,r,i,a,o,s,c,l,u=new o8e(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,s8e(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 J0(e,0,1/0,u.slice(0)),!l}function s8e(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 c8e={resolve:u8e,tokenize:d8e},l8e={partial:!0,tokenize:f8e};function u8e(e){return T2(e),e}function d8e(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(l8e,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 f8e(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),d2(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 E2(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||n2(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||a2(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||n2(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 D2(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||=!o2(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function O2(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`),d2(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 k2(e,t){let n;return r;function r(i){return i2(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):o2(i)?d2(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var p8e={name:`definition`,tokenize:h8e},m8e={partial:!0,tokenize:g8e};function h8e(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return D2.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=$0(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 a2(t)?k2(e,l)(t):l(t)}function l(t){return E2(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(m8e,d,d)(t)}function d(t){return o2(t)?d2(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 g8e(e,t,n){return r;function r(t){return a2(t)?k2(e,i)(t):n(t)}function i(t){return O2(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return o2(t)?d2(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||i2(e)?t(e):n(e)}}var _8e={name:`hardBreakEscape`,tokenize:v8e};function v8e(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 y8e={name:`headingAtx`,resolve:b8e,tokenize:x8e};function b8e(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`},J0(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function x8e(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||a2(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)):o2(n)?d2(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||a2(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var S8e=`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(`.`),A2=[`pre`,`script`,`style`,`textarea`],C8e={concrete:!0,name:`htmlFlow`,resolveTo:E8e,tokenize:D8e},w8e={partial:!0,tokenize:k8e},T8e={partial:!0,tokenize:O8e};function E8e(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 D8e(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:M):e2(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):e2(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:M):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 e2(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||a2(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&A2.includes(l)?(i=1,r.interrupt?t(s):O(s)):S8e.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||t2(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 o2(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||e2(t)?(e.consume(t),b):o2(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||t2(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):o2(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):o2(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||a2(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||o2(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):o2(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),M):t===93&&i===5?(e.consume(t),re):i2(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(w8e,ae,ee)(t)):t===null||i2(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),O)}function ee(t){return e.check(T8e,te,ae)(t)}function te(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),k}function k(t){return t===null||i2(t)?ee(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),M):O(t)}function j(t){return t===47?(e.consume(t),o=``,ne):O(t)}function ne(t){if(t===62){let n=o.toLowerCase();return A2.includes(n)?(e.consume(t),ie):O(t)}return e2(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function re(t){return t===93?(e.consume(t),M):O(t)}function M(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),M):O(t)}function ie(t){return t===null||i2(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),ie)}function ae(n){return e.exit(`htmlFlow`),t(n)}}function O8e(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 k8e(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(_2,t,n)}}var A8e={name:`htmlText`,tokenize:j8e};function j8e(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):e2(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):e2(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,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(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,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):i2(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):i2(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return e2(t)?(e.consume(t),S):n(t)}function S(t){return t===45||t2(t)?(e.consume(t),S):C(t)}function C(t){return i2(t)?(o=C,j(t)):o2(t)?(e.consume(t),C):A(t)}function w(t){return t===45||t2(t)?(e.consume(t),w):t===47||t===62||a2(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||e2(t)?(e.consume(t),E):i2(t)?(o=T,j(t)):o2(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||t2(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):i2(t)?(o=D,j(t)):o2(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,ee):i2(t)?(o=O,j(t)):o2(t)?(e.consume(t),O):(e.consume(t),te)}function ee(t){return t===i?(e.consume(t),i=void 0,k):t===null?n(t):i2(t)?(o=ee,j(t)):(e.consume(t),ee)}function te(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||a2(t)?T(t):(e.consume(t),te)}function k(e){return e===47||e===62||a2(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return o2(t)?d2(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}var j2={name:`labelEnd`,resolveAll:F8e,resolveTo:I8e,tokenize:L8e},M8e={tokenize:R8e},N8e={tokenize:z8e},P8e={tokenize:B8e};function F8e(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&&J0(e,0,e.length,n),e}function I8e(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=Y0(s,e.slice(a+1,a+r+3)),s=Y0(s,[[`enter`,u,t]]),s=Y0(s,m2(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Y0(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Y0(s,e.slice(o+1)),s=Y0(s,[[`exit`,c,t]]),J0(e,a,e.length,s),e}function L8e(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($0(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(M8e,u,o?u:d)(t):t===91?e.attempt(N8e,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(P8e,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function R8e(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 a2(t)?k2(e,a)(t):a(t)}function a(t){return t===41?u(t):E2(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return a2(t)?k2(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?O2(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return a2(t)?k2(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 z8e(e,t,n){let r=this;return i;function i(t){return D2.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes($0(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function B8e(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 V8e={name:`labelStartImage`,resolveAll:j2.resolveAll,tokenize:H8e};function H8e(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 U8e={name:`labelStartLink`,resolveAll:j2.resolveAll,tokenize:W8e};function W8e(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 M2={name:`lineEnding`,tokenize:G8e};function G8e(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),d2(e,t,`linePrefix`)}}var N2={name:`thematicBreak`,tokenize:K8e};function K8e(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`),o2(t)?d2(e,s,`whitespace`)(t):s(t))}}var P2={continuation:{tokenize:X8e},exit:Q8e,name:`list`,tokenize:Y8e},q8e={partial:!0,tokenize:$8e},J8e={partial:!0,tokenize:Z8e};function Y8e(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:r2(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(N2,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 r2(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(_2,r.interrupt?n:u,e.attempt(q8e,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return o2(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 X8e(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(_2,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,d2(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!o2(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(J8e,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,d2(e,e.attempt(P2,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Z8e(e,t,n){let r=this;return d2(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 Q8e(e){e.exit(this.containerState.type)}function $8e(e,t,n){let r=this;return d2(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!o2(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var F2={name:`setextUnderline`,resolveTo:e5e,tokenize:t5e};function e5e(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 t5e(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`),o2(t)?d2(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||i2(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var n5e={tokenize:r5e};function r5e(e){let t=this,n=e.attempt(_2,r,e.attempt(this.parser.constructs.flowInitial,i,d2(e,e.attempt(this.parser.constructs.flow,i,e.attempt(c8e,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 i5e={resolveAll:L2()},a5e=I2(`string`),o5e=I2(`text`);function I2(e){return{resolveAll:L2(e===`text`?s5e: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 L2(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 s5e(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 c5e=s({attentionMarkers:()=>g5e,contentInitial:()=>u5e,disable:()=>_5e,document:()=>l5e,flow:()=>f5e,flowInitial:()=>d5e,insideSpan:()=>h5e,string:()=>p5e,text:()=>m5e}),l5e={42:P2,43:P2,45:P2,48:P2,49:P2,50:P2,51:P2,52:P2,53:P2,54:P2,55:P2,56:P2,57:P2,62:v2},u5e={91:p8e},d5e={[-2]:C2,[-1]:C2,32:C2},f5e={35:y8e,42:N2,45:[F2,N2],60:C8e,61:F2,95:N2,96:S2,126:S2},p5e={38:b2,92:y2},m5e={[-5]:M2,[-4]:M2,[-3]:M2,33:V8e,38:b2,42:h2,60:[U6e,A8e],91:U8e,92:[_8e,y2],93:j2,95:h2,96:n8e},h5e={null:[h2,i5e]},g5e={null:[42,95]},_5e={null:[]};function v5e(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=Y0(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=m2(a,l.events,l),l.events):[]}function f(e,t){return b5e(p(e),t)}function p(e){return y5e(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&&J0(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 y5e(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 b5e(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=`
|
|
132
|
+
`;break;case-3:o=`\r
|
|
133
|
+
`;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 x5e(e){let t={constructs:Z0([c5e,...(e||{}).extensions||[]]),content:n(I6e),defined:[],document:n(R6e),flow:n(n5e),lazy:{},string:n(a5e),text:n(o5e)};return t;function n(e){return n;function n(n){return v5e(t,e,n)}}}function S5e(e){for(;!T2(e););return e}var R2=/[\0\t\n\r]/g;function C5e(){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(R2.lastIndex=u,c=R2.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 w5e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function T5e(e){return e.replace(w5e,E5e)}function E5e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Q0(n.slice(t?2:1),t?16:10)}return q0(n)||e}var z2={}.hasOwnProperty;function D5e(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),O5e(n)(S5e(x5e(n).document().write(C5e()(e,t,!0))))}function O5e(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Se),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ve),blockQuote:a(pe),characterEscape:T,characterReference:T,codeFenced:a(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(me,o),codeText:a(he,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ge),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(_e),hardBreakEscape:a(ye),hardBreakTrailing:a(ye),htmlFlow:a(be,o),htmlFlowData:T,htmlText:a(be,o),htmlTextData:T,image:a(xe),label:o,link:a(Se),listItem:a(we),listItemValue:f,listOrdered:a(Ce,d),listUnordered:a(Ce),paragraph:a(Te),reference:oe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ve),strong:a(Ee),thematicBreak:a(Oe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:fe,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:ue,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(k),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(ee),htmlFlowData:E,htmlText:c(te),htmlTextData:E,image:c(j),label:re,labelText:ne,lineEnding:D,link:c(A),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:M,resourceTitleString:ie,resource:ae,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};V2(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]];z2.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]||H2).call(a,void 0,e[0])}for(r.position={start:B2(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:B2(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:B2(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]||H2).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+A0({start:e.start,end:e.end})+`): it’s not open`);n.position.end=B2(e.end)}function u(){return U0(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=$0(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=De(),n.position={start:B2(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=B2(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=B2(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 ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){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 j(){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 ne(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=T5e(t),n.identifier=$0(t).toLowerCase()}function re(){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 M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ae(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=$0(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function le(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Q0(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=q0(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=B2(e.end)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function pe(){return{type:`blockquote`,children:[]}}function me(){return{type:`code`,lang:null,meta:null,value:``}}function he(){return{type:`inlineCode`,value:``}}function ge(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function _e(){return{type:`emphasis`,children:[]}}function ve(){return{type:`heading`,depth:0,children:[]}}function ye(){return{type:`break`}}function be(){return{type:`html`,value:``}}function xe(){return{type:`image`,title:null,url:``,alt:null}}function Se(){return{type:`link`,title:null,url:``,children:[]}}function Ce(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function we(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Te(){return{type:`paragraph`,children:[]}}function Ee(){return{type:`strong`,children:[]}}function De(){return{type:`text`,value:``}}function Oe(){return{type:`thematicBreak`}}}function B2(e){return{line:e.line,column:e.column,offset:e.offset}}function V2(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?V2(e,r):k5e(e,r)}}function k5e(e,t){let n;for(n in t)if(z2.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 H2(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+A0({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+A0({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+A0({start:t.start,end:t.end})+`) is still open`)}function A5e(e){let t=this;t.parser=n;function n(n){return D5e(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function j5e(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 M5e(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
134
|
+
`}]}function N5e(e,t){let n=t.value?t.value+`
|
|
135
|
+
`:``,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 P5e(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function F5e(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I5e(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=u2(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 L5e(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 R5e(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function U2(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 z5e(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return U2(e,t);let i={src:u2(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 B5e(e,t){let n={src:u2(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 V5e(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 H5e(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return U2(e,t);let i={href:u2(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 U5e(e,t){let n={href:u2(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 W5e(e,t,n){let r=e.all(t),i=n?G5e(n):W2(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:`
|
|
136
|
+
`}),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:`
|
|
137
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function G5e(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=W2(n[r])}return t}function W2(e){return e.spread??e.children.length>1}function K5e(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 q5e(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function J5e(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Y5e(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function X5e(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=O0(t.children[1]),o=D0(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 Z5e(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 Q5e(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var G2=9,K2=32;function $5e(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(q2(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(q2(t.slice(i),i>0,!1)),a.join(``)}function q2(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===G2||t===K2;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===G2||t===K2;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function e7e(e,t){let n={type:`text`,value:$5e(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function t7e(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var n7e={blockquote:j5e,break:M5e,code:N5e,delete:P5e,emphasis:F5e,footnoteReference:I5e,heading:L5e,html:R5e,imageReference:z5e,image:B5e,inlineCode:V5e,linkReference:H5e,link:U5e,listItem:W5e,list:K5e,paragraph:q5e,root:J5e,strong:Y5e,table:X5e,tableCell:Q5e,tableRow:Z5e,text:e7e,thematicBreak:t7e,toml:J2,yaml:J2,definition:J2,footnoteDefinition:J2};function J2(){}var r7e=typeof self==`object`?self:globalThis,Y2=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new r7e[e](t)},i7e=(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(Y2(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(Y2(a,o),i)};return r},X2=e=>i7e(new Map,e)(0),Z2=``,{toString:a7e}={},{keys:o7e}=Object,Q2=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=a7e.call(e).slice(8,-1);switch(n){case`Array`:return[1,Z2];case`Object`:return[2,Z2];case`Date`:return[3,Z2];case`RegExp`:return[4,Z2];case`Map`:return[5,Z2];case`Set`:return[6,Z2];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},$2=([e,t])=>e===0&&(t===`function`||t===`symbol`),s7e=(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]=Q2(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 o7e(r))(e||!$2(Q2(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||!($2(Q2(n))||$2(Q2(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!$2(Q2(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},e4=(e,{json:t,lossy:n}={})=>{let r=[];return s7e(!(t||n),!!t,new Map,r)(e),r},t4=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?X2(e4(e,t)):structuredClone(e):(e,t)=>X2(e4(e,t));function c7e(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 l7e(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function u7e(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||c7e,r=e.options.footnoteBackLabel||l7e,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=u2(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:{...t4(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
138
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
139
|
+
`}]}}var n4=(function(e){if(e==null)return m7e;if(typeof e==`function`)return r4(e);if(typeof e==`object`)return Array.isArray(e)?d7e(e):f7e(e);if(typeof e==`string`)return p7e(e);throw Error(`Expected function, string, or object as test`)});function d7e(e){let t=[],n=-1;for(;++n<e.length;)t[n]=n4(e[n]);return r4(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function f7e(e){let t=e;return r4(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function p7e(e){return r4(t);function t(t){return t&&t.type===e}}function r4(e){return t;function t(t,n,r){return!!(h7e(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function m7e(){return!0}function h7e(e){return typeof e==`object`&&!!e&&`type`in e}function g7e(e){return e}var i4=[];function a4(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=n4(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 (`+g7e(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=_7e(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 _7e(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?i4:[e]}function o4(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),a4(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 s4={}.hasOwnProperty,v7e={};function y7e(e,t){let n=t||v7e,r=new Map,i=new Map,a={all:s,applyData:x7e,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...n7e,...n.handlers},one:o,options:n,patch:b7e,wrap:C7e};return o4(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(s4.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=t4(n);return r.children=a.all(e),r}return t4(e)}return(a.options.unknownHandler||S7e)(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=c4(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=c4(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function b7e(e,t){e.position&&(t.position=s6e(e))}function x7e(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,t4(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function S7e(e,t){let n=t.data||{},r=`value`in t&&!(s4.call(n,`hProperties`)||s4.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 C7e(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
140
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
141
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
142
|
+
`}),n}function c4(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function l4(e,t){let n=y7e(e,t),r=n.one(e,void 0),i=u7e(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
143
|
+
`},i)),a}function w7e(e,t){return e&&`run`in e?async function(n,r){let i=l4(n,{file:r,...t});await e.run(i,r)}:function(n,r){return l4(n,{file:r,...e||t})}}function u4(e){if(e)throw e}var T7e=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 d4(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 E7e(){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?D7e(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 D7e(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 f4={basename:O7e,dirname:k7e,extname:A7e,join:j7e,sep:`/`};function O7e(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);p4(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 k7e(e){if(p4(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 A7e(e){p4(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 j7e(...e){let t=-1,n;for(;++t<e.length;)p4(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:M7e(n)}function M7e(e){p4(e);let t=e.codePointAt(0)===47,n=N7e(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function N7e(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 p4(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var P7e={cwd:F7e};function F7e(){return`/`}function m4(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function I7e(e){if(typeof e==`string`)e=new URL(e);else if(!m4(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 L7e(e)}function L7e(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 h4=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],g4=class{constructor(e){let t;t=e?m4(e)?{path:e}:typeof e==`string`||R7e(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:P7e.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<h4.length;){let e=h4[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)h4.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?f4.basename(this.path):void 0}set basename(e){v4(e,`basename`),_4(e,`basename`),this.path=f4.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?f4.dirname(this.path):void 0}set dirname(e){y4(this.basename,`dirname`),this.path=f4.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?f4.extname(this.path):void 0}set extname(e){if(_4(e,`extname`),y4(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=f4.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){m4(e)&&(e=I7e(e)),v4(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?f4.basename(this.path,this.extname):void 0}set stem(e){v4(e,`stem`),_4(e,`stem`),this.path=f4.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 P0(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 _4(e,t){if(e&&e.includes(f4.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+f4.sep+"`")}function v4(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function y4(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function R7e(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var z7e=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),b4=u(T7e(),1),B7e={}.hasOwnProperty,V7e=new class e extends z7e{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=E7e()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,b4.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(C4(`data`,this.frozen),this.namespace[e]=t,this):B7e.call(this.namespace,e)&&this.namespace[e]||void 0:e?(C4(`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=E4(e),n=this.parser||this.Parser;return x4(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),x4(`process`,this.parser||this.Parser),S4(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=E4(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);U7e(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(),x4(`processSync`,this.parser||this.Parser),S4(`processSync`,this.compiler||this.Compiler),this.process(e,r),T4(`processSync`,`process`,t),n;function r(e,r){t=!0,u4(e),n=r}}run(e,t,n){w4(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=E4(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),T4(`runSync`,`run`,n),r;function i(e,t){u4(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=E4(t),r=this.compiler||this.Compiler;return S4(`stringify`,r),w4(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(C4(`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,b4.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];d4(o)&&d4(r)&&(r=(0,b4.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function x4(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function S4(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function C4(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 w4(e){if(!d4(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function T4(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function E4(e){return H7e(e)?e:new g4(e)}function H7e(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function U7e(e){return typeof e==`string`||W7e(e)}function W7e(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var D4=[],O4={allowDangerousHtml:!0},G7e=/^(https?|ircs?|mailto|xmpp)$/i,K7e=[{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 q7e(e){let t=J7e(e),n=Y7e(e);return X7e(t.runSync(t.parse(n),n),e)}function J7e(e){let t=e.rehypePlugins||D4,n=e.remarkPlugins||D4,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...O4}:O4;return V7e().use(A5e).use(n).use(w7e,r).use(t)}function Y7e(e){let t=e.children||``,n=new g4;return typeof t==`string`?n.value=t:``+t,n}function X7e(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Z7e;for(let e of K7e)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return o4(e,l),p6e(e,{Fragment:I.Fragment,components:i,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.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 H0)if(Object.hasOwn(H0,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=H0[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 Z7e(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||G7e.test(e.slice(0,t))?e:``}var{useSmooth:Q7e,useSmoothStatus:$7e,withSmoothContextProvider:e9e}=Qde,t9e=({components:e,componentsByLanguage:t,smooth:n=!0,preprocess:r,...i})=>{let a=GD(),{text:o}=Q7e((0,N.useMemo)(()=>r?{...a,text:r(a.text)}:a,[a,r]),n),{pre:s=P3e,code:c=F3e,SyntaxHighlighter:l=Q1,CodeHeader:u=I3e}=e??{},d=(0,N.useMemo)(()=>({Pre:s,Code:c,SyntaxHighlighter:l,CodeHeader:u}),[s,c,l,u]),f=Py(e=>(0,I.jsx)(z3e,{components:d,componentsByLanguage:t,...e}));return(0,I.jsx)(q7e,{components:(0,N.useMemo)(()=>{let{pre:t,code:n,SyntaxHighlighter:r,CodeHeader:i,...a}=e??{};return{...a,pre:N3e,code:f}},[f,e]),...i,children:o})},k4=(0,N.forwardRef)(({className:e,containerProps:t,containerComponent:n=`div`,...r},i)=>(0,I.jsx)(n,{"data-status":$7e().type,...t,className:(0,$1.default)(e,t?.className),ref:i,children:(0,I.jsx)(t9e,{...r})}));k4.displayName=`MarkdownTextPrimitive`;var n9e=e9e(k4);function A4(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 r9e(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function i9e(e,t,n){let r=n4((n||{}).ignore||[]),i=a9e(t),a=-1;for(;++a<i.length;)a4(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 a9e(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([o9e(e[0]),s9e(e[1])])}return t}function o9e(e){return typeof e==`string`?new RegExp(r9e(e),`g`):e}function s9e(e){return typeof e==`function`?e:function(){return e}}var j4=`phrasing`,M4=[`autolink`,`link`,`image`,`label`];function c9e(){return{transforms:[h9e],enter:{literalAutolink:u9e,literalAutolinkEmail:N4,literalAutolinkHttp:N4,literalAutolinkWww:N4},exit:{literalAutolink:m9e,literalAutolinkEmail:p9e,literalAutolinkHttp:d9e,literalAutolinkWww:f9e}}}function l9e(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:j4,notInConstruct:M4},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:j4,notInConstruct:M4},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:j4,notInConstruct:M4}]}}function u9e(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function N4(e){this.config.enter.autolinkProtocol.call(this,e)}function d9e(e){this.config.exit.autolinkProtocol.call(this,e)}function f9e(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 p9e(e){this.config.exit.autolinkEmail.call(this,e)}function m9e(e){this.exit(e)}function h9e(e){i9e(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,g9e],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,_9e]],{ignore:[`link`,`linkReference`]})}function g9e(e,t,n,r,i){let a=``;if(!P4(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!v9e(n)))return!1;let o=y9e(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 _9e(e,t,n,r){return!P4(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function v9e(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 y9e(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=A4(e,`(`),a=A4(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 P4(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||c2(n)||s2(n))&&(!t||n!==47)}F4.peek=O9e;function b9e(){this.buffer()}function x9e(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function S9e(){this.buffer()}function C9e(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function w9e(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$0(this.sliceSerialize(e)).toLowerCase(),n.label=t}function T9e(e){this.exit(e)}function E9e(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$0(this.sliceSerialize(e)).toLowerCase(),n.label=t}function D9e(e){this.exit(e)}function O9e(){return`[`}function F4(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 k9e(){return{enter:{gfmFootnoteCallString:b9e,gfmFootnoteCall:x9e,gfmFootnoteDefinitionLabelString:S9e,gfmFootnoteDefinition:C9e},exit:{gfmFootnoteCallString:w9e,gfmFootnoteCall:T9e,gfmFootnoteDefinitionLabelString:E9e,gfmFootnoteDefinition:D9e}}}function A9e(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:F4},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?`
|
|
144
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?I4:j9e))),s(),o}}function j9e(e,t,n){return t===0?e:I4(e,t,n)}function I4(e,t,n){return(n?``:` `)+e}var M9e=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];L4.peek=L9e;function N9e(){return{canContainEols:[`delete`],enter:{strikethrough:F9e},exit:{strikethrough:I9e}}}function P9e(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:M9e}],handlers:{delete:L4}}}function F9e(e){this.enter({type:`delete`,children:[]},e)}function I9e(e){this.exit(e)}function L4(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 L9e(){return`~`}function R9e(e){return e.length}function z9e(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||R9e,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=B9e(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]=R4(r[d]);else{let e=R4(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(`
|
|
145
|
+
`)}function B9e(e){return e==null?``:String(e)}function R4(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 V9e(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()),H9e);return i(),o}function H9e(e,t,n){return`>`+(n?``:` `)+e}function U9e(e,t){return z4(e,t.inConstruct,!0)&&!z4(e,t.notInConstruct,!1)}function z4(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 B4(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
146
|
+
`&&U9e(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
147
|
+
`}function W9e(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 G9e(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 K9e(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function q9e(e,t,n,r){let i=K9e(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(G9e(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,J9e);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(W9e(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:`
|
|
148
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
149
|
+
`),a&&(u+=s.move(a+`
|
|
150
|
+
`)),u+=s.move(c),l(),u}function J9e(e,t,n){return(n?``:` `)+e}function V4(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Y9e(e,t,n,r){let i=V4(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?` `:`
|
|
151
|
+
`,...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 X9e(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function H4(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function U4(e,t,n){let r=p2(e),i=p2(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}}W4.peek=Z9e;function W4(e,t,n,r){let i=X9e(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=U4(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=H4(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=U4(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+H4(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Z9e(e,t,n){return n.options.emphasis||`*`}function Q9e(e,t){let n=!1;return o4(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)&&U0(e)&&(t.options.setext||n))}function $9e(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Q9e(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
152
|
+
`,after:`
|
|
153
|
+
`});return r(),t(),o+`
|
|
154
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
155
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
156
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=H4(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}G4.peek=eet;function G4(e){return e.value||``}function eet(){return`<`}K4.peek=tet;function K4(e,t,n,r){let i=V4(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 tet(){return`!`}q4.peek=net;function q4(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 net(){return`!`}J4.peek=ret;function J4(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 ret(){return"`"}function Y4(e,t){let n=U0(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))}X4.peek=iet;function X4(e,t,n,r){let i=V4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Y4(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 iet(e,t,n){return Y4(e,n)?`<`:`[`}Z4.peek=aet;function Z4(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 aet(){return`[`}function Q4(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 oet(e){let t=Q4(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 set(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function $4(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 cet(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?set(n):Q4(n),s=e.ordered?o===`.`?`)`:`.`:oet(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),$4(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 uet(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 det(e,t,n,r){let i=uet(n),a=n.bulletCurrent||Q4(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 fet(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var pet=n4([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function met(e,t,n,r){return(e.children.some(function(e){return pet(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function het(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}e3.peek=get;function e3(e,t,n,r){let i=het(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=U4(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=H4(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=U4(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+H4(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function get(e,t,n){return n.options.strong||`*`}function _et(e,t,n,r){return n.safe(e.value,r)}function vet(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 yet(e,t,n){let r=($4(n)+(n.options.ruleSpaces?` `:``)).repeat(vet(n));return n.options.ruleSpaces?r.slice(0,-1):r}var t3={blockquote:V9e,break:B4,code:q9e,definition:Y9e,emphasis:W4,hardBreak:B4,heading:$9e,html:G4,image:K4,imageReference:q4,inlineCode:J4,link:X4,linkReference:Z4,list:cet,listItem:det,paragraph:fet,root:met,strong:e3,text:_et,thematicBreak:yet};function bet(){return{enter:{table:xet,tableData:r3,tableHeader:r3,tableRow:wet},exit:{codeText:Tet,table:Cet,tableData:n3,tableHeader:n3,tableRow:n3}}}function xet(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 Cet(e){this.exit(e),this.data.inTable=void 0}function wet(e){this.enter({type:`tableRow`,children:[]},e)}function n3(e){this.exit(e)}function r3(e){this.enter({type:`tableCell`,children:[]},e)}function Tet(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Eet));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Eet(e,t){return t===`|`?t:e}function Det(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
157
|
+
`,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(`
|
|
158
|
+
`))}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 z9e(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=t3.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Oet(){return{exit:{taskListCheckValueChecked:i3,taskListCheckValueUnchecked:i3,paragraph:Aet}}}function ket(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:jet}}}function i3(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Aet(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 jet(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=t3.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 Met(){return[c9e(),k9e(),N9e(),bet(),Oet()]}function Net(e){return{extensions:[l9e(),A9e(e),P9e(),Det(e),ket()]}}var Pet={tokenize:Bet,partial:!0},a3={tokenize:Vet,partial:!0},o3={tokenize:Het,partial:!0},s3={tokenize:Uet,partial:!0},Fet={tokenize:Wet,partial:!0},c3={name:`wwwAutolink`,tokenize:Ret,previous:p3},l3={name:`protocolAutolink`,tokenize:zet,previous:m3},u3={name:`emailAutolink`,tokenize:Let,previous:h3},d3={};function Iet(){return{text:d3}}for(var f3=48;f3<123;)d3[f3]=u3,f3++,f3===58?f3=65:f3===91&&(f3=97);d3[43]=u3,d3[45]=u3,d3[46]=u3,d3[95]=u3,d3[72]=[u3,l3],d3[104]=[u3,l3],d3[87]=[u3,c3],d3[119]=[u3,c3];function Let(e,t,n){let r=this,i,a;return o;function o(t){return!g3(t)||!h3.call(r,r.previous)||_3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return g3(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Fet,u,l)(t):t===45||t===95||t2(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&&e2(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Ret(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!p3.call(r,r.previous)||_3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Pet,e.attempt(a3,e.attempt(o3,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function zet(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&m3.call(r,r.previous)&&!_3(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(e2(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||n2(t)||a2(t)||c2(t)||s2(t)?n(t):e.attempt(a3,e.attempt(o3,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Bet(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 Vet(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(s3,c,s)(t):t===null||a2(t)||c2(t)||t!==45&&s2(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 Het(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(s3,t,a)(o):o===null||a2(o)||c2(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Uet(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||a2(o)||c2(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||a2(e)||c2(e)?t(e):r(e)}function a(e){return e2(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):e2(t)?(e.consume(t),o):n(t)}}function Wet(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return t2(e)?n(e):t(e)}}function p3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||a2(e)}function m3(e){return!e2(e)}function h3(e){return!(e===47||g3(e))}function g3(e){return e===43||e===45||e===46||e===95||t2(e)}function _3(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 Get={tokenize:$et,partial:!0};function Ket(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Xet,continuation:{tokenize:Zet},exit:Qet}},text:{91:{name:`gfmFootnoteCall`,tokenize:Yet},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:qet,resolveTo:Jet}}}}function qet(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=$0(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 Jet(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 Yet(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||a2(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes($0(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return a2(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 Xet(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||a2(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=$0(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return a2(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),d2(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Zet(e,t,n){return e.check(_2,t,e.attempt(Get,t,n))}function Qet(e){e.exit(`gfmFootnoteDefinition`)}function $et(e,t,n){let r=this;return d2(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 ett(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&&J0(o,o.length,0,m2(s,e.slice(r+1,n),t)),J0(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),J0(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=p2(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=p2(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var ttt=class{constructor(){this.map=[]}add(e,t,n){ntt(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 ntt(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 rtt(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 itt(){return{flow:{null:{name:`table`,tokenize:att,resolveAll:ott}}}}function att(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):o2(t)?d2(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||a2(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,o2(t)?d2(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 o2(t)?d2(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 o2(t)?d2(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)):o2(n)?d2(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||a2(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 ott(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 ttt;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(y3(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=v3(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=v3(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=v3(f,t,o,i,n,d)):(o[0]=o[1],d=v3(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&y3(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=rtt(t.events,n))}return e}function v3(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},b3(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=b3(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=b3(t.events,n[2]),a=b3(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({},b3(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function y3(e,t,n,r,i){let a=[],o=b3(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 b3(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var stt={name:`tasklistCheck`,tokenize:ltt};function ctt(){return{text:{91:stt}}}function ltt(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 a2(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):o2(r)?e.check({tokenize:utt},t,n)(r):n(r)}}function utt(e,t,n){return d2(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function dtt(e){return Z0([Iet(),Ket(),ett(e),itt(),ctt()])}var ftt={};function ptt(e){let t=this,n=e||ftt,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(dtt(n)),a.push(Met()),o.push(Net(n))}function mtt(e){return typeof e==`string`&&/^(https?:|mailto:)/i.test(e.trim())}function x3(e){return function(t){return(0,N.createElement)(e,t)}}function htt({href:e,children:t,...n}){return mtt(e)?(0,I.jsx)(`a`,{...n,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t}):(0,I.jsx)(`span`,{...n,children:t})}var gtt=j3e({a:htt,p:x3(`p`),h1:x3(`h1`),h2:x3(`h2`),h3:x3(`h3`),h4:x3(`h4`),h5:x3(`h5`),h6:x3(`h6`),ul:x3(`ul`),ol:x3(`ol`),li:x3(`li`),blockquote:x3(`blockquote`),hr:x3(`hr`),strong:x3(`strong`),em:x3(`em`),del:x3(`del`),table:x3(`table`),thead:x3(`thead`),tbody:x3(`tbody`),tr:x3(`tr`),th:x3(`th`),td:x3(`td`)}),_tt=(0,N.memo)(function(){return(0,I.jsx)(n9e,{remarkPlugins:[ptt],className:`oc-md`,smooth:!1,components:gtt})});function S3(e){return(0,I.jsx)(PT,{"data-slot":`select`,...e})}function C3(e){return(0,I.jsx)(RT,{"data-slot":`select-value`,...e})}function w3({className:e,size:t=`default`,children:n,...r}){return(0,I.jsxs)(IT,{"data-slot":`select-trigger`,"data-size":t,className:R$(`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,I.jsx)(zT,{asChild:!0,children:(0,I.jsx)(dm,{className:`size-4 opacity-50`})})]})}function T3({className:e,children:t,position:n=`popper`,...r}){return(0,I.jsx)(VT,{children:(0,I.jsxs)(UT,{"data-slot":`select-content`,className:R$(`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,I.jsx)(uE,{className:`flex cursor-default items-center justify-center py-1`,children:(0,I.jsx)(pm,{className:`size-4`})}),(0,I.jsx)($T,{className:R$(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,I.jsx)(fE,{className:`flex cursor-default items-center justify-center py-1`,children:(0,I.jsx)(dm,{className:`size-4`})})]})})}function Q({className:e,children:t,...n}){return(0,I.jsxs)(iE,{"data-slot":`select-item`,className:R$(`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,I.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(cE,{children:(0,I.jsx)(um,{className:`size-4`})})}),(0,I.jsx)(oE,{children:t})]})}var E3=1e3;function vtt(){return[{id:`incorrect`,label:hDe()},{id:`incoherence`,label:vDe()},{id:`altered_words`,label:xDe()},{id:`formatting`,label:wDe()},{id:`latency`,label:DDe()},{id:`api_error`,label:ADe()},{id:`other`,label:sQ()}]}function ytt(){return[{id:`altered_words`,label:FDe()},{id:`formatting`,label:RDe()},{id:`other`,label:sQ()}]}function btt(e){return e===`user`?ytt():vtt()}var xtt=[{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 Stt(){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 xtt)try{document.querySelector(n)&&t.push(e)}catch{}return{plugins:e,extensionsDetected:t}}var D3=N.createContext(null);function Ctt(){let e=N.useContext(D3);if(!e)throw Error(`useFeedback must be used within <FeedbackProvider>`);return e}function wtt({children:e}){let t=F(V.feedback.submitFeedback),[n,r]=(0,N.useState)(null),[i,a]=(0,N.useState)(``),[o,s]=(0,N.useState)(``),[c,l]=(0,N.useState)(!1),[u,d]=(0,N.useState)(null),f=N.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`,...Stt()}})).displayedMatchesStored)}catch{l(!1)}}}let h=u!==null,g=n?.role===`user`;return(0,I.jsxs)(D3.Provider,{value:f,children:[e,(0,I.jsx)(c1,{open:n!==null,onOpenChange:p,children:n?(0,I.jsxs)(l1,{className:`sm:max-w-md`,children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:VDe()}),(0,I.jsx)(p1,{children:h?WDe():g?qDe():XDe()})]}),h?(0,I.jsx)(`div`,{className:`oc-feedback__result`,role:`status`,children:n.sourceWasOpen?u===!0?(0,I.jsx)(`p`,{className:`oc-feedback__fidelity is-ok`,children:$De()}):(0,I.jsx)(`p`,{className:`oc-feedback__fidelity is-warn`,children:nOe()}):(0,I.jsx)(`p`,{className:`oc-feedback__fidelity`,children:aOe()})}):(0,I.jsxs)(`div`,{className:`oc-feedback__form`,children:[(0,I.jsx)(`label`,{className:`oc-feedback__label`,children:cOe()}),(0,I.jsxs)(S3,{value:i,onValueChange:a,children:[(0,I.jsx)(w3,{children:(0,I.jsx)(C3,{placeholder:dOe()})}),(0,I.jsx)(T3,{children:btt(n.role).map(e=>(0,I.jsx)(Q,{value:e.id,children:e.label},e.id))})]}),(0,I.jsx)(`label`,{className:`oc-feedback__label`,htmlFor:`oc-feedback-comment`,children:mOe()}),(0,I.jsx)(`textarea`,{id:`oc-feedback-comment`,className:`oc-feedback__textarea`,placeholder:_Oe(),value:o,maxLength:E3,onChange:e=>s(e.target.value.slice(0,E3)),rows:4}),(0,I.jsxs)(`div`,{className:`oc-feedback__count`,children:[o.length,`/`,E3]})]}),(0,I.jsx)(d1,{children:h?(0,I.jsx)(X,{onClick:()=>p(!1),children:bOe()}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(X,{variant:`outline`,onClick:()=>p(!1),children:COe()}),(0,I.jsx)(X,{onClick:()=>void m(),disabled:!i||c,children:c?EOe():kOe()})]})})]}):null})]})}function Ttt(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 O3(){let e=Ctt(),t=gy(e=>e.metadata?.custom?.messageId),n=gy(e=>e.metadata?.custom?.chatId),r=gy(e=>e.role),i=gy(e=>e.metadata?.custom?.rawText??``),a=P(V.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,...Ttt(a.currentTarget,i)})}return(0,I.jsx)(`button`,{type:`button`,className:`oc-iconbtn${o?` is-on`:``}`,title:o?MOe():FOe(),"aria-label":ROe(),onClick:s,children:(0,I.jsx)(Oee,{size:15,"aria-hidden":!0})})}function k3(e,t){return e!=null&&e[t]!==void 0}var Ett=[`inherit`,`fast`,`standard`];function Dtt(e){return e==null||e.fastMode===void 0?`inherit`:e.fastMode?`fast`:`standard`}function Ott(e){return e===`inherit`?TZe():e===`fast`?GQ():KQ()}function ktt(e){return e===`inherit`?null:e===`fast`}function A3(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function j3(e){return e.length?e[0].toUpperCase()+e.slice(1):e}var Att={off:`Off`,minimal:`Min`,low:`Low`,medium:`Med`,high:`High`,xhigh:`XHigh`};function jtt(e,t){return Att[e]??t}function M3(e,t){return e==null||!t||t<=0?null:Math.round(e/t*100)}function Mtt(e,t){let n=M3(e,t);return n===null?null:nQe({pct:n,used:A3(e),total:A3(t)})}function Ntt(e){return cQe({level:e??`full`})}function Ptt(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?_Qe({cost:e.toFixed(2),tokens:A3(t)}):n?bQe({cost:e.toFixed(2)}):r?CQe({tokens:A3(t)}):null}function Ftt(e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` · `):null}var Itt=new Set([`knobThinkingLevel`,`knobModel`,`knobFastMode`,`knobUnset`,`agentFiles`,`sessionCompact`,`configDefaults`]),Ltt=new Set([`knobThinkingLevel`,`knobModel`]);function N3(e,t){return Itt.has(t)?e==null?Ltt.has(t):e[t]===!0:!1}function Rtt(e,t){return{model:e(`knobModel`)&&t.hasModels,thinking:e(`knobThinkingLevel`)&&t.hasLevels,speed:e(`knobFastMode`),reset:e(`knobUnset`)}}function P3(e,t){return e===void 0?`loading`:e===null?{blocked:!N3(null,t),gatewayVersion:null}:{blocked:!N3(e.capabilities,t),gatewayVersion:e.gatewayVersion}}function F3(e){let t=P(V.compat.forChat,e===null?`skip`:{chatId:e}),n=t==null?null:t.capabilities;return{can:(0,N.useCallback)(e=>N3(n,e),[n]),loading:t===void 0,gatewayVersion:t?.gatewayVersion??null}}function ztt(e){let t=F(V.chats.setSessionKnob),[n,r]=(0,N.useState)(null),[i,a]=(0,N.useState)(null);return{apply:(0,N.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 I3({label:e,overridden:t,onReset:n,pending:r,error:i,onRetry:a,help:o,children:s,resettable:c=!0}){return(0,I.jsxs)(`div`,{className:`oc-spanel__row${t?` is-overridden`:``}`,children:[(0,I.jsxs)(`div`,{className:`oc-spanel__rowhead`,children:[(0,I.jsx)(`span`,{className:`oc-spanel__label`,children:e}),r?(0,I.jsx)(Cm,{size:13,className:`oc-spanel__spin`,"aria-label":UQ()}):t?c?(0,I.jsx)(`button`,{type:`button`,className:`oc-spanel__reset`,title:HQ(),"aria-label":HQ(),onClick:n,children:(0,I.jsx)(Pm,{size:12,"aria-hidden":!0})}):null:(0,I.jsx)(`span`,{className:`oc-spanel__badge`,children:sZe()})]}),(0,I.jsx)(`div`,{className:`oc-spanel__ctl`,children:s}),o?(0,I.jsx)(`p`,{className:`oc-spanel__help`,children:o}):null,i?(0,I.jsxs)(`p`,{className:`oc-spanel__error`,role:`alert`,children:[mZe(),(0,I.jsx)(`button`,{type:`button`,className:`oc-spanel__retry`,onClick:a,children:WQ()})]}):null]})}function L3({options:e,value:t,onChange:n,disabled:r}){return(0,I.jsx)(`div`,{className:`oc-spanel__seg`,role:`group`,children:e.map(e=>(0,I.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 Btt({options:e,value:t,onChange:n,disabled:r,ariaLabel:i}){let a=t===null||e.some(e=>e.id===t);return(0,I.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,I.jsx)(`option`,{value:``,disabled:!0,hidden:!0}):null,a?null:(0,I.jsx)(`option`,{value:t,children:t}),e.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))]})}function R3({chatId:e,sm:t,settings:n}){let{apply:r,pending:i,error:a}=ztt(e),{can:o}=F3(e),s=i!==null,c=(0,N.useCallback)(()=>{a&&r(a.field,a.value)},[r,a]),l=t.thinkingLevels??[],u=t.availableModels??[],d=Dtt(n),f=Rtt(o,{hasModels:u.length>0,hasLevels:l.length>0});return(0,I.jsxs)(I.Fragment,{children:[f.model?(0,I.jsx)(I3,{label:pU(),overridden:k3(n,`model`),onReset:()=>void r(`model`,null),pending:i===`model`,error:a?.field===`model`,onRetry:c,resettable:f.reset,children:u.length<=4?(0,I.jsx)(L3,{options:u,value:t.model??null,onChange:e=>void r(`model`,e),disabled:s}):(0,I.jsx)(Btt,{options:u,value:t.model??null,onChange:e=>void r(`model`,e),disabled:s,ariaLabel:pU()})}):null,f.thinking?(0,I.jsx)(I3,{label:yZe(),overridden:k3(n,`thinkingLevel`),onReset:()=>void r(`thinkingLevel`,null),pending:i===`thinkingLevel`,error:a?.field===`thinkingLevel`,onRetry:c,resettable:f.reset,children:(0,I.jsx)(L3,{options:l.map(e=>({id:e.id,label:jtt(e.id,j3(e.label)),title:j3(e.label)})),value:t.thinkingLevel??null,onChange:e=>void r(`thinkingLevel`,e),disabled:s})}):null,f.speed?(0,I.jsx)(I3,{label:SZe(),overridden:k3(n,`fastMode`),onReset:()=>void r(`fastMode`,null),pending:i===`fastMode`,error:a?.field===`fastMode`,onRetry:c,resettable:f.reset,children:(0,I.jsx)(L3,{options:Ett.map(e=>({id:e,label:Ott(e)})),value:d,onChange:e=>void r(`fastMode`,ktt(e)),disabled:s})}):null]})}function z3({label:e,state:t,destructive:n,onClick:r,onRetry:i}){return(0,I.jsxs)(`div`,{className:`oc-spanel__action`,children:[(0,I.jsxs)(X,{variant:n?`destructive`:`outline`,size:`sm`,disabled:t===`pending`,onClick:r,children:[t===`pending`?(0,I.jsx)(Cm,{className:`oc-spanel__spin`,"aria-hidden":!0}):null,e]}),t===`done`?(0,I.jsx)(`p`,{className:`oc-spanel__action-note`,role:`status`,children:XQe()}):null,t===`error`?(0,I.jsxs)(`p`,{className:`oc-spanel__error`,role:`alert`,children:[$Qe(),(0,I.jsx)(`button`,{type:`button`,className:`oc-spanel__retry`,onClick:i,children:WQ()})]}):null]})}function Vtt({chatId:e,open:t,onOpenChange:n}){let r=P(V.messages.getSessionMeta,t?{chatId:e}:`skip`),i=P(V.agents.getChatAgent,t?{chatId:e}:`skip`),a=r?.sessionMeta??null,o=r?.sessionSettings??null,{can:s}=F3(t?e:null),c=g1(),l=$n(V.agentFiles.compactSession),u=F(V.chats.resetSession),[d,f]=(0,N.useState)(`idle`),[p,m]=(0,N.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:kQe(),description:MQe(),confirmLabel:FQe(),cancelLabel:uW()})&&await h()}async function v(){await c({title:VQe(),description:WQe(),confirmLabel:qQe(),cancelLabel:uW(),destructive:!0})&&await g()}let y=M3(a?.totalTokens,a?.contextTokens),b=y==null?``:y>=90?`is-critical`:y>=75?`is-warn`:`is-ok`,x=Mtt(a?.totalTokens,a?.contextTokens),S=Ptt(a?.estimatedCostUsd,a?.totalTokens),C=i?.agent??null,w=Ftt([C?C.displayName??C.agentId:null,a?.agentRuntime,a?.model]);return(0,I.jsx)(W1,{open:t,onOpenChange:n,children:(0,I.jsxs)(G1,{side:`right`,className:`oc-spanel`,children:[(0,I.jsxs)(K1,{children:[(0,I.jsx)(J1,{children:FZe()}),(0,I.jsx)(Y1,{children:RZe()})]}),(0,I.jsx)(`div`,{className:`oc-spanel__body`,children:r===void 0?(0,I.jsx)(`p`,{className:`oc-spanel__loading`,children:KO()}):(0,I.jsxs)(I.Fragment,{children:[a?(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h3`,{className:`oc-spanel__cat`,children:VZe()}),(0,I.jsx)(R3,{chatId:e,sm:a,settings:o})]}):null,(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h3`,{className:`oc-spanel__cat`,children:WZe()}),x!==null&&y!==null?(0,I.jsxs)(`div`,{className:`oc-spanel__static`,children:[(0,I.jsx)(`span`,{className:`oc-spanel__label`,children:$Ze()}),(0,I.jsxs)(`span`,{className:`oc-meter oc-spanel__meter ${b}`,children:[(0,I.jsx)(`span`,{className:`oc-meter__track`,children:(0,I.jsx)(`span`,{className:`oc-meter__fill`,style:{width:`${Math.min(y,100)}%`}})}),(0,I.jsx)(`span`,{className:`oc-meter__label`,children:x})]})]}):null,(0,I.jsxs)(`div`,{className:`oc-spanel__static`,children:[(0,I.jsx)(`span`,{className:`oc-spanel__label`,children:aQe()}),(0,I.jsx)(`span`,{className:`oc-spanel__value`,children:Ntt(a?.verboseLevel)}),(0,I.jsx)(`p`,{className:`oc-spanel__help`,children:dQe()})]}),S===null?null:(0,I.jsxs)(`div`,{className:`oc-spanel__static`,children:[(0,I.jsx)(`span`,{className:`oc-spanel__label`,children:mQe()}),(0,I.jsx)(`span`,{className:`oc-spanel__value`,children:S})]})]}),w===null?null:(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h3`,{className:`oc-spanel__cat`,children:qZe()}),(0,I.jsx)(`div`,{className:`oc-spanel__static`,children:(0,I.jsx)(`span`,{className:`oc-spanel__value`,children:w})})]})]})}),(0,I.jsxs)(q1,{className:`oc-spanel__actions`,children:[(0,I.jsx)(`h3`,{className:`oc-spanel__cat`,children:XZe()}),s(`sessionCompact`)?(0,I.jsx)(z3,{label:EQe(),state:d,onClick:()=>void _(),onRetry:()=>void h()}):null,(0,I.jsx)(z3,{label:RQe(),state:p,destructive:!0,onClick:()=>void v(),onRetry:()=>void g()})]})]})})}var B3={showSource:!0,showReport:!0,copyAssistant:!0,copyUser:!0,showDelete:!0,showTools:!1,voiceInput:!1},V3=(0,N.createContext)(B3);function H3(){return(0,N.useContext)(V3)}var U3=(0,N.createContext)(null),W3=(0,N.createContext)(null);function G3({className:e}){let t=ZQ();return(0,I.jsx)(`div`,{className:e,"aria-hidden":!0,children:t.logoUrl?t.logoMasked?(0,I.jsx)(`span`,{className:`oc-avatar__img oc-avatar__img--mask`,style:{"--oc-logo-url":`url("${t.logoUrl}")`}}):(0,I.jsx)(`img`,{className:`oc-avatar__img`,src:t.logoUrl,alt:``}):t.isDefault?(0,I.jsx)(NO,{className:`oc-avatar__mark`}):t.initials})}function K3({chatId:e,focusMessageId:t}){let{runtime:n,turnGate:r,queueSend:i}=J4e({chatId:e}),a=P(V.me.getMe,{host:xO}),o=a?.ui?.effective??B3,s=o.showTools,c=wO(a?.resolvedThemeMode),l=a?.resolvedChartBrand,u=a?.resolvedChartTokens,d=P(V.agents.getChatAgent,e?{chatId:e}:`skip`),f=d?.multiAgent?d.agent:null,p=(0,N.useMemo)(()=>{let e=l?.label??`Atrium`,t=u?.colors?.[c],n=ife(l,afe(t?.primary,t?.[`primary-foreground`],c));return{label:e,logoUrl:n?.url??null,logoMasked:n?.masked??!1,isDefault:l?.isDefault??!0,initials:ofe(e),agentName:f?.displayName??f?.agentId??null,agentEmoji:f?.emoji??null}},[l,c,u,f]),m=F(V.me.setUiPref).withOptimisticUpdate(x1),h=P(V.messages.getSessionMeta,e?{chatId:e}:`skip`),g=e!==null&&h===null,_=H1(),{width:v,startResize:y}=U1({storageKey:`oc.sources.width`,defaultWidth:380,min:300,max:680,edge:`right`}),[b,x]=(0,N.useState)(null);(0,N.useEffect)(()=>{x(null)},[e]);let S=(0,N.useMemo)(()=>({activeMessageId:b,openFor:e=>x(e),close:()=>x(null)}),[b]),C=b!==null;return(0,I.jsx)(_ie,{runtime:n,children:(0,I.jsx)(U3.Provider,{value:r,children:(0,I.jsx)(W3.Provider,{value:i,children:(0,I.jsx)(V3.Provider,{value:o,children:(0,I.jsx)(XQ.Provider,{value:p,children:(0,I.jsxs)(F1.Provider,{value:S,children:[(0,I.jsxs)(`div`,{className:`oc-chat`,children:[(0,I.jsx)(`div`,{className:`oc-chat__convo`,children:e?g?(0,I.jsx)(Htt,{}):(0,I.jsx)(Wtt,{chatId:e,showTools:s,onToggleTools:()=>void m({key:`showTools`,value:!s}),focusMessageId:t??null}):(0,I.jsx)(`div`,{className:`oc-empty`,children:SH()})}),C&&!_?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`oc-sources-resizer`,onPointerDown:y,role:`separator`,"aria-orientation":`vertical`,"aria-label":TK()}),(0,I.jsx)(`aside`,{className:`oc-sources-col`,style:{width:v,flex:`0 0 ${v}px`},children:(0,I.jsx)(I1,{messageId:b,onClose:S.close})})]}):null]}),C&&_?(0,I.jsx)(W1,{open:!0,onOpenChange:e=>{e||S.close()},children:(0,I.jsx)(G1,{side:`right`,className:`oc-sources-panel-sheet`,children:(0,I.jsx)(I1,{messageId:b,onClose:S.close})})}):null]})})})})})})}function Htt(){let e=ss();return(0,I.jsxs)(`div`,{className:`oc-notfound`,role:`status`,children:[(0,I.jsx)(`div`,{className:`oc-notfound__icon`,"aria-hidden":!0,children:(0,I.jsx)(Fm,{size:28})}),(0,I.jsx)(`h2`,{className:`oc-notfound__title`,children:TH()}),(0,I.jsx)(`p`,{className:`oc-notfound__body`,children:OH()}),(0,I.jsxs)(`button`,{type:`button`,className:`oc-notfound__cta`,onClick:()=>void e({to:`/`}),children:[(0,I.jsx)(Nm,{size:16,"aria-hidden":!0}),jH()]})]})}function Utt(e,t){(0,N.useEffect)(()=>{if(!t)return;let e=!1,n=0,r=0,i=()=>{if(e)return;let a=document.querySelector(`[data-message-id="${CSS.escape(t)}"]`);if(a){a.scrollIntoView({block:`center`,behavior:`smooth`}),a.classList.remove(`oc-msg--highlight`),a.offsetWidth,a.classList.add(`oc-msg--highlight`),window.setTimeout(()=>a.classList.remove(`oc-msg--highlight`),2400);return}n++<40&&(r=window.setTimeout(i,150))};return r=window.setTimeout(i,0),()=>{e=!0,window.clearTimeout(r)}},[e,t])}function Wtt({chatId:e,showTools:t,onToggleTools:n,focusMessageId:r}){let i=P(V.bridgeHealth.getBridgeAvailability,{chatId:e}),a=i&&!i.available?i:null,o=P(V.agents.getChatAgent,{chatId:e})?.readOnly===!0;return Utt(e,r),(0,I.jsxs)(bO.Root,{className:`oc-thread`,children:[(0,I.jsx)(Ytt,{chatId:e}),(0,I.jsx)(qtt,{chatId:e}),(0,I.jsxs)(bO.Viewport,{className:`oc-thread__viewport`,children:[(0,I.jsx)(bO.Empty,{children:(0,I.jsx)(Jtt,{})}),(0,I.jsx)(bO.Messages,{components:{UserMessage:nnt,AssistantMessage:rnt,SystemMessage:int}})]}),(0,I.jsx)(bO.If,{empty:!1,children:(0,I.jsxs)(bO.ScrollToBottom,{className:`oc-scrolldown`,children:[(0,I.jsx)(ent,{}),(0,I.jsx)(`span`,{children:PH()})]})}),o?(0,I.jsx)(Ktt,{}):a?(0,I.jsx)(Gtt,{}):null,(0,I.jsx)(cnt,{showTools:t,onToggleTools:n,unavailable:a!==null||o})]})}function Gtt(){return(0,I.jsxs)(`div`,{className:`oc-chat-banner oc-chat-banner--error`,role:`status`,children:[(0,I.jsx)(hm,{size:16,"aria-hidden":!0}),(0,I.jsx)(`span`,{children:LH()})]})}function Ktt(){return(0,I.jsxs)(`div`,{className:`oc-chat-banner oc-chat-banner--error`,role:`status`,children:[(0,I.jsx)(wm,{size:16,"aria-hidden":!0}),(0,I.jsx)(`span`,{children:BH()})]})}function qtt({chatId:e}){let t=P(V.messages.listByChat,{chatId:e}),[n,r]=(0,N.useState)(``),i=(0,N.useRef)(null);return(0,N.useEffect)(()=>{i.current=null,r(``)},[e]),(0,N.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===UH()?`${UH()} `:UH()))}},[t]),(0,I.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,className:`oc-sr-only`,children:n})}function Jtt(){return(0,I.jsxs)(`div`,{className:`oc-emptystate`,children:[(0,I.jsx)(G3,{className:`oc-emptystate__avatar`}),(0,I.jsx)(`h2`,{className:`oc-emptystate__title`,children:KH()})]})}function q3({sm:e,detail:t=!0}){let n=e.totalTokens!=null&&e.contextTokens&&e.contextTokens>0?Math.round(e.totalTokens/e.contextTokens*100):null;return n==null?null:(0,I.jsxs)(`span`,{className:`oc-meter ${n>=90?`is-critical`:n>=75?`is-warn`:`is-ok`}`,title:jU({pct:n,used:A3(e.totalTokens),total:A3(e.contextTokens)}),children:[(0,I.jsx)(`span`,{className:`oc-meter__track`,children:(0,I.jsx)(`span`,{className:`oc-meter__fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,I.jsxs)(`span`,{className:`oc-meter__label`,children:[n,`%`,t?(0,I.jsxs)(`span`,{className:`oc-meter__detail`,children:[` · `,A3(e.totalTokens),`/`,A3(e.contextTokens)]}):null]})]})}function Ytt({chatId:e}){let t=P(V.messages.getSessionMeta,{chatId:e}),n=P(V.agents.getChatAgent,{chatId:e}),r=t?.sessionMeta??null,i=t?.sessionSettings??null,a=n?.multiAgent?n.agent:null,o=H3(),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),u=(0,N.useRef)(null),d=(0,N.useRef)(null),[f,p]=(0,N.useState)(!1),m=!k3(i,`thinkingLevel`),h=(s,l)=>(0,I.jsxs)(I.Fragment,{children:[a?(0,I.jsxs)(`span`,{className:`oc-chip oc-chip--agent${a.state===`ok`?``:` is-warn`}`,title:QH({name:a.displayName??a.agentId})+(a.inheritedDefault?tU():``)+(a.state===`deleted`?iU():a.state===`stale`?sU():``),children:[a.emoji?(0,I.jsx)(`span`,{className:`oc-chip__emoji`,"aria-hidden":!0,children:a.emoji}):(0,I.jsx)(lm,{size:13,"aria-hidden":!0}),(0,I.jsx)(`span`,{className:`oc-chip__label`,children:a.displayName??a.agentId}),o.showTools&&n?.multiInstance?(0,I.jsxs)(`span`,{className:`oc-chip__instance`,title:uU({instance:a.instanceName}),children:[(0,I.jsx)(Im,{size:11,"aria-hidden":!0}),a.instanceName]}):null]}):null,o.showTools&&!s&&r?.model?(0,I.jsxs)(`span`,{className:`oc-chip oc-chip--info`,title:r.modelProvider?gU({provider:r.modelProvider}):pU(),children:[(0,I.jsx)(Qtt,{}),(0,I.jsx)(`span`,{className:`oc-chip__label`,children:r.model})]}):null,o.showTools&&!s&&r?.thinkingLevel?(0,I.jsxs)(`span`,{className:`oc-chip oc-chip--info`,title:m?yU():SU(),children:[(0,I.jsx)($tt,{}),(0,I.jsxs)(`span`,{className:`oc-chip__label`,children:[TU(),`\xA0: `,j3(r.thinkingLevel)]}),m?(0,I.jsx)(`span`,{className:`oc-chip__hint`,children:OU()}):null]}):null,o.showTools&&r?(0,I.jsx)(q3,{sm:r,detail:!s}):null,(0,I.jsx)(Xtt,{chatId:e,title:t?.title??null,compact:s,ghost:l}),r?(0,I.jsx)(Ztt,{chatId:e,sm:r,settings:i,onOpenPanel:()=>c(!0),compact:s,ghost:l}):null]});return(0,N.useLayoutEffect)(()=>{let e=l.current;if(!e)return;let t=()=>{let t=d.current?.offsetWidth??0;if(t===0)return;let n=Math.min(u.current?.scrollWidth??0,360),r=e.clientWidth-n-16<t;p(e=>e===r?e:r)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[[BU(),QU(),r?.model??``,r?.thinkingLevel??``,a?.displayName??a?.agentId??``,n?.multiInstance?a?.instanceName??``:``,t?.title??``,o.showTools?`1`:`0`].join(`|`)]),(0,I.jsxs)(`header`,{className:`oc-chathead`,ref:l,children:[(0,I.jsx)(`div`,{className:`oc-chathead__title`,title:t?.title??void 0,ref:u,children:t?.title||YH()}),(0,I.jsx)(`div`,{className:`oc-chathead__meta`,children:h(f,!1)}),(0,I.jsx)(`div`,{className:`oc-chathead-ghost`,"aria-hidden":!0,ref:d,children:h(!1,!0)}),(0,I.jsx)(Vtt,{chatId:e,open:s,onOpenChange:c})]})}function J3(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 Xtt({chatId:e,title:t,compact:n=!1,ghost:r=!1}){let i=Zn();async function a(n){let[r,a]=await Promise.all([i.query(V.messages.listByChat,{chatId:e}),i.query(V.messages.getStreamingText,{chatId:e})]),o=new Map(a.map(e=>[e.messageId,e.text])),s=r.map(e=>({role:e.role,text:e.status===`streaming`?o.get(e._id)??e.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}))})),c=r.length>=200,l={title:t??void 0,truncated:c,exportedAt:Date.now()},u=A2e(t);n===`md`?J3(O2e(s,l),`${u}.md`,`text/markdown`):J3(k2e(s,l),`${u}.json`,`application/json`)}let o=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vm,{size:13,"aria-hidden":!0}),n?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`oc-chip__label`,children:BU()}),(0,I.jsx)(dm,{size:13,className:`oc-chip__chev`,"aria-hidden":!0})]})]});return r?(0,I.jsx)(`span`,{className:`oc-chip oc-chip--btn`,children:o}):(0,I.jsxs)(z$,{children:[(0,I.jsx)(B$,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,className:`oc-chip oc-chip--btn`,title:LU(),children:o})}),(0,I.jsxs)(V$,{align:`end`,className:`w-44`,children:[(0,I.jsx)(U$,{children:BU()}),(0,I.jsx)(H$,{onClick:()=>void a(`md`),children:UU()}),(0,I.jsx)(H$,{onClick:()=>void a(`json`),children:KU()})]})]})}function Ztt({chatId:e,sm:t,settings:n,onOpenPanel:r,compact:i=!1,ghost:a=!1}){let[o,s]=(0,N.useState)(!1),c=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Rm,{size:13,"aria-hidden":!0}),i?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`oc-chip__label`,children:QU()}),(0,I.jsx)(dm,{size:13,className:`oc-chip__chev`,"aria-hidden":!0})]})]});return a?(0,I.jsx)(`span`,{className:`oc-chip oc-chip--btn`,children:c}):(0,I.jsxs)(K$,{open:o,onOpenChange:s,children:[(0,I.jsx)(q$,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,className:`oc-chip oc-chip--btn`,title:YU(),children:c})}),(0,I.jsxs)(J$,{align:`end`,className:`oc-spanel-pop w-80 p-2`,children:[t.totalTokens!=null&&t.contextTokens?(0,I.jsxs)(`div`,{className:`oc-spanel-pop__usage`,children:[(0,I.jsx)(`span`,{className:`oc-spanel-pop__usage-label`,children:PU()}),(0,I.jsx)(q3,{sm:t})]}):null,(0,I.jsx)(R3,{chatId:e,sm:t,settings:n}),(0,I.jsxs)(`button`,{type:`button`,className:`oc-spanel-pop__all`,onClick:()=>{s(!1),r()},children:[(0,I.jsx)(Rm,{size:13,"aria-hidden":!0}),MZe(),(0,I.jsx)(fm,{size:13,"aria-hidden":!0})]})]})]})}function Qtt(){return(0,I.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,I.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,I.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`}),(0,I.jsx)(`path`,{d:`M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3`})]})}function $tt(){return(0,I.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,I.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,I.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 Y3({children:e}){return(0,I.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 ent(){return(0,I.jsx)(Y3,{children:(0,I.jsx)(`path`,{d:`M12 5v14M19 12l-7 7-7-7`})})}function X3(){return(0,I.jsxs)(Y3,{children:[(0,I.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,I.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]})}function Z3(){return(0,I.jsx)(Y3,{children:(0,I.jsx)(`path`,{d:`M20 6 9 17l-5-5`})})}var Q3={File:O3e},tnt={...Q3,Text:_tt};function $3({kind:e}){let t=gy(e=>e.metadata?.custom?.messageId),n=F(V.messages.deleteMessage).withOptimisticUpdate(Y4e),r=g1(),i=b1(),a=(0,N.useContext)(U3),[o,s]=(0,N.useState)(!1);if(!t)return null;async function c(){if(await r(e===`assistant`?{title:tW(),description:iW(),confirmLabel:sW(),cancelLabel:uW(),destructive:!0}:{title:pW(),description:gW(),confirmLabel:yW(),cancelLabel:uW(),destructive:!0})){s(!0),e===`assistant`&&a?.begin();try{await n({messageId:t})}catch(t){e===`assistant`&&a?.cancel(),i.error(jW(),t)}finally{s(!1)}}}return(0,I.jsx)(`button`,{type:`button`,className:`oc-iconbtn oc-iconbtn--danger`,title:e===`assistant`?SW():TW(),"aria-label":OW(),"aria-busy":o,disabled:o,onClick:()=>void c(),children:o?(0,I.jsx)(Cm,{size:15,className:`oc-iconbtn__spin`,"aria-hidden":!0}):(0,I.jsx)(Bm,{size:15,"aria-hidden":!0})})}function e6(){let e=gy(e=>e.metadata?.custom?.rawText??``),[t,n]=(0,N.useState)(!1),r=[...e].length;return(0,I.jsxs)(`div`,{className:`oc-msg__source`,children:[(0,I.jsxs)(`div`,{className:`oc-msg__source-head`,children:[(0,I.jsx)(`span`,{className:`oc-msg__source-label`,children:r>1?jK({count:r}):OK({count:r})}),(0,I.jsx)(`button`,{type:`button`,className:`oc-iconbtn`,title:PK(),"aria-label":PK(),onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)})},children:t?(0,I.jsx)(Z3,{}):(0,I.jsx)(X3,{})})]}),(0,I.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.length>0?e:LK()})]})}function t6({active:e,onToggle:t}){return(0,I.jsx)(`button`,{type:`button`,className:`oc-iconbtn${e?` is-on`:``}`,onClick:t,"aria-pressed":e,title:e?BK():UK(),"aria-label":KK(),children:(0,I.jsx)(Tee,{size:15,"aria-hidden":!0})})}function nnt(){let[e,t]=(0,N.useState)(!1),n=H3(),r=gy(e=>e.id.startsWith(`optimistic-`)),i=gy(e=>e.id);return(0,I.jsx)(lO.Root,{className:`oc-msg oc-msg--user${r?` is-sending`:``}`,"data-message-id":i,children:(0,I.jsxs)(`div`,{className:`oc-msg__col oc-msg__col--user`,children:[(0,I.jsx)(`div`,{className:`oc-msg__bubble`,children:e?(0,I.jsx)(e6,{}):(0,I.jsx)(lO.Parts,{components:Q3})}),r?(0,I.jsxs)(`span`,{className:`oc-msg__sending`,role:`status`,children:[(0,I.jsx)(`span`,{className:`oc-msg__sending-spin`,"aria-hidden":!0}),QK()]}):(0,I.jsxs)(By.Root,{className:`oc-msg__actions oc-msg__actions--user`,hideWhenRunning:!0,autohide:`not-last`,children:[n.copyUser?(0,I.jsxs)(By.Copy,{className:`oc-iconbtn`,title:YK(),children:[(0,I.jsx)(lO.If,{copied:!0,children:(0,I.jsx)(Z3,{})}),(0,I.jsx)(lO.If,{copied:!1,children:(0,I.jsx)(X3,{})})]}):null,n.showSource?(0,I.jsx)(t6,{active:e,onToggle:()=>t(e=>!e)}):null,n.showReport?(0,I.jsx)(O3,{}):null,n.showDelete?(0,I.jsx)($3,{kind:`user`}):null]})]})})}function rnt(){let[e,t]=(0,N.useState)(!1),n=H3(),r=ZQ(),i=gy(e=>e.id);return(0,I.jsxs)(lO.Root,{className:`oc-msg oc-msg--assistant`,"data-message-id":i,children:[(0,I.jsx)(G3,{className:`oc-msg__avatar`}),(0,I.jsxs)(`div`,{className:`oc-msg__col`,children:[(0,I.jsxs)(`div`,{className:`oc-msg__name`,children:[r.agentEmoji?(0,I.jsx)(`span`,{className:`oc-msg__name-emoji`,"aria-hidden":!0,children:r.agentEmoji}):null,w2e(r)]}),(0,I.jsxs)(`div`,{className:`oc-msg__body`,children:[n.showTools?(0,I.jsxs)(`div`,{className:`oc-msg__meta`,children:[(0,I.jsx)(g3e,{}),(0,I.jsx)(b3e,{})]}):null,e?(0,I.jsx)(e6,{}):(0,I.jsx)(lO.Parts,{components:tnt}),(0,I.jsx)(n3e,{})]}),(0,I.jsxs)(By.Root,{className:`oc-msg__actions`,hideWhenRunning:!0,autohide:`not-last`,children:[n.copyAssistant?(0,I.jsxs)(By.Copy,{className:`oc-iconbtn`,title:sq(),children:[(0,I.jsx)(lO.If,{copied:!0,children:(0,I.jsx)(Z3,{})}),(0,I.jsx)(lO.If,{copied:!1,children:(0,I.jsx)(X3,{})})]}):null,n.showSource?(0,I.jsx)(t6,{active:e,onToggle:()=>t(e=>!e)}):null,n.showReport?(0,I.jsx)(O3,{}):null,n.showDelete?(0,I.jsx)($3,{kind:`assistant`}):null]})]})]})}function int(){let e=gy(e=>e.id);return(0,I.jsx)(lO.Root,{className:`oc-msg oc-msg--system`,"data-message-id":e,children:(0,I.jsx)(`div`,{className:`oc-msg__body`,children:(0,I.jsx)(lO.Parts,{components:Q3})})})}function ant(){let e=my(e=>e.status?.type),t=my(e=>e.type),n=e===`incomplete`;return(0,I.jsxs)($E.Root,{className:`oc-attach${n?` oc-attach--error`:``}`,"data-status":e,children:[(0,I.jsx)(`span`,{className:`oc-attach__icon`,"aria-hidden":!0,children:n?(0,I.jsx)(hm,{size:14}):t===`image`?(0,I.jsx)(Aee,{size:14}):(0,I.jsx)(Nee,{size:14})}),(0,I.jsx)(`span`,{className:`oc-attach__name`,children:(0,I.jsx)($E.Name,{})}),n?(0,I.jsx)(`span`,{className:`oc-attach__state`,children:yq()}):null,(0,I.jsx)($E.Remove,{className:`oc-attach__remove`,"aria-label":Oq(),children:(0,I.jsx)(Gm,{size:13,"aria-hidden":!0})})]})}function ont(){let e=(0,N.useSyncExternalStore)(AO.subscribe,AO.getSnapshot);return e.active?(0,I.jsxs)(`div`,{className:`oc-upload`,role:`status`,"aria-live":`polite`,children:[(0,I.jsxs)(`div`,{className:`oc-upload__head`,children:[(0,I.jsx)(Cm,{className:`oc-upload__spin`,size:14,"aria-hidden":!0}),(0,I.jsx)(`span`,{children:e.count>1?Tq({count:e.count,percent:e.percent}):Sq({percent:e.percent})})]}),(0,I.jsx)(`div`,{className:`oc-upload__track`,"aria-hidden":!0,children:(0,I.jsx)(`div`,{className:`oc-upload__bar`,style:{width:`${e.percent}%`}})})]}):null}function snt(){let e=(0,N.useContext)(W3),t=hy(),n=Sie(e=>e.text).trim().length>0;return(0,I.jsx)(`button`,{type:`button`,className:`oc-composer__send`,disabled:!n||e===null,"aria-label":PJ(),title:n?LJ():jJ(),onClick:()=>{if(e===null)return;let n=t.getState().text;n.trim()!==``&&e(n).then(e=>{e&&t.setText(``)})},children:(0,I.jsx)(sm,{size:18,"aria-hidden":!0})})}function cnt({showTools:e,onToggleTools:t,unavailable:n=!1}){let r=H3().voiceInput,i=Tie(e=>e.isRunning),a=(0,N.useContext)(W3),o=hy();return(0,I.jsxs)(WD.Root,{className:`oc-composer${n?` oc-composer--disabled`:``}`,children:[(0,I.jsx)(WD.Attachments,{components:{Attachment:ant}}),(0,I.jsx)(ont,{}),(0,I.jsx)(WD.Input,{className:`oc-composer__input`,placeholder:n?uq():pq(),autoFocus:!0,rows:1,disabled:n,onKeyDownCapture:e=>{if(!i||a===null||e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing)return;e.preventDefault(),e.stopPropagation();let t=o.getState().text;t.trim()!==``&&a(t).then(e=>{e&&o.setText(``)})},autoCorrect:`off`,autoCapitalize:`off`,autoComplete:`off`,"data-gramm":`false`,"data-gramm_editor":`false`,"data-enable-grammarly":`false`}),(0,I.jsxs)(`div`,{className:`oc-composer__bar`,children:[(0,I.jsxs)(`div`,{className:`oc-composer__group`,children:[(0,I.jsx)(WD.AddAttachment,{className:`oc-composer__icon`,"aria-label":gq(),disabled:i||n,title:i?jJ():void 0,children:(0,I.jsx)(Nm,{size:18,"aria-hidden":!0})}),(0,I.jsxs)(`button`,{type:`button`,className:`oc-composer__tools${e?` is-on`:``}`,onClick:t,"aria-pressed":e,title:e?jq():Pq(),children:[(0,I.jsx)(Rm,{size:15,"aria-hidden":!0}),Lq()]})]}),(0,I.jsxs)(`div`,{className:`oc-composer__group`,children:[r?(0,I.jsx)(`button`,{type:`button`,className:`oc-composer__icon`,title:yJ(),"aria-label":SJ(),children:(0,I.jsx)(Dm,{size:18,"aria-hidden":!0})}):null,n?(0,I.jsx)(`button`,{type:`button`,className:`oc-composer__send`,disabled:!0,"aria-label":TJ(),children:(0,I.jsx)(sm,{size:18,"aria-hidden":!0})}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(bO.If,{running:!1,children:(0,I.jsx)(WD.Send,{className:`oc-composer__send`,"aria-label":OJ(),children:(0,I.jsx)(sm,{size:18,"aria-hidden":!0})})}),(0,I.jsx)(bO.If,{running:!0,children:(0,I.jsx)(snt,{})})]})]})]})]})}function lnt(){var e=[...arguments];return(0,N.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var n6=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function r6(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function i6(e){return`nodeType`in e}function a6(e){return e?r6(e)?e:i6(e)?e.ownerDocument?.defaultView??window:window:window}function o6(e){let{Document:t}=a6(e);return e instanceof t}function s6(e){return r6(e)?!1:e instanceof a6(e).HTMLElement}function c6(e){return e instanceof a6(e).SVGElement}function l6(e){return e?r6(e)?e.document:i6(e)?o6(e)?e:s6(e)||c6(e)?e.ownerDocument:document:document:document}var u6=n6?N.useLayoutEffect:N.useEffect;function d6(e){let t=(0,N.useRef)(e);return u6(()=>{t.current=e}),(0,N.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function unt(){let e=(0,N.useRef)(null);return[(0,N.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,N.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function f6(e,t){t===void 0&&(t=[e]);let n=(0,N.useRef)(e);return u6(()=>{n.current!==e&&(n.current=e)},t),n}function p6(e,t){let n=(0,N.useRef)();return(0,N.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function m6(e){let t=d6(e),n=(0,N.useRef)(null);return[n,(0,N.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function h6(e){let t=(0,N.useRef)();return(0,N.useEffect)(()=>{t.current=e},[e]),t.current}var g6={};function _6(e,t){return(0,N.useMemo)(()=>{if(t)return t;let n=g6[e]==null?0:g6[e]+1;return g6[e]=n,e+`-`+n},[e,t])}function v6(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 y6=v6(1),b6=v6(-1);function dnt(e){return`clientX`in e&&`clientY`in e}function x6(e){if(!e)return!1;let{KeyboardEvent:t}=a6(e.target);return t&&e instanceof t}function fnt(e){if(!e)return!1;let{TouchEvent:t}=a6(e.target);return t&&e instanceof t}function S6(e){if(fnt(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 dnt(e)?{x:e.clientX,y:e.clientY}:null}var C6=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[C6.Translate.toString(e),C6.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),w6=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function pnt(e){return e.matches(w6)?e:e.querySelector(w6)}var mnt={display:`none`};function hnt(e){let{id:t,value:n}=e;return N.createElement(`div`,{id:t,style:mnt},n)}function gnt(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return N.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 _nt(){let[e,t]=(0,N.useState)(``);return{announce:(0,N.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var T6=(0,N.createContext)(null);function vnt(e){let t=(0,N.useContext)(T6);(0,N.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function ynt(){let[e]=(0,N.useState)(()=>new Set),t=(0,N.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,N.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var bnt={draggable:`
|
|
159
|
+
To pick up a draggable item, press the space bar.
|
|
160
|
+
While dragging, use the arrow keys to move the item.
|
|
161
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
162
|
+
`},xnt={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 Snt(e){let{announcements:t=xnt,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=bnt}=e,{announce:a,announcement:o}=_nt(),s=_6(`DndLiveRegion`),[c,l]=(0,N.useState)(!1);if((0,N.useEffect)(()=>{l(!0)},[]),vnt((0,N.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=N.createElement(N.Fragment,null,N.createElement(hnt,{id:r,value:i.draggable}),N.createElement(gnt,{id:s,announcement:o}));return n?(0,ls.createPortal)(u,n):u}var E6;(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`})(E6||={});function D6(){}function O6(e,t){return(0,N.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function k6(){var e=[...arguments];return(0,N.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var A6=Object.freeze({x:0,y:0});function j6(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Cnt(e,t){let n=S6(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 M6(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function wnt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function N6(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 P6(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function F6(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 Tnt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=F6(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=j6(F6(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(M6)},I6=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=N6(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=N6(r),o=i.reduce((e,t,r)=>e+j6(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(M6)};function Ent(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 Dnt=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=Ent(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(wnt)};function Ont(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function L6(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:A6}function knt(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 Ant=knt(1);function R6(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 jnt(e,t,n){let r=R6(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 Mnt={ignoreTransform:!1};function z6(e,t){t===void 0&&(t=Mnt);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=a6(e).getComputedStyle(e);t&&(n=jnt(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 B6(e){return z6(e,{ignoreTransform:!0})}function Nnt(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Pnt(e,t){return t===void 0&&(t=a6(e).getComputedStyle(e)),t.position===`fixed`}function Fnt(e,t){t===void 0&&(t=a6(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 V6(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(o6(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!s6(i)||c6(i)||n.includes(i))return n;let a=a6(e).getComputedStyle(i);return i!==e&&Fnt(i,a)&&n.push(i),Pnt(i,a)?n:r(i.parentNode)}return e?r(e):n}function H6(e){let[t]=V6(e,1);return t??null}function U6(e){return!n6||!e?null:r6(e)?e:i6(e)?o6(e)||e===l6(e).scrollingElement?window:s6(e)?e:null:null}function W6(e){return r6(e)?e.scrollX:e.scrollLeft}function G6(e){return r6(e)?e.scrollY:e.scrollTop}function K6(e){return{x:W6(e),y:G6(e)}}var q6;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(q6||={});function J6(e){return!n6||!e?!1:e===document.scrollingElement}function Y6(e){let t={x:0,y:0},n=J6(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 Int={x:.2,y:.2};function Lnt(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Int);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Y6(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=q6.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=q6.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=q6.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=q6.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function Rnt(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 X6(e){return e.reduce((e,t)=>y6(e,K6(t)),A6)}function znt(e){return e.reduce((e,t)=>e+W6(t),0)}function Bnt(e){return e.reduce((e,t)=>e+G6(t),0)}function Z6(e,t){if(t===void 0&&(t=z6),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);H6(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Vnt=[[`x`,[`left`,`right`],znt],[`y`,[`top`,`bottom`],Bnt]],Q6=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=V6(t),r=X6(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Vnt)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})}},$6=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 Hnt(e){let{EventTarget:t}=a6(e);return e instanceof t?e:l6(e)}function e8(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 t8;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(t8||={});function n8(e){e.preventDefault()}function Unt(e){e.stopPropagation()}var r8;(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`})(r8||={});var i8={start:[r8.Space,r8.Enter],cancel:[r8.Esc],end:[r8.Space,r8.Enter,r8.Tab]},Wnt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case r8.Right:return{...n,x:n.x+25};case r8.Left:return{...n,x:n.x-25};case r8.Down:return{...n,y:n.y+25};case r8.Up:return{...n,y:n.y-25}}},a8=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 $6(l6(t)),this.windowListeners=new $6(a6(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(t8.Resize,this.handleCancel),this.windowListeners.add(t8.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(t8.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Z6(n),t(A6)}handleKeyDown(e){if(x6(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=i8,coordinateGetter:a=Wnt,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}:A6;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=b6(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}=Y6(n),p=Rnt(n),m={x:Math.min(i===r8.Right?p.right-p.width/2:p.right,Math.max(i===r8.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===r8.Down?p.bottom-p.height/2:p.bottom,Math.max(i===r8.Down?p.top:p.top+p.height/2,u.y))},h=i===r8.Right&&!s||i===r8.Left&&!c,g=i===r8.Down&&!l||i===r8.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===r8.Right&&e<=d.x||i===r8.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===r8.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===r8.Down&&e<=d.y||i===r8.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===r8.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,y6(b6(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()}};a8.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=i8,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 o8(e){return!!(e&&`distance`in e)}function s8(e){return!!(e&&`delay`in e)}var c8=class{constructor(e,t,n){n===void 0&&(n=Hnt(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=l6(i),this.documentListeners=new $6(this.document),this.listeners=new $6(n),this.windowListeners=new $6(a6(i)),this.initialCoordinates=S6(r)??A6,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(t8.Resize,this.handleCancel),this.windowListeners.add(t8.DragStart,n8),this.windowListeners.add(t8.VisibilityChange,this.handleCancel),this.windowListeners.add(t8.ContextMenu,n8),this.documentListeners.add(t8.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(s8(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(o8(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(t8.Click,Unt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(t8.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=S6(e)??A6,s=b6(n,o);if(!t&&a){if(o8(a)){if(a.tolerance!=null&&e8(s,a.tolerance))return this.handleCancel();if(e8(s,a.distance))return this.handleStart()}if(s8(a)&&e8(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===r8.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Gnt={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},l8=class extends c8{constructor(e){let{event:t}=e,n=l6(t.target);super(e,Gnt,n)}};l8.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 Knt={move:{name:`mousemove`},end:{name:`mouseup`}},u8;(function(e){e[e.RightClick=2]=`RightClick`})(u8||={});var qnt=class extends c8{constructor(e){super(e,Knt,l6(e.event.target))}};qnt.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===u8.RightClick?!1:(r?.({event:n}),!0)}}];var d8={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Jnt=class extends c8{constructor(e){super(e,d8)}static setup(){return window.addEventListener(d8.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(d8.move.name,e)};function e(){}}};Jnt.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 f8;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(f8||={});var p8;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(p8||={});function Ynt(e){let{acceleration:t,activator:n=f8.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=p8.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=Znt({delta:d,disabled:!a}),[m,h]=unt(),g=(0,N.useRef)({x:0,y:0}),_=(0,N.useRef)({x:0,y:0}),v=(0,N.useMemo)(()=>{switch(n){case f8.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case f8.DraggableRect:return i}},[n,i,c]),y=(0,N.useRef)(null),b=(0,N.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,N.useMemo)(()=>s===p8.TreeOrder?[...l].reverse():l,[s,l]);(0,N.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}=Lnt(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 Xnt={x:{[q6.Backward]:!1,[q6.Forward]:!1},y:{[q6.Backward]:!1,[q6.Forward]:!1}};function Znt(e){let{delta:t,disabled:n}=e,r=h6(t);return p6(e=>{if(n||!r||!e)return Xnt;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[q6.Backward]:e.x[q6.Backward]||i.x===-1,[q6.Forward]:e.x[q6.Forward]||i.x===1},y:{[q6.Backward]:e.y[q6.Backward]||i.y===-1,[q6.Forward]:e.y[q6.Forward]||i.y===1}}},[n,t,r])}function Qnt(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return p6(e=>t==null?null:r??e??null,[r,t])}function $nt(e,t){return(0,N.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 m8;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(m8||={});var h8;(function(e){e.Optimized=`optimized`})(h8||={});var g8=new Map;function ert(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,N.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,N.useRef)(e),d=g(),f=f6(d),p=(0,N.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,N.useRef)(null),h=p6(t=>{if(d&&!n)return g8;if(!t||t===g8||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 Q6(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,N.useEffect)(()=>{u.current=e},[e]),(0,N.useEffect)(()=>{d||p()},[n,d]),(0,N.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,N.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 m8.Always:return!1;case m8.BeforeDragging:return n;default:return!n}}}function _8(e,t){return p6(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function trt(e,t){return _8(e,t)}function nrt(e){let{callback:t,disabled:n}=e,r=d6(t),i=(0,N.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,N.useEffect)(()=>()=>i?.disconnect(),[i]),i}function v8(e){let{callback:t,disabled:n}=e,r=d6(t),i=(0,N.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,N.useEffect)(()=>()=>i?.disconnect(),[i]),i}function rrt(e){return new Q6(z6(e),e)}function y8(e,t,n){t===void 0&&(t=rrt);let[r,i]=(0,N.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=nrt({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=v8({callback:a});return u6(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function irt(e){return L6(e,_8(e))}var b8=[];function art(e){let t=(0,N.useRef)(e),n=p6(n=>e?n&&n!==b8&&e&&t.current&&e.parentNode===t.current.parentNode?n:V6(e):b8,[e]);return(0,N.useEffect)(()=>{t.current=e},[e]),n}function ort(e){let[t,n]=(0,N.useState)(null),r=(0,N.useRef)(e),i=(0,N.useCallback)(e=>{let t=U6(e.target);t&&n(e=>e?(e.set(t,K6(t)),new Map(e)):null)},[]);return(0,N.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=U6(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,K6(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=>{U6(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,N.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>y6(e,t),A6):X6(e):A6,[e,t])}function x8(e,t){t===void 0&&(t=[]);let n=(0,N.useRef)(null);return(0,N.useEffect)(()=>{n.current=null},t),(0,N.useEffect)(()=>{let t=e!==A6;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?b6(e,n.current):A6}function srt(e){(0,N.useEffect)(()=>{if(!n6)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 crt(e,t){return(0,N.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function S8(e){return(0,N.useMemo)(()=>e?Nnt(e):null,[e])}var C8=[];function lrt(e,t){t===void 0&&(t=z6);let[n]=e,r=S8(n?a6(n):null),[i,a]=(0,N.useState)(C8);function o(){a(()=>e.length?e.map(e=>J6(e)?r:new Q6(t(e),e)):C8)}let s=v8({callback:o});return u6(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function w8(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return s6(t)?t:e}function urt(e){let{measure:t}=e,[n,r]=(0,N.useState)(null),i=v8({callback:(0,N.useCallback)(e=>{for(let{target:n}of e)if(s6(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=m6((0,N.useCallback)(e=>{let n=w8(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,N.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var drt=[{sensor:l8,options:{}},{sensor:a8,options:{}}],frt={current:{}},T8={draggable:{measure:B6},droppable:{measure:B6,strategy:m8.WhileDragging,frequency:h8.Optimized},dragOverlay:{measure:z6}},E8=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}},prt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new E8,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:D6},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:T8,measureDroppableContainers:D6,windowRect:null,measuringScheduled:!1},D8={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:D6,draggableNodes:new Map,over:null,measureDroppableContainers:D6},O8=(0,N.createContext)(D8),k8=(0,N.createContext)(prt);function mrt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new E8}}}function hrt(e,t){switch(t.type){case E6.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case E6.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 E6.DragEnd:case E6.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case E6.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new E8(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case E6.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 E8(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case E6.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new E8(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function grt(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,N.useContext)(O8),a=h6(r),o=h6(n?.id);return(0,N.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!x6(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=pnt(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function A8(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function _rt(e){return(0,N.useMemo)(()=>({draggable:{...T8.draggable,...e?.draggable},droppable:{...T8.droppable,...e?.droppable},dragOverlay:{...T8.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function vrt(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,N.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=L6(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=H6(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var j8=(0,N.createContext)({...A6,scaleX:1,scaleY:1}),M8;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(M8||={});var N8=(0,N.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=drt,collisionDetection:o=Dnt,measuring:s,modifiers:c,...l}=e,[u,d]=(0,N.useReducer)(hrt,void 0,mrt),[f,p]=ynt(),[m,h]=(0,N.useState)(M8.Uninitialized),g=m===M8.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,N.useRef)({initial:null,translated:null}),C=(0,N.useMemo)(()=>_==null?null:{id:_,data:x?.data??frt,rect:S},[_,x]),w=(0,N.useRef)(null),[T,E]=(0,N.useState)(null),[D,O]=(0,N.useState)(null),ee=f6(l,Object.values(l)),te=_6(`DndDescribedBy`,t),k=(0,N.useMemo)(()=>b.getEnabled(),[b]),A=_rt(s),{droppableRects:j,measureDroppableContainers:ne,measuringScheduled:re}=ert(k,{dragging:g,dependencies:[y.x,y.y],config:A.droppable}),M=Qnt(v,_),ie=(0,N.useMemo)(()=>D?S6(D):null,[D]),ae=Ie(),oe=trt(M,A.draggable.measure);vrt({activeNode:_==null?null:v.get(_),config:ae.layoutShiftCompensation,initialRect:oe,measure:A.draggable.measure});let se=y8(M,A.draggable.measure,oe),ce=y8(M?M.parentElement:null),le=(0,N.useRef)({activatorEvent:null,active:null,activeNode:M,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ue=b.getNodeFor(le.current.over?.id),de=urt({measure:A.dragOverlay.measure}),fe=de.nodeRef.current??M,pe=g?de.rect??se:null,me=!!(de.nodeRef.current&&de.rect),he=irt(me?null:se),ge=S8(fe?a6(fe):null),_e=art(g?ue??M:null),ve=lrt(_e),ye=A8(c,{transform:{x:y.x-he.x,y:y.y-he.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:se,containerNodeRect:ce,draggingNodeRect:pe,over:le.current.over,overlayNodeRect:de.rect,scrollableAncestors:_e,scrollableAncestorRects:ve,windowRect:ge}),be=ie?y6(ie,y):null,xe=ort(_e),Se=x8(xe),Ce=x8(xe,[se]),we=y6(ye,Se),Te=pe?Ant(pe,ye):null,Ee=C&&Te?o({active:C,collisionRect:Te,droppableRects:j,droppableContainers:k,pointerCoordinates:be}):null,De=P6(Ee,`id`),[Oe,ke]=(0,N.useState)(null),Ae=Ont(me?ye:y6(ye,Ce),Oe?.rect??null,se),je=(0,N.useRef)(null),Me=(0,N.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;je.current=new n({active:w.current,activeNode:i,event:a,options:r,context:le,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=ee.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=ee.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}=ee.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,ls.unstable_batchedUpdates)(()=>{r?.(i),h(M8.Initializing),d({type:E6.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(je.current),O(a)})},onMove(e){d({type:E6.DragMove,coordinates:e})},onEnd:o(E6.DragEnd),onCancel:o(E6.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=le.current,o=null;if(t&&i){let{cancelDrop:s}=ee.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===E6.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=E6.DragCancel)}w.current=null,(0,ls.unstable_batchedUpdates)(()=>{d({type:e}),h(M8.Uninitialized),ke(null),E(null),O(null),je.current=null;let t=e===E6.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=ee.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Ne=$nt(a,(0,N.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,Me(n,t))},[v,Me]));srt(a),u6(()=>{se&&m===M8.Initializing&&h(M8.Initialized)},[se,m]),(0,N.useEffect)(()=>{let{onDragMove:e}=ee.current,{active:t,activatorEvent:n,collisions:r,over:i}=le.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:we.x,y:we.y},over:i};(0,ls.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[we.x,we.y]),(0,N.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=le.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=ee.current,o=r.get(De),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,ls.unstable_batchedUpdates)(()=>{ke(s),a?.(c),f({type:`onDragOver`,event:c})})},[De]),u6(()=>{le.current={activatorEvent:D,active:C,activeNode:M,collisionRect:Te,collisions:Ee,droppableRects:j,draggableNodes:v,draggingNode:fe,draggingNodeRect:pe,droppableContainers:b,over:Oe,scrollableAncestors:_e,scrollAdjustedTranslate:we},S.current={initial:pe,translated:Te}},[C,M,Ee,Te,v,fe,pe,j,b,Oe,_e,we]),Ynt({...ae,delta:y,draggingRect:Te,pointerCoordinates:be,scrollableAncestors:_e,scrollableAncestorRects:ve});let Pe=(0,N.useMemo)(()=>({active:C,activeNode:M,activeNodeRect:se,activatorEvent:D,collisions:Ee,containerNodeRect:ce,dragOverlay:de,draggableNodes:v,droppableContainers:b,droppableRects:j,over:Oe,measureDroppableContainers:ne,scrollableAncestors:_e,scrollableAncestorRects:ve,measuringConfiguration:A,measuringScheduled:re,windowRect:ge}),[C,M,se,D,Ee,ce,de,v,b,j,Oe,ne,_e,ve,A,re,ge]),Fe=(0,N.useMemo)(()=>({activatorEvent:D,activators:Ne,active:C,activeNodeRect:se,ariaDescribedById:{draggable:te},dispatch:d,draggableNodes:v,over:Oe,measureDroppableContainers:ne}),[D,Ne,C,se,d,te,v,Oe,ne]);return N.createElement(T6.Provider,{value:p},N.createElement(O8.Provider,{value:Fe},N.createElement(k8.Provider,{value:Pe},N.createElement(j8.Provider,{value:Ae},i)),N.createElement(grt,{disabled:n?.restoreFocus===!1})),N.createElement(Snt,{...n,hiddenTextDescribedById:te}));function Ie(){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}}}),yrt=(0,N.createContext)(null),P8=`button`,brt=`Draggable`;function xrt(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=_6(brt),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,N.useContext)(O8),{role:p=P8,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,N.useContext)(g?j8:yrt),[v,y]=m6(),[b,x]=m6(),S=crt(o,t),C=f6(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,N.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===P8?!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 F8(){return(0,N.useContext)(k8)}var Srt=`Droppable`,Crt={timeout:25};function I8(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=_6(Srt),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,N.useContext)(O8),u=(0,N.useRef)({disabled:n}),d=(0,N.useRef)(!1),f=(0,N.useRef)(null),p=(0,N.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Crt,...i},_=f6(h??r),v=v8({callback:(0,N.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]=m6((0,N.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=f6(t);return(0,N.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,N.useEffect)(()=>(s({type:E6.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:E6.UnregisterDroppable,key:a,id:r})),[r]),(0,N.useEffect)(()=>{n!==u.current.disabled&&(s({type:E6.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 wrt(e){let{animation:t,children:n}=e,[r,i]=(0,N.useState)(null),[a,o]=(0,N.useState)(null),s=h6(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]),N.createElement(N.Fragment,null,n,r?(0,N.cloneElement)(r,{ref:o}):null)}var Trt={x:0,y:0,scaleX:1,scaleY:1};function Ert(e){let{children:t}=e;return N.createElement(O8.Provider,{value:D8},N.createElement(j8.Provider,{value:Trt},t))}var Drt={position:`fixed`,touchAction:`none`},Ort=e=>x6(e)?`transform 250ms ease`:void 0,krt=(0,N.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=Ort}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...Drt,width:s.width,height:s.height,top:s.top,left:s.left,transform:C6.Transform.toString(d),transformOrigin:i&&r?Cnt(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return N.createElement(n,{className:o,style:f,ref:t},a)}),Art={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:C6.Transform.toString(t)},{transform:C6.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 jrt(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return d6((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=w8(a);if(!c)return;let{transform:l}=a6(a).getComputedStyle(a),u=R6(l);if(!u)return;let d=typeof t==`function`?t:Mrt(t);return Z6(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 Mrt(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...Art,...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 L8=0;function Nrt(e){return(0,N.useMemo)(()=>{if(e!=null)return L8++,L8},[e])}var Prt=N.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}=F8(),S=(0,N.useContext)(j8),C=Nrt(d?.id),w=A8(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=_8(f),E=jrt({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return N.createElement(Ert,null,N.createElement(wrt,{animation:E},d&&C?N.createElement(krt,{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))}),Frt=e=>{let{transform:t}=e;return{...t,y:0}};function Irt(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 Lrt=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e,i=r[0];return!t||!i?n:Irt(n,t,i)},Rrt=e=>{let{transform:t}=e;return{...t,x:0}};function R8(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function zrt(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function z8(e){return e!==null&&e>=0}function Brt(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 Vrt(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var B8={scaleX:1,scaleY:1},Hrt=e=>{let{rects:t,activeNodeRect:n,activeIndex:r,overIndex:i,index:a}=e,o=t[r]??n;if(!o)return null;let s=Urt(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,...B8}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...B8}:a<r&&a>=i?{x:o.width+s,y:0,...B8}:{x:0,y:0,...B8}};function Urt(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 V8=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=R8(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}},H8={scaleX:1,scaleY:1},Wrt=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,...H8}:null}let s=Grt(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...H8}:r<t&&r>=a?{x:0,y:o.height+s,...H8}:{x:0,y:0,...H8}};function Grt(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 U8=`Sortable`,W8=N.createContext({activeIndex:-1,containerId:U8,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:V8,disabled:{draggable:!1,droppable:!1}});function G8(e){let{children:t,id:n,items:r,strategy:i=V8,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=F8(),d=_6(U8,n),f=s.rect!==null,p=(0,N.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,N.useRef)(p),v=!Brt(p,_.current),y=g!==-1&&h===-1||v,b=Vrt(a);u6(()=>{v&&m&&u(p)},[v,p,m,u]),(0,N.useEffect)(()=>{_.current=p},[p]);let x=(0,N.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:zrt(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return N.createElement(W8.Provider,{value:x},t)}var Krt=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return R8(n,r,i).indexOf(t)},qrt=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},Jrt={duration:200,easing:`ease`},K8=`transform`,q8=C6.Transition.toString({property:K8,duration:0,easing:`linear`}),Yrt={roleDescription:`sortable`};function Xrt(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,N.useState)(null),s=(0,N.useRef)(n);return u6(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=z6(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,N.useEffect)(()=>{a&&o(null)},[a]),a}function J8(e){let{animateLayoutChanges:t=qrt,attributes:n,disabled:r,data:i,getNewIndex:a=Krt,id:o,strategy:s,resizeObserverConfig:c,transition:l=Jrt}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,N.useContext)(W8),y=Zrt(r,p),b=u.indexOf(o),x=(0,N.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,N.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=I8({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:ee,attributes:te,setNodeRef:k,listeners:A,isDragging:j,over:ne,setActivatorNodeRef:re,transform:M}=xrt({id:o,data:x,attributes:{...Yrt,...n},disabled:y.draggable}),ie=lnt(E,k),ae=!!D,oe=ae&&!m&&z8(f)&&z8(g),se=!_&&j,ce=oe?(se&&oe?M:null)??(s??v)({rects:h,activeNodeRect:ee,activeIndex:f,overIndex:g,index:b}):null,le=z8(f)&&z8(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,ue=D?.id,de=(0,N.useRef)({activeId:ue,items:u,newIndex:le,containerId:d}),fe=u!==de.current.items,pe=t({active:D,containerId:d,isDragging:j,isSorting:ae,id:o,index:b,items:u,newIndex:de.current.newIndex,previousItems:de.current.items,previousContainerId:de.current.containerId,transition:l,wasDragging:de.current.activeId!=null}),me=Xrt({disabled:!pe,index:b,node:w,rect:C});return(0,N.useEffect)(()=>{ae&&de.current.newIndex!==le&&(de.current.newIndex=le),d!==de.current.containerId&&(de.current.containerId=d),u!==de.current.items&&(de.current.items=u)},[ae,le,d,u]),(0,N.useEffect)(()=>{if(ue===de.current.activeId)return;if(ue!=null&&de.current.activeId==null){de.current.activeId=ue;return}let e=setTimeout(()=>{de.current.activeId=ue},50);return()=>clearTimeout(e)},[ue]),{active:D,activeIndex:f,attributes:te,data:x,rect:C,index:b,newIndex:le,items:u,isOver:T,isSorting:ae,isDragging:j,listeners:A,node:w,overIndex:g,over:ne,setNodeRef:ie,setActivatorNodeRef:re,setDroppableNodeRef:E,setDraggableNodeRef:k,transform:me??ce,transition:he()};function he(){if(me||fe&&de.current.newIndex===b)return q8;if(!(se&&!x6(O)||!l)&&(ae||pe))return C6.Transition.toString({...l,property:K8})}}function Zrt(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function Y8(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 Qrt=[r8.Down,r8.Right,r8.Up,r8.Left],X8=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(Qrt.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 r8.Down:r.top<a.top&&t.push(n);break;case r8.Up:r.top>a.top&&t.push(n);break;case r8.Left:r.left>a.left&&t.push(n);break;case r8.Right:r.left<a.left&&t.push(n);break}});let c=I6({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=P6(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=V6(c).some((e,t)=>s[t]!==e),i=Z8(e,t),a=$rt(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:b6(u,l)}}}};function Z8(e,t){return!Y8(e)||!Y8(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function $rt(e,t){return!Y8(e)||!Y8(t)||!Z8(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Q8({open:e,onOpenChange:t,title:n,description:r,children:i,onSubmit:a,submitLabel:o=`Enregistrer`,submitting:s=!1,canSubmit:c=!0}){let[l,u]=(0,N.useState)(!1),d=s||l;async function f(){if(!(!c||d))try{u(!0),await a()}finally{u(!1)}}return(0,I.jsx)(W1,{open:e,onOpenChange:t,children:(0,I.jsxs)(G1,{side:`right`,className:`w-4/5 sm:max-w-none gap-0 p-0`,children:[(0,I.jsxs)(K1,{className:`border-b px-6 py-4`,children:[(0,I.jsx)(J1,{children:n}),r?(0,I.jsx)(Y1,{children:r}):null]}),(0,I.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,I.jsx)(`div`,{className:`oc-sheet__body flex-1 overflow-y-auto px-6 py-4`,children:i}),(0,I.jsxs)(q1,{className:`border-t px-6 py-4`,children:[(0,I.jsxs)(X,{type:`submit`,disabled:!c||d,children:[d?(0,I.jsx)(Cm,{className:`size-4 animate-spin`}):null,o]}),(0,I.jsx)(X,{type:`button`,variant:`ghost`,onClick:()=>t(!1),children:`Annuler`})]})]})]})})}var $8=6e4,e5=60*$8,t5=24*e5,n5=7*t5,r5=30*t5,i5=365*t5;function eit(e,t){let n=t-e;if(n<$8)return`maintenant`;if(n<e5)return`${Math.floor(n/$8)}min`;if(n<t5)return`${Math.floor(n/e5)}h`;if(n<n5)return`${Math.floor(n/t5)}j`;if(n<r5)return`${Math.floor(n/n5)}sem`;if(n<i5)return`${Math.floor(n/r5)}mois`;let r=Math.floor(n/i5);return`${r}an${r>1?`s`:``}`}var a5=[{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)`}],o5=e=>a5.find(t=>t.value===e)?.hue??null,s5=`project:none`,tit=e=>`project:${e}`,c5=`oc.noproject.collapsed`;function nit({activeChatId:e,onSelect:t,onNewChat:n,newChatShortcut:r}){let i=P(V.messages.listChats,{}),a=P(V.projects.listProjects,{}),o=P(V.me.getMe,{host:xO})?.ui?.effective,s=o?.showChatProvider??!0,c=o?.showChatAge??!0,l=new Set((i??[]).map(e=>e.providerKind).filter(e=>e!=null)),u=s&&l.size>1,[,d]=(0,N.useState)(0);(0,N.useEffect)(()=>{if(!c)return;let e=window.setInterval(()=>d(e=>e+1),6e4);return()=>window.clearInterval(e)},[c]);let f=F(V.projects.createProject),p=F(V.projects.setProjectCollapsed),m=F(V.chats.reorderChat),h=F(V.chats.moveChatToProject),g=_1(),_=gRe(),v=(0,N.useRef)(null),y=(0,N.useRef)(null),b=(0,N.useRef)(null),[x,S]=(0,N.useState)(`full`);(0,N.useLayoutEffect)(()=>{let e=v.current;if(!e)return;let t=()=>{let t=e.clientWidth,n=y.current?.offsetWidth??0,r=b.current?.offsetWidth??0,i=n===0||t>=n?`full`:t>=r?`label`:`icon`;S(e=>e===i?e:i)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[_,r]);let[C,w]=(0,N.useState)(null),T=(0,N.useRef)(!1);(0,N.useEffect)(()=>{!T.current&&i&&w(i)},[i]);let E=C??i??[],[D,O]=(0,N.useState)(null),[ee,te]=(0,N.useState)(()=>localStorage.getItem(c5)===`1`);function k(){te(e=>(localStorage.setItem(c5,e?`0`:`1`),!e))}let A=k6(O6(l8,{activationConstraint:{distance:4}}),O6(a8,{coordinateGetter:X8})),j=E.filter(e=>e.pinned),ne=E.filter(e=>!e.pinned),re=e=>ne.filter(t=>(t.projectId??null)===e);function M(e){return E.find(t=>t._id===e)}async function ie(e){O(null);let{active:t,over:n}=e;if(!n)return;let r=M(String(t.id));if(!r)return;let i=String(n.id);if(i.startsWith(`project:`)){let e=i===s5?null:i.slice(8);if((r.projectId??null)===e)return;T.current=!0,w(t=>(t??E).map(t=>t._id===r._id?{...t,projectId:e}:t));try{await h({chatId:r._id,projectId:e})}finally{T.current=!1}return}let a=M(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;T.current=!0,w(e=>(e??E).map(e=>e._id===r._id?{...e,projectId:a.projectId??null}:e));try{await h({chatId:r._id,projectId:a.projectId??null})}finally{T.current=!1}return}let o=a.pinned?j:re(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;T.current=!0,w(e=>[...(e??E).filter(e=>!o.some(t=>t._id===e._id)),...u]);try{await m({chatId:r._id,prevKey:d?d.sortKey:null,nextKey:f?f.sortKey:null})}finally{T.current=!1}}let ae=D?M(D):null;return(0,I.jsxs)(`aside`,{className:`oc-sidebar`,children:[(0,I.jsxs)(`div`,{className:`oc-sidebar__top`,ref:v,children:[(0,I.jsxs)(X,{className:x===`icon`?`oc-newchat flex-1 justify-center`:`oc-newchat flex-1 justify-start`,onClick:n,title:`${_} (${r})`,"aria-label":_,children:[(0,I.jsx)(Nm,{}),x===`icon`?null:(0,I.jsx)(`span`,{className:`oc-newchat__label`,children:_}),x===`full`?(0,I.jsx)(`kbd`,{className:`oc-newchat__kbd`,"aria-hidden":!0,children:r}):null]}),(0,I.jsx)(`div`,{className:`oc-newchat-ghost`,"aria-hidden":!0,children:(0,I.jsxs)(`div`,{className:`oc-newchat-ghost__row`,ref:y,children:[(0,I.jsxs)(X,{className:`oc-newchat justify-start`,tabIndex:-1,children:[(0,I.jsx)(Nm,{}),(0,I.jsx)(`span`,{className:`oc-newchat__label`,children:_}),(0,I.jsx)(`kbd`,{className:`oc-newchat__kbd`,children:r})]}),(0,I.jsx)(X,{variant:`outline`,size:`icon`,tabIndex:-1,children:(0,I.jsx)(xm,{})})]})}),(0,I.jsx)(`div`,{className:`oc-newchat-ghost`,"aria-hidden":!0,children:(0,I.jsxs)(`div`,{className:`oc-newchat-ghost__row`,ref:b,children:[(0,I.jsxs)(X,{className:`oc-newchat justify-start`,tabIndex:-1,children:[(0,I.jsx)(Nm,{}),(0,I.jsx)(`span`,{className:`oc-newchat__label`,children:_})]}),(0,I.jsx)(X,{variant:`outline`,size:`icon`,tabIndex:-1,children:(0,I.jsx)(xm,{})})]})}),(0,I.jsx)(X,{className:`oc-newproject`,variant:`outline`,size:`icon`,"aria-label":vQ(),title:vQ(),onClick:async()=>{let e=await g({title:vQ(),label:xRe(),placeholder:wRe(),confirmLabel:DRe()});e&&await f({name:e})},children:(0,I.jsx)(xm,{})})]}),(0,I.jsxs)(N8,{sensors:A,collisionDetection:I6,modifiers:[Rrt,Lrt],onDragStart:e=>O(e.active.id),onDragCancel:()=>O(null),onDragEnd:ie,children:[(0,I.jsxs)(`div`,{className:`oc-sidebar__scroll`,children:[j.length>0?(0,I.jsx)(l5,{label:ARe(),chats:j,children:j.map(n=>(0,I.jsx)(d5,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))}):null,(a??[]).map(n=>{let r=re(n._id);return(0,I.jsx)(l5,{label:n.name,dropId:tit(n._id),projectId:n._id,chats:r,collapsible:!0,collapsed:n.collapsed,onToggle:()=>void p({projectId:n._id,collapsed:!n.collapsed}),children:n.collapsed?null:r.length===0?(0,I.jsx)(`div`,{className:`oc-sidebar__empty`,children:NRe()}):r.map(n=>(0,I.jsx)(d5,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))},n._id)}),(0,I.jsx)(l5,{label:IRe(),dropId:s5,chats:re(null),collapsible:!0,collapsed:ee,onToggle:k,children:ee?null:re(null).map(n=>(0,I.jsx)(d5,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))})]}),(0,I.jsx)(Prt,{children:ae?(0,I.jsxs)(`div`,{className:`oc-chatitem oc-chatitem--overlay`,children:[(0,I.jsx)(Sm,{className:`size-3.5 opacity-60`}),o5(ae.color)?(0,I.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:o5(ae.color)}}):(0,I.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,I.jsx)(`span`,{className:`oc-chatitem__label`,children:ae.title||yQ()})]}):null})]})]})}function l5({label:e,dropId:t,projectId:n,chats:r,collapsible:i,collapsed:a,onToggle:o,children:s}){let c=F(V.projects.deleteProject),l=g1(),u=P(V.projects.projectChatCount,n?{projectId:n}:`skip`),{setNodeRef:d,isOver:f}=I8({id:t??`static:${e}`});return(0,I.jsxs)(`div`,{ref:t?d:void 0,className:`oc-sidebar__group`+(f?` oc-sidebar__group--over`:``),children:[(0,I.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,I.jsx)(fm,{className:`size-3.5`}):(0,I.jsx)(dm,{className:`size-3.5`}):null,(0,I.jsx)(`span`,{className:`oc-sidebar__group-label`,children:e}),n?(0,I.jsx)(`button`,{className:`oc-sidebar__group-del`,"aria-label":xQ(),onClick:async t=>{t.stopPropagation();let r=u??0;await l({title:GRe({name:e}),description:r>0?JRe({count:r}):ZRe(),confirmWord:SQ(),confirmLabel:xQ(),destructive:!0})&&await c({projectId:n})},children:(0,I.jsx)(Bm,{className:`size-3.5`})}):null]}),(0,I.jsx)(G8,{items:r.map(e=>e._id),strategy:Wrt,children:s})]})}var u5={openclaw:`OpenClaw`,hermes:`Hermes`};function d5({chat:e,active:t,projects:n,onSelect:r,showProviderBadge:i}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=J8({id:e._id}),d=F(V.chats.renameChat),f=F(V.chats.deleteChat),p=F(V.chats.pinChat),m=F(V.chats.setChatColor),h=P(V.me.getMe,{host:xO})?.ui?.effective?.showChatAge??!0,g=g1(),[_,v]=(0,N.useState)(!1),[y,b]=(0,N.useState)(e.title??``),x={transform:C6.Transform.toString(c),transition:l,opacity:+!u},S=o5(e.color);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{ref:s,style:x,className:`oc-chatitem group/row`+(t?` oc-chatitem--active`:``),children:[(0,I.jsx)(`button`,{className:`oc-chatitem__grip`,"aria-label":nze(),...a,...o,children:(0,I.jsx)(Sm,{className:`size-3.5`})}),S?(0,I.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:S}}):(0,I.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,I.jsx)(`button`,{className:`oc-chatitem__label`,onClick:()=>r(e._id),children:e.title||yQ()}),e.readOnly?(0,I.jsx)(`span`,{className:`oc-chatitem__readonly`,title:bQ(),children:(0,I.jsx)(wm,{size:12,"aria-label":bQ()})}):null,i&&e.providerKind?(0,I.jsx)(`span`,{className:`oc-chatitem__bridge oc-chatitem__bridge--${e.providerKind} group-hover/row:opacity-0 group-focus-within/row:opacity-0`,title:kze({provider:u5[e.providerKind]}),children:u5[e.providerKind]}):null,h?(0,I.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:eit(e.updatedAt,Date.now())}):null,(0,I.jsxs)(z$,{children:[(0,I.jsx)(B$,{asChild:!0,children:(0,I.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":aze(),className:`opacity-0 group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,I.jsx)(ym,{})})}),(0,I.jsxs)(V$,{align:`end`,className:`w-48`,children:[(0,I.jsxs)(H$,{onSelect:()=>{b(e.title??``),v(!0)},children:[(0,I.jsx)(Pee,{}),` `,cze()]}),(0,I.jsxs)(H$,{onSelect:()=>void p({chatId:e._id,pinned:!e.pinned}),children:[e.pinned?(0,I.jsx)(Iee,{}):(0,I.jsx)(Fee,{}),e.pinned?dze():mze()]}),(0,I.jsx)(U$,{children:_ze()}),(0,I.jsxs)(`div`,{className:`oc-colorgrid`,onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void m({chatId:e._id,color:null}),"aria-label":bze(),children:`✕`}),a5.map(t=>(0,I.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,I.jsx)(W$,{}),(0,I.jsxs)(H$,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{await g({title:Cze(),description:Eze(),confirmLabel:SQ(),destructive:!0})&&await f({chatId:e._id})})},children:[(0,I.jsx)(Bm,{}),` `,SQ()]})]})]})]}),(0,I.jsx)(Q8,{open:_,onOpenChange:v,title:Mze(),canSubmit:y.trim().length>0,onSubmit:async()=>{await d({chatId:e._id,title:y.trim()}),v(!1)},children:(0,I.jsx)(`div`,{className:`oc-form`,children:(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:Fze()}),(0,I.jsx)($$,{value:y,onChange:e=>b(e.target.value),autoFocus:!0})]})})})]})}var rit=Z$(`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,I.jsx)(n?Cy:`span`,{"data-slot":`badge`,"data-variant":t,className:R$(rit({variant:t}),e),...r})}function iit(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 ait(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 oit({open:e,onOpenChange:t,agents:n,onPick:r}){let[i,a]=(0,N.useState)(``),o=(0,N.useMemo)(()=>iit(ait(n??[],i)),[n,i]);return(0,I.jsx)(c1,{open:e,onOpenChange:t,children:(0,I.jsxs)(l1,{className:`oc-agentpicker`,children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:BVe()}),(0,I.jsx)(p1,{children:UVe()})]}),n===void 0?(0,I.jsx)(`p`,{className:`oc-agentpicker__hint`,children:KVe()}):n.length===0?(0,I.jsx)(`p`,{className:`oc-agentpicker__hint`,children:YVe()}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)($$,{autoFocus:!0,value:i,onChange:e=>a(e.target.value),placeholder:QVe(),className:`oc-agentpicker__search`,"aria-label":tHe()}),(0,I.jsx)(`div`,{className:`oc-agentpicker__list`,role:`listbox`,children:o.map(e=>(0,I.jsxs)(`div`,{className:`oc-agentpicker__group`,children:[(0,I.jsxs)(`div`,{className:`oc-agentpicker__instance`,children:[(0,I.jsx)(Im,{size:13,"aria-hidden":!0}),(0,I.jsx)(`span`,{children:e.instanceName}),(0,I.jsx)($,{variant:`outline`,className:`oc-agentpicker__kind`,children:e.kind})]}),e.agents.map(e=>(0,I.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`?iHe():void 0,children:[(0,I.jsx)(lm,{size:15,"aria-hidden":!0,className:`oc-agentpicker__icon`}),(0,I.jsxs)(`span`,{className:`oc-agentpicker__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,I.jsx)(`span`,{className:`oc-agentpicker__model`,children:e.model}):null,e.isDefault?(0,I.jsx)(zm,{size:13,"aria-label":sHe(),className:`oc-agentpicker__default`}):null]},`${e.instanceName}/${e.agentId}`))]},e.instanceName))})]})]})})}function sit(e){let t=F(V.chats.createChat),n=P(V.agents.listMyAgents),[r,i]=(0,N.useState)(!1),a=(0,N.useCallback)(async(n,r)=>{e(await t({title:`New chat`,instanceName:n,agentId:r}))},[t,e]);return{startNewChat:(0,N.useCallback)(async()=>{let e=n;if(e&&e.length===1&&e[0].state!==`deleted`){await a(e[0].instanceName,e[0].agentId);return}i(!0)},[n,a]),picker:(0,I.jsx)(oit,{open:r,onOpenChange:i,agents:n,onPick:(e,t)=>{i(!1),a(e,t)}})}}var f5=[`admin`,`user`,`pending`];function p5(){let e=P(V.me.authProviders)?.anonymous===!0,[t,n]=(0,N.useState)(!1),r=P(V.dev.listUsersDev,e?{}:`skip`),i=P(V.me.getImpersonation),a=F(V.dev.setMyRole),o=F(V.dev.setRole),s=F(V.admin.startImpersonation),c=F(V.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,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`oc-devfab`,onClick:()=>n(!0),title:OLe(),children:[(0,I.jsx)(Wm,{size:13}),`DEV`]}),(0,I.jsx)(c1,{open:t,onOpenChange:n,children:(0,I.jsxs)(l1,{children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:jLe()}),(0,I.jsx)(p1,{children:PLe()})]}),(0,I.jsxs)(`div`,{className:`oc-devsw__me`,children:[(0,I.jsxs)(`span`,{className:`oc-devsw__melabel`,children:[LLe({canonical:l?.canonical??`…`}),` `,(0,I.jsx)($,{variant:`outline`,children:l?.role??`…`})]}),(0,I.jsx)(`div`,{className:`oc-devsw__roles`,children:f5.map(e=>(0,I.jsx)(X,{type:`button`,size:`xs`,variant:l?.role===e?`secondary`:`ghost`,disabled:l?.role===e,onClick:()=>void a({role:e}),children:e===`admin`?BLe():e===`user`?ULe():KLe()},e))})]}),d?(0,I.jsxs)(`div`,{className:`oc-devsw__imp`,children:[YLe(),` `,(0,I.jsx)(`strong`,{children:i.targetLabel}),`.`,(0,I.jsx)(X,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>void c(),children:QLe()})]}):null,(0,I.jsx)(`div`,{className:`oc-devsw__list`,children:f.length===0?(0,I.jsx)(`p`,{className:`oc-devsw__empty`,children:tRe()}):f.map(e=>(0,I.jsxs)(`div`,{className:`oc-devsw__row`,children:[(0,I.jsx)(`span`,{className:`oc-devsw__label`,children:e.name||e.email||e.canonical||e.userId.slice(0,8)}),(0,I.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:f5.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))}),(0,I.jsx)(X,{type:`button`,size:`xs`,variant:`ghost`,disabled:!u||e.role===`pending`,title:u?e.role===`pending`?sRe():uRe():iRe(),onClick:()=>{s({profileId:e.profileId}),n(!1)},children:pRe()})]},e.profileId))})]})})]})}function m5({label:e,mode:t,minimal:n=!1}){let{signOut:r}=Ir(),i=F(V.me.setThemeMode).withOptimisticUpdate((e,{mode:t})=>{let n=e.getQuery(V.me.getMe,{host:xO});if(!n)return;let r=t===null?n.defaultThemeMode??`system`:t;e.setQuery(V.me.getMe,{host:xO},{...n,themeMode:t,resolvedThemeMode:r})}),a=t??`default`;return(0,I.jsxs)(z$,{children:[(0,I.jsx)(B$,{asChild:!0,children:(0,I.jsxs)(X,{variant:`ghost`,size:`sm`,className:`gap-1.5`,children:[e,(0,I.jsx)(dm,{className:`opacity-60`})]})}),(0,I.jsx)(V$,{align:`end`,className:`w-52`,children:n?(0,I.jsxs)(H$,{onClick:()=>void r(),children:[(0,I.jsx)(Tm,{}),` `,sk()]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(U$,{children:bfe()}),(0,I.jsxs)(x4e,{value:a,onValueChange:e=>void i({mode:e==="default"?null:e}),children:[(0,I.jsxs)(G$,{value:`light`,children:[(0,I.jsx)(Bee,{}),` `,YO()]}),(0,I.jsxs)(G$,{value:`dark`,children:[(0,I.jsx)(Am,{}),` `,QO()]}),(0,I.jsxs)(G$,{value:`system`,children:[(0,I.jsx)(km,{}),` `,tk()]}),(0,I.jsx)(G$,{value:`default`,children:ik()})]}),(0,I.jsx)(W$,{}),(0,I.jsxs)(H$,{onClick:()=>void r(),children:[(0,I.jsx)(Tm,{}),` `,sk()]})]})})]})}var cit={altered_words:()=>SGe(),incorrect:()=>TGe(),incoherence:()=>OGe(),formatting:()=>jGe(),latency:()=>PGe(),api_error:()=>LGe(),other:()=>BGe()},lit=e=>cit[e]?.()??e,uit={anomaly_open:Vm,anomaly_resolved:gm,feedback_reply:Em};function dit(e){return e.kind===`feedback_reply`?{title:gGe(),body:yGe()}:{title:e.title,body:e.body}}function fit(){let e=P(V.notifications.myUnreadCount)??0,t=P(V.notifications.myNotifications),n=P(V.feedback.myFeedback),r=F(V.notifications.markRead),i=F(V.notifications.markAllRead),a=F(V.notifications.clearOne),o=F(V.notifications.clearAll),s=F(V.feedback.closeMyFeedback),c=ss(),[l,u]=(0,N.useState)(!1),d=e=>{if(e.unread&&r({notificationId:e._id}),!e.href)return;if(u(!1),e.href.startsWith(`/chat/`)){c({to:`/chat/$chatId`,params:{chatId:e.href.slice(6)}});return}let[t,n]=e.href.split(`?`);c({to:t,search:Object.fromEntries(new URLSearchParams(n??``))})};return(0,I.jsxs)(z$,{open:l,onOpenChange:u,children:[(0,I.jsx)(B$,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`oc-bell`,"aria-label":e>0?gWe({count:e}):yWe(),children:[(0,I.jsx)(cm,{size:18,"aria-hidden":!0}),e>0?(0,I.jsx)(`span`,{className:`oc-bell__badge`,"aria-hidden":!0,children:e>9?`9+`:e}):null]})}),(0,I.jsxs)(V$,{align:`end`,className:`oc-notif`,children:[(0,I.jsxs)(`div`,{className:`oc-notif__head`,children:[(0,I.jsx)(`span`,{children:SWe()}),t&&t.length>0?(0,I.jsxs)(`span`,{className:`oc-notif__bulk`,children:[(0,I.jsx)(`button`,{type:`button`,className:`oc-notif__act`,disabled:e===0,onClick:()=>void i({}),children:TWe()}),(0,I.jsx)(`button`,{type:`button`,className:`oc-notif__act`,onClick:()=>void o({}),children:OWe()})]}):null]}),t===void 0?(0,I.jsx)(`div`,{className:`oc-notif__empty`,children:KO()}):t.length===0?(0,I.jsx)(`div`,{className:`oc-notif__empty`,children:jWe()}):(0,I.jsx)(`div`,{className:`oc-notif__list`,children:t.map(e=>{let t=uit[e.kind]??cm,{title:n,body:i}=dit(e);return(0,I.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?()=>d(e):void 0,children:[(0,I.jsxs)(`div`,{className:`oc-notif__item-head`,children:[(0,I.jsx)(t,{size:14,className:`oc-notif__kind oc-notif__kind--${e.kind}`,"aria-hidden":!0}),(0,I.jsx)(`span`,{className:`oc-notif__title`,children:n}),(0,I.jsxs)(`span`,{className:`oc-notif__row-actions`,children:[e.unread?(0,I.jsx)(`button`,{type:`button`,title:wQ(),"aria-label":wQ(),onClick:t=>{t.stopPropagation(),r({notificationId:e._id})},children:(0,I.jsx)(um,{size:13})}):null,(0,I.jsx)(`button`,{type:`button`,title:TQ(),"aria-label":TQ(),onClick:t=>{t.stopPropagation(),a({notificationId:e._id})},children:(0,I.jsx)(Gm,{size:13})})]})]}),(0,I.jsx)(`p`,{className:`oc-notif__body`,children:i}),(0,I.jsx)(`div`,{className:`oc-notif__when`,children:new Date(e.createdAt).toLocaleString(q())})]},e._id)})}),n&&n.length>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`oc-notif__head oc-notif__head--sub`,children:RWe()}),(0,I.jsx)(`div`,{className:`oc-notif__list`,children:n.map(e=>(0,I.jsx)(pit,{it:e,onClose:t=>s({feedbackId:e._id,reason:t}),onNavigate:()=>u(!1)},e._id))})]}):null]})]})}function pit({it:e,onClose:t,onNavigate:n}){let r=b1(),[i,a]=(0,N.useState)(!1),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(``),[u,d]=(0,N.useState)(!1);async function f(){d(!0);try{await t(c.trim()||void 0)}catch(e){r.error(EQ(),e)}finally{d(!1)}}return(0,I.jsxs)(`div`,{className:`oc-notif__item`,children:[(0,I.jsxs)(`div`,{className:`oc-notif__item-head`,children:[(0,I.jsx)(`span`,{className:`oc-notif__title`,children:lit(e.category)}),(0,I.jsx)(`span`,{className:`oc-notif__status${e.answered?` is-answered`:``}`,children:e.answered?VWe():WWe()})]}),(0,I.jsx)(`div`,{className:`oc-notif__when`,children:new Date(e.at).toLocaleString(q())}),e.thread.length>0?(0,I.jsx)(`div`,{className:`oc-notif__thread`,children:e.thread.map((e,t)=>(0,I.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,I.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?qWe():XWe()}),(0,I.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):null,e.messageText?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`oc-notif__report-toggle`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[i?(0,I.jsx)(dm,{size:13,"aria-hidden":!0}):(0,I.jsx)(fm,{size:13,"aria-hidden":!0}),nGe()]}),i?(0,I.jsx)(`div`,{className:`oc-notif__report-msg`,children:e.messageText}):null]}):null,(0,I.jsxs)(`div`,{className:`oc-notif__report-actions`,children:[(0,I.jsx)(xs,{to:`/chat/$chatId`,params:{chatId:e.chatId},search:{m:e.messageId},className:`oc-notif__link`,onClick:n,children:$We()}),o?null:(0,I.jsx)(`button`,{type:`button`,className:`oc-notif__link oc-notif__link--muted`,onClick:()=>s(!0),children:EQ()})]}),o?(0,I.jsxs)(`div`,{className:`oc-notif__close-form`,children:[(0,I.jsx)(`textarea`,{className:`oc-notif__close-input`,rows:2,value:c,onChange:e=>l(e.target.value),placeholder:sGe()}),(0,I.jsxs)(`div`,{className:`oc-notif__close-actions`,children:[(0,I.jsx)(`button`,{type:`button`,className:`oc-notif__close-confirm`,disabled:u,onClick:()=>void f(),children:uGe()}),(0,I.jsx)(`button`,{type:`button`,className:`oc-notif__close-cancel`,onClick:()=>{s(!1),l(``)},children:pGe()})]})]}):null]})}var h5={mod:!0,key:`k`},g5={mod:!0,shift:!0,key:`o`};function mit(e){return/mac/i.test(e)}function hit(){if(typeof navigator>`u`)return``;let e=navigator;return e.userAgentData?.platform||e.platform||e.userAgent||``}var _5=null;function v5(){return _5===null&&(_5=mit(hit())),_5}function y5(e,t){let n=e.key.toUpperCase();if(t){let t=``;return e.alt&&(t+=`⌥`),e.shift&&(t+=`⇧`),e.mod&&(t+=`⌘`),t+n}let r=[];return e.mod&&r.push(`Ctrl`),e.shift&&r.push(`Shift`),e.alt&&r.push(`Alt`),r.push(n),r.join(`+`)}function b5(e,t){let n=e.metaKey||e.ctrlKey;return!!t.mod!==n||!!t.shift!==e.shiftKey||!!t.alt!==e.altKey?!1:e.key.toLowerCase()===t.key.toLowerCase()}var x5=2,git=180;function _it(){let e=ss(),t=(0,N.useRef)(null),n=(0,N.useRef)(null),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(``),[s,c]=(0,N.useState)(``),[l,u]=(0,N.useState)(0),d=(0,N.useMemo)(()=>y5(h5,v5()),[]);(0,N.useEffect)(()=>{let e=setTimeout(()=>c(a),git);return()=>clearTimeout(e)},[a]);let f=s.trim(),p=P(V.search.searchConversations,f.length>=x5?{query:f}:`skip`),m=p??[],h=f.length>=x5&&p===void 0;(0,N.useEffect)(()=>{let e=e=>{b5(e,h5)&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,N.useEffect)(()=>{r&&(o(``),c(``),u(0))},[r]),(0,N.useEffect)(()=>{u(0)},[p]),(0,N.useEffect)(()=>{(n.current?.querySelector(`[data-index="${l}"]`))?.scrollIntoView({block:`nearest`})},[l]);let g=(0,N.useCallback)(t=>{i(!1),e({to:`/chat/$chatId`,params:{chatId:t}})},[e]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`oc-search-trigger`,onClick:()=>i(!0),"aria-label":YBe(),children:[(0,I.jsx)(Fm,{className:`oc-search-trigger__icon`,"aria-hidden":!0}),(0,I.jsx)(`span`,{className:`oc-search-trigger__label`,children:QBe()}),(0,I.jsx)(`kbd`,{className:`oc-search-trigger__kbd`,children:d})]}),(0,I.jsx)(c1,{open:r,onOpenChange:i,children:(0,I.jsxs)(l1,{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,I.jsx)(f1,{className:`sr-only`,children:tVe()}),(0,I.jsxs)(`div`,{className:`oc-search-palette__head`,children:[(0,I.jsx)(Fm,{className:`oc-search-palette__head-icon`,"aria-hidden":!0}),(0,I.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,m.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=m[l];t&&g(t.chatId)}},placeholder:iVe(),className:`oc-search-palette__field`,autoComplete:`off`,spellCheck:!1,"aria-label":sVe()})]}),(0,I.jsx)(`div`,{className:`oc-search-palette__results`,ref:n,role:`listbox`,children:f.length<x5?(0,I.jsx)(`div`,{className:`oc-search-palette__hint`,children:uVe({count:x5})}):h?(0,I.jsx)(`div`,{className:`oc-search-palette__hint`,children:pVe()}):m.length===0?(0,I.jsx)(`div`,{className:`oc-search-palette__hint`,children:gVe({term:f})}):m.map((e,t)=>(0,I.jsxs)(`button`,{type:`button`,"data-index":t,role:`option`,"aria-selected":t===l,className:R$(`oc-search-result`,t===l&&`is-active`),onMouseMove:()=>u(t),onClick:()=>g(e.chatId),children:[(0,I.jsx)(`span`,{className:`oc-search-result__icon`,"aria-hidden":!0,children:e.matchedIn===`title`?(0,I.jsx)(kee,{size:15}):(0,I.jsx)(Em,{size:15})}),(0,I.jsxs)(`span`,{className:`oc-search-result__body`,children:[(0,I.jsx)(`span`,{className:`oc-search-result__title`,children:e.title||yVe()}),e.snippet?(0,I.jsx)(`span`,{className:`oc-search-result__snippet`,children:e.snippet}):null]}),(0,I.jsx)(`span`,{className:`oc-search-result__tag`,children:e.matchedIn===`title`?SVe():TVe()})]},e.chatId))}),(0,I.jsxs)(`div`,{className:`oc-search-palette__footer`,children:[(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`kbd`,{children:`↑`}),(0,I.jsx)(`kbd`,{children:`↓`}),` `,OVe()]}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`kbd`,{children:`↵`}),` `,jVe()]}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`kbd`,{children:PVe()}),` `,LVe()]})]})]})})]})}var S5=[`conversational`,`documentary`],vit=new Set(S5),yit=`conversational`;function bit(e){let t=new Set((e??[]).filter(e=>vit.has(e)));return t.size===0?[yit]:S5.filter(e=>t.has(e))}function xit({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=P(V.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=P(V.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,state:e.state,outOfPool:!0}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,I.jsx)(c1,{open:n,onOpenChange:r,children:(0,I.jsxs)(l1,{className:`oc-access`,children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:vMe({user:t})}),(0,I.jsx)(p1,{children:xMe()})]}),i?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?wMe():DMe()}):null,(0,I.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:AMe()}):u.length===0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:zMe()}):[...d.entries()].map(([t,n])=>(0,I.jsx)(Sit,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function Sit({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=F(V.agents.assignAgent),s=F(V.agents.removeAgent),c=F(V.agents.setDefaultAgent),l=b1();if(!e)return null;async function u(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(NMe(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(IMe(),e)}}return(0,I.jsxs)(`div`,{className:`oc-access__group`,children:[(0,I.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,I.jsx)(Im,{size:13,"aria-hidden":!0}),(0,I.jsx)(`span`,{children:t}),(0,I.jsx)($,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`;return(0,I.jsxs)(`div`,{className:`oc-access__row`,children:[(0,I.jsx)(C1,{checked:r,disabled:s&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":HMe({name:e.displayName??e.agentId})}),(0,I.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,I.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,I.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:GMe()}):null,e.outOfPool?(0,I.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:JMe()}):null,r?o?(0,I.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":uQ(),title:uQ(),children:(0,I.jsx)(zm,{size:14,fill:`currentColor`})}):(0,I.jsx)(X,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":dQ(),title:dQ(),onClick:()=>void d(e.agentId),children:(0,I.jsx)(zm,{size:14})}):null]},e.agentId)})]})}function Cit(e,t){return typeof e==`number`&&typeof t==`number`?e-t:typeof e==`boolean`&&typeof t==`boolean`?!!e-+!!t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:`base`})}function wit(e,t,n){return[...e].sort((e,r)=>{let i=t(e),a=t(r),o=i==null,s=a==null;if(o||s)return o&&s?0:o?1:-1;let c=Cit(i,a);return n===`asc`?c:-c})}function C5({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,I.jsx)(`table`,{"data-slot":`table`,className:R$(`w-full caption-bottom text-sm`,e),...t})})}function w5({className:e,...t}){return(0,I.jsx)(`thead`,{"data-slot":`table-header`,className:R$(`[&_tr]:border-b`,e),...t})}function T5({className:e,...t}){return(0,I.jsx)(`tbody`,{"data-slot":`table-body`,className:R$(`[&_tr:last-child]:border-0`,e),...t})}function E5({className:e,...t}){return(0,I.jsx)(`tr`,{"data-slot":`table-row`,className:R$(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function D5({className:e,...t}){return(0,I.jsx)(`th`,{"data-slot":`table-head`,className:R$(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function O5({className:e,...t}){return(0,I.jsx)(`td`,{"data-slot":`table-cell`,className:R$(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}function k5({title:e,rows:t,columns:n,rowActions:r,onAdd:i,addLabel:a=gHe(),bulkActions:o,emptyHint:s=yHe(),isExpanded:c,renderExpanded:l}){let[u,d]=(0,N.useState)(new Set),[f,p]=(0,N.useState)(null),m=t??[],h=f?n[f.index]:void 0,g=f&&h?.sort?wit(m,h.sort,f.dir):m;function _(e){p(t=>!t||t.index!==e?{index:e,dir:`asc`}:t.dir===`asc`?{index:e,dir:`desc`}:null)}let v=+!!o+n.length+ +!!r,y=m.length>0&&u.size===m.length,b=u.size>0&&!y;function x(){d(y?new Set:new Set(m.map(e=>e._id)))}function S(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,I.jsxs)(`div`,{className:`oc-dt`,children:[(0,I.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,I.jsx)(`h2`,{className:`oc-dt__title`,children:e}),(0,I.jsxs)(`div`,{className:`oc-dt__bar-actions`,children:[u.size>0&&o?o.map(e=>(0,I.jsxs)(X,{size:`sm`,variant:e.variant===`destructive`?`destructive`:`outline`,onClick:()=>{e.onSelect([...u]),d(new Set)},children:[e.variant===`destructive`?(0,I.jsx)(Bm,{}):null,e.label,` (`,u.size,`)`]},e.label)):null,i?(0,I.jsxs)(X,{size:`sm`,onClick:i,children:[(0,I.jsx)(Nm,{}),` `,a]}):null]})]}),t===void 0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:SHe()}):m.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:s}):(0,I.jsxs)(C5,{children:[(0,I.jsx)(w5,{children:(0,I.jsxs)(E5,{children:[o?(0,I.jsx)(D5,{className:`w-8`,children:(0,I.jsx)(C1,{"aria-label":THe(),checked:y?!0:b?`indeterminate`:!1,onCheckedChange:x})}):null,n.map((e,t)=>{let n=f?.index===t;return e.sort?(0,I.jsx)(D5,{className:e.className,"aria-sort":n?f.dir===`asc`?`ascending`:`descending`:`none`,children:(0,I.jsxs)(`button`,{type:`button`,className:`oc-dt__sort`,onClick:()=>_(t),"aria-label":PHe({column:e.header}),children:[e.header,n?f.dir===`asc`?(0,I.jsx)(pm,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,I.jsx)(dm,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,I.jsx)(mm,{className:`oc-dt__sort-icon oc-dt__sort-icon--idle`,"aria-hidden":!0})]})},e.header):(0,I.jsx)(D5,{className:e.className,children:e.header},e.header)}),r?(0,I.jsx)(D5,{className:`w-8`}):null]})}),(0,I.jsx)(T5,{children:g.map(e=>{let t=r?.(e)??[],i=c?.(e)??!1;return(0,I.jsxs)(N.Fragment,{children:[(0,I.jsxs)(E5,{className:`group/row`,children:[o?(0,I.jsx)(O5,{children:(0,I.jsx)(C1,{"aria-label":OHe(),checked:u.has(e._id),onCheckedChange:()=>S(e._id)})}):null,n.map(t=>(0,I.jsx)(O5,{className:t.className,children:t.cell(e)},t.header)),r?(0,I.jsx)(O5,{children:t.length>0?(0,I.jsxs)(z$,{children:[(0,I.jsx)(B$,{asChild:!0,children:(0,I.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":jHe(),className:`opacity-0 transition-opacity group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,I.jsx)(ym,{})})}),(0,I.jsx)(V$,{align:`end`,children:t.map((t,n)=>(0,I.jsxs)(`div`,{children:[t.variant===`destructive`&&n>0?(0,I.jsx)(W$,{}):null,(0,I.jsx)(H$,{variant:t.variant,onSelect:()=>t.onSelect(e),children:t.label})]},t.label))})]}):null}):null]}),i&&l?(0,I.jsx)(E5,{className:`oc-dt__expansion`,children:(0,I.jsx)(O5,{colSpan:v,className:`oc-dt__expansion-cell`,children:l(e)})}):null]},e._id)})})]})]})}function A5({icon:e,total:t,items:n}){if(t===0)return(0,I.jsxs)($,{variant:`outline`,className:`oc-group-chip oc-group-chip--empty gap-1`,children:[e,`0`]});let r=t-n.length;return(0,I.jsxs)(`div`,{className:`oc-group-detail`,children:[n.map((e,t)=>(0,I.jsxs)($,{variant:e.highlight?`secondary`:`outline`,className:`oc-group-chip gap-1`,title:e.label,children:[e.marker,(0,I.jsx)(`span`,{className:`oc-group-chip__txt`,children:e.label})]},t)),r>0?(0,I.jsxs)($,{variant:`outline`,className:`oc-group-chip`,children:[`+`,r]}):null]})}function j5({delayDuration:e=0,...t}){return(0,I.jsx)(vue,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function M5({...e}){return(0,I.jsx)(yue,{"data-slot":`tooltip`,...e})}function N5({...e}){return(0,I.jsx)(bue,{"data-slot":`tooltip-trigger`,...e})}function P5({className:e,sideOffset:t=0,children:n,...r}){return(0,I.jsx)(xue,{children:(0,I.jsxs)(Sue,{"data-slot":`tooltip-content`,sideOffset:t,className:R$(`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,I.jsx)(Cue,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var F5={AGENT_NOT_FOUND:()=>({label:LHe(),hint:BHe()}),AUTH_TOKEN_MISMATCH:()=>({label:UHe(),hint:KHe()}),DEVICE_SIGNING_FAILED:()=>({label:YHe(),hint:QHe()}),SESSION_SCOPE_DENIED:()=>({label:tUe(),hint:iUe()}),GATEWAY_TIMEOUT:()=>({label:sUe(),hint:uUe()}),GATEWAY_DISCONNECTED:()=>({label:pUe(),hint:gUe()}),ATTACHMENT_TOO_LARGE:()=>({label:TUe(),hint:OUe()}),ATTACHMENT_REJECTED:()=>({label:jUe(),hint:PUe()}),BRIDGE_UNREACHABLE:()=>({label:yUe(),hint:SUe()}),INVALID_REQUEST:()=>({label:LUe(),hint:BUe()}),NOT_CONFIGURED:()=>({label:UUe(),hint:KUe()}),UNROUTED:()=>({label:YUe(),hint:QUe()}),UPSTREAM_ERROR:()=>({label:tWe(),hint:iWe()}),UNKNOWN:()=>({label:sWe(),hint:uWe()})};function I5(e){return e?F5[e]?.()??{label:e,hint:pWe()}:F5.UNKNOWN()}var Tit=[`gateway-http`,`shared-fs`,`off`],Eit=[`inline`,`shared-fs`];He.object({mediaMode:He.optional(He.union(He.literal(`gateway-http`),He.literal(`shared-fs`),He.literal(`off`))),inboundMediaMode:He.optional(He.union(He.literal(`inline`),He.literal(`shared-fs`))),rehydration:He.optional(He.boolean()),mediaMaxMb:He.optional(He.number()),inboundAgentMount:He.optional(He.string()),outboundAgentMount:He.optional(He.string())});var L5={mediaMode:`gateway-http`,inboundMediaMode:`inline`,rehydration:!0,mediaMaxMb:1024,inboundAgentMount:`/home/node/.openclaw/media/inbound`,outboundAgentMount:`/home/node/.openclaw/media/outbound`};function Dit(e){return{mediaMode:e.mediaMode??L5.mediaMode,inboundMediaMode:e.inboundMediaMode??L5.inboundMediaMode,rehydration:e.rehydration??L5.rehydration,mediaMaxMb:e.mediaMaxMb??L5.mediaMaxMb,inboundAgentMount:e.inboundAgentMount??L5.inboundAgentMount,outboundAgentMount:e.outboundAgentMount??L5.outboundAgentMount}}function Oit(e,t){let n={},r=r=>{(e[r]!==L5[r]||t[r]!==void 0)&&(n[r]=e[r])};return r(`mediaMode`),r(`inboundMediaMode`),r(`rehydration`),r(`mediaMaxMb`),r(`inboundAgentMount`),r(`outboundAgentMount`),n}var R5=e=>typeof e==`string`?e:null;function z5(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function B5(e,t){let n=z5(e),r=z5(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 kit(e,t){if(e===null||t===null)return!1;let n=B5(t,e.min);return n!==null&&n>=0}function V5(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=R5(e.min),n=R5(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 Ait(e,t,n){if(e===null)return`unknown`;let{range:r}=V5(n,t);return kit(r,e)?r!==null&&(B5(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function H5(e){return e===`supported`?c2e():e===`beyond`?d2e():m2e()}function U5(e){return e??YQ()}function W5(e){return e===null?C2e():b2e({version:e})}function jit(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}function G5(e){return e.filter(e=>e.state===`error`)}function Mit(e){return e.reachable&&G5(e.targets).length===0}function Nit(e){return e.state===`error`&&e.lastErrorCode!==null}function Pit(e){return!!e.lastDownstreamRejectCode}function K5(e){return e.kind??`openclaw`}function Fit(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function Iit(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,K5(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(K5(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return Fit(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>K5(e)===r)}))}function Lit(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var q5={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function J5(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=q5[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function Y5(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:J5(e.from,t)??t-q5.h,to:J5(e.to,t)??t}}var X5=[{label:iIe(),from:`now-5m`},{label:sIe(),from:`now-15m`},{label:uIe(),from:`now-30m`},{label:pIe(),from:`now-1h`},{label:gIe(),from:`now-3h`},{label:yIe(),from:`now-6h`},{label:SIe(),from:`now-12h`},{label:TIe(),from:`now-24h`},{label:OIe(),from:`now-2d`},{label:jIe(),from:`now-7d`},{label:PIe(),from:`now-30d`},{label:LIe(),from:`now-90d`}];function Z5(e){return new Date(e).toLocaleString(`fr-FR`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function Rit(e){if(e.kind===`relative`){let t=X5.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${Z5(e.from)} → ${Z5(e.to)}`}function Q5(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 $5(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function zit(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}function e7(e){let[t,n]=(0,N.useState)(0);return(0,N.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,N.useMemo)(()=>{let{from:t,to:n}=Y5(e);return e.kind===`absolute`?{from:t,to:n}:{from:t7(t),to:t7(n)}},[e,t])}function t7(e){return Math.floor(e/6e4)*6e4}function n7({value:e,onChange:t}){let[n,r]=(0,N.useState)(!1),[i,a]=(0,N.useState)(``),o=Y5(e),[s,c]=(0,N.useState)(()=>Q5(o.from)),[l,u]=(0,N.useState)(()=>Q5(o.to));function d(t){if(t){let t=Y5(e);c(Q5(t.from)),u(Q5(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=$5(s),n=$5(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,N.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?X5:X5.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),h=$5(s)!==null&&$5(l)!==null;return(0,I.jsxs)(CT,{open:n,onOpenChange:d,children:[(0,I.jsx)(wT,{asChild:!0,children:(0,I.jsxs)(X,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,I.jsx)(wee,{}),Rit(e)]})}),(0,I.jsx)(TT,{children:(0,I.jsx)(ET,{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,I.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,I.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,I.jsx)(`div`,{className:`oc-timerange__section-title`,children:`Plage absolue`}),(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:`De`}),(0,I.jsx)($$,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:`À`}),(0,I.jsx)($$,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,I.jsx)(X,{size:`sm`,className:`oc-timerange__apply`,disabled:!h,onClick:p,children:`Appliquer`})]}),(0,I.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,I.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,I.jsx)(Fm,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,I.jsx)($$,{value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher une plage`,"aria-label":`Rechercher une plage relative`})]}),(0,I.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,I.jsx)(`li`,{className:`oc-timerange__empty`,children:`Aucune plage.`}):m.map(t=>(0,I.jsx)(`li`,{children:(0,I.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 Bit=250;function r7({q:e,onQChange:t,searchPlaceholder:n=uHe(),children:r,timeRange:i,onTimeRangeChange:a,onReset:o,canReset:s=!0}){let[c,l]=(0,N.useState)(e);(0,N.useEffect)(()=>{l(e)},[e]);let u=(0,N.useRef)(null);function d(e){l(e),u.current!==null&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>t(e),Bit)}(0,N.useEffect)(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]);function f(){u.current!==null&&window.clearTimeout(u.current),o()}return(0,I.jsxs)(`div`,{className:`oc-filterbar`,children:[(0,I.jsxs)(`div`,{className:`oc-filterbar__search`,children:[(0,I.jsx)(Fm,{className:`oc-filterbar__search-icon`,"aria-hidden":!0}),(0,I.jsx)($$,{value:c,onChange:e=>d(e.target.value),placeholder:n,"aria-label":n})]}),r?(0,I.jsx)(`div`,{className:`oc-filterbar__quick`,children:r}):null,i&&a?(0,I.jsx)(n7,{value:i,onChange:a}):null,(0,I.jsxs)(X,{variant:`ghost`,size:`sm`,className:`oc-filterbar__reset`,onClick:f,disabled:!s,children:[(0,I.jsx)(Pm,{}),pHe()]})]})}var i7=`__all__`,a7={q:``,state:i7,instance:i7,version:i7},o7={connected:0,error:1,idle:2};function Vit(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function Hit(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function s7(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function c7(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function Uit(e,t,n){switch(e){case`state`:return(o7[t.state]??99)-(o7[n.state]??99);case`instance`:return s7(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return s7(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return B5(e,r)??s7(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return s7(t.targetLabel,n.targetLabel)}}function Wit(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=c7(t.key,e),a=c7(t.key,r);return i&&a?0:i?1:a?-1:n*Uit(t.key,e,r)})}function Git(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(o7[e]??99)-(o7[t]??99))}function Kit(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>s7(e.label,t.label))}function qit(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>B5(e,t)??s7(e,t))}function Jit({connections:e,displayByInstance:t}){let[n,r]=(0,N.useState)(a7),[i,a]=(0,N.useState)(null),o=(0,N.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount,attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),s=(0,N.useMemo)(()=>Git(o),[o]),c=(0,N.useMemo)(()=>Kit(o),[o]),l=(0,N.useMemo)(()=>qit(o),[o]),u=(0,N.useMemo)(()=>Wit(Hit(o,n),i),[o,n,i]);function d(e){a(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:aFe()}):(0,I.jsxs)(`div`,{className:`oc-conn`,children:[(0,I.jsxs)(r7,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:mFe(),onReset:()=>r(a7),canReset:Vit(n),children:[(0,I.jsxs)(S3,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-36`,children:(0,I.jsx)(C3,{placeholder:yFe()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:i7,children:mQ()}),s.map(e=>(0,I.jsx)(Q,{value:e,children:Xit(e)},e))]})]}),(0,I.jsxs)(S3,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-40`,children:(0,I.jsx)(C3,{placeholder:SFe()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:i7,children:mQ()}),c.map(e=>(0,I.jsx)(Q,{value:e.name,children:e.label},e.name))]})]}),(0,I.jsxs)(S3,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-36`,children:(0,I.jsx)(C3,{placeholder:TFe()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:i7,children:mQ()}),l.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]})]}),u.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:OFe()}):(0,I.jsxs)(C5,{className:`oc-conn__table`,children:[(0,I.jsx)(w5,{children:(0,I.jsxs)(E5,{children:[(0,I.jsx)(l7,{label:jFe(),sortKey:`target`,sort:i,onSort:d}),(0,I.jsx)(l7,{label:PFe(),sortKey:`state`,sort:i,onSort:d}),(0,I.jsx)(l7,{label:LFe(),sortKey:`instance`,sort:i,onSort:d}),(0,I.jsx)(l7,{label:BFe(),sortKey:`host`,sort:i,onSort:d}),(0,I.jsx)(l7,{label:UFe(),sortKey:`version`,sort:i,onSort:d}),(0,I.jsx)(D5,{children:KFe()}),(0,I.jsx)(l7,{label:YFe(),sortKey:`lastOk`,sort:i,onSort:d})]})}),(0,I.jsx)(T5,{children:u.map(e=>(0,I.jsx)(Yit,{r:e},e._id))})]})]})}function l7({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,I.jsx)(D5,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,I.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,I.jsx)(pm,{size:13,"aria-hidden":!0}):(0,I.jsx)(dm,{size:13,"aria-hidden":!0}):(0,I.jsx)(mm,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function Yit({r:e}){let t=Nit(e)?I5(e.lastErrorCode):null,n=Pit(e)?I5(e.lastDownstreamRejectCode):null;return(0,I.jsxs)(N.Fragment,{children:[(0,I.jsxs)(E5,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,I.jsx)(O5,{children:(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,I.jsx)(O5,{children:(0,I.jsx)(Zit,{state:e.state})}),(0,I.jsx)(O5,{children:e.instanceLabel?(0,I.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,I.jsx)(O5,{children:(0,I.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,I.jsx)(O5,{children:e.gatewayVersion?(0,I.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,I.jsx)(O5,{children:(0,I.jsx)(`span`,{className:`oc-conn__stats`,children:cFe({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,I.jsx)(O5,{children:e.lastOkAt?(0,I.jsx)(`span`,{className:`oc-traces__mono`,children:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,I.jsx)(E5,{className:`oc-conn__detail-row`,children:(0,I.jsxs)(O5,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,I.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,I.jsx)(`strong`,{children:t.label}),` `,(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,I.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,I.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[dFe({label:n.label}),` `,(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${new Date(e.lastDownstreamRejectAt).toLocaleTimeString(`fr-FR`)}`:``]}):null]})}):null]})}function Xit(e){return e===`connected`?hQ():e===`error`?gQ():_Q()}function Zit({state:e}){return e===`connected`?(0,I.jsx)($,{variant:`secondary`,children:hQ()}):e===`error`?(0,I.jsx)($,{variant:`destructive`,children:gQ()}):(0,I.jsx)($,{variant:`outline`,children:_Q()})}function Qit(){return P(V.bridgeHealth.getBridgeHealth,{})}function $it(){let e=Qit(),t=P(V.compat.getBridgeCompat,{}),n=P(V.me.getMe,{host:xO})?.role===`admin`,r=P(V.admin.listInstances,n?{}:`skip`),i=ss(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=Iit(e?e.targets:[],t?t.targets:[],r??[]),s=t?.compat??null,c=t===void 0?`loading`:t===null?`nodata`:`ready`,l=s!==null&&jit(s,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,I.jsxs)(`div`,{className:`oc-bridge`,children:[(0,I.jsx)(eat,{health:e,compat:t,onSeeAnomalies:a}),(0,I.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:APe()}),o.map(e=>(0,I.jsx)(tat,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:s,compatStatus:c,compatReachable:t?.reachable??!0},e.key)),l?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:_2e()}):null]})}function eat({health:e,compat:t,onSeeAnomalies:n}){let r=t&&t!==null?(0,I.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:U5(t.bridgeVersion)}),` · `,N0e(),` `,(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?YQ():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:pQ()});if(e===null)return(0,I.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:FPe()});let i=G5(e.targets),a=!e.reachable,o=Mit(e),s=o?`ok`:`error`,c=new Date(e.checkedAt).toLocaleString(`fr-FR`),l=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,I.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${s}`,children:[(0,I.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:o?(0,I.jsx)(gm,{size:22}):a?(0,I.jsx)(Vee,{size:22}):(0,I.jsx)(Vm,{size:22})}),(0,I.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,I.jsx)(`div`,{className:`oc-bridge-card__title`,children:o?RPe():a?VPe():WPe({count:i.length})}),(0,I.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,I.jsxs)(`span`,{children:[(0,I.jsx)(Lee,{size:12,"aria-hidden":!0}),` `,qPe({time:c})]}),l?(0,I.jsx)(`span`,{children:XPe({time:l})}):null,r]}),a?(0,I.jsx)(`p`,{className:`oc-bridge-card__hint`,children:I5(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,I.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:$Pe()})]})}function tat({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a}){let o=r?V5(r,e):null,s=new Map;for(let e of n)s.set(e.name,e.displayName??e.name);let c=[],l=new Set;for(let n of t){if(!n.instanceName||l.has(n.instanceName))continue;l.add(n.instanceName);let t=n.gatewayVersion??null;c.push({instanceName:n.instanceName,displayName:s.get(n.instanceName)??n.instanceName,version:t,state:Ait(t,e,r)})}let u=c.map(e=>e.state),d=u.includes(`beyond`)?`beyond`:u.length>0&&u.every(e=>e===`supported`)?`supported`:null,[f,p]=(0,N.useState)(!1),[m,h]=(0,N.useState)(null),g=m===null?null:n.find(e=>e.name===m)??null,_=new Set(n.map(e=>e.name));return(0,I.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,I.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,I.jsx)(Im,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,I.jsx)(`span`,{className:`oc-bridge-provider__name`,children:Lit(e)}),d?(0,I.jsx)($,{variant:d===`beyond`?`destructive`:`secondary`,children:H5(d)}):null]}),(0,I.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:D0e()}),(0,I.jsx)(nat,{support:o,compatStatus:i,compatReachable:a,manifest:r,instanceRows:c,canConfigure:e=>_.has(e),onConfigure:h}),(0,I.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),children:[f?(0,I.jsx)(dm,{size:13,"aria-hidden":!0}):(0,I.jsx)(fm,{size:13,"aria-hidden":!0}),nFe({count:t.length})]}),f?(0,I.jsx)(Jit,{connections:t,displayByInstance:s}):null,g?(0,I.jsx)(u7,{instance:g,onClose:()=>h(null)},g._id):null]})}function nat({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i,canConfigure:a,onConfigure:o}){return t===`loading`?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:pQ()}):t===`nodata`?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:A0e()}):(0,I.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:R0e()}),r===null?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:V0e()}):(0,I.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,I.jsx)(`span`,{className:`oc-compat__label`,children:W0e()}),e&&e.range!==null?(0,I.jsx)(`span`,{children:q0e({min:e.range.min,max:e.range.maxValidated})}):(0,I.jsx)(`span`,{children:YQ()}),e?(0,I.jsx)(aat,{versions:e.validatedVersions}):null]}),i.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:a2e()}):(0,I.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,I.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,I.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:U5(e.version)}),(0,I.jsx)($,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:H5(e.state)}),a(e.instanceName)?(0,I.jsxs)(z$,{children:[(0,I.jsx)(B$,{asChild:!0,children:(0,I.jsx)(X,{variant:`ghost`,size:`icon`,className:`oc-compat__target-menu`,"aria-label":fQ(),children:(0,I.jsx)(ym,{size:16,"aria-hidden":!0})})}),(0,I.jsx)(V$,{align:`end`,children:(0,I.jsx)(H$,{onSelect:()=>o(e.instanceName),children:fQ()})})]}):null]},e.instanceName))})]})}function u7({instance:e,onClose:t}){return(0,I.jsx)(c1,{open:!0,onOpenChange:e=>!e&&t(),children:(0,I.jsxs)(l1,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:tNe({instance:e.displayName??e.name})}),(0,I.jsx)(p1,{children:oNe()})]}),(0,I.jsx)(iat,{instance:e,onClose:t})]})})}function rat({text:e}){return(0,I.jsx)(j5,{delayDuration:150,children:(0,I.jsxs)(M5,{children:[(0,I.jsx)(N5,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,className:`oc-field__help`,"aria-label":e,onClick:e=>e.preventDefault(),children:(0,I.jsx)(See,{"aria-hidden":!0})})}),(0,I.jsx)(P5,{className:`max-w-xs text-pretty`,children:e})]})})}function d7({label:e,help:t}){return(0,I.jsxs)(`span`,{className:`oc-field__label`,children:[e,(0,I.jsx)(rat,{text:t})]})}function f7({label:e,result:t}){return t?t.checked?(0,I.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,I.jsx)(gm,{"aria-hidden":!0}):(0,I.jsx)(Vm,{"aria-hidden":!0}),(0,I.jsxs)(`span`,{children:[e,` — `,t.ok?vPe():t.detail]})]}):(0,I.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,xPe()]}):null}function iat({instance:e,onClose:t}){let n=F(V.admin.upsertInstanceConfig),r=$n(V.bridge.validateMediaPaths),i=b1(),[a,o]=(0,N.useState)(()=>Dit(e.config??{})),[s,c]=(0,N.useState)(!1),[l,u]=(0,N.useState)(!1),[d,f]=(0,N.useState)(null),p=a.inboundMediaMode===`shared-fs`,m=a.mediaMode===`shared-fs`,h=p||m;async function g(){u(!0),f(null);try{f(await r({instanceName:e.name,inboundMediaMode:a.inboundMediaMode,mediaMode:a.mediaMode}))}catch(e){i.error(oPe(),e)}finally{u(!1)}}async function _(){c(!0);try{let r=e.config??{};await n({instanceId:e._id,config:Oit(a,r)}),t()}catch(e){i.error(DNe(),e)}finally{c(!1)}}return(0,I.jsx)(`div`,{className:`oc-bridge-config`,children:(0,I.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,I.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(d7,{label:fNe(),help:ANe()}),(0,I.jsxs)(S3,{value:a.mediaMode,onValueChange:e=>o({...a,mediaMode:e}),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-full`,children:(0,I.jsx)(C3,{})}),(0,I.jsx)(T3,{children:Tit.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))})]})]}),(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(d7,{label:hNe(),help:NNe()}),(0,I.jsxs)(S3,{value:a.inboundMediaMode,onValueChange:e=>o({...a,inboundMediaMode:e}),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-full`,children:(0,I.jsx)(C3,{})}),(0,I.jsx)(T3,{children:Eit.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))})]})]}),(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(d7,{label:vNe(),help:INe()}),(0,I.jsx)($$,{type:`number`,min:1,max:4096,className:`w-full`,value:a.mediaMaxMb,onChange:e=>o({...a,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),h&&(0,I.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[p&&(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(d7,{label:HNe(),help:GNe()}),(0,I.jsx)($$,{className:`w-full`,spellCheck:!1,value:a.inboundAgentMount,onChange:e=>o({...a,inboundAgentMount:e.target.value})})]}),m&&(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(d7,{label:JNe(),help:ZNe()}),(0,I.jsx)($$,{className:`w-full`,spellCheck:!1,value:a.outboundAgentMount,onChange:e=>o({...a,outboundAgentMount:e.target.value})})]})]}),(0,I.jsxs)(`label`,{className:`oc-field--row`,children:[(0,I.jsx)(C1,{checked:a.rehydration,onCheckedChange:e=>o({...a,rehydration:e===!0})}),(0,I.jsx)(d7,{label:xNe(),help:zNe()})]}),h&&d!==null&&(0,I.jsx)(`div`,{className:`oc-bridge-config__check`,children:d.reachable?!d.inbound&&!d.outbound?(0,I.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,I.jsx)(Vm,{"aria-hidden":!0}),DPe({reason:d.reason??`?`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(f7,{label:fPe(),result:d.inbound}),(0,I.jsx)(f7,{label:hPe(),result:d.outbound}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:lPe()})]}):(0,I.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,I.jsx)(Vm,{"aria-hidden":!0}),wPe()]})}),(0,I.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[h&&(0,I.jsxs)(X,{variant:`outline`,size:`sm`,onClick:()=>void g(),disabled:l,children:[l?(0,I.jsx)(Cm,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,l?rPe():ePe()]}),(0,I.jsx)(X,{size:`sm`,onClick:()=>void _(),disabled:s,children:wNe()})]})]})})}function aat({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,I.jsxs)(K$,{children:[(0,I.jsx)(q$,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?X0e():$0e({count:e.length}),(0,I.jsx)(dm,{size:13,"aria-hidden":!0})]})}),(0,I.jsxs)(J$,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,I.jsx)(`p`,{className:`oc-compat__versions-title`,children:n2e()}),(0,I.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,I.jsx)($,{variant:`secondary`,children:e},e))})]})]})}var oat=[{value:`eq`,label:`=`},{value:`neq`,label:`≠`},{value:`contains`,label:$ze()},{value:`gt`,label:`>`},{value:`gte`,label:`≥`},{value:`lt`,label:`<`},{value:`lte`,label:`≤`}],p7=1;function sat(){return{id:p7++,field:``,op:`eq`,value:``}}function cat(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,N.useRef)(t),i=!!(r.current&&r.current.length>0),[a,o]=(0,N.useState)(i),[s,c]=(0,N.useState)(()=>i?cat(r.current):[]);function l(e){n(e.filter(e=>e.field!==``&&e.value!==``).map(e=>({field:e.field,op:e.op,value:zit(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,sat()])}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,I.jsxs)(`div`,{className:`oc-advfilter`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`oc-advfilter__toggle`,"aria-expanded":a,onClick:()=>o(e=>!e),children:[(0,I.jsx)(dm,{className:`oc-advfilter__chevron`+(a?` is-open`:``),"aria-hidden":!0}),nBe(),p>0?(0,I.jsx)(`span`,{className:`oc-advfilter__count`,children:p}):null]}),a?(0,I.jsxs)(`div`,{className:`oc-advfilter__body`,children:[s.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:aBe()}):(0,I.jsx)(`ul`,{className:`oc-advfilter__rows`,children:s.map(t=>(0,I.jsxs)(`li`,{className:`oc-advfilter__row`,children:[(0,I.jsxs)(S3,{value:t.field||void 0,onValueChange:e=>u(t.id,{field:e}),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-40`,children:(0,I.jsx)(C3,{placeholder:cBe()})}),(0,I.jsx)(T3,{children:e.map(e=>(0,I.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),(0,I.jsxs)(S3,{value:t.op,onValueChange:e=>u(t.id,{op:e}),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-28`,children:(0,I.jsx)(C3,{})}),(0,I.jsx)(T3,{children:oat.map(e=>(0,I.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),(0,I.jsx)($$,{className:`oc-advfilter__value`,value:t.value,onChange:e=>u(t.id,{value:e.target.value}),placeholder:dBe()}),(0,I.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":mBe(),onClick:()=>f(t.id),children:(0,I.jsx)(Gm,{})})]},t.id))}),(0,I.jsxs)(X,{variant:`outline`,size:`sm`,className:`oc-advfilter__add`,onClick:d,children:[(0,I.jsx)(Nm,{}),_Be()]})]}):null]})}var lat=[`eq`,`neq`,`contains`,`gt`,`gte`,`lt`,`lte`],h7=[50,100,200,500],g7=`now-30d`,uat=`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`||!lat.includes(i)||typeof a!=`string`&&typeof a!=`number`&&typeof a!=`boolean`||n.push({field:r,op:i,value:a})}return n}var x7=sp().optional(),S7=sp().optional(),C7=sp().optional(),w7=sp().optional().catch(void 0),dat=Rp({q:x7,kind:sp().default(`all`).catch(`all`),limit:fee().pipe(Bp([Kp(h7[0]),Kp(h7[1]),Kp(h7[2]),Kp(h7[3])])).catch(100),statusClass:Wp([`2xx`,`4xx`,`5xx`]).optional().catch(void 0),principalType:Wp([`user`,`service`,`system`]).optional().catch(void 0),direction:Wp([`inbound`,`outbound`,`internal`]).optional().catch(void 0),roleKey:w7,from:S7,to:S7,adv:C7}),fat=Rp({q:x7,action:w7,impersonated:Wp([`yes`,`no`]).optional().catch(void 0),resource:w7,from:S7,to:S7,adv:C7}),pat=Rp({q:x7,status:Wp([`open`,`acknowledged`,`resolved`,`all`]).default(`open`).catch(`open`),severity:Wp([`info`,`warn`,`critical`]).optional().catch(void 0),kind:w7,from:S7,to:S7}),mat=Rp({from:S7,to:S7}),hat=Rp({q:x7,status:Wp([`active`,`disabled`]).optional().catch(void 0)}),gat=Rp({q:x7,role:w7});Rp({q:x7,mode:Wp([`per-user`,`shared`]).optional().catch(void 0)});var _at={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`,`groups`];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 vat={uiprefs:`preferences`};function yat({granted:e,onToggle:t}){let n=new Set(e),r=A7.filter(e=>n.has(k7[e])).length;return(0,I.jsxs)(z$,{children:[(0,I.jsx)(B$,{asChild:!0,children:(0,I.jsx)(X,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?uhe():phe({count:r})})}),(0,I.jsxs)(V$,{align:`start`,className:`w-52`,children:[(0,I.jsx)(U$,{children:ghe()}),A7.map(e=>{let r=k7[e];return(0,I.jsxs)(H$,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,I.jsx)(C1,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,I.jsx)(`span`,{children:O7[e]??e})]},e)})]})]})}function bat(){let e=os({from:`/settings/users`}),t=ss({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=P(V.admin.listUsers,{filter:{q:n||void 0,role:r===T7?void 0:r},withAgents:!0}),s=P(V.me.getMe,{host:xO}),c=F(V.admin.setRole),l=F(V.admin.setUserPermissions),u=F(V.admin.startImpersonation),d=F(V.admin.deleteUser),f=F(V.admin.setUserName),p=g1(),m=_1(),h=b1(),[g,_]=(0,N.useState)(null),v=(0,N.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(yhe(),e)}}async function S(e){try{await l(e)}catch(e){h.error(She(),e)}}async function C(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await p({title:Uhe(),description:Khe({user:t}),confirmWord:Yhe(),confirmLabel:Qhe(),destructive:!0}))try{await d({profileId:e._id}),h.success(ige({user:t}))}catch(e){h.error(tge(),e)}}async function w(e){let t=e.email||e.name||e.userId.slice(0,8),n=await m({title:uge(),label:pge({user:t}),placeholder:gge(),defaultValue:e.name??``,confirmLabel:GZ()});if(n!==null)try{await f({profileId:e._id,name:n}),h.success(yge())}catch(e){h.error(Sge(),e)}}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(r7,{q:n,onQChange:i,searchPlaceholder:The(),onReset:b,canReset:y,children:(0,I.jsxs)(S3,{value:r,onValueChange:a,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-36`,children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:T7,children:Ohe()}),v.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]})}),(0,I.jsx)(k5,{title:jhe(),rows:o,emptyHint:Phe(),rowActions:e=>{let t=[{label:UZ(),onSelect:()=>_({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:sge(),onSelect:()=>void w(e)}];return e.userId!==s?.userId&&t.push({label:Lhe(),onSelect:()=>void u({profileId:e._id})},{label:Bhe(),variant:`destructive`,onSelect:()=>void C(e)}),t},columns:[{header:Tge(),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,I.jsxs)(`div`,{className:`flex flex-col`,children:[(0,I.jsx)(`span`,{children:t}),n?(0,I.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:Oge(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,I.jsxs)(S3,{value:e.role,onValueChange:t=>void x({profileId:e._id,role:t}),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-28`,children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:`pending`,children:`pending`}),(0,I.jsx)(Q,{value:`user`,children:`user`}),(0,I.jsx)(Q,{value:`admin`,children:`admin`})]})]})},{header:jge(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,I.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:Pge()}):(0,I.jsx)(yat,{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:HZ(),cell:e=>(0,I.jsx)(A5,{icon:(0,I.jsx)(Im,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,I.jsx)(xit,{profileId:g?.profileId??null,userLabel:g?.label??``,open:g!==null,onOpenChange:e=>{e||_(null)}})]})}var P7={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``},xat={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Sat(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``}}function Cat(){let e=P(V.admin.listInstances,{}),t=P(V.agents.listAllInstanceAgents,{}),n=F(V.admin.upsertInstance),r=F(V.admin.deleteInstance),i=b1(),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(P7),[l,u]=(0,N.useState)(null),[d,f]=(0,N.useState)(null),[p,m]=(0,N.useState)(null),[h,g]=(0,N.useState)(null);async function _(){try{await n({instanceId:h??void 0,name:s.name,gatewayUrl:s.gatewayUrl,bridgeUrl:s.bridgeUrl||void 0,displayName:s.displayName||void 0,kind:s.kind,gatewayVersion:s.gatewayVersion||void 0,gatewayHttpUrl:s.gatewayHttpUrl||void 0}),c(P7),g(null),o(!1)}catch(e){i.error(Vge(),e)}}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[Wge(),(0,I.jsx)(`strong`,{children:qge()}),Xge()]}),(0,I.jsx)(k5,{title:$ge(),rows:e,addLabel:n_e(),onAdd:()=>{g(null),c(P7),o(!0)},emptyHint:a_e(),columns:[{header:c_e(),cell:e=>e.name,sort:e=>e.name},{header:d_e(),cell:e=>(0,I.jsx)($,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:m_e(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:__e(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:HZ(),cell:e=>{let n=(t?.[e.name]??[]).filter(e=>e.presentInLastOk!==!1&&e.enabled);if(n.length===0)return(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let r=t=>e.defaultAgentId===t;return(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...n].sort((e,t)=>Number(r(t.agentId))-Number(r(e.agentId))).map(e=>(0,I.jsxs)($,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?$Z():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:O_e(),onSelect:()=>{g(e._id),c(Sat(e)),o(!0)}},{label:UZ(),onSelect:()=>u(e.name)},{label:vve(),onSelect:()=>m(e)},{label:b_e(),onSelect:()=>f(e)},{label:WZ(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:WZ(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,I.jsx)(Q8,{open:a,onOpenChange:o,title:h?j_e():T_e(),description:L_e(),canSubmit:!!(s.name&&s.gatewayUrl),onSubmit:_,submitLabel:GZ(),children:(0,I.jsxs)(`div`,{className:`oc-form`,children:[(0,I.jsxs)(L7,{label:H_e(),children:[(0,I.jsx)($$,{value:s.name,disabled:h!==null,onChange:e=>c({...s,name:e.target.value})}),h?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:P_e()}):null]}),(0,I.jsx)(L7,{label:G_e(),children:(0,I.jsxs)(S3,{value:s.kind,onValueChange:e=>c({...s,kind:e}),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-40`,children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:`openclaw`,children:`OpenClaw`}),(0,I.jsx)(Q,{value:`hermes`,children:`Hermes`})]})]})}),(0,I.jsx)(L7,{label:J_e(),children:(0,I.jsx)($$,{value:s.gatewayUrl,onChange:e=>c({...s,gatewayUrl:e.target.value})})}),(0,I.jsx)(L7,{label:Z_e(),children:(0,I.jsx)($$,{value:s.bridgeUrl,placeholder:eve(),onChange:e=>c({...s,bridgeUrl:e.target.value})})}),(0,I.jsx)(L7,{label:rve(),children:(0,I.jsx)($$,{value:s.displayName,onChange:e=>c({...s,displayName:e.target.value})})}),(0,I.jsx)(L7,{label:ove(),children:(0,I.jsx)($$,{value:s.gatewayVersion,placeholder:lve(),onChange:e=>c({...s,gatewayVersion:e.target.value})})}),(0,I.jsx)(L7,{label:fve(),children:(0,I.jsx)($$,{value:s.gatewayHttpUrl,placeholder:hve(),onChange:e=>c({...s,gatewayHttpUrl:e.target.value})})})]})}),(0,I.jsx)(jat,{instanceName:l,open:l!==null,onOpenChange:e=>{e||u(null)}}),d?(0,I.jsx)(u7,{instance:d,onClose:()=>f(null)},d._id):null,p?(0,I.jsx)(wat,{instance:p,onClose:()=>m(null)},p._id):null]})}function wat({instance:e,onClose:t}){let n=P(V.instanceSecrets.listInstanceSecretStatus,{}),r=xat[e.kind??`openclaw`],i=(0,N.useMemo)(()=>{let t={};for(let r of n??[])r.instanceId===e._id&&(t[r.field]=r.updatedAt);return t},[n,e._id]);return(0,I.jsx)(c1,{open:!0,onOpenChange:e=>!e&&t(),children:(0,I.jsxs)(l1,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:xve({instance:e.displayName??e.name})}),(0,I.jsx)(p1,{children:wve()})]}),(0,I.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,I.jsx)(Dat,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,I.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,I.jsx)(Eat,{instance:e})}),(0,I.jsx)(Tat,{instance:e})]})})}function Tat({instance:e}){let t=$n(V.instanceSync.forceInstanceSync),n=b1(),[r,i]=(0,N.useState)(!1);async function a(){if(!r){i(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(Eye());break;case`no_agents`:n.success(Mye());break;case`no_bridge_url`:n.error(Fye());break;case`deploy_misconfigured`:n.error(Rye());break;case`unauthorized`:n.error(Wye());break;case`not_served`:n.error(qye());break;default:n.error(Vye());break}}catch(e){n.error(kye(),e)}finally{i(!1)}}}return(0,I.jsxs)(`div`,{className:`oc-form`,children:[(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:Xye()}),(0,I.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,I.jsx)(X,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?Cye():bye()})})]})}function Eat({instance:e}){let t=P(V.bridgeAuth.listBridgeAuthStatus,{}),n=$n(V.bridgeAuth.mintBridgeSecret),r=F(V.bridgeAuth.revokeBridgeSecret),i=b1(),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(null),[l,u]=(0,N.useState)(!1),d=(t??[]).find(t=>t.instanceId===e._id),f=d!==void 0;async function p(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),u(!1)}catch(e){i.error(XZ(),e)}finally{o(!1)}}}async function m(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(mbe())}catch(e){i.error(XZ(),e)}finally{o(!1)}}}async function h(){if(s)try{await navigator.clipboard.writeText(s),u(!0)}catch{}}return(0,I.jsxs)(L7,{label:$ye(),children:[(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:nbe()}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)($,{variant:f?`outline`:`secondary`,children:f?`${KZ()} · ${d.prefix}…${d.lastFour}`:qZ()}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(X,{size:`sm`,onClick:()=>void p(),disabled:a,children:f?cbe():abe()}),f?(0,I.jsx)(X,{size:`sm`,variant:`destructive`,onClick:()=>void m(),disabled:a,children:dbe()}):null]})]}),s?(0,I.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,I.jsx)(`p`,{className:`oc-sa__minted-warning`,children:ybe()}),(0,I.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,I.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,I.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void h(),children:l?KV():YV()})]}),(0,I.jsx)(X,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),u(!1)},children:ZZ()})]}):null]})}function Dat({instanceId:e,field:t,updatedAt:n}){let r=$n(V.instanceSecrets.setInstanceSecret),i=F(V.instanceSecrets.clearInstanceSecret),a=$n(V.deviceIdentity.generateDeviceIdentity),o=b1(),[s,c]=(0,N.useState)(``),[l,u]=(0,N.useState)(!1),[d,f]=(0,N.useState)(null),[p,m]=(0,N.useState)(!1),h=n!==null,g=t===`deviceIdentity`,_=t===`token`?Dve():t===`deviceIdentity`?Ave():Nve();async function v(){if(!(!s.trim()||l)){u(!0);try{await r({instanceId:e,field:t,plaintext:s}),c(``),f(null),m(!1),o.success(Qve())}catch(e){o.error(JZ(),e)}finally{u(!1)}}}async function y(){if(!l){u(!0);try{await i({instanceId:e,field:t}),f(null),m(!1),o.success(rye())}catch(e){o.error(JZ(),e)}finally{u(!1)}}}async function b(){if(!l){u(!0);try{f(await a({instanceId:e})),m(!1),o.success(YZ())}catch(e){o.error(_ye(),e)}finally{u(!1)}}}let x=d?`openclaw devices approve ${d.id}`:``;async function S(){if(x)try{await navigator.clipboard.writeText(x),m(!0)}catch{}}return(0,I.jsxs)(L7,{label:_,children:[g?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:lye()}):null,(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)($,{variant:h?`outline`:`secondary`,children:h?KZ():qZ()}),(0,I.jsx)($$,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:s,placeholder:h?Uve():Bve(),onChange:e=>c(e.target.value)}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(X,{size:`sm`,onClick:()=>void v(),disabled:l||s.trim().length===0,children:Kve()}),g?(0,I.jsx)(X,{size:`sm`,variant:`outline`,onClick:()=>void b(),disabled:l,children:oye()}):null,h?(0,I.jsx)(X,{size:`sm`,variant:`destructive`,onClick:()=>void y(),disabled:l,children:Yve()}):null]})]}),d?(0,I.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:YZ()}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:mye()}),(0,I.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,I.jsx)(`code`,{className:`oc-sa__minted-plain`,children:x}),(0,I.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void S(),children:p?KV():YV()})]}),(0,I.jsx)(X,{size:`sm`,variant:`ghost`,onClick:()=>{f(null),m(!1)},children:ZZ()})]}):null]})}var Oat={conversational:Wbe,documentary:Xbe},kat={conversational:qbe,documentary:$be},F7=e=>(Oat[e]??(()=>e))(),I7=e=>(kat[e]??(()=>``))();function Aat({agentId:e,types:t,onToggle:n}){return(0,I.jsxs)(`div`,{className:`oc-agentcard__types`,children:[(0,I.jsx)(`span`,{className:`oc-agentcard__types-label`,children:Mbe()}),t.map(e=>(0,I.jsx)($,{variant:`secondary`,className:`oc-agenttype__chip`,title:I7(e),children:F7(e)},e)),(0,I.jsxs)(K$,{children:[(0,I.jsx)(q$,{asChild:!0,children:(0,I.jsx)(X,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:Fbe()})}),(0,I.jsxs)(J$,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,I.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:Rbe()}),(0,I.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:Vbe()}),(0,I.jsx)(`div`,{className:`oc-agenttypes-pop__list`,children:S5.map(r=>{let i=`agtype-${e}-${r}`;return(0,I.jsxs)(`div`,{className:`oc-agenttypes-pop__item`,children:[(0,I.jsx)(C1,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,I.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,I.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:F7(r)}),(0,I.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:I7(r)})]})]},r)})})]})]})]})}function jat({instanceName:e,open:t,onOpenChange:n}){let r=P(V.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=F(V.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(V.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(V.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=F(V.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(V.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(V.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),o=F(V.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(V.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=bit(r);e.setQuery(V.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),s=F(V.agents.removeInstanceAgent),c=g1(),l=b1();async function u(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){l.error(QZ(),e)}}async function d(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){l.error(QZ(),e)}}async function f(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await o({instanceName:e,agentId:t,types:i})}catch(e){l.error(QZ(),e)}}async function p(t,n){if(e&&await c({title:cxe({name:n}),description:dxe(),confirmLabel:mxe(),destructive:!0}))try{await s({instanceName:e,agentId:t}),l.success(_xe())}catch(e){l.error(QZ(),e)}}return(0,I.jsx)(c1,{open:t,onOpenChange:n,children:(0,I.jsxs)(l1,{className:`oc-access`,children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:wbe({name:e??``})}),(0,I.jsx)(p1,{children:Dbe()})]}),r===void 0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:bxe()}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?Cxe():r.discovery.lastPollOk?Exe():kxe({error:r.discovery.error??`?`})}),r.agents.length===0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:Mxe()}):(0,I.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>{let t=e.presentInLastOk===!1,n=r.defaultAgentId===e.agentId,i=e.displayName??e.agentId,a=e.types??[];return(0,I.jsxs)(`div`,{className:`oc-agentcard`+(e.enabled?``:` oc-agentcard--off`),children:[(0,I.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,I.jsx)(C1,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void u(e.agentId,t===!0)}),(0,I.jsxs)(`span`,{className:`oc-agentcard__name`,title:i,children:[e.emoji?`${e.emoji} `:``,i]}),e.model?(0,I.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,t?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:Lxe()}),(0,I.jsx)(X,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void p(e.agentId,i),children:axe()})]}):n?(0,I.jsx)($,{variant:`default`,children:$Z()}):(0,I.jsx)(X,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void d(e.agentId),children:nxe()})]}),e.enabled?(0,I.jsx)(Aat,{agentId:e.agentId,types:a,onToggle:t=>void f(e.agentId,t,a)}):null]},e.agentId)})})]})]})})}function L7({label:e,children:t}){return(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}var Mat=[{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 Nat(){let e=os({from:`/settings/audit`}),t=ss({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,N.useMemo)(()=>b7(e.adv),[e.adv]),{from:c,to:l}=e7(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=P(V.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,N.useMemo)(()=>{let e=new Set;for(let t of g??[])e.add(t.action);return[...e].sort()},[g]),v=(0,N.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!==_at.from;function b(){t({search:{},replace:!0})}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[Bxe(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:Uxe()})]}),(0,I.jsxs)(r7,{q:n,onQChange:u,searchPlaceholder:Kxe(),timeRange:o,onTimeRangeChange:m,onReset:b,canReset:y,children:[(0,I.jsxs)(S3,{value:r,onValueChange:d,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-40`,children:(0,I.jsx)(C3,{placeholder:eQ()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:T7,children:Zxe()}),_.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]}),(0,I.jsxs)(S3,{value:i,onValueChange:f,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-40`,children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:T7,children:eSe()}),(0,I.jsx)(Q,{value:`yes`,children:rSe()}),(0,I.jsx)(Q,{value:`no`,children:oSe()})]})]}),(0,I.jsxs)(S3,{value:a,onValueChange:p,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-40`,children:(0,I.jsx)(C3,{placeholder:tQ()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:T7,children:dSe()}),v.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]})]}),(0,I.jsx)(m7,{fields:Mat,seed:s,onChange:h}),(0,I.jsx)(k5,{title:mSe(),rows:g,emptyHint:_Se(),columns:[{header:bSe(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:eQ(),cell:e=>e.action,sort:e=>e.action},{header:CSe(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:ESe(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:tQ(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}var Pat={pending:lwe,user:fwe,admin:hwe,observer:vwe,agent:xwe};function R7(e){if(e.builtin){let t=Pat[e.key];if(t)return t()}return e.description}var z7=[{value:`never`,label:()=>tH(),days:null},{value:`30`,label:()=>iH(),days:30},{value:`90`,label:()=>sH(),days:90}],Fat=720*60*60*1e3,B7=`__all__`,V7={name:``,roleKey:``,description:``};function Iat(){let e=os({from:`/settings/serviceAccounts`}),t=ss({from:`/settings/serviceAccounts`}),n=e.q??``,r=e.status??B7,[i,a]=(0,N.useState)(B7),o=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),s=e=>void t({search:t=>({...t,status:e===B7?void 0:e})}),c=P(V.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:i===B7?void 0:i,disabled:r===B7?void 0:r===`disabled`}}),l=P(V.apiKeys.listKeys,{}),u=P(V.apiKeys.listRoles,{}),d=F(V.apiKeys.createServiceAccount),f=F(V.apiKeys.updateServiceAccount),p=F(V.apiKeys.deleteServiceAccount),m=$n(V.apiKeys.mintApiKey),h=F(V.apiKeys.revokeApiKey),g=g1(),_=b1(),v=n!==``||i!==B7||r!==B7;function y(){a(B7),t({search:{},replace:!0})}let[b,x]=(0,N.useState)(!1),[S,C]=(0,N.useState)(V7),[w,T]=(0,N.useState)(null),[E,D]=(0,N.useState)(new Set),[O,ee]=(0,N.useState)(null),te=(0,N.useRef)(!1),[k,A]=(0,N.useState)(new Set),[j,ne]=(0,N.useState)({}),[re,M]=(0,N.useState)(null),ie=(0,N.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 ae(e){D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function oe(){try{w?(await f({serviceAccountId:w,name:S.name,roleKey:S.roleKey,description:S.description}),_.success(pB())):await d({name:S.name,roleKey:S.roleKey,description:S.description||void 0}),C(V7),T(null),x(!1)}catch(e){_.error(w?uB():sB(),e)}}function se(e){C({name:e.name,roleKey:e.roleKey,description:e.description??``}),T(e._id),x(!0)}async function ce(e){if(te.current)return;te.current=!0;let t=j[e._id]??`never`,n=z7.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;ee(e._id);try{let t=await m({serviceAccountId:e._id,expiresAt:r});M({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){_.error(gB(),e)}finally{te.current=!1,ee(null)}}async function le(e){if(await g({title:yB(),description:(0,I.jsxs)(I.Fragment,{children:[SB(),` `,(0,I.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,TB(),` `,(0,I.jsx)(`strong`,{children:OB()}),` `,jB()]}),confirmWord:e.name,confirmLabel:PB(),destructive:!0}))try{await p({serviceAccountId:e._id}),_.success(LB(),e.name)}catch(e){_.error(BB(),e)}}async function ue(e){if(await g({title:UB(),description:(0,I.jsxs)(I.Fragment,{children:[KB(),` `,(0,I.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,YB()]}),confirmLabel:QB(),destructive:!0})&&!k.has(e._id)){A(t=>new Set(t).add(e._id));try{await h({keyId:e._id})}catch(e){_.error(tV(),e)}finally{A(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:pR()}),(0,I.jsxs)(r7,{q:n,onQChange:o,searchPlaceholder:gR(),onReset:y,canReset:v,children:[(0,I.jsxs)(S3,{value:i,onValueChange:a,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-40`,children:(0,I.jsx)(C3,{placeholder:yR()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:B7,children:SR()}),(u??[]).map(e=>(0,I.jsx)(Q,{value:e.key,children:e.key},e._id))]})]}),(0,I.jsxs)(S3,{value:r,onValueChange:s,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-36`,children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:B7,children:TR()}),(0,I.jsx)(Q,{value:`active`,children:OR()}),(0,I.jsx)(Q,{value:`disabled`,children:jR()})]})]})]}),(0,I.jsx)(k5,{title:PR(),rows:c,addLabel:LR(),onAdd:()=>{C(V7),T(null),x(!0)},emptyHint:BR(),isExpanded:e=>E.has(e._id),renderExpanded:e=>(0,I.jsx)(Lat,{account:e,keys:ie.get(e._id)??[],onRevoke:ue,revoking:k}),rowActions:e=>[{label:QR(),onSelect:()=>se(e)},{label:UR(),onSelect:()=>void ce(e)},{label:E.has(e._id)?KR():YR(),onSelect:()=>ae(e._id)},{label:tz(),variant:`destructive`,onSelect:()=>void le(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,I.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":E.has(e._id)?iz():sz(),onClick:()=>ae(e._id),children:E.has(e._id)?(0,I.jsx)(dm,{}):(0,I.jsx)(fm,{})})},{header:uz(),sort:e=>e.name,cell:e=>(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[(0,I.jsx)(`span`,{children:e.name}),e.description?(0,I.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:pz(),sort:e=>e.roleKey,cell:e=>(0,I.jsx)($,{variant:`secondary`,children:e.roleKey})},{header:gz(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,I.jsx)($,{variant:`destructive`,children:jR()}):(0,I.jsx)($,{variant:`outline`,children:OR()})},{header:yz(),cell:e=>(0,I.jsxs)(S3,{value:j[e._id]??`never`,onValueChange:t=>ne(n=>({...n,[e._id]:t})),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-32`,children:(0,I.jsx)(C3,{})}),(0,I.jsx)(T3,{children:z7.map(e=>(0,I.jsx)(Q,{value:e.value,children:e.label()},e.value))})]})},{header:Sz(),sort:e=>(ie.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(ie.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,I.jsx)(`span`,{className:`oc-sa__keycount`,children:O===e._id?Tz():Oz({count:t})})}}]}),(0,I.jsx)(Q8,{open:b,onOpenChange:e=>{x(e),e||T(null)},title:w?jz():Bz(),description:w?Pz():Uz(),canSubmit:!!(S.name&&S.roleKey),onSubmit:oe,submitLabel:w?Lz():Kz(),children:(0,I.jsxs)(`div`,{className:`oc-form`,children:[(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:Yz()}),(0,I.jsx)($$,{value:S.name,onChange:e=>C({...S,name:e.target.value})})]}),(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:Qz()}),(0,I.jsxs)(S3,{value:S.roleKey||void 0,onValueChange:e=>C({...S,roleKey:e}),children:[(0,I.jsx)(w3,{className:`w-full`,children:(0,I.jsx)(C3,{placeholder:tB()})}),(0,I.jsx)(T3,{children:(u??[]).map(e=>(0,I.jsxs)(Q,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(u??[]).find(e=>e.key===S.roleKey),t=e?R7(e):null;return t?(0,I.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:iB()}),(0,I.jsx)($$,{value:S.description,onChange:e=>C({...S,description:e.target.value})})]})]})}),(0,I.jsx)(Rat,{minted:re,onClose:()=>M(null)})]})}function Lat({account:e,keys:t,onRevoke:n,revoking:r}){return(0,I.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,I.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[iV(),` `,(0,I.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:sV()}):(0,I.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{children:uV()}),(0,I.jsx)(`th`,{children:pV()}),(0,I.jsx)(`th`,{children:gV()}),(0,I.jsx)(`th`,{children:yV()}),(0,I.jsx)(`th`,{children:SV()}),(0,I.jsx)(`th`,{children:TV()}),(0,I.jsx)(`th`,{})]})}),(0,I.jsx)(`tbody`,{children:t.map(t=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{children:(0,I.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,I.jsx)(`td`,{children:(0,I.jsx)($,{variant:`secondary`,children:e.roleKey})}),(0,I.jsx)(`td`,{children:zat(t.createdAt)}),(0,I.jsx)(`td`,{className:Bat(t.lastUsedAt)?`oc-sa__stale`:``,children:Vat(t.lastUsedAt)}),(0,I.jsx)(`td`,{children:Hat(t.expiresAt)}),(0,I.jsx)(`td`,{children:Uat(t)}),(0,I.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,I.jsx)(X,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?OV():jV()})})]},t._id))})]})]})}function Rat({minted:e,onClose:t}){let[n,r]=(0,N.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,I.jsx)(c1,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,I.jsxs)(l1,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:PV()}),(0,I.jsx)(p1,{children:LV({name:e.accountName})})]}),(0,I.jsx)(`div`,{className:`oc-sa__minted-warning`,children:BV()}),(0,I.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,I.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,I.jsxs)(X,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":UV(),children:[n?(0,I.jsx)(um,{}):(0,I.jsx)(_m,{}),n?KV():YV()]})]}),(0,I.jsx)(d1,{children:(0,I.jsx)(X,{onClick:()=>{r(!1),t()},children:QV()})})]}):null})}function zat(e){return new Date(e).toLocaleString(`fr-FR`)}function Bat(e){return e===null?!1:Date.now()-e>Fat}function Vat(e){return e===null?uH():new Date(e).toLocaleString(`fr-FR`)}function Hat(e){return e===null?`—`:new Date(e).toLocaleDateString(`fr-FR`)}function Uat(e){return e.disabled?(0,I.jsx)($,{variant:`destructive`,children:pH()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,I.jsx)($,{variant:`outline`,children:gH()}):(0,I.jsx)($,{variant:`outline`,children:yH()})}var H7=[{group:()=>kSe(),keys:[{key:`traces.read`,label:()=>nQ()},{key:`traces.read.content`,label:()=>KSe(),phi:!0},{key:`traces.write`,label:()=>rQ()}]},{group:()=>MSe(),keys:[{key:`kpi.read`,label:()=>nQ()},{key:`kpi.write`,label:()=>rQ()}]},{group:()=>FSe(),keys:[{key:`openclaw.query`,label:()=>ZSe()},{key:`anomalies.read`,label:()=>eCe()},{key:`anomalies.report`,label:()=>rCe()}]},{group:()=>RSe(),keys:[{key:`chats.read`,label:()=>nQ()},{key:`selfheal`,label:()=>lCe()}]},{group:()=>VSe(),keys:[{key:`admin.manage`,label:()=>oCe()}]}],Wat=H7.flatMap(e=>e.keys.map(e=>e.key));function U7(e){return e.includes(`*`)}var W7={key:``,name:``,description:``};function Gat(){let e=P(V.apiKeys.listRoles,{}),t=F(V.apiKeys.createRole),n=F(V.apiKeys.ensureRolesSeeded),r=F(V.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(V.apiKeys.listRoles,{});r&&e.setQuery(V.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),i=g1(),a=b1(),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(W7),[u,d]=(0,N.useState)(new Set);(0,N.useEffect)(()=>{n({}).catch(e=>{a.error(hCe(),e)})},[n,a]);let f=e??[];async function p(e,t){if(U7(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:vCe({name:e.name}),description:xCe(),confirmLabel:wCe()}))){d(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){a.error(DCe(),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(W7),s(!1)}catch(e){a.error(ACe(),e)}}let h=e===void 0,g=!h&&f.length===0;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[NCe(),` `,(0,I.jsx)(`code`,{children:`admin`}),` `,ICe(),` `,(0,I.jsx)(`code`,{children:`traces.read.content`}),` `,zCe()]}),(0,I.jsxs)(`div`,{className:`oc-dt`,children:[(0,I.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,I.jsx)(`h2`,{className:`oc-dt__title`,children:HCe()}),(0,I.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,I.jsx)(X,{size:`sm`,onClick:()=>{l(W7),s(!0)},children:GCe()})})]}),h?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:JCe()}):g?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:ZCe()}):(0,I.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,I.jsxs)(`table`,{className:`oc-matrix`,children:[(0,I.jsxs)(`thead`,{children:[(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:ewe()}),H7.map(e=>(0,I.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,I.jsx)(`tr`,{children:H7.flatMap(e=>e.keys.map(e=>(0,I.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?fCe({key:e.key}):e.key,children:[e.label(),e.phi?(0,I.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,I.jsx)(`tbody`,{children:f.map(e=>{let t=U7(e.permissions),n=u.has(e._id);return(0,I.jsxs)(`tr`,{children:[(0,I.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,I.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,I.jsx)(`span`,{children:e.name}),(0,I.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,I.jsxs)($,{variant:`outline`,className:`gap-1`,children:[(0,I.jsx)(wm,{}),` `,rwe()]}):(0,I.jsx)($,{variant:`secondary`,children:owe()})]}),R7(e)?(0,I.jsx)(`p`,{className:`oc-matrix__roledesc`,children:R7(e)}):null]}),Wat.map(r=>(0,I.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,I.jsx)(C1,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?wwe():n?Dwe():r,onCheckedChange:()=>void p(e,r)})},r))]},e.key)})})]})})]}),(0,I.jsx)(Q8,{open:o,onOpenChange:s,title:Awe(),description:Nwe(),canSubmit:!!(c.key&&c.name),onSubmit:m,submitLabel:Iwe(),children:(0,I.jsxs)(`div`,{className:`oc-form`,children:[(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:zwe()}),(0,I.jsx)($$,{value:c.key,placeholder:Hwe(),onChange:e=>l({...c,key:e.target.value})})]}),(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:Gwe()}),(0,I.jsx)($$,{value:c.name,onChange:e=>l({...c,name:e.target.value})})]}),(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:Jwe()}),(0,I.jsx)($$,{value:c.description,onChange:e=>l({...c,description:e.target.value})})]})]})})]})}function Kat(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function qat(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function Jat(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function Yat(e){switch(e){case`admin`:return oYe();case`user`:return lYe();case`pending`:return fYe();default:return e}}function G7(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function K7(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}function Xat({className:e,orientation:t=`horizontal`,...n}){return(0,I.jsx)(Qle,{"data-slot":`tabs`,"data-orientation":t,className:R$(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Zat=Z$(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Qat({className:e,variant:t=`default`,...n}){return(0,I.jsx)($le,{"data-slot":`tabs-list`,"data-variant":t,className:R$(Zat({variant:t}),e),...n})}function q7({className:e,...t}){return(0,I.jsx)(eue,{"data-slot":`tabs-trigger`,className:R$(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function J7({className:e,...t}){return(0,I.jsx)(tue,{"data-slot":`tabs-content`,className:R$(`flex-1 text-sm outline-none`,e),...t})}var Y7={name:``,description:``};function $at(){let e=P(V.groups.listGroups,{}),t=P(V.me.getMe,{host:xO})?.role===`admin`,n=F(V.groups.createGroup),r=F(V.groups.updateGroup),i=F(V.groups.deleteGroup),a=g1(),o=b1(),[s,c]=(0,N.useState)(!1),[l,u]=(0,N.useState)(null),[d,f]=(0,N.useState)(Y7),[p,m]=(0,N.useState)(null),[h,g]=(0,N.useState)(``),_=(0,N.useMemo)(()=>{if(!e)return e;let t=h.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.members.some(e=>e.label.toLowerCase().includes(t))||e.agents.some(e=>e.toLowerCase().includes(t))||e.charts.some(e=>e.name.toLowerCase().includes(t))):e},[e,h]);function v(){u(null),f(Y7),c(!0)}function y(e){u(e),f({name:e.name,description:e.description??``}),c(!0)}async function b(){try{l?await r({groupId:l._id,name:d.name,description:d.description}):await n({name:d.name,description:d.description||void 0}),f(Y7),u(null),c(!1)}catch(e){o.error(TXe(),e)}}async function x(e){if(await a({title:yJe({name:e.name}),description:SJe(),confirmWord:e.name,confirmLabel:TJe(),cancelLabel:tJe(),destructive:!0}))try{await i({groupId:e._id})}catch(e){o.error(OXe(),e)}}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:yqe()}),(0,I.jsx)(r7,{q:h,onQChange:g,onReset:()=>g(``),canReset:h!==``,searchPlaceholder:Bqe()}),(0,I.jsx)(k5,{title:gqe(),rows:_,addLabel:Sqe(),onAdd:t?v:void 0,emptyHint:Tqe(),columns:[{header:Oqe(),cell:e=>e.name,sort:e=>e.name},{header:jqe(),cell:e=>(0,I.jsx)(A5,{icon:(0,I.jsx)(Um,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,I.jsx)(Lm,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:Pqe(),cell:e=>(0,I.jsx)(A5,{icon:(0,I.jsx)(Im,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:Lqe(),cell:e=>(0,I.jsx)(A5,{icon:(0,I.jsx)(Mm,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,I.jsx)(zm,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:Uqe(),onSelect:()=>m({groupId:e._id,name:e.name})},...t?[{label:Kqe(),onSelect:()=>y(e)},{label:Yqe(),variant:`destructive`,onSelect:()=>void x(e)}]:[]]}),(0,I.jsx)(Q8,{open:s,onOpenChange:c,title:l?sJe():iJe(),description:uJe(),canSubmit:!!d.name.trim(),onSubmit:b,submitLabel:Qqe(),children:(0,I.jsxs)(`div`,{className:`oc-form`,children:[(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:pJe()}),(0,I.jsx)($$,{value:d.name,onChange:e=>f({...d,name:e.target.value})})]}),(0,I.jsxs)(`label`,{className:`oc-field`,children:[(0,I.jsx)(`span`,{className:`oc-field__label`,children:gJe()}),(0,I.jsx)($$,{value:d.description,onChange:e=>f({...d,description:e.target.value})})]})]})}),(0,I.jsx)(eot,{groupId:p?.groupId??null,groupName:p?.name??``,open:p!==null,onOpenChange:e=>{e||m(null)}})]})}var X7=8;function Z7({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,I.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,I.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,I.jsx)(bee,{size:14,"aria-hidden":!0}),ZJe()]}),(0,I.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":rYe({page:e,pages:t}),children:[e,` / `,t]}),(0,I.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[eYe(),(0,I.jsx)(fm,{size:14,"aria-hidden":!0})]})]})}function eot({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=P(V.groups.getGroup,n&&e?{groupId:e}:`skip`),a=P(V.groups.listAssignableInstances,n?{}:`skip`),o=P(V.groups.listAssignableUsers,n?{}:`skip`),s=F(V.groups.addMember),c=F(V.groups.removeMember),l=F(V.groups.bulkSetMembers),u=F(V.groups.setGroupManager),d=b1(),[f,p]=(0,N.useState)(``),[m,h]=(0,N.useState)(``),[g,_]=(0,N.useState)(`members`),[v,y]=(0,N.useState)(1),[b,x]=(0,N.useState)(new Set),S=(0,N.useRef)(null),C=(0,N.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),w=(0,N.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),T=i?.viewerIsAdmin===!0,E=(0,N.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,N.useEffect)(()=>{p(``),h(``),_(`members`),y(1),S.current=null},[n,e]),(0,N.useEffect)(()=>{y(1)},[f]),(0,N.useEffect)(()=>{n&&i&&e&&S.current!==e&&(S.current=e,x(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let D=(0,N.useMemo)(()=>o?Kat(o,f,b):[],[o,f,b]);async function O(t,n){if(e)try{n?await c({groupId:e,userId:t}):await s({groupId:e,userId:t})}catch(e){d.error(zQ(),e)}}async function ee(t,n){if(e)try{await u({groupId:e,userId:t,manager:!n})}catch(e){d.error(bXe(),e)}}let te=G7(D,e=>C.has(e.userId)),k=D.filter(e=>C.has(e.userId)).length,A=K7(D,v,X7);async function j(){if(!e||D.length===0)return;let t=D.map(e=>e.userId);try{await l({groupId:e,userIds:t,member:te!==`all`})}catch(e){d.error(zQ(),e)}}return(0,I.jsx)(c1,{open:n,onOpenChange:r,children:(0,I.jsxs)(l1,{className:`oc-access`,children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:OJe({name:t})}),(0,I.jsx)(p1,{children:jJe()})]}),(0,I.jsxs)(Xat,{value:g,onValueChange:_,className:`oc-access__tabs`,children:[(0,I.jsxs)(Qat,{className:`w-full`,children:[(0,I.jsxs)(q7,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,I.jsx)(Um,{size:13,"aria-hidden":!0}),PJe(),i?(0,I.jsx)($,{variant:`secondary`,className:`oc-access__tabcount`,children:C.size}):null]}),(0,I.jsxs)(q7,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,I.jsx)(Im,{size:13,"aria-hidden":!0}),BJe(),i?(0,I.jsx)($,{variant:`secondary`,className:`oc-access__tabcount`,children:E.size}):null]}),(0,I.jsxs)(q7,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,I.jsx)(Mm,{size:13,"aria-hidden":!0}),KYe(),i?(0,I.jsx)($,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,I.jsx)(J7,{value:`members`,children:o===void 0||i===void 0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:jQ()}):o.length===0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:EYe()}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)($$,{value:f,onChange:e=>p(e.target.value),placeholder:LJe(),className:`oc-access__search`}),D.length===0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:KJe()}):(0,I.jsxs)(I.Fragment,{children:[D.length>1?(0,I.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,I.jsx)(C1,{checked:te===`all`?!0:te===`some`?`indeterminate`:!1,onCheckedChange:()=>void j(),"aria-label":AQ()}),(0,I.jsx)(`span`,{className:`oc-access__label`,children:AQ()}),(0,I.jsxs)($,{variant:`outline`,className:`oc-access__count`,children:[k,` / `,D.length]})]}):null,(0,I.jsx)(`div`,{className:`oc-access__list`,children:A.pageItems.map(e=>{let t=C.has(e.userId),n=Jat(e),r=w.has(e.userId);return(0,I.jsxs)(`div`,{className:`oc-access__row`,children:[(0,I.jsx)(C1,{checked:t,onCheckedChange:()=>void O(e.userId,t),"aria-label":hYe({user:n.primary})}),(0,I.jsxs)(`span`,{className:`oc-access__who`,children:[(0,I.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,I.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,I.jsx)($,{variant:`outline`,className:`oc-access__role`,children:Yat(e.role)}),(0,I.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&T?(0,I.jsx)(X,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?LQ():IQ(),title:r?LQ():IQ(),onClick:()=>void ee(e.userId,r),children:(0,I.jsx)(Lm,{size:15,"aria-hidden":!0})}):t&&r?(0,I.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":FQ(),title:FQ(),children:(0,I.jsx)(Lm,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,I.jsx)(Z7,{page:A.page,pageCount:A.pageCount,onPage:y})]})]})}),(0,I.jsx)(J7,{value:`agents`,children:a===void 0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:jQ()}):a.length===0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:kYe()}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)($$,{value:m,onChange:e=>h(e.target.value),placeholder:UJe(),className:`oc-access__search`}),(0,I.jsx)(`div`,{className:`oc-access__list`,children:a.map(t=>(0,I.jsx)(tot,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:E,query:m},`${e}-${t._id}`))})]})}),(0,I.jsx)(J7,{value:`charts`,children:(0,I.jsx)(not,{groupId:e})})]})]})})}function tot({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=P(V.groups.listAssignableAgents,{instanceName:t}),o=F(V.groups.assignAgentToGroup),s=F(V.groups.removeAgentFromGroup),c=F(V.groups.bulkSetGroupAgents),l=b1(),[u,d]=(0,N.useState)(1);if((0,N.useEffect)(()=>{d(1)},[i]),!e)return null;let f=qat(a?.agents??[],i),p=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&f.length===0)return null;let m=f.filter(e=>e.presentInLastOk!==!1),h=G7(m,e=>r.has(`${t}/${e.agentId}`)),g=K7(f,u,X7);async function _(n,r){try{r?await s({groupId:e,instanceName:t,agentId:n}):await o({groupId:e,instanceName:t,agentId:n})}catch(e){l.error(BQ(),e)}}async function v(){if(m.length===0)return;let n=m.map(e=>e.agentId);try{await c({groupId:e,instanceName:t,agentIds:n,assigned:h!==`all`})}catch(e){l.error(BQ(),e)}}return(0,I.jsxs)(`div`,{className:`oc-access__group`,children:[(0,I.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,I.jsx)(Im,{size:13,"aria-hidden":!0}),(0,I.jsx)(`span`,{children:t}),(0,I.jsx)($,{variant:`outline`,className:`oc-access__kind`,children:n}),p?(0,I.jsx)($,{variant:`outline`,className:`oc-access__stale`,children:RYe()}):null]}),a===void 0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:CYe()}):f.length===0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:p?FYe():MYe()}):(0,I.jsxs)(I.Fragment,{children:[m.length>1?(0,I.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,I.jsx)(C1,{checked:h===`all`?!0:h===`some`?`indeterminate`:!1,onCheckedChange:()=>void v(),"aria-label":AQ()}),(0,I.jsx)(`span`,{className:`oc-access__label`,children:AQ()})]}):null,g.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,I.jsxs)(`div`,{className:`oc-access__row`,children:[(0,I.jsx)(C1,{checked:i,disabled:a&&!i,onCheckedChange:()=>void _(e.agentId,i),"aria-label":vYe({name:e.displayName??e.agentId})}),(0,I.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,I.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,I.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":MQ(),title:MQ(),children:(0,I.jsx)(zm,{size:14,fill:`currentColor`})}):null,a?(0,I.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:VYe()}):null]},e.agentId)}),(0,I.jsx)(Z7,{page:g.page,pageCount:g.pageCount,onPage:d})]})]})}function not({groupId:e}){let t=P(V.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=F(V.charts.assignChartToGroup),r=F(V.charts.removeChartFromGroup),i=F(V.charts.setGroupDefaultChart),a=F(V.charts.addChartToGroupPool),o=F(V.charts.removeChartFromGroupPool),s=b1();if(!e)return null;if(t===void 0)return(0,I.jsx)(`p`,{className:`oc-access__hint`,children:jQ()});let{pool:c,addable:l,canManagePool:u}=t;if(c.length===0&&!u)return(0,I.jsx)(`p`,{className:`oc-access__hint`,children:YYe()});async function d(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){s.error(RQ(),e)}}async function f(t){try{await i({groupId:e,chartKey:t})}catch(e){s.error(RQ(),e)}}async function p(t){try{await a({groupId:e,chartKey:t})}catch(e){s.error(RQ(),e)}}async function m(t){try{await o({groupId:e,chartKey:t})}catch(e){s.error(RQ(),e)}}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`oc-access__list`,children:c.map(e=>(0,I.jsxs)(`div`,{className:`oc-access__row`,children:[(0,I.jsx)(C1,{checked:e.selected,onCheckedChange:()=>void d(e.chartKey,e.selected),"aria-label":oXe({name:e.name})}),(0,I.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,I.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":PQ(),title:PQ(),children:(0,I.jsx)(zm,{size:14,fill:`currentColor`})}):(0,I.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void f(e.chartKey),children:dXe()}):null,u?(0,I.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":NQ({name:e.name}),title:NQ({name:e.name}),onClick:()=>void m(e.chartKey),children:(0,I.jsx)(Gm,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),u?l.length>0?(0,I.jsxs)(S3,{value:``,onValueChange:e=>void p(e),children:[(0,I.jsx)(w3,{size:`sm`,className:`oc-access__search`,children:(0,I.jsx)(C3,{placeholder:tXe()})}),(0,I.jsx)(T3,{children:l.map(e=>(0,I.jsx)(Q,{value:e.chartKey,children:e.name},e.chartKey))})]}):c.length===0?(0,I.jsx)(`p`,{className:`oc-access__hint`,children:QYe()}):null:null]})}var rot=[50,100,200,500],Q7=`all`,$7=`__all__`,iot=[`2xx`,`4xx`,`5xx`],aot=[`user`,`service`,`system`],oot=[`inbound`,`outbound`,`internal`],sot={kind:`relative`,from:`now-30d`,to:`now`},cot=[{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 lot(){let e=os({from:`/settings/traces`}),t=ss({from:`/settings/traces`}),n=e.limit,r=e.kind,i=e.statusClass??$7,a=e.principalType??$7,o=e.direction??$7,s=e.roleKey??$7,c=e.q??``,l=_7(e.from,e.to),u=(0,N.useMemo)(()=>b7(e.adv),[e.adv]),{from:d,to:f}=e7(l),[p,m]=(0,N.useState)(null),[h,g]=(0,N.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===$7?void 0:e})}),x=e=>void t({search:t=>({...t,principalType:e===$7?void 0:e})}),S=e=>void t({search:t=>({...t,direction:e===$7?void 0:e})}),C=e=>void t({search:t=>({...t,roleKey:e===$7?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=P(V.observability.listEvents,{limit:n}),D=P(V.observability.listEvents,{limit:n,kind:r===Q7?void 0:r,filter:{q:c||void 0,from:d,to:f,statusClass:i===$7?void 0:i,principalType:a===$7?void 0:a,direction:o===$7?void 0:o,roleKey:s===$7?void 0:s,advanced:u.length>0?u:void 0}}),O=(0,N.useMemo)(()=>{let e=new Set;for(let t of E??[])e.add(t.kind);return[...e].sort()},[E]),ee=(0,N.useMemo)(()=>{let e=new Set;for(let t of E??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[E]),te=c!==``||i!==$7||a!==$7||o!==$7||s!==$7||u.length>0||l.kind!==`relative`||l.from!==sot.from;function k(){t({search:{limit:100,kind:`all`},replace:!0})}let A=p?E?.filter(e=>e.correlationId===p):D;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[VOe(),(0,I.jsx)(`strong`,{children:WOe()}),qOe(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:XOe()})]}),(0,I.jsxs)(r7,{q:c,onQChange:y,searchPlaceholder:$Oe(),timeRange:l,onTimeRangeChange:w,onReset:k,canReset:te,children:[(0,I.jsxs)(S3,{value:i,onValueChange:b,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-32`,children:(0,I.jsx)(C3,{placeholder:nke()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:$7,children:ake()}),iot.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]}),(0,I.jsxs)(S3,{value:a,onValueChange:x,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-32`,children:(0,I.jsx)(C3,{placeholder:cke()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:$7,children:dke()}),aot.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]}),(0,I.jsxs)(S3,{value:o,onValueChange:S,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-32`,children:(0,I.jsx)(C3,{placeholder:mke()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:$7,children:_ke()}),oot.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]}),(0,I.jsxs)(S3,{value:s,onValueChange:C,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-36`,children:(0,I.jsx)(C3,{placeholder:bke()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:$7,children:Cke()}),ee.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]}),(0,I.jsxs)(S3,{value:r,onValueChange:v,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-44`,children:(0,I.jsx)(C3,{placeholder:Eke()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:Q7,children:kke()}),O.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]}),(0,I.jsxs)(S3,{value:String(n),onValueChange:e=>_(Number(e)),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-28`,children:(0,I.jsx)(C3,{})}),(0,I.jsx)(T3,{children:rot.map(e=>(0,I.jsx)(Q,{value:String(e),children:Mke({count:e})},e))})]})]}),(0,I.jsx)(m7,{fields:cot,seed:u,onChange:T}),p?(0,I.jsx)(`div`,{className:`oc-traces__followline`,children:(0,I.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>m(null),title:Fke(),children:[(0,I.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[Rke(),(0,I.jsx)(`code`,{children:e9(p)})]}),(0,I.jsx)(Gm,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,I.jsx)(`span`,{className:`sr-only`,children:Vke()})]})}):null,(0,I.jsx)(k5,{title:Wke(),rows:A,emptyHint:p?qke():Xke(),columns:[{header:$ke(),sort:e=>e.at,cell:e=>(0,I.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:nAe(),sort:e=>e.kind,cell:e=>(0,I.jsx)($,{variant:`secondary`,children:e.kind})},{header:aAe(),sort:e=>t9(e)??null,cell:e=>{let t=t9(e);return t?(0,I.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,I.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":cAe(),children:`✓`})}},{header:dAe(),sort:e=>e.direction,cell:e=>e.direction?(0,I.jsx)($,{variant:`outline`,children:e.direction}):(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:mAe(),sort:e=>e.principalType,cell:e=>(0,I.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,I.jsx)($,{variant:`outline`,children:e.principalType}),e.principalId?(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:e9(e.principalId)}):null]})},{header:_Ae(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,I.jsx)($,{variant:`secondary`,children:e.roleKey}):(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:bAe(),sort:e=>e.route,cell:e=>e.route?(0,I.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,I.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:CAe(),sort:e=>e.status,cell:e=>e.status===null?(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,I.jsx)(`span`,{className:`oc-traces__status ${uot(e.status)}`,children:e.status})},{header:EAe(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,I.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:kAe(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,I.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:MAe(),onClick:()=>m(e.correlationId),children:e9(e.correlationId)}):(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:FAe(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,I.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>g(e),children:RAe()}):(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,I.jsx)(dot,{row:h,onClose:()=>g(null)})]})}function uot(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 e9(e){return e.length>8?e.slice(0,8):e}function t9(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 dot({row:e,onClose:t}){let n=(0,N.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,I.jsx)(c1,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,I.jsxs)(l1,{className:`max-w-lg`,children:[(0,I.jsxs)(u1,{children:[(0,I.jsxs)(f1,{className:`oc-traces__meta-title`,children:[VAe(),` `,(0,I.jsx)(`code`,{children:e.kind}),(0,I.jsx)($,{variant:`outline`,children:WAe()})]}),(0,I.jsx)(p1,{children:qAe()})]}),(0,I.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}function n9({className:e,size:t=`default`,...n}){return(0,I.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:R$(`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 r9({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`card-header`,className:R$(`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 i9({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`card-title`,className:R$(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function a9({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`card-description`,className:R$(`text-sm text-muted-foreground`,e),...t})}function o9({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`card-content`,className:R$(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function fot({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`card-footer`,className:R$(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}var s9=[{metric:`api.calls`,label:BIe(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:UIe(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:KIe(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:YIe(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:QIe(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:tLe(),unit:`/h`,group:`Assistant`,isError:!0}],c9=s9.length,pot=[`API`,`OpenClaw`,`Chat`,`Assistant`],mot=1e3,hot=36e5;function got(e,t){let n=Math.max(1,Math.ceil((t-e)/hot)),r=Math.min(n*c9,mot);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/c9))}}function _ot(){let e=os({from:`/settings/kpi`}),t=ss({from:`/settings/kpi`}),n=_7(e.from,e.to,uat,`now`),r=e=>void t({search:t=>({...t,...v7(e)})}),{from:i,to:a}=e7(n),{rowLimit:o,buckets:s}=got(i,a),c=P(V.kpi.listKpis,{limit:o,filter:{from:i,to:a}}),l=(0,N.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,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[iLe(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:sLe()})]}),(0,I.jsx)(vot,{value:n,onChange:r})]});return c===void 0?(0,I.jsxs)(I.Fragment,{children:[u,(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:uLe()})]}):c.length===0?(0,I.jsxs)(I.Fragment,{children:[u,(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:pLe()})]}):(0,I.jsxs)(I.Fragment,{children:[u,pot.map(e=>{let t=s9.filter(t=>t.group===e);return t.some(e=>(l.get(e.metric)??[]).length>0)?(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,I.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,I.jsx)(yot,{config:e,series:l.get(e.metric)??[]},e.metric))})]},e):null})]})}function vot({value:e,onChange:t}){return(0,I.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,I.jsx)(n7,{value:e,onChange:t})})}function yot({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,r=n?n.value:0;return(0,I.jsxs)(n9,{size:`sm`,className:`oc-kpi__card`,children:[(0,I.jsxs)(r9,{children:[(0,I.jsx)(i9,{className:`oc-kpi__card-title`,children:e.label}),(0,I.jsx)(a9,{className:`oc-kpi__card-metric`,children:(0,I.jsx)(`code`,{children:e.metric})})]}),(0,I.jsxs)(o9,{className:`oc-kpi__card-body`,children:[(0,I.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,I.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&r>0?` oc-kpi__value--error`:``),children:d9(r)}),(0,I.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,I.jsx)(xot,{series:t,isError:e.isError,unit:e.unit}),(0,I.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,I.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:gLe({value:f9(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:yLe()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:SLe({count:t.length})})]})]})]})}var l9=240,u9=48,bot=1;function xot({series:e,isError:t,unit:n}){if(e.length===0)return(0,I.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=l9/e.length,a=Math.max(i-bot,1);return(0,I.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${l9} ${u9}`,preserveAspectRatio:`none`,role:`img`,"aria-label":TLe({max:d9(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(u9-1):0,c=o*i,l=u9-s;return(0,I.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,I.jsxs)(`title`,{children:[f9(e.bucket),` · `,d9(e.value),` `,n]})},e.bucket)})})}function d9(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function f9(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 p9=`__all__`,Sot=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Cot(e){return e===`open`?Zwe():e===`acknowledged`?eTe():rTe()}var wot=[`info`,`warn`,`critical`],Tot=[`detector`,`agent`],Eot={kind:`relative`,from:`now-30d`,to:`now`},Dot=200,m9=`all`;function Oot(){let e=os({from:`/settings/anomalies`}),t=ss({from:`/settings/anomalies`}),n=e.q??``,r=e.status===m9?p9:e.status,i=e.severity??p9,a=e.kind??p9,[o,s]=(0,N.useState)(p9),c=_7(e.from,e.to),{from:l,to:u}=e7(c),d=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),f=e=>void t({search:t=>({...t,status:e===p9?m9:e})}),p=e=>void t({search:t=>({...t,severity:e===p9?void 0:e})}),m=e=>void t({search:t=>({...t,kind:e===p9?void 0:e})}),h=e=>void t({search:t=>({...t,...v7(e)})}),g=g1(),_=b1(),v=F(V.anomalies.resolveAnomaly),y=(P(V.me.getMe,{host:xO})?.permissions??[]).includes(`admin.manage`),b=P(V.anomalies.listAnomalies,{limit:Dot,filter:{q:n||void 0,from:l,to:u,anomalyStatus:r===p9?void 0:r,severity:i===p9?void 0:i,source:o===p9?void 0:o,kind:a===p9?void 0:a}}),x=(0,N.useMemo)(()=>{let e=new Set;for(let t of b??[])e.add(t.kind);return[...e].sort()},[b]),S=n!==``||r!==`open`||i!==p9||o!==p9||a!==p9||c.kind!==`relative`||c.from!==Eot.from;function C(){s(p9),t({search:{status:`open`},replace:!0})}async function w(e){if(await g({title:oTe(),description:(0,I.jsxs)(I.Fragment,{children:[lTe(),` `,(0,I.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,fTe(),` `,(0,I.jsx)(`strong`,{children:hTe()}),`.`,` `,vTe()]}),confirmLabel:xTe()}))try{await v({anomalyId:e._id,status:`resolved`}),_.success(wTe(),e.kind)}catch(e){_.error(DTe(),e)}}async function T(e){try{await v({anomalyId:e._id,status:`acknowledged`}),_.success(ATe(),e.kind)}catch(e){_.error(NTe(),e)}}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[ITe(),` `,(0,I.jsx)(`strong`,{children:zTe()}),` `,HTe(),` `,(0,I.jsx)(`strong`,{children:GTe()}),` `,JTe(),` `,(0,I.jsx)(`strong`,{children:ZTe()}),` `,eEe(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:rEe()})]}),(0,I.jsxs)(r7,{q:n,onQChange:d,searchPlaceholder:oEe(),timeRange:c,onTimeRangeChange:h,onReset:C,canReset:S,children:[(0,I.jsxs)(S3,{value:r,onValueChange:f,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-36`,children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:p9,children:lEe()}),Sot.map(e=>(0,I.jsx)(Q,{value:e.value,children:Cot(e.value)},e.value))]})]}),(0,I.jsxs)(S3,{value:i,onValueChange:p,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-36`,children:(0,I.jsx)(C3,{placeholder:iQ()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:p9,children:mEe()}),wot.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]}),(0,I.jsxs)(S3,{value:o,onValueChange:s,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-32`,children:(0,I.jsx)(C3,{placeholder:aQ()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:p9,children:yEe()}),Tot.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]}),(0,I.jsxs)(S3,{value:a,onValueChange:m,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-36`,children:(0,I.jsx)(C3,{placeholder:oQ()})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:p9,children:wEe()}),x.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]})]}),(0,I.jsx)(k5,{title:DEe(),rows:b,emptyHint:r===`open`?AEe():NEe(),rowActions:e=>y&&e.status===`open`?[{label:IEe(),onSelect:()=>void w(e)},{label:zEe(),onSelect:()=>void T(e)}]:[],columns:[{header:HEe(),cell:e=>(0,I.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)}),sort:e=>e.at},{header:oQ(),cell:e=>(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:iQ(),cell:e=>(0,I.jsx)(jot,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:GEe(),cell:e=>(0,I.jsx)(Mot,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:aQ(),cell:e=>(0,I.jsx)($,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:JEe(),cell:e=>(0,I.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:ZEe(),cell:e=>(0,I.jsx)(Aot,{row:e}),sort:e=>e.evidence??null},{header:eDe(),cell:e=>e.correlationId?(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:Not(e.correlationId)}):(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function kot(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 Aot({row:e}){let t=ss(),n=kot(e);if(!n.dominantCode)return(0,I.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=I5(n.dominantCode),i=n.sampleCorrelationId;return(0,I.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,I.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,I.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,I.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,I.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,I.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,rDe()]}):null]})}function jot({severity:e}){return(0,I.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function Mot({status:e}){return e===`open`?(0,I.jsx)($,{variant:`destructive`,children:oDe()}):e===`acknowledged`?(0,I.jsx)($,{variant:`secondary`,children:lDe()}):(0,I.jsx)($,{variant:`outline`,children:fDe()})}function Not(e){return e.length>8?e.slice(0,8):e}function Pot(){let e=P(V.integrations.status.status,{}),t=F(V.admin.setIntegrationConfig),[n,r]=(0,N.useState)(null);if((0,N.useEffect)(()=>{e&&n===null&&r(e.config)},[e,n]),!e||!n)return(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:KJ()});let i=n,a=(e,t,n)=>r({...i,[e]:{...i[e],[t]:n}}),o=(e,n)=>void t({[e]:n});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[YJ(),` `,(0,I.jsx)(`strong`,{children:QJ()}),` `,tY()]}),(0,I.jsxs)(h9,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,I.jsx)($,{variant:`secondary`,children:iY()}):(0,I.jsx)($,{variant:`outline`,children:sY()}):(0,I.jsx)($,{variant:`outline`,children:uY()}),note:gY(),children:[(0,I.jsx)(g9,{label:SY(),children:(0,I.jsx)($$,{value:i.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>a(`langfuse`,`host`,e.target.value),onBlur:()=>o(`langfuse`,{host:i.langfuse.host??``})})}),(0,I.jsx)(_9,{label:PY(),checked:i.langfuse.enabled??!0,onChange:e=>{a(`langfuse`,`enabled`,e),o(`langfuse`,{enabled:e})}})]}),(0,I.jsxs)(h9,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,I.jsx)($,{variant:`secondary`,children:iY()}):(0,I.jsx)($,{variant:`outline`,children:sY()}):(0,I.jsx)($,{variant:`outline`,children:uY()}),note:yY(),children:[(0,I.jsx)(g9,{label:TY(),children:(0,I.jsx)($$,{value:i.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>a(`opik`,`baseUrl`,e.target.value),onBlur:()=>o(`opik`,{baseUrl:i.opik.baseUrl??``})})}),(0,I.jsx)(g9,{label:OY(),children:(0,I.jsx)($$,{value:i.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||jY(),onChange:e=>a(`opik`,`workspace`,e.target.value),onBlur:()=>o(`opik`,{workspace:i.opik.workspace??``})})}),(0,I.jsx)(_9,{label:PY(),checked:i.opik.enabled??!0,onChange:e=>{a(`opik`,`enabled`,e),o(`opik`,{enabled:e})}})]}),(0,I.jsxs)(h9,{title:LY(),status:(0,I.jsx)($,{variant:`outline`,children:pY()}),note:BY(),children:[(0,I.jsx)(g9,{label:UY(),children:(0,I.jsx)(v9,{value:i.tts.auto??`off`,options:[[`off`,KY()],[`always`,YY()],[`inbound`,QY()],[`tagged`,tX()]],onChange:e=>{a(`tts`,`auto`,e),o(`tts`,{auto:e})}})}),(0,I.jsx)(g9,{label:iX(),children:(0,I.jsx)(v9,{value:i.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,sX()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{a(`tts`,`provider`,e),o(`tts`,{provider:e})}})}),(0,I.jsx)(g9,{label:uX(),children:(0,I.jsx)($$,{value:i.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>a(`tts`,`model`,e.target.value),onBlur:()=>o(`tts`,{model:i.tts.model??``})})}),(0,I.jsx)(g9,{label:pX(),children:(0,I.jsx)($$,{value:i.tts.voice??``,placeholder:gX(),onChange:e=>a(`tts`,`voice`,e.target.value),onBlur:()=>o(`tts`,{voice:i.tts.voice??``})})})]}),(0,I.jsxs)(h9,{title:yX(),status:(0,I.jsx)($,{variant:`outline`,children:pY()}),note:e.secrets.openai?SX():TX(),children:[(0,I.jsx)(_9,{label:OX(),checked:i.talk.enabled??!1,onChange:e=>{a(`talk`,`enabled`,e),o(`talk`,{enabled:e})}}),(0,I.jsx)(g9,{label:jX(),children:(0,I.jsx)(v9,{value:i.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{a(`talk`,`realtimeProvider`,e),o(`talk`,{realtimeProvider:e})}})}),(0,I.jsx)(g9,{label:PX(),children:(0,I.jsx)($$,{value:i.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>a(`talk`,`realtimeModel`,e.target.value),onBlur:()=>o(`talk`,{realtimeModel:i.talk.realtimeModel??``})})}),(0,I.jsx)(g9,{label:pX(),children:(0,I.jsx)($$,{value:i.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>a(`talk`,`voice`,e.target.value),onBlur:()=>o(`talk`,{voice:i.talk.voice??``})})}),(0,I.jsx)(g9,{label:LX(),children:(0,I.jsx)(v9,{value:i.talk.transport??`webrtc`,options:[[`webrtc`,BX()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{a(`talk`,`transport`,e),o(`talk`,{transport:e})}})}),(0,I.jsx)(g9,{label:UX(),children:(0,I.jsx)($$,{value:i.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>a(`talk`,`speechLocale`,e.target.value),onBlur:()=>o(`talk`,{speechLocale:i.talk.speechLocale??``})})}),(0,I.jsx)(_9,{label:KX(),checked:i.talk.interruptOnSpeech??!0,onChange:e=>{a(`talk`,`interruptOnSpeech`,e),o(`talk`,{interruptOnSpeech:e})}})]}),(0,I.jsxs)(`section`,{className:`oc-int__section`,children:[(0,I.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,I.jsx)(`h3`,{className:`oc-uipa__h`,children:YX()}),(0,I.jsx)($,{variant:`outline`,children:QX()})]}),(0,I.jsxs)(`p`,{className:`oc-uipa__note`,children:[tZ(),(0,I.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,I.jsx)(k5,{title:iZ(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:sZ(),columns:[{header:uZ(),cell:e=>(0,I.jsx)($,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:pZ(),cell:e=>e.lastAt>0?new Date(e.lastAt).toLocaleString(`fr-FR`):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:gZ(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:yZ(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:SZ(),cell:e=>e.lastError??`—`,sort:e=>e.lastError??null}]})]})}function h9({title:e,status:t,note:n,children:r}){return(0,I.jsxs)(`section`,{className:`oc-int__section`,children:[(0,I.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,I.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,I.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,I.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function g9({label:e,children:t}){return(0,I.jsxs)(`label`,{className:`oc-int__field`,children:[(0,I.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function _9({label:e,checked:t,onChange:n}){return(0,I.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,I.jsx)(C1,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,I.jsx)(`span`,{children:e})]})}function v9({value:e,options:t,onChange:n}){return(0,I.jsxs)(S3,{value:e,onValueChange:n,children:[(0,I.jsx)(w3,{size:`sm`,className:`w-full`,children:(0,I.jsx)(C3,{})}),(0,I.jsx)(T3,{children:t.map(([e,t])=>(0,I.jsx)(Q,{value:e,children:t},e))})]})}var Fot={altered_words:()=>TZ(),incorrect:()=>OZ(),incoherence:()=>jZ(),formatting:()=>PZ(),latency:()=>LZ(),api_error:()=>BZ(),other:()=>Cfe()},y9=e=>Fot[e]?.()??e;function b9({matches:e,sourceWasOpen:t}){return t?e===!0?(0,I.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:kfe()}):e===!1?(0,I.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:Mfe()}):(0,I.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,I.jsx)(`span`,{className:`oc-fbadmin__pill`,children:Efe()})}function Iot({data:e,closeReason:t}){let n=e.snapshot,r=F(V.feedback.respondToFeedback),[i,a]=(0,N.useState)(e.thread),[o,s]=(0,N.useState)(``),[c,l]=(0,N.useState)(!1);async function u(){let t=o.trim();if(!(!t||c)){l(!0);try{await r({feedbackId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),s(``)}finally{l(!1)}}}let d=[];try{d=n.contextJson?JSON.parse(n.contextJson):[]}catch{d=[]}return(0,I.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,I.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,I.jsx)(b9,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,I.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[y9(e.category),` · `,n.messageRole,n.isRegeneration?` · ${Ffe()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h4`,{className:`oc-fbadmin__h`,children:Rfe()}),(0,I.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h4`,{className:`oc-fbadmin__h`,children:Ume()}),(0,I.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h4`,{className:`oc-fbadmin__h`,children:Vfe()}),i.length>0?(0,I.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.map((e,t)=>(0,I.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,I.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?Wfe():qfe()}),(0,I.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,I.jsx)(`p`,{className:`oc-fbadmin__meta`,children:Xfe()}),(0,I.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:$fe(),value:o,maxLength:2e3,rows:3,onChange:e=>s(e.target.value.slice(0,2e3))}),(0,I.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,I.jsx)(X,{size:`sm`,onClick:()=>void u(),disabled:!o.trim()||c,children:c?npe():ape()})})]}),(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h4`,{className:`oc-fbadmin__h`,children:cpe()}),(0,I.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||VZ()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ppe()}),(0,I.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||VZ()})]}):null,n.promptText?(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h4`,{className:`oc-fbadmin__h`,children:gpe()}),(0,I.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,d.length>0?(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ype({count:n.contextCount??d.length,truncated:n.contextTruncated?Spe():``})}),(0,I.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:d.map((e,t)=>(0,I.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,I.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,I.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h4`,{className:`oc-fbadmin__h`,children:Tpe()}),(0,I.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[n.outboxText??``,n.outboxStatus?`\n[status: ${n.outboxStatus}]`:``]})]}):null,n.clientInfo?.extensionsDetected&&n.clientInfo.extensionsDetected.length>0?(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h4`,{className:`oc-fbadmin__h`,children:Ope()}),(0,I.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,I.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h4`,{className:`oc-fbadmin__h`,children:jpe()}),(0,I.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?Ppe({theme:n.clientInfo.theme}):null,n.runId?`run ${n.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,n.clientInfo?.plugins&&n.clientInfo.plugins.length>0?(0,I.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[Lpe(),` `,n.clientInfo.plugins.join(`, `),(0,I.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,Bpe()]})]}):null,n.clientInfo?.userAgent?(0,I.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function Lot(){let e=P(V.feedback.listForAdmin,{}),t=F(V.feedback.readSnapshot),n=F(V.feedback.deleteFeedback),r=g1(),[i,a]=(0,N.useState)(null),[o,s]=(0,N.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:the(),description:ihe(),confirmLabel:she(),destructive:!0})&&(await n({feedbackId:e._id}),i===e._id&&a(null))}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[Upe(),` `,(0,I.jsx)(`strong`,{children:Kpe()}),` `,Ype()]}),(0,I.jsx)(k5,{title:Qpe(),rows:e,emptyHint:tme(),isExpanded:e=>i===e._id&&!!o[e._id],renderExpanded:e=>o[e._id]?(0,I.jsx)(Iot,{data:o[e._id],closeReason:e.userCloseReason}):null,columns:[{header:ime(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:sme(),cell:e=>y9(e.category),sort:e=>y9(e.category)},{header:ume(),cell:e=>e.messageRole===`user`?pme():gme(),sort:e=>e.messageRole},{header:yme(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${Sme({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:Tme(),cell:e=>(0,I.jsx)(b9,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:Ome(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:jme(),cell:e=>e.userClosedAt==null?e.answered?(0,I.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:Pme()}):(0,I.jsx)(`span`,{className:`oc-fbadmin__pill`,children:Lme()}):(0,I.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:Bme()}),sort:e=>e.userClosedAt==null?+!!e.answered:2}],rowActions:e=>[{label:i===e._id?Kme():Yme(),onSelect:()=>void c(e)},{label:Qme(),onSelect:()=>void l(e),variant:`destructive`}]})]})}var x9=`all`;function S9(e){switch(e){case`image`:return PA();case`audio`:return LA();case`video`:return BA();case`pdf`:return UA();case`document`:return KA();case`archive`:return YA();default:return QA()}}function Rot(){let[e,t]=(0,N.useState)(x9),[n,r]=(0,N.useState)(x9),[i,a]=(0,N.useState)(x9),[o,s]=(0,N.useState)(x9),[c,l]=(0,N.useState)(null),u=F(V.files.softDelete),d=b1();function f(){t(x9),r(x9),a(x9),s(x9)}async function p(){let e=c;if(l(null),e)try{await u({fileId:e.id}),d.success(jj())}catch(e){d.error(Pj(),e)}}let m=P(V.files.listMine,{direction:e===x9?void 0:e,chatId:n===x9?void 0:n,instanceName:i===x9?void 0:i,category:o===x9?void 0:o}),h=(0,N.useMemo)(()=>new Intl.DateTimeFormat(q(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(m===void 0)return(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:KO()});let{files:g,facets:_,truncated:v,cap:y}=m,b=e!==x9||n!==x9||i!==x9||o!==x9;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:tA()}),(0,I.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,I.jsxs)(S3,{value:e,onValueChange:t,children:[(0,I.jsx)(w3,{size:`sm`,"aria-label":iA(),children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:x9,children:sA()}),(0,I.jsx)(Q,{value:`inbound`,children:uA()}),(0,I.jsx)(Q,{value:`outbound`,children:pA()})]})]}),(0,I.jsxs)(S3,{value:n,onValueChange:r,children:[(0,I.jsx)(w3,{size:`sm`,"aria-label":gA(),children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:x9,children:yA()}),_.chats.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.title},e.id))]})]}),_.multiProvider?(0,I.jsxs)(S3,{value:i,onValueChange:a,children:[(0,I.jsx)(w3,{size:`sm`,"aria-label":SA(),children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:x9,children:TA()}),_.instances.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]}):null,(0,I.jsxs)(S3,{value:o,onValueChange:s,children:[(0,I.jsx)(w3,{size:`sm`,"aria-label":OA(),children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:x9,children:jA()}),_.categories.map(e=>(0,I.jsx)(Q,{value:e,children:S9(e)},e))]})]}),b?(0,I.jsxs)(X,{variant:`ghost`,size:`sm`,onClick:f,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,I.jsx)(Pm,{size:14,"aria-hidden":!0}),Sj()]}):null]}),g.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:b?Yj():Kj()}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(C5,{children:[(0,I.jsx)(w5,{children:(0,I.jsxs)(E5,{children:[(0,I.jsx)(D5,{children:tj()}),(0,I.jsx)(D5,{children:ij()}),(0,I.jsx)(D5,{children:sj()}),(0,I.jsx)(D5,{children:uj()}),(0,I.jsx)(D5,{children:pj()}),(0,I.jsx)(D5,{className:`text-right`,children:gj()})]})}),(0,I.jsx)(T5,{children:g.map(e=>(0,I.jsxs)(E5,{children:[(0,I.jsx)(O5,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:e.filename}),(0,I.jsx)(O5,{title:e.mimeType,children:S9(e.category)}),(0,I.jsx)(O5,{children:(0,I.jsx)($,{variant:`secondary`,children:e.direction===`inbound`?uA():pA()})}),(0,I.jsx)(O5,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,I.jsx)(O5,{className:`whitespace-nowrap text-muted-foreground`,children:h.format(e.createdAt)}),(0,I.jsx)(O5,{className:`text-right`,children:(0,I.jsxs)(z$,{children:[(0,I.jsx)(B$,{asChild:!0,children:(0,I.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":Tj(),children:(0,I.jsx)(ym,{size:16})})}),(0,I.jsxs)(V$,{align:`end`,children:[e.url?(0,I.jsx)(H$,{asChild:!0,children:(0,I.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,I.jsx)(vm,{size:14}),yj()]})}):(0,I.jsxs)(H$,{disabled:!0,children:[(0,I.jsx)(vm,{size:14}),Uj()]}),(0,I.jsxs)(H$,{variant:`destructive`,onSelect:()=>l({id:e._id,filename:e.filename}),children:[(0,I.jsx)(Bm,{size:14}),Oj()]})]})]})})]},e._id))})]}),v?(0,I.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:Qj({cap:y})}):null]}),(0,I.jsx)(e1,{open:c!==null,onOpenChange:e=>!e&&l(null),children:(0,I.jsxs)(t1,{children:[(0,I.jsxs)(n1,{children:[(0,I.jsx)(i1,{children:Lj()}),(0,I.jsx)(a1,{children:Bj()})]}),(0,I.jsxs)(r1,{children:[(0,I.jsx)(s1,{children:uW()}),(0,I.jsx)(o1,{onClick:()=>void p(),children:Oj()})]})]})})]})}var C9=2e4,w9=6e4;function zot(e){return typeof e!=`number`||e<=0?0:Math.round(e/C9*100)}function Bot(e){return e<=0?0:Math.round(e/w9*100)}function T9(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function E9(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var D9=3;function Vot(e,t){let n=new Map;for(let t of e.split(`
|
|
163
|
+
`))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
|
|
164
|
+
`))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<D9&&a.push(e)):t>0&&(i+=t,o.length<D9&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function Hot(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var O9=e=>`${e.instanceName}::${e.agentId}`;function Uot(){let e=P(V.me.getMe,{host:xO}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),r=P(V.admin.listInstances,e!==void 0&&t?{}:`skip`),[i,a]=(0,N.useState)(null);(0,N.useEffect)(()=>{!t||!r||r.length===0||(!i||!r.some(e=>e.name===i))&&a(r[0].name)},[t,r,i]);let o=P(V.agents.listAgentsForInstance,t&&i?{instanceName:i}:`skip`),s=P(V.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),c=(0,N.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,N.useState)(null);(0,N.useEffect)(()=>{!c||c.length===0||(!l||!c.some(e=>O9(e)===l))&&u(O9(c[0]))},[c,l]);let d=c?.find(e=>O9(e)===l)??null,f=$n(V.agentFiles.listAgentFiles),[p,m]=(0,N.useState)({status:`idle`}),h=d?.instanceName??null,g=d?.agentId??null,_=P(V.compat.forInstance,n&&h!==null?{instanceName:h}:`skip`),v=n&&h!==null?P3(_,`agentFiles`):null,y=v===null?!1:v===`loading`?null:v.blocked,b=(0,N.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,N.useEffect)(()=>{y===!1&&b()},[b,y]);let[x,S]=(0,N.useState)(null),C=q(),w=(0,N.useMemo)(()=>new Intl.NumberFormat(C,{maximumFractionDigits:0}),[C]);return e===void 0||c===void 0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:KO()}):(0,I.jsxs)(`div`,{className:`oc-afiles`,children:[(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:a$e()}),(0,I.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(r?.length??0)>1?(0,I.jsxs)(S3,{value:i??``,onValueChange:e=>a(e),children:[(0,I.jsx)(w3,{size:`sm`,"aria-label":qQ(),children:(0,I.jsx)(C3,{})}),(0,I.jsx)(T3,{children:(r??[]).map(e=>(0,I.jsx)(Q,{value:e.name,children:e.name},e.name))})]}):null,c.length>0?(0,I.jsxs)(S3,{value:l??``,onValueChange:e=>u(e),children:[(0,I.jsx)(w3,{size:`sm`,"aria-label":u$e(),children:(0,I.jsx)(C3,{})}),(0,I.jsx)(T3,{children:c.map(e=>(0,I.jsx)(Q,{value:O9(e),children:e.label},O9(e)))})]}):(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:p$e()})]}),d===null?null:v===`loading`?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:KO()}):v!==null&&v.blocked?(0,I.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,I.jsx)(Vm,{size:14,"aria-hidden":!0}),` `,W5(v.gatewayVersion)]}):p.status===`loading`||p.status===`idle`?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:KO()}):p.status===`error`?(0,I.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[y$e(),` `,(0,I.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:WQ()})]}):p.files.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:g$e()}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`oc-afiles__list`,children:p.files.map(e=>{let n=zot(e.size),r=n>=80;return(0,I.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,I.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,I.jsx)($,{variant:`outline`,children:S$e()}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`oc-afiles__size`,children:T$e({size:T9(e.size,C)})}),(0,I.jsx)(`span`,{className:`oc-afiles__gauge${r?` is-warn`:``}`,"aria-hidden":!0,children:(0,I.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,I.jsx)(`span`,{className:`oc-afiles__pct`,children:O$e({pct:w.format(n)})}),r?(0,I.jsx)(Vm,{size:14,className:`oc-afiles__warn`,"aria-label":j$e()}):(0,I.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,I.jsx)(X,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>S(e),children:t?L$e():B$e()})]},e.name)})}),(0,I.jsx)(`p`,{className:`oc-afiles__budget`,children:P$e({used:T9(E9(p.files),C),total:T9(w9,C),pct:w.format(Bot(E9(p.files)))})})]}),x&&d?(0,I.jsx)(Wot,{instanceName:d.instanceName,agentId:d.agentId,name:x.name,isAdmin:t,onClose:()=>S(null),onSaved:()=>void b()}):null]})}function Wot({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:a}){let o=$n(V.agentFiles.getAgentFile),s=$n(V.agentFiles.setAgentFile),c=b1(),[l,u]=(0,N.useState)(null),[d,f]=(0,N.useState)(!1),[p,m]=(0,N.useState)(``),[h,g]=(0,N.useState)(!1),[_,v]=(0,N.useState)(!1),[y,b]=(0,N.useState)(!1),[x,S]=(0,N.useState)(!1),C=(0,N.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,N.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(o1e({name:n})),a(),await C(!1)}catch(e){Hot(e)?b(!0):S(!0)}finally{v(!1)}}}let T=l!==null&&p!==l.content,E=(0,N.useMemo)(()=>l===null?null:Vot(l.content,p),[l,p]),D=p.length>C9,O=q(),ee=(0,N.useMemo)(()=>new Intl.NumberFormat(O),[O]);return(0,I.jsx)(c1,{open:!0,onOpenChange:e=>!e&&i(),children:(0,I.jsxs)(l1,{className:`oc-afiles__editor`,children:[(0,I.jsxs)(u1,{children:[(0,I.jsx)(f1,{children:JQ({name:n})}),(0,I.jsxs)(p1,{children:[G$e({agent:t,instance:e}),r?null:(0,I.jsxs)(I.Fragment,{children:[` · `,J$e()]})]})]}),d?(0,I.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[f1e(),` `,(0,I.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void C(!1),children:WQ()})]}):l===null?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:KO()}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`textarea`,{className:`oc-afiles__source`,value:p,readOnly:!r,spellCheck:!1,onChange:e=>m(e.target.value),"aria-label":JQ({name:n})}),(0,I.jsx)(`p`,{className:`oc-afiles__hint`,children:Z$e()}),y?(0,I.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[h1e(),` `,(0,I.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void C(!0),children:v1e()})]}):null,x?(0,I.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:l1e()}):null,(0,I.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,I.jsx)(`span`,{className:`oc-afiles__count${D?` is-over`:``}`,children:e1e({count:ee.format(p.length),max:ee.format(C9)})}),r?(0,I.jsx)(X,{size:`sm`,disabled:!T||_||y,onClick:()=>g(!0),children:_?UQ():r1e()}):null]})]}),(0,I.jsx)(e1,{open:h,onOpenChange:g,children:(0,I.jsxs)(t1,{children:[(0,I.jsxs)(n1,{children:[(0,I.jsx)(i1,{children:x1e({name:n})}),(0,I.jsx)(a1,{children:w1e({agent:t})})]}),E?(0,I.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,I.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:D1e({added:E.added,removed:E.removed})}),E.sampleAdded.length>0?(0,I.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,I.jsx)(`span`,{className:`oc-afiles__diff-label`,children:A1e()}),E.sampleAdded.map((e,t)=>(0,I.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,E.sampleRemoved.length>0?(0,I.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,I.jsx)(`span`,{className:`oc-afiles__diff-label`,children:N1e()}),E.sampleRemoved.map((e,t)=>(0,I.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,I.jsxs)(r1,{children:[(0,I.jsx)(s1,{children:uW()}),(0,I.jsx)(o1,{onClick:()=>void w(),children:I1e()})]})]})})]})})}var k9=[{id:`messages`,label:()=>yI()},{id:`composer`,label:()=>SI()},{id:`sidebar`,label:()=>TI()},{id:`other`,label:()=>OI()}],A9={showSource:{category:`messages`,label:()=>jI(),help:()=>PI()},showReport:{category:`messages`,label:()=>LI(),help:()=>BI()},copyAssistant:{category:`messages`,label:()=>UI()},copyUser:{category:`messages`,label:()=>KI()},showDelete:{category:`messages`,label:()=>YI()},showTools:{category:`messages`,label:()=>QI(),help:()=>tL()},voiceInput:{category:`composer`,label:()=>iL(),help:()=>sL()},showChatAge:{category:`sidebar`,label:()=>uL(),help:()=>pL()},showChatProvider:{category:`sidebar`,label:()=>gL(),help:()=>yL()}};function j9(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function Got(e,t){let n=j9(t.trim()),r=new Map(k9.map(e=>[e.id,e.label()])),i=new Map(k9.map(e=>[e.id,[]]));for(let t of e){let e=A9[t],a=e?.category??`other`;n&&!j9(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return k9.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var Kot=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`],qot={voiceInput:`voiceInput`};function Jot(e){return Kot.includes(e)}function M9(e){return e===`admin`}function Yot(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Xot(e){return e===`on`?!0:e===`off`?!1:null}function Zot(e){return Jot(e)?qot[e]:void 0}var Qot={voiceInput:()=>QL()};function $ot({prefKey:e,ui:t}){let n=F(V.admin.setUiPrefDefault),r=F(V.admin.setFeatureEnabled),i=Zot(e),a=i?Qot[e]?.():void 0;return(0,I.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,I.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,I.jsx)(`span`,{className:`oc-prefs__gov-label`,children:BL()}),(0,I.jsxs)(S3,{value:Yot(t.defaults[e]),onValueChange:t=>void n({key:e,value:Xot(t)}),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-36`,children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:`on`,children:iR()}),(0,I.jsx)(Q,{value:`off`,children:sR()}),(0,I.jsx)(Q,{value:`inherit`,children:uR()})]})]}),i?(0,I.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,I.jsx)(C1,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":UL()}),UL()]}):null]}),a?(0,I.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function est(){let[e,t]=(0,N.useState)(``),[n,r]=(0,N.useState)(!1),i=P(V.me.getMe,{host:xO}),a=i?.ui,o=M9(i?.role)&&n,s=F(V.me.setUiPref).withOptimisticUpdate(x1),c=(0,N.useMemo)(()=>a?Got(Object.keys(a.effective),e):[],[a,e]);return a?(0,I.jsxs)(`div`,{className:`oc-prefs-panel`,children:[M9(i?.role)?(0,I.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,I.jsx)(C1,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":LL()}),LL()]}):null,o?(0,I.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,I.jsx)(`p`,{children:KL()}),(0,I.jsx)(`p`,{children:YL()}),(0,I.jsx)(`p`,{children:tR()})]}):null,(0,I.jsx)($$,{value:e,onChange:e=>t(e.target.value),placeholder:SL(),"aria-label":SL(),className:`mb-2`}),c.length===0?(0,I.jsx)(`div`,{className:`oc-prefs__empty`,children:TL()}):(0,I.jsx)(`div`,{className:`oc-prefs`,children:c.map(e=>(0,I.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,I.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=A9[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,I.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${l&&!i?` is-overridden`:``}`,children:[(0,I.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,I.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,I.jsx)(`span`,{className:`oc-prefs__lock`,children:OL()}):l?null:(0,I.jsx)(`span`,{className:`oc-prefs__def`,children:jL()})]}),r?(0,I.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,I.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&l?(0,I.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void s({key:e,value:null}),children:PL()}):null,(0,I.jsx)(C1,{checked:c,disabled:i,onCheckedChange:t=>void s({key:e,value:t===!0}),"aria-label":n})]}),o?(0,I.jsx)($ot,{prefKey:e,ui:a}):null]},e)})]},e.id))})]}):(0,I.jsx)(`div`,{className:`oc-prefs__empty`,children:KO()})}function tst(){let e=P(V.me.getMe,{host:xO}),t=F(V.me.setLocale),n=F(V.me.setMyName),r=b1(),i=e?.locale??`default`,a=e?.name??``,[o,s]=(0,N.useState)(null),c=o??a,l=c.trim()!==a.trim();async function u(){try{await n({name:c}),s(null),r.success(Tk())}catch(e){r.error(Ok(),e)}}return(0,I.jsxs)(`div`,{className:`oc-appearance`,children:[(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h2`,{className:`oc-show__title`,children:pk()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:gk()})]}),(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[(0,I.jsx)($$,{className:`max-w-xs`,value:c,maxLength:120,placeholder:yk(),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l&&(e.preventDefault(),u())}}),(0,I.jsx)(X,{size:`sm`,disabled:!l,onClick:()=>void u(),children:GZ()})]}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:Sk()})]}),(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h2`,{className:`oc-show__title`,children:jk()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:Pk()})]}),(0,I.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`,`default`].map(e=>(0,I.jsx)(X,{variant:i===e?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e==="default"?null:e}),children:e===`fr`?Kk():e===`en`?Yk():ik()},e))}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:Lk()})]}),(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h2`,{className:`oc-show__title`,children:Bk()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:Uk()})]}),(0,I.jsx)(est,{})]})]})}var nst=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function rst(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 ist(){let e=$n(V.agentFiles.getChatDefaults),t=$n(V.agentFiles.setChatDefaults),n=b1(),[r,i]=(0,N.useState)({status:`loading`}),[a,o]=(0,N.useState)({thinkingDefault:null,fastModeDefault:null}),[s,c]=(0,N.useState)(!1),[l,u]=(0,N.useState)(!1),d=P(V.admin.listInstances,{}),[f,p]=(0,N.useState)(null);(0,N.useEffect)(()=>{!d||d.length===0||(!f||!d.some(e=>e.name===f))&&p(d[0].name)},[d,f]);let m=(d?.length??0)>1,h=d!==void 0&&d.length===0,g=P(V.compat.forInstance,f?{instanceName:f}:`skip`),_=f?P3(g,`configDefaults`):`loading`,v=_===`loading`?null:_.blocked,y=(0,N.useMemo)(()=>m&&f?{instanceName:f}:{},[m,f]),b=(0,N.useRef)(0),x=(0,N.useCallback)(async()=>{let t=++b.current;i({status:`loading`});try{let n=rst(await e(y));if(b.current!==t)return;i({status:`done`,current:n}),o(n)}catch{if(b.current!==t)return;i({status:`error`})}},[e,y]);(0,N.useEffect)(()=>{v===!1&&(m&&!f||x())},[x,v,m,f]);let S=r.status===`done`?r.current:null,C=S!==null&&a.thinkingDefault!==null&&a.thinkingDefault!==S.thinkingDefault,w=S!==null&&a.fastModeDefault!==null&&a.fastModeDefault!==S.fastModeDefault,T=C||w;async function E(){u(!0);try{await t({...y,...C?{thinkingDefault:a.thinkingDefault}:{},...w?{fastModeDefault:a.fastModeDefault}:{}}),n.success(l0e()),await x()}catch(e){n.error(f0e(),e)}finally{u(!1)}}let D=(0,N.useMemo)(()=>nst.map(e=>({id:e,label:j3(e)})),[]),O=(0,N.useMemo)(()=>[{id:`fast`,label:GQ()},{id:`standard`,label:KQ()}],[]);return(0,I.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:H1e()}),m&&f?(0,I.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,I.jsx)(`span`,{className:`oc-cdefaults__label`,children:qQ()}),(0,I.jsxs)(S3,{value:f,onValueChange:e=>p(e),disabled:l,children:[(0,I.jsx)(w3,{size:`sm`,"aria-label":qQ(),children:(0,I.jsx)(C3,{})}),(0,I.jsx)(T3,{children:(d??[]).map(e=>(0,I.jsx)(Q,{value:e.name,children:e.name},e.name))})]})]}):null,h?(0,I.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:lNe()}):_===`loading`?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:KO()}):_.blocked?(0,I.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,I.jsx)(Vm,{size:14,"aria-hidden":!0}),` `,W5(_.gatewayVersion)]}):r.status===`loading`?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:KO()}):r.status===`error`?(0,I.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[r0e(),` `,(0,I.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:WQ()})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,I.jsx)(`span`,{className:`oc-cdefaults__label`,children:G1e()}),(0,I.jsx)(L3,{options:D,value:a.thinkingDefault,onChange:e=>o({...a,thinkingDefault:e}),disabled:l}),(0,I.jsx)(`p`,{className:`oc-cdefaults__help`,children:J1e()})]}),(0,I.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,I.jsx)(`span`,{className:`oc-cdefaults__label`,children:Z1e()}),(0,I.jsx)(L3,{options:O,value:a.fastModeDefault===null?null:a.fastModeDefault?`fast`:`standard`,onChange:e=>o({...a,fastModeDefault:e===`fast`}),disabled:l}),(0,I.jsx)(`p`,{className:`oc-cdefaults__help`,children:e0e()})]}),(0,I.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,I.jsx)(X,{size:`sm`,disabled:!T||l,onClick:()=>c(!0),children:l?UQ():o0e()})}),(0,I.jsx)(`p`,{className:`oc-cdefaults__note`,children:h0e()})]}),(0,I.jsx)(e1,{open:s,onOpenChange:c,children:(0,I.jsxs)(t1,{children:[(0,I.jsxs)(n1,{children:[(0,I.jsx)(i1,{children:v0e()}),(0,I.jsx)(a1,{children:x0e()})]}),(0,I.jsxs)(r1,{children:[(0,I.jsx)(s1,{children:uW()}),(0,I.jsx)(o1,{onClick:()=>void E(),children:w0e()})]})]})})]})}function ast(e){return e===`user`?nqe():e===`all`?aqe():kQ({group:e.group})}function ost(e){return e===`common`?uqe():e===`owner`?pqe():kQ({group:e.group})}function sst(e){return e.name||e.email||e.userId.slice(0,8)}function cst(){let e=P(V.admin.listUsers,{}),[t,n]=(0,N.useState)(``),r=P(V.introspect.introspectUser,t?{userId:t}:`skip`);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:OKe()}),(0,I.jsxs)(S3,{value:t,onValueChange:n,children:[(0,I.jsx)(w3,{size:`sm`,"aria-label":DQ(),children:(0,I.jsx)(C3,{placeholder:DQ()})}),(0,I.jsx)(T3,{children:(e??[]).map(e=>(0,I.jsx)(Q,{value:e.userId,children:sst(e)},e._id))})]}),t===``?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:NKe()}):r===void 0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:KO()}):(0,I.jsxs)(`div`,{className:`oc-introspect`,children:[(0,I.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,I.jsx)(`h3`,{className:`oc-introspect__title`,children:IKe()}),(0,I.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,I.jsx)(`strong`,{children:r.user.label}),(0,I.jsx)($,{variant:`secondary`,children:r.role})]})]}),(0,I.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,I.jsx)(`h3`,{className:`oc-introspect__title`,children:zKe()}),r.groups.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:OQ()}):(0,I.jsx)(`div`,{className:`oc-introspect__chips`,children:r.groups.map(e=>(0,I.jsx)($,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,I.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,I.jsx)(`h3`,{className:`oc-introspect__title`,children:HKe()}),r.agents.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:OQ()}):(0,I.jsx)(`ul`,{className:`oc-introspect__list`,children:r.agents.map(e=>(0,I.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,I.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,I.jsx)($,{variant:`default`,children:$Ke()}):null,(0,I.jsx)($,{variant:`outline`,children:ast(e.via)}),(0,I.jsx)($,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,I.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,I.jsx)(`h3`,{className:`oc-introspect__title`,children:GKe()}),r.charts.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:OQ()}):(0,I.jsx)(`ul`,{className:`oc-introspect__list`,children:r.charts.map(e=>(0,I.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,I.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,I.jsx)($,{variant:`outline`,children:ost(e.via)})]},e.key))})]}),(0,I.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,I.jsx)(`h3`,{className:`oc-introspect__title`,children:JKe()}),r.permissions.length===0?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:OQ()}):(0,I.jsx)(`div`,{className:`oc-introspect__chips`,children:r.permissions.map(e=>(0,I.jsx)($,{variant:`secondary`,children:e},e))})]})]})]})}var N9=[{id:`personal`,label:()=>qXe(),tabs:[`preferences`,`theme`,`files`]},{id:`agents`,label:()=>XXe(),tabs:[`instances`,`agentFiles`,`chatDefaults`,`bridge`]},{id:`access`,label:()=>$Xe(),tabs:[`users`,`groups`,`access`,`roles`,`serviceAccounts`]},{id:`observability`,label:()=>nZe(),tabs:[`traces`,`kpi`,`anomalies`,`audit`,`feedbacks`,`integrations`]}],lst=new Map(N9.flatMap(e=>e.tabs.map(t=>[t,e.id])));function P9(e){let t=lst.get(e);if(!t)throw Error(`Settings tab "${e}" belongs to no group`);return t}function ust(e,t){return e.find(e=>P9(e)===t)}N9.flatMap(e=>[...e.tabs]);function dst(){let e=P(V.bridgeHealth.getBridgeAvailability,{});if(e===void 0)return null;let t=e.known?e.available?`ok`:`error`:`idle`,n=e.known?e.available?`${CBe()}${e.checkedAt?EBe({time:new Date(e.checkedAt).toLocaleTimeString(`fr-FR`)}):``}`:kBe({reason:e.reason??`?`}):bBe();return(0,I.jsx)(j5,{delayDuration:150,children:(0,I.jsxs)(M5,{children:[(0,I.jsx)(N5,{asChild:!0,children:(0,I.jsx)(`span`,{className:`oc-bridge-dot oc-bridge-dot--${t}`,role:`img`,"aria-label":n})}),(0,I.jsx)(P5,{children:n})]})})}var fst={users:()=>UGe(),groups:()=>SKe(),instances:()=>KGe(),bridge:()=>YGe(),serviceAccounts:()=>QGe(),roles:()=>tKe(),traces:()=>iKe(),kpi:()=>sKe(),anomalies:()=>uKe(),files:()=>Qk(),agentFiles:()=>n$e(),preferences:()=>uk(),chatDefaults:()=>z1e(),access:()=>TKe(),integrations:()=>pKe(),theme:()=>tM(),audit:()=>gKe(),feedbacks:()=>yKe()};function F9(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 pst(e,t){let n=new Set(t),r=[...t];return e.map(e=>n.has(e)?r.shift():e)}function mst({tab:e,active:t}){let n=fst[e]?.()??O7[e]??e,r=`oc-settings-tabs__tab`+(t?` is-active`:``),i=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`oc-settings-tabs__label`,children:n}),e===`bridge`?(0,I.jsx)(dst,{}):null]});return D7.includes(e)?(0,I.jsx)(xs,{to:`/settings/$tab`,params:{tab:e},className:r,role:`tab`,"aria-selected":t,children:i}):(0,I.jsx)(xs,{to:`/settings/${e}`,className:r,role:`tab`,"aria-selected":t,children:i})}function hst({tab:e,active:t}){let{attributes:n,listeners:r,setNodeRef:i,transform:a,transition:o,isDragging:s}=J8({id:e});return(0,I.jsxs)(`div`,{ref:i,style:{transform:C6.Transform.toString(a),transition:o,opacity:s?.5:1},className:`oc-settings-tabs__item`,role:`presentation`,children:[(0,I.jsx)(`button`,{type:`button`,className:`oc-settings-tabs__grip`,"aria-label":FXe(),...n,...r,children:(0,I.jsx)(Sm,{size:14,"aria-hidden":!0})}),(0,I.jsx)(mst,{tab:e,active:t})]})}function gst(){let e=P(V.me.getMe,{host:xO}),t=F(V.me.setSettingsTabOrder),n=N7(Gs({select:e=>e.pathname})),r=n===void 0?void 0:P9(n),i=(0,N.useMemo)(()=>F9(e?.settingsTabOrder??null),[e?.settingsTabOrder]),[a,o]=(0,N.useState)(i);(0,N.useEffect)(()=>o(i),[i]);let s=(0,N.useMemo)(()=>new Set(j7(e?.permissions??[])),[e?.permissions]),c=(0,N.useMemo)(()=>r===void 0?[]:a.filter(e=>s.has(e)&&P9(e)===r),[a,s,r]),l=k6(O6(l8,{activationConstraint:{distance:5}}),O6(a8,{coordinateGetter:X8}));if(r===void 0||c.length===0)return null;let u=N9.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=pst(a,R8(c,i,s));o(l),t({order:l})}return(0,I.jsx)(`div`,{className:`oc-settings-tabs`,role:`tablist`,"aria-label":u?.label(),children:(0,I.jsx)(N8,{sensors:l,collisionDetection:Tnt,modifiers:[Frt],onDragEnd:d,children:(0,I.jsx)(G8,{items:c,strategy:Hrt,children:c.map(e=>(0,I.jsx)(hst,{tab:e,active:e===n},e))})})})}function _st(){let e=P(V.me.getMe,{host:xO}),t=ss(),n=N7(Gs({select:e=>e.pathname})),r=n===void 0?void 0:P9(n),i=(0,N.useMemo)(()=>new Set(j7(e?.permissions??[])),[e?.permissions]),a=(0,N.useMemo)(()=>F9(e?.settingsTabOrder??null).filter(e=>i.has(e)),[e?.settingsTabOrder,i]),o=N9.filter(e=>e.tabs.some(e=>i.has(e)));function s(e){let n=ust(a,e.id);n&&t({to:M7(n)})}return(0,I.jsxs)(`nav`,{className:`oc-settings-nav`,"aria-label":RXe(),children:[(0,I.jsx)(xs,{to:`/`,className:`oc-settings-nav__back`,children:VXe()}),(0,I.jsx)(`div`,{className:`oc-settings-nav__title`,children:WXe()}),(0,I.jsx)(`div`,{className:`oc-settings-nav__list`,children:o.map(e=>(0,I.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 vst=.1,yst=[248,248,248],bst=[24,24,24];function xst(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function Sst(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function I9(e,t,n){return Sst(e,t,n)>=vst}function Cst(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function wst(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Tst=12*1024*1024,Est=480,Dst=160,Ost=.92;async function kst(e,t={}){if(!e.type.startsWith(`image/`))throw Error(tF());if(e.size>Tst)throw Error(iF());let{source:n,width:r,height:i,cleanup:a}=await Ast(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Est/r,Dst/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(uF());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=xst(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(uF());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);I9(e.data,d.width,d.height)?Cst(e.data,t.variantFor===`dark`?yst:bst):wst(e.data),p.putImageData(e,0,0)}let m=I9(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await R9(f,`image/webp`,Ost)??await R9(f,`image/png`);if(!h)throw Error(pF());return{blob:h,hasAlpha:m}}finally{a()}}async function Ast(e){if(e.type===`image/svg+xml`)return L9(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return L9(e)}async function L9(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(sF())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function R9(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var z9=`__all__`,B9={kind:`relative`,from:`now-24h`,to:`now`},jst=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function V9({title:e,description:t,children:n}){return(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,I.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,I.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Mst(e){return e===`light`?YO():e===`dark`?QO():tk()}var Nst=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Pst({tokens:e,mode:t}){let n=e.colors[t];return(0,I.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Nst.map(e=>{let t=n[e];return(0,I.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function H9({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a}){return(0,I.jsxs)(`button`,{type:`button`,className:R$(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,I.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,I.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,I.jsx)(um,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,I.jsx)(Pst,{tokens:r,mode:i}):(0,I.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,I.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,I.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]})}function Fst({selectedKey:e,resolvedMode:t}){let n=P(V.charts.listMyCharts),r=F(V.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h2`,{className:`oc-show__title`,children:OM()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:jM()})]}),(0,I.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,I.jsx)(H9,{selected:e===null,title:PM(),subtitle:LM(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?BM():n.via===`owner`?UM():KM({group:n.via.group});return(0,I.jsx)(H9,{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,I.jsx)(`p`,{className:`oc-show__desc`,children:YM()}):null]})}function Ist(){let e=F(V.charts.importChart),[t,n]=(0,N.useState)(``),[r,i]=(0,N.useState)(``),[a,o]=(0,N.useState)(null),[s,c]=(0,N.useState)(!1),[l,u]=(0,N.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(sP())}}}async function f(){if(o(null),c(!1),t.trim()===``){o(pP());return}let a;try{a=JSON.parse(r)}catch{o(sP());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,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h2`,{className:`oc-show__title`,children:LN()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:BN()})]}),(0,I.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,I.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,I.jsx)(`span`,{className:`oc-chart-import__label`,children:UN()}),(0,I.jsx)($$,{value:t,onChange:e=>n(e.target.value),placeholder:KN(),maxLength:60})]}),(0,I.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,I.jsx)(`span`,{className:`oc-chart-import__label`,children:YN()}),(0,I.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:QN(),rows:8,spellCheck:!1})]}),(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[(0,I.jsx)(X,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,I.jsx)(Hm,{className:`size-4`}),tP(),(0,I.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,I.jsx)(X,{size:`sm`,disabled:l,onClick:()=>void f(),children:iP()})]}),a?(0,I.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,I.jsx)(`p`,{className:`oc-chart-import__ok`,children:uP()}):null]})]})}function Lst({chart:e}){let t=$n(V.charts.setChartLogo),n=F(V.charts.removeChartLogo),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await kst(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,I.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,I.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?PP():LP()}),(0,I.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,I.jsx)(`img`,{src:t,alt:``}):null}),(0,I.jsx)(X,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,I.jsx)(Hm,{className:`size-4`}),t?UP():BP(),(0,I.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,I.jsx)(X,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:YP()}):null,t?(0,I.jsx)(X,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:KP()}):null]})}return(0,I.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,I.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:jP()}),(0,I.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,I.jsx)(f,{mode:`light`}),(0,I.jsx)(f,{mode:`dark`})]}),r?(0,I.jsx)(`span`,{className:`oc-show__desc`,children:QP()}):null,a?(0,I.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function U9({chart:e}){let t=P(V.me.getMe,{host:xO}),n=F(V.charts.addChartDomain),r=F(V.charts.removeChartDomain),[i,a]=(0,N.useState)(``),[o,s]=(0,N.useState)(null),[c,l]=(0,N.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,I.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,I.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:gF()}),(0,I.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,I.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,I.jsx)(`span`,{className:`oc-show__desc`,children:OF()}):u.map(e=>(0,I.jsxs)($,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,I.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":jF({domain:e}),onClick:()=>void f(e),children:(0,I.jsx)(Gm,{className:`size-3`})})]},e))}),(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[(0,I.jsx)($$,{value:i,onChange:e=>a(e.target.value),placeholder:SF(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,I.jsx)(X,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:TF()})]}),(0,I.jsx)(`span`,{className:`oc-show__desc`,children:yF()}),o?(0,I.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function Rst({chart:e}){let t=F(V.charts.updateChart),n=F(V.charts.deleteChart),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(e.name),[s,c]=(0,N.useState)(()=>JSON.stringify(e.tokens,null,2)),[l,u]=(0,N.useState)(null),[d,f]=(0,N.useState)(!1);function p(){o(e.name),c(JSON.stringify(e.tokens,null,2)),u(null),i(!0)}async function m(){if(e.chartId===void 0)return;u(null);let n;try{n=JSON.parse(s)}catch{u(sP());return}f(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){u(e instanceof Error?e.message:String(e))}finally{f(!1)}}async function h(){if(e.chartId!==void 0&&window.confirm(KF()))try{await n({chartId:e.chartId})}catch{}}return(0,I.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,I.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,I.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,I.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(X,{variant:`outline`,size:`sm`,onClick:p,children:TP()}),(0,I.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>void h(),children:OP()})]})})]}),r?(0,I.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,I.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,I.jsx)(`span`,{className:`oc-chart-import__label`,children:BF()}),(0,I.jsx)($$,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,I.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,I.jsx)(`span`,{className:`oc-chart-import__label`,children:UF()}),(0,I.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),l?(0,I.jsx)(`p`,{className:`oc-chart-import__error`,children:l}):null,(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[(0,I.jsx)(X,{size:`sm`,disabled:d,onClick:()=>void m(),children:PF()}),(0,I.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:LF()})]})]}):null,(0,I.jsx)(Lst,{chart:e}),(0,I.jsx)(U9,{chart:e})]})}function zst(){let e=P(V.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h2`,{className:`oc-show__title`,children:gP()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:yP()})]}),e!==void 0&&t.length===0?(0,I.jsx)(`p`,{className:`oc-show__desc`,children:SP()}):(0,I.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,I.jsx)(Rst,{chart:e},e.key))})]})}function Bst({chart:e,groups:t}){let n=F(V.charts.addChartToGroupPool),r=F(V.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,I.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,I.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,I.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,I.jsx)($,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?yN():e.kind===`custom`&&e.scope===`personal`?iI():gN()}),e.isGlobalDefault?(0,I.jsx)($,{variant:`default`,children:SN()}):null]}),(0,I.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,I.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ON()}),(a??[]).map(e=>(0,I.jsxs)($,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,I.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":PN({group:e.name}),onClick:()=>void l(e.groupId),children:(0,I.jsx)(Gm,{className:`size-3`})})]},e.groupId)),s.length>0?(0,I.jsxs)(S3,{value:``,onValueChange:e=>void c(e),children:[(0,I.jsx)(w3,{size:`sm`,className:`w-56`,children:(0,I.jsx)(C3,{placeholder:jN()})}),(0,I.jsx)(T3,{children:s.map(e=>(0,I.jsx)(Q,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,I.jsx)(`span`,{className:`oc-show__desc`,children:TN()}):null]})]})}function Vst({chart:e}){let t=F(V.charts.promoteChartToCommon),n=F(V.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(KF()))try{await n({chartId:e.chartId})}catch{}}return(0,I.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,I.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,I.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,I.jsx)($,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?sI():iI()}),e.ownerLabel?(0,I.jsx)(`span`,{className:`oc-show__desc`,children:tI({owner:e.ownerLabel})}):null]}),(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,I.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:uI()}):null,(0,I.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:pI()})]})]})}function Hst({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=F(V.admin.setDefaultThemeMode),i=F(V.admin.setDefaultLocale),a=F(V.charts.setDefaultChart),o=P(V.charts.listChartsAdmin),s=P(V.groups.listGroups,{}),c=e??`system`,l=t??`fr`;return(0,I.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h2`,{className:`oc-show__title`,children:SM()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:TM()})]}),(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h3`,{className:`oc-show__title`,children:QM()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:tN()})]}),(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[(0,I.jsx)(X,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:PM()}),CO.map(e=>(0,I.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,I.jsx)(X,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h3`,{className:`oc-show__title`,children:iN()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:sN()})]}),(0,I.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,I.jsx)(Bst,{chart:e,groups:s??[]},e.key))})]}),(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h3`,{className:`oc-show__title`,children:uN()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:pN()})]}),(0,I.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,I.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,I.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,I.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,I.jsx)(U9,{chart:e})]},e.key))})]}),(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h3`,{className:`oc-show__title`,children:YF()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:QF()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,I.jsx)(`p`,{className:`oc-show__desc`,children:gI()}):(0,I.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,I.jsx)(Vst,{chart:e},e.key))})})()]}),(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h3`,{className:`oc-show__title`,children:iM()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:sM()})]}),(0,I.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,I.jsx)(X,{variant:c===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Mst(e)},e))})]}),(0,I.jsxs)(`section`,{className:`oc-show__section`,children:[(0,I.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,I.jsx)(`h3`,{className:`oc-show__title`,children:uM()}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:pM()})]}),(0,I.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,I.jsx)(X,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e}),children:e===`fr`?Kk():Yk()},e))}),(0,I.jsx)(`p`,{className:`oc-show__desc`,children:gM()})]})]})}function Ust(){let e=P(V.me.getMe,{host:xO}),t=wO(e?.resolvedThemeMode);return(0,I.jsxs)(`div`,{className:`oc-appearance`,children:[(0,I.jsx)(Fst,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,I.jsx)(Ist,{}),(0,I.jsx)(zst,{}),e?.role===`admin`?(0,I.jsx)(Hst,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function Wst(){let[e,t]=(0,N.useState)(!0),[n,r]=(0,N.useState)(`per-user`),[i,a]=(0,N.useState)(``),[o,s]=(0,N.useState)(z9),[c,l]=(0,N.useState)(z9),[u,d]=(0,N.useState)(B9),f=i!==``||o!==z9||c!==z9;function p(){a(``),s(z9),l(z9),d(B9)}return(0,I.jsxs)(`div`,{className:`oc-show`,children:[(0,I.jsx)(Ust,{}),(0,I.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,I.jsx)(`summary`,{className:`oc-show__title`,children:yM()}),(0,I.jsxs)(V9,{title:`Buttons`,description:`Variants`,children:[(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[(0,I.jsx)(X,{children:`Default`}),(0,I.jsx)(X,{variant:`secondary`,children:`Secondary`}),(0,I.jsx)(X,{variant:`outline`,children:`Outline`}),(0,I.jsx)(X,{variant:`ghost`,children:`Ghost`}),(0,I.jsx)(X,{variant:`destructive`,children:`Destructive`}),(0,I.jsx)(X,{variant:`link`,children:`Link`})]}),(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[(0,I.jsx)(X,{size:`sm`,children:`Small`}),(0,I.jsx)(X,{children:`Default`}),(0,I.jsx)(X,{size:`lg`,children:`Large`}),(0,I.jsx)(X,{size:`icon`,"aria-label":`more`,children:(0,I.jsx)(ym,{})}),(0,I.jsx)(X,{disabled:!0,children:`Disabled`})]})]}),(0,I.jsx)(V9,{title:`Badges`,children:(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[(0,I.jsx)($,{children:`Default`}),(0,I.jsx)($,{variant:`secondary`,children:`Secondary`}),(0,I.jsx)($,{variant:`outline`,children:`Outline`}),(0,I.jsx)($,{variant:`destructive`,children:`Destructive`})]})}),(0,I.jsx)(V9,{title:`Inputs & selection`,children:(0,I.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,I.jsx)($$,{placeholder:`Text input…`}),(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[(0,I.jsxs)(S3,{value:n,onValueChange:r,children:[(0,I.jsx)(w3,{className:`w-56`,children:(0,I.jsx)(C3,{placeholder:`Select…`})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,I.jsx)(Q,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,I.jsxs)(`label`,{className:`oc-show__check`,children:[(0,I.jsx)(C1,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,I.jsx)(V9,{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,I.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,I.jsxs)(r7,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,I.jsxs)(S3,{value:o,onValueChange:s,children:[(0,I.jsx)(w3,{size:`sm`,children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:z9,children:`Toutes directions`}),(0,I.jsx)(Q,{value:`inbound`,children:`inbound`}),(0,I.jsx)(Q,{value:`outbound`,children:`outbound`}),(0,I.jsx)(Q,{value:`internal`,children:`internal`})]})]}),(0,I.jsxs)(S3,{value:c,onValueChange:l,children:[(0,I.jsx)(w3,{size:`sm`,children:(0,I.jsx)(C3,{})}),(0,I.jsxs)(T3,{children:[(0,I.jsx)(Q,{value:z9,children:`Toutes sévérités`}),(0,I.jsx)(Q,{value:`info`,children:`info`}),(0,I.jsx)(Q,{value:`warn`,children:`warn`}),(0,I.jsx)(Q,{value:`critical`,children:`critical`})]})]})]}),(0,I.jsx)(m7,{fields:jst,onChange:()=>{}}),(0,I.jsxs)(`div`,{className:`oc-show__row`,children:[(0,I.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,I.jsx)(n7,{value:u,onChange:d})]})]})}),(0,I.jsx)(V9,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,I.jsxs)(z$,{children:[(0,I.jsx)(B$,{asChild:!0,children:(0,I.jsx)(X,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,I.jsx)(ym,{})})}),(0,I.jsxs)(V$,{align:`start`,children:[(0,I.jsx)(U$,{children:`Actions`}),(0,I.jsx)(W$,{}),(0,I.jsx)(H$,{children:`Edit`}),(0,I.jsx)(H$,{children:`Duplicate`}),(0,I.jsx)(W$,{}),(0,I.jsx)(H$,{variant:`destructive`,children:`Delete`})]})]})}),(0,I.jsx)(V9,{title:`Card`,children:(0,I.jsxs)(n9,{className:`w-80`,children:[(0,I.jsxs)(r9,{children:[(0,I.jsx)(i9,{children:`Instance`}),(0,I.jsx)(a9,{children:`Non-secret metadata only.`})]}),(0,I.jsx)(o9,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,I.jsxs)(fot,{className:`gap-2`,children:[(0,I.jsx)(X,{size:`sm`,children:`Save`}),(0,I.jsx)(X,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,I.jsx)(V9,{title:`Table`,children:(0,I.jsxs)(C5,{children:[(0,I.jsx)(w5,{children:(0,I.jsxs)(E5,{children:[(0,I.jsx)(D5,{className:`w-8`,children:(0,I.jsx)(C1,{"aria-label":`select all`})}),(0,I.jsx)(D5,{children:`Name`}),(0,I.jsx)(D5,{children:`Mode`}),(0,I.jsx)(D5,{className:`text-right`,children:`Status`}),(0,I.jsx)(D5,{className:`w-8`})]})}),(0,I.jsx)(T5,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,I.jsxs)(E5,{children:[(0,I.jsx)(O5,{children:(0,I.jsx)(C1,{"aria-label":`select ${e.n}`})}),(0,I.jsx)(O5,{className:`font-medium`,children:e.n}),(0,I.jsx)(O5,{children:(0,I.jsx)($,{variant:`secondary`,children:e.m})}),(0,I.jsx)(O5,{className:`text-right`,children:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,I.jsx)(um,{className:`size-3.5`}),` `,e.s]})}),(0,I.jsx)(O5,{children:(0,I.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,I.jsx)(ym,{})})})]},e.n))})]})}),(0,I.jsx)(V9,{title:`App fragments`,description:`Chat-specific components`,children:(0,I.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,I.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,I.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,I.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,I.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,I.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,I.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,I.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,I.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,I.jsx)(`span`,{className:`oc-run-status__dot`}),(0,I.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}var W9=`oc.theme`;function G9(e){let t=e===`dark`||e===`system`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;document.documentElement.classList.toggle(`dark`,t)}function K9(e){(0,N.useEffect)(()=>{let t=e??localStorage.getItem(W9)??`system`;if(localStorage.setItem(W9,t),G9(t),t===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>G9(`system`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}},[e])}function Gst(e){(0,N.useEffect)(()=>{if(!e)return;document.documentElement.lang=e;let t;try{t=q()}catch{t=void 0}t!==e&&HO(e)},[e])}function Kst(){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(mr,{children:(0,I.jsx)(`div`,{className:`oc-boot`,children:cQ()})}),(0,I.jsx)(pr,{children:(0,I.jsx)(Jst,{})}),(0,I.jsx)(fr,{children:(0,I.jsx)(O4e,{children:(0,I.jsx)(Yst,{})})})]})}function qst(){return(0,I.jsxs)(`svg`,{className:`oc-provider__logo`,viewBox:`0 0 48 48`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{fill:`#EA4335`,d:`M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z`}),(0,I.jsx)(`path`,{fill:`#4285F4`,d:`M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z`}),(0,I.jsx)(`path`,{fill:`#FBBC05`,d:`M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z`}),(0,I.jsx)(`path`,{fill:`#34A853`,d:`M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z`})]})}function Jst(){let{signIn:e}=Ir();K9(void 0);let t=P(V.charts.brandForHost,{host:xO}),n=efe(xO),r=t??n??null,i=wO(void 0);TO(r?.tokens??null,i),(0,N.useEffect)(()=>{t&&tfe(xO,t)},[t]);let a=r?.brand,o=a&&!a.isDefault?jO(a,i):null,s=a?.label??`Atrium`,c=P(V.me.authProviders),[l,u]=(0,N.useState)(null);async function d(t){u(null);try{await e(t)}catch{u(QAe())}}let f=c!==void 0&&!c.google&&!c.microsoft&&!c.anonymous;return(0,I.jsxs)(`div`,{className:`oc-signin`,children:[(0,I.jsxs)(`svg`,{className:`oc-signin__motif`,viewBox:`0 0 1200 1000`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`polyline`,{className:`oc-signin__line`,points:`0,860 470,860 522,790 574,940 626,810 678,860 1200,860`,vectorEffect:`non-scaling-stroke`}),(0,I.jsx)(`polyline`,{className:`oc-signin__pulse`,points:`0,860 470,860 522,790 574,940 626,810 678,860 1200,860`,pathLength:`100`,vectorEffect:`non-scaling-stroke`})]}),(0,I.jsxs)(`div`,{className:`oc-signin__brand`,children:[o?(0,I.jsx)(`img`,{className:`oc-signin__brandlogo`,src:o,alt:``}):null,(0,I.jsx)(`span`,{className:`oc-signin__wordmark`,children:s})]}),(0,I.jsxs)(`div`,{className:`oc-signin__card`,children:[(0,I.jsx)(`h1`,{className:`oc-signin__title`,children:tje()}),(0,I.jsx)(`p`,{className:`oc-signin__subtitle`,children:ije()}),(0,I.jsx)(`div`,{className:`oc-signin__providers`,children:c?.google?(0,I.jsxs)(`button`,{type:`button`,className:`oc-provider oc-provider--google`,onClick:()=>void d(`google`),children:[(0,I.jsx)(qst,{}),(0,I.jsx)(`span`,{children:sje()})]}):null}),l?(0,I.jsx)(`p`,{className:`oc-signin__error`,children:l}):null,f?(0,I.jsx)(`p`,{className:`oc-signin__error`,children:uje()}):null,c?.anonymous?(0,I.jsx)(`button`,{type:`button`,className:`oc-signin__dev`,onClick:()=>void e(`anonymous`),children:pje()}):null]})]})}function Yst(){let e=P(V.me.getMe,{host:xO}),t=F(V.me.bootstrap),n=ss();(0,N.useEffect)(()=>{e&&!e.hasProfile&&t()},[e,t]),K9(e?.resolvedThemeMode);let r=wO(e?.resolvedThemeMode);TO(e?.resolvedChartTokens,r),Gst(e?.resolvedLocale);let i=(0,N.useRef)(null);if((0,N.useEffect)(()=>{e&&(i.current!==null&&i.current!==e.userId&&n({to:`/`}),i.current=e.userId)},[e,n]),e===void 0)return(0,I.jsx)(`div`,{className:`oc-boot`,children:cQ()});let a=e.name||e.email||gje();return e.role===`pending`?(0,I.jsxs)(`div`,{className:`oc-shell`,children:[(0,I.jsx)(q9,{}),(0,I.jsx)(p5,{}),(0,I.jsxs)(`header`,{className:`oc-topbar`,children:[(0,I.jsx)(`span`,{className:`oc-topbar__brand`,children:(0,I.jsx)(J9,{brand:e.resolvedChartBrand,resolvedThemeMode:e.resolvedThemeMode})}),(0,I.jsx)(`div`,{className:`oc-topbar__actions`,children:(0,I.jsx)(m5,{label:a,mode:e.themeMode,minimal:!0})})]}),(0,I.jsxs)(`div`,{className:`oc-pending`,children:[(0,I.jsx)(`h1`,{className:`oc-pending__title`,children:yje()}),(0,I.jsx)(`p`,{className:`oc-pending__body`,children:Sje()})]})]}):(0,I.jsx)(Zst,{canOpenSettings:j7(e.permissions??[]).length>0,userLabel:a,themeMode:e.themeMode,resolvedThemeMode:e.resolvedThemeMode,brand:e.resolvedChartBrand},e.userId)}function q9(){let e=P(V.me.getImpersonation),t=F(V.admin.stopImpersonation);return!e||!e.impersonating?null:(0,I.jsxs)(`div`,{className:`oc-imp`,role:`alert`,children:[(0,I.jsx)(Dee,{className:`size-4 shrink-0`}),(0,I.jsxs)(`span`,{className:`oc-imp__text`,children:[Tje(),` `,(0,I.jsx)(`strong`,{children:e.targetLabel}),Oje(),(0,I.jsx)(`strong`,{children:e.realLabel}),jje()]}),(0,I.jsx)(X,{size:`sm`,variant:`outline`,className:`oc-imp__exit`,onClick:()=>void t(),children:Pje()})]})}function J9({brand:e,resolvedThemeMode:t}){let n=wO(t),r=e?.label??`Atrium`,i=e?.isDefault??!0,a=jO(e,n),[o,s]=(0,N.useState)(!1);return(0,N.useEffect)(()=>s(!1),[a]),(0,I.jsxs)(I.Fragment,{children:[a!==null&&!o?(0,I.jsx)(`img`,{className:`oc-brand__logo`,src:a,alt:``,"aria-hidden":`true`,onError:()=>s(!0)}):i?(0,I.jsx)(NO,{className:`oc-brand__logo`}):null,(0,I.jsx)(`span`,{className:`oc-brand__label`,children:r})]})}function Xst({userLabel:e,themeMode:t,resolvedThemeMode:n,brand:r,collapsed:i,onToggleSidebar:a}){return(0,I.jsxs)(`header`,{className:`oc-topbar`,children:[(0,I.jsxs)(`div`,{className:`oc-topbar__left`,children:[(0,I.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":i?Lje():Bje(),onClick:a,children:i?(0,I.jsx)(Mee,{}):(0,I.jsx)(jee,{})}),(0,I.jsx)(xs,{to:`/`,className:`oc-topbar__brand`,children:(0,I.jsx)(J9,{brand:r,resolvedThemeMode:n})})]}),(0,I.jsx)(`div`,{className:`oc-topbar__search`,children:(0,I.jsx)(_it,{})}),(0,I.jsxs)(`div`,{className:`oc-topbar__actions`,children:[(0,I.jsx)(fit,{}),(0,I.jsx)(m5,{label:e,mode:t})]})]})}function Zst({canOpenSettings:e,userLabel:t,themeMode:n,resolvedThemeMode:r,brand:i}){let{width:a,collapsed:o,toggleCollapsed:s,collapse:c,startResize:l,isMobile:u}=T3e(),d=zs(),f=as({strict:!1}),p=ss(),m=!!d({to:`/settings`,fuzzy:!0});(0,N.useEffect)(()=>{u&&c()},[Gs({select:e=>e.pathname}),u,c]);let h=(0,N.useCallback)(e=>{p({to:`/chat/$chatId`,params:{chatId:e}})},[p]),{startNewChat:g,picker:_}=sit(h),v=(0,N.useMemo)(()=>y5(g5,v5()),[]);return(0,N.useEffect)(()=>{let e=e=>{b5(e,g5)&&(e.preventDefault(),g())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]),(0,I.jsxs)(`div`,{className:`oc-shell`,children:[_,(0,I.jsx)(q9,{}),(0,I.jsx)(p5,{}),(0,I.jsx)(Xst,{userLabel:t,themeMode:n,resolvedThemeMode:r,brand:i,collapsed:o,onToggleSidebar:s}),(0,I.jsxs)(`div`,{className:u?`oc-workspace oc-workspace--mobile`:`oc-workspace`,children:[u&&!o?(0,I.jsx)(`div`,{className:`oc-sidebar-backdrop`,onClick:c,"aria-hidden":!0}):null,o?null:(0,I.jsxs)(`div`,{className:`oc-sidebar-col`,style:u?void 0:{width:a,flex:`0 0 ${a}px`},children:[m?(0,I.jsx)(_st,{}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(nit,{activeChatId:f.chatId??null,onSelect:h,onNewChat:()=>void g(),newChatShortcut:v}),e?(0,I.jsx)(X,{variant:`ghost`,className:`m-2 justify-start`,asChild:!0,children:(0,I.jsx)(xs,{to:`/settings`,children:Uje()})}):null]}),(0,I.jsx)(`div`,{className:`oc-sidebar-resizer`,onPointerDown:l,role:`separator`,"aria-orientation":`vertical`,"aria-label":Kje()})]}),(0,I.jsx)(`main`,{className:`oc-main`,children:(0,I.jsx)(Fs,{})})]})]})}function Qst(){let e=P(V.me.getMe,{host:xO}),t=ss(),n=Gs({select:e=>e.pathname}),r=(0,N.useMemo)(()=>e?j7(e.permissions??[]):[],[e]),i=e!==void 0&&r.length===0;if((0,N.useEffect)(()=>{i&&t({to:`/`})},[i,t]),e===void 0)return(0,I.jsx)(`div`,{className:`oc-admin__hint`,style:{padding:16},children:cQ()});if(i)return null;let a=N7(n),o=a!==void 0&&!r.includes(a);return(0,I.jsxs)(`div`,{className:`oc-admin`,children:[(0,I.jsx)(gst,{}),(0,I.jsx)(`div`,{className:`oc-admin__body`,children:o?(0,I.jsx)($st,{}):(0,I.jsx)(Fs,{})})]})}function $st(){return(0,I.jsxs)(`div`,{className:`oc-route-error`,role:`alert`,children:[(0,I.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,I.jsx)(Vm,{size:28})}),(0,I.jsx)(`h2`,{className:`oc-route-error__title`,children:Yje()}),(0,I.jsx)(`p`,{className:`oc-route-error__body`,children:Qje()})]})}function ect(){let e=P(V.me.getMe,{host:xO}),t=ss();return(0,N.useEffect)(()=>{if(e===void 0)return;let n=j7(e.permissions??[]);t({to:n.length>0?M7(n[0]):`/`,replace:!0})},[e,t]),(0,I.jsx)(`div`,{className:`oc-admin__hint`,style:{padding:16},children:cQ()})}function tct(){let{tab:e}=as({from:`/settings/$tab`});switch(e){case`groups`:return(0,I.jsx)($at,{});case`integrations`:return(0,I.jsx)(Pot,{});case`instances`:return(0,I.jsx)(Cat,{});case`bridge`:return(0,I.jsx)($it,{});case`theme`:return(0,I.jsx)(Wst,{});case`feedbacks`:return(0,I.jsx)(Lot,{});case`files`:return(0,I.jsx)(Rot,{});case`agentFiles`:return(0,I.jsx)(Uot,{});case`preferences`:return(0,I.jsx)(tst,{});case`chatDefaults`:return(0,I.jsx)(ist,{});case`access`:return(0,I.jsx)(cst,{});default:return(0,I.jsx)(Gat,{})}}function nct(){let{chatId:e}=as({from:`/chat/$chatId`}),{m:t}=os({from:`/chat/$chatId`});return(0,I.jsx)(K3,{chatId:e,focusMessageId:t??null})}function rct(){return(0,I.jsx)(K3,{chatId:null})}var Y9=Es({component:Kst}),ict=ws({getParentRoute:()=>Y9,path:`/`,component:rct}),act=ws({getParentRoute:()=>Y9,path:`chat/$chatId`,component:nct,validateSearch:e=>({m:typeof e.m==`string`?e.m:void 0})}),X9=ws({getParentRoute:()=>Y9,path:`settings`,component:Qst}),oct=ws({getParentRoute:()=>X9,path:`/`,component:ect}),sct=ws({getParentRoute:()=>X9,path:`traces`,validateSearch:dat,component:lot}),cct=ws({getParentRoute:()=>X9,path:`audit`,validateSearch:fat,component:Nat}),lct=ws({getParentRoute:()=>X9,path:`anomalies`,validateSearch:pat,component:Oot}),uct=ws({getParentRoute:()=>X9,path:`kpi`,validateSearch:mat,component:_ot}),dct=ws({getParentRoute:()=>X9,path:`serviceAccounts`,validateSearch:hat,component:Iat}),fct=ws({getParentRoute:()=>X9,path:`users`,validateSearch:gat,component:bat}),pct=ws({getParentRoute:()=>X9,path:`uiprefs`,beforeLoad:()=>{throw ia({to:`/settings/$tab`,params:{tab:vat.uiprefs},replace:!0})}}),mct=ws({getParentRoute:()=>X9,path:`$tab`,parseParams:e=>({tab:Wp([...D7]).catch(`roles`).parse(e.tab)}),component:tct});function hct({reset:e}){let t=ss();return(0,I.jsxs)(`div`,{className:`oc-route-error`,role:`alert`,children:[(0,I.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,I.jsx)(Vm,{size:28})}),(0,I.jsx)(`h2`,{className:`oc-route-error__title`,children:tMe()}),(0,I.jsx)(`p`,{className:`oc-route-error__body`,children:iMe()}),(0,I.jsxs)(`div`,{className:`oc-route-error__actions`,children:[(0,I.jsx)(`button`,{type:`button`,className:`oc-route-error__cta`,onClick:()=>e(),children:sMe()}),(0,I.jsx)(`button`,{type:`button`,className:`oc-route-error__cta oc-route-error__cta--ghost`,onClick:()=>void t({to:`/`}),children:lQ()})]})]})}function gct(){let e=ss();return(0,I.jsxs)(`div`,{className:`oc-route-error`,role:`status`,children:[(0,I.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,I.jsx)(Eee,{size:28})}),(0,I.jsx)(`h2`,{className:`oc-route-error__title`,children:fMe()}),(0,I.jsx)(`p`,{className:`oc-route-error__body`,children:hMe()}),(0,I.jsx)(`div`,{className:`oc-route-error__actions`,children:(0,I.jsx)(`button`,{type:`button`,className:`oc-route-error__cta`,onClick:()=>void e({to:`/`}),children:lQ()})})]})}var Z9=Vs({routeTree:Y9.addChildren([ict,act,X9.addChildren([oct,sct,cct,lct,uct,dct,fct,pct,mct])]),defaultPreload:`intent`,defaultErrorComponent:hct,defaultNotFoundComponent:gct});async function _ct(){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 vct=()=>null;function Q9({children:e}){return(0,I.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=_r.createRoot(document.getElementById(`root`));$9.render((0,I.jsx)(N.StrictMode,{children:(0,I.jsx)(Q9,{children:`Chargement…`})})),_ct().then(e=>{let t=new Yn(e);$9.render((0,I.jsx)(N.StrictMode,{children:(0,I.jsx)(Lr,{client:t,children:(0,I.jsxs)(E4e,{children:[(0,I.jsx)(wtt,{children:(0,I.jsx)(Ws,{router:Z9})}),(0,I.jsx)(N.Suspense,{fallback:null,children:(0,I.jsx)(vct,{router:Z9,position:`bottom-right`})})]})})}))}).catch(e=>{console.error(`Boot failed:`,e),$9.render((0,I.jsx)(N.StrictMode,{children:(0,I.jsxs)(Q9,{children:[`Configuration manquante\xA0:`,` `,e instanceof Error?e.message:String(e)]})}))});
|