@cotal-ai/web 0.181.0 → 0.182.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,110 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-Bfff_dYO.js","assets/rolldown-runtime-XKyaHtl9.js"])))=>i.map(i=>d[i]);
2
+ import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ee=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function L(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function te(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else L(te.bind(null,e))}var ne={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=te,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=L,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{var t=r();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 i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.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,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),a=t(((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=i()})),o=e(r(),1),s=e(a(),1),c=e=>e.kind===`msg`?`msg\u0001${e.channel}`:`dm\u0001${e.to}`;function l(e,t){if(e.view===`channel`)return{kind:`msg`,channel:e.channel};if(e.view!==`dm`)return;let n=t??void 0;if(e.with===void 0)return e.peer===n?void 0:{kind:`dm`,to:e.peer};if(e.peer===n)return{kind:`dm`,to:e.with};if(e.with===n)return{kind:`dm`,to:e.peer}}var u=`You'll show on the roster as operator when you post. Replies come to your DMs.`;function d(e){return e.mode===`participant`?u:e.reason===`This dashboard was started with --creds, which can only read.`?"Restart `cotal web` without `--creds` to post here.":``}function f(e){return/^[A-Za-z0-9_@%+=:,./-]+$/.test(e)?e:`'${e.replace(/'/g,`'\\''`)}'`}function p(e){return e.kind===`msg`?`cotal send -c ${f(e.channel)} "<text>"`:`cotal send -t ${f(e.to)} "<text>"`}function m(e,t){return t?{view:`dm`,peer:e,with:t}:{view:`dm`,peer:e}}function h(e,t){if(e!==null)return e.mode===`off`?{text:`Read only`,title:e.reason}:t?{text:`On the roster`,title:`You show on the roster as operator once you post, so agents can reply to you.`}:{text:`Not on the roster`,title:u}}var g=class extends Error{status;error;constructor(e,t){super(t),this.status=e,this.error=t,this.name=`SendRefused`}};async function _(e){let t=``;try{let n=await e.json();n&&typeof n.error==`string`&&(t=n.error)}catch{}return new g(e.status,t)}function v(e,t){let n=t instanceof g?t.status:void 0,r=(t instanceof g?t.error:t instanceof Error?t.message:String(t)).trim()||(n===void 0?`the request failed`:`HTTP ${n}`),i=/[.?!]$/.test(r)?r:`${r}.`;return`Couldn't post to ${e}. ${n===502?`The broker refused it: ${i}`:i} Your message is still here.`}var y=class extends Error{status;reason;constructor(e,t,n){super(e),this.status=t,this.reason=n}};async function b(e,t){if(!e.ok){let n;try{let t=await e.json();t&&typeof t.error==`string`&&(n=t.error)}catch{}let r=n===void 0?``:`: ${n}`;throw new y(`${t} refused with HTTP ${e.status}${r}`,e.status,n)}return e.json()}async function x(e){let t=await Promise.all(e.map(async e=>{try{return{value:await e.read()}}catch(e){return{error:e}}})),n=[];for(let r=0;r<t.length;r++){let i=t[r];if(`error`in i){let t=i.error;n.push({kind:`refused`,name:e[r].name,reason:t&&t.message?t.message:String(i.error)})}else e[r].apply(i.value)}return n}function S(e){if(!e.length)return``;let t=e.filter(e=>e.kind!==`partial`).map(e=>e.name),n=e.filter(e=>e.kind===`partial`).map(e=>e.name),r=[];return t.length&&r.push(`stale: ${t.join(`, `)}`),n.length&&r.push(`partial: ${n.join(`, `)}`),r.join(` · `)}var C=new Map;function w(e,t){C.set(e,t)}function T(e){if(e.kind===`text`)return e.text;if(e.kind===`artifact`)return`[artifact ${e.name} (${e.mediaType}, ${e.size} bytes) ${e.digest}]`;if(e.kind===`data`){let t=JSON.stringify(e.data);return t===void 0?`[empty data part]`:t}let t=e.kind,n=C.has(t)?C.get(t):void 0;if(typeof n==`function`){let r;try{r=n(e)}catch(e){let n=e;return`[renderer for part kind ${JSON.stringify(t)} failed: ${n&&n.message?n.message:String(e)}]`}return typeof r==`string`?r:`[renderer for part kind ${JSON.stringify(t)} returned ${typeof r}, expected a string]`}let r=JSON.stringify(e.data);return r===void 0?`[unrenderable part kind ${JSON.stringify(t)} \u2014 no renderer for it on this surface]`:`[${t}] ${r}`}function E(e){return(e||[]).map(e=>T(e)).join(` `)}function D(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type!==`CUSTOM`||t.name!==`cotal.toolResult`)return;let n=t.value;if(typeof n!=`object`||!n||Array.isArray(n)||Object.keys(n).some(e=>e!==`toolCallId`&&e!==`isError`))return;let r=n;if(!(typeof r.toolCallId!=`string`||`isError`in r&&typeof r.isError!=`boolean`))return{toolCallId:r.toolCallId,...typeof r.isError==`boolean`?{isError:r.isError}:{}}}function O(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}var k=e=>`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`,A=e=>{let t=O(e);return t&&k(t)},j=2e3,M=`ag-ui.frame`,N=e=>typeof e==`string`?e:void 0,P=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,F=class{label;constructor(e){this.label=e}};function I(e,t){if(typeof e.id!=`string`)return[];let n=Array.isArray(e.parts)?e.parts:[],r=[];for(let i of n){if(typeof i!=`object`||!i||i.kind!==M)continue;let n=i.events,a=r.length===0?e.id:`${e.id}#${r.length}`;r.push({id:a,ts:e.ts,events:Array.isArray(n)&&n.length>0?n:[new F(`A frame with no events`)],live:t})}return r.length>0?r:[{id:e.id,ts:e.ts,events:[new F(E(n))],live:t}]}function ee(e){let t=e.lastIndexOf(`__`);return t<0?e:e.slice(t+2)}var L=new Map([[`Bash`,`command`],[`Edit`,`edit`],[`MultiEdit`,`edit`],[`NotebookEdit`,`edit`],[`Write`,`write`],[`Read`,`read`],[`cotal_send`,`send`],[`cotal_dm`,`dm`],[`cotal_inbox`,`inbox`]]);function te(e){return L.get(e)??`other`}function ne(e){let t=/^events\.([A-Za-z0-9_]+)\.([A-Za-z0-9_]+)$/.exec(e);return t?`${t[1]}.${t[2]}`:void 0}function re(e){let t=0;for(let n of e)t+=n.events.length;return t}var ie=new Map([[`human`,`prompt`],[`sdk`,`prompt`],[`channel`,`mesh`],[`auto-continuation`,`continuation`],[`notification`,`notification`]]);function R(e){let t=e.cotal,n=typeof t==`object`&&t?N(t.turnSource):void 0;return n===void 0?void 0:ie.get(n)}function z(e){let t=[],n=new Map,r=new Map,i=new Map,a=new Map,o=!1,s=(e,t,n,r,i)=>{let a=e.get(t);if(a!==void 0)return a.at=r,a.live=a.live&&i,a;let o={text:``,user:!1,key:n,at:r,live:i};return e.set(t,o),o},c=(e,t,n,r,i)=>{let a=s(e,t,n,r,i);return a.text=``,a.user=!1,a.key=n,a.live=i,a},l=(e,n,r,i,a,o=!0)=>{let s=e.get(n);if(e.delete(n),s===void 0||s.text.length===0)return;let c=r===`said`&&s.user?`prompt`:r;t.push({item:{kind:c,key:s.key,text:s.text,cut:i},at:a??s.at,live:s.live&&o})},u=()=>{for(let e of[...n.keys()])l(n,e,`said`,!0);for(let e of[...r.keys()])l(r,e,`reasoning`,!0)};for(let d of e){let e=P(d.ts);d.events.forEach((f,p)=>{let m=`${d.id}:${p}`,h=d.live;if(f instanceof F){t.push({item:{kind:`unknown`,key:m,label:f.label,ts:e},at:e,live:h});return}let g=f,_=typeof g==`object`&&!!g,v=_?N(g.type):void 0,y=(_?P(g.timestamp):void 0)??e;switch((v===`RUN_STARTED`||v===`RUN_FINISHED`||v===`RUN_ERROR`)&&u(),v){case`RUN_STARTED`:{let e=R(g);t.push({item:{kind:`turn`,key:m,ts:y,...e?{source:e}:{}},at:y,live:h});break}case`RUN_FINISHED`:t.push({item:{kind:`turnEnd`,key:m,ts:y},at:y,live:h});break;case`RUN_ERROR`:t.push({item:{kind:`runError`,key:m,ts:y},at:y,live:h});break;case`TEXT_MESSAGE_START`:c(n,N(g.messageId)??``,m,y,h).user=N(g.role)===`user`;break;case`TEXT_MESSAGE_CONTENT`:{let e=s(n,N(g.messageId)??``,m,y,h);e.text+=N(g.delta)??``;break}case`TEXT_MESSAGE_END`:l(n,N(g.messageId)??``,`said`,!1,y,h);break;case`REASONING_MESSAGE_START`:c(r,N(g.messageId)??``,m,y,h);break;case`REASONING_MESSAGE_CONTENT`:{let e=s(r,N(g.messageId)??``,m,y,h);e.text+=N(g.delta)??``;break}case`REASONING_MESSAGE_END`:l(r,N(g.messageId)??``,`reasoning`,!1,y,h);break;case`TOOL_CALL_START`:{let e=N(g.toolCallName)??`?`,n=ee(e),r={key:m,id:N(g.toolCallId)??``,name:n,full:e,kind:te(n),...y===void 0?{}:{ts:y},live:h};if(r.id!==``){i.set(r.id,r);let e=a.get(r.id);e&&(r.input=e.input,r.result=e.result,r.live=r.live&&e.live,a.delete(r.id))}t.push({call:r,at:y,live:h});break}case`TOOL_CALL_END`:break;case`TOOL_CALL_ARGS`:case`TOOL_CALL_RESULT`:{let e=N(g.toolCallId)??``,t=i.get(e),n=N(v===`TOOL_CALL_ARGS`?g.delta:g.content);if(n!==void 0&&e!==``){let r=t??a.get(e)??{live:h};v===`TOOL_CALL_ARGS`?r.input=(r.input??``)+n:r.result=n,r.live=r.live&&h,t||a.set(e,r)}break}case`CUSTOM`:{let e=D(g);if(e!==void 0){o=!0;let t=i.get(e.toolCallId);t!==void 0&&(y!==void 0&&(t.end=y),t.failed=e.isError===!0,t.live=t.live&&h);break}t.push({item:{kind:`unknown`,key:m,label:`Custom event ${N(g.name)===void 0?`(unnamed)`:JSON.stringify(g.name)}`,ts:y},at:y,live:h});break}default:t.push({item:{kind:`unknown`,key:m,label:`Unrecognised event ${JSON.stringify(v??null)}`,ts:y},at:y,live:h})}})}return u(),{flat:t,marked:o}}function ae(e,t){return e.filter(e=>t(e.msg)).map((e,t)=>({msg:e.msg,i:t,at:P(e.msg.ts)})).sort((e,t)=>(e.at??1/0)-(t.at??1/0)||e.i-t.i).map(({msg:e,at:t})=>({msg:e,at:t}))}function B(e,t){let n=(e,t)=>e!==void 0&&t!==void 0&&e<t,r=[],i=0;for(let a of e){for(;i<t.length&&n(t[i].at,a.at);)r.push(t[i++]);r.push(a)}for(;i<t.length;)r.push(t[i++]);return r}function V(e,t){let{flat:n,marked:r}=z(e),i=ae(t,e=>typeof e.channel==`string`||typeof e.to==`string`).map(({msg:e,at:t})=>({post:{kind:`post`,key:`post:${e.id}`,msg:e,...typeof e.channel==`string`?{channel:e.channel}:{to:e.to},live:!0},at:t})),a=[],o,s,c=e=>{s=void 0,(o?.steps??a).push(e)},l=(e,t,n)=>{o!==void 0&&(o.outcome=e,t!==void 0&&(o.end=t),o.live=o.live&&n,o=void 0)};for(let e of B(n,i)){if(`post`in e){c(e.post);continue}if(`call`in e){if(s!==void 0)s.calls.push(e.call),s.live=s.live&&e.call.live;else{let t={kind:`tools`,key:e.call.key,calls:[e.call],live:e.call.live};c(t),s=t}continue}let t=e.item;switch(t.kind){case`turn`:s=void 0,o!==void 0&&(o.superseded=!0),o={kind:`turn`,key:t.key,...t.ts===void 0?{}:{start:t.ts},outcome:`open`,superseded:!1,...t.source?{source:t.source}:{},steps:[],live:e.live},a.push(o);break;case`turnEnd`:s=void 0,o===void 0?a.push({kind:`turnEnd`,key:t.key,...t.ts===void 0?{}:{ts:t.ts},live:e.live}):l(`finished`,t.ts,e.live);break;case`runError`:c({kind:`runError`,key:t.key,...t.ts===void 0?{}:{ts:t.ts},live:e.live}),l(`failed`,t.ts,e.live);break;case`said`:case`prompt`:case`reasoning`:c({...t,...e.at===void 0?{}:{ts:e.at},live:e.live});break;case`unknown`:c({...t,live:e.live})}}let u=a.some(e=>e.kind===`turn`&&e.outcome!==`open`&&e.steps.some(e=>e.kind===`tools`));return{items:a,toolStatus:r||!u}}function H(e,t){if(e.failed!==void 0)return e.failed?`failed`:`done`;if(!t.toolStatus||!t.trailing)return`called`;let n=t.turn;return n===void 0||n.outcome!==`open`||n.superseded?`noResult`:t.status===`working`?`running`:t.status===`waiting`?`pending`:`noResult`}var oe={command:{title:{running:`Running a command`,done:`Ran a command`,failed:`A command failed`,pending:`A command hasn't finished`,noResult:`No result arrived for a command`},one:`ran a command`,many:`ran # commands`,noun:[`command`,`commands`]},edit:{title:{running:`Editing a file`,done:`Edited a file`,failed:`An edit failed`,pending:`An edit hasn't finished`,noResult:`No result arrived for an edit`},one:`made an edit`,many:`made # edits`,noun:[`edit`,`edits`]},write:{title:{running:`Writing a file`,done:`Wrote a file`,failed:`A write failed`,pending:`A write hasn't finished`,noResult:`No result arrived for a write`},one:`wrote a file`,many:`wrote # times`,noun:[`write`,`writes`]},read:{title:{running:`Reading a file`,done:`Read a file`,failed:`A read failed`,pending:`A read hasn't finished`,noResult:`No result arrived for a read`},one:`read a file`,many:`read # times`,noun:[`read`,`reads`]},send:{title:{running:`Sending a message`,done:`Sent a message`,failed:`A message failed`,pending:`A message hasn't finished`,noResult:`No result arrived for a message`},one:`sent a message`,many:`sent # messages`,noun:[`message`,`messages`]},dm:{title:{running:`Sending a direct message`,done:`Sent a direct message`,failed:`A direct message failed`,pending:`A direct message hasn't finished`,noResult:`No result arrived for a direct message`},one:`sent a direct message`,many:`sent # direct messages`,noun:[`direct message`,`direct messages`]},inbox:{title:{running:`Checking the inbox`,done:`Checked the inbox`,failed:`An inbox check failed`,pending:`An inbox check hasn't finished`,noResult:`No result arrived for an inbox check`},one:`checked the inbox`,many:`checked the inbox # times`,noun:[`inbox check`,`inbox checks`]},other:{title:{running:`Using a tool`,done:`Used a tool`,failed:`A tool call failed`,pending:`A tool call hasn't finished`,noResult:`No result arrived for a tool call`},one:`called a tool`,many:`called # tools`,noun:[`tool call`,`tool calls`]}},U={one:`called another tool`,many:`called # other tools`},W=e=>e.charAt(0).toUpperCase()+e.slice(1),se=(e,t)=>t===1?e.one:e.many.replace(`#`,String(t)),ce=(e,t,n)=>`${e} ${e===1?t:n}`,le=64;function ue(e,t=le){let n=Array.from(e);return n.length>t?`${n.slice(0,t).join(``)}…`:e}function de(e,t,n){return t===`called`?`Called ${ue(n)}`:oe[e].title[t]}function fe(e,t){let n=e.filter(e=>e.failed===!0).length;if(!t){let t=e.map(e=>ue(e.name));return{title:`Called ${t.length<2?t.join(``):`${t.slice(0,-1).join(`, `)} and ${t.at(-1)}`}`,failed:n}}let r=new Map;for(let t of e)r.set(t.kind,(r.get(t.kind)??0)+1);let i=r.size>1;return{title:W([...r].map(([e,t])=>se(e===`other`&&i?U:oe[e],t)).join(`, `)),failed:n}}var pe=e=>e.steps.flatMap(e=>e.kind===`tools`?e.calls:[]);function me(e,t,n){let r=(e,t)=>e===void 0||t===void 0?void 0:ye(t-e,!1),i=(e,t,n)=>t===void 0?n:`${e} ${t}`,a;a=e.outcome===`finished`?i(`Worked for`,r(e.start,e.end),`Worked`):e.outcome===`failed`?i(`Turn failed after`,r(e.start,e.end),`Turn failed`):e.superseded||t!==`working`&&t!==`waiting`?`No end arrived for this turn`:t===`working`?i(`Working for`,r(e.start,n),`Working`):i(`Open for`,r(e.start,n),`Turn open`);let o=pe(e).filter(e=>e.failed===!0);if(o.length===0)return{title:a};let[s,c]=new Set(o.map(e=>e.kind)).size===1?oe[o[0].kind].noun:[`call`,`calls`];return{title:a,failed:`${ce(o.length,s,c)} failed`}}var he={prompt:`started by a prompt`,mesh:`started by a message from the mesh`,continuation:`started by the harness continuing itself`,notification:`started by a notification`};function ge(e){let t=[],n=A(e.start),r=A(e.end);e.outcome===`open`?n!==void 0&&t.push(`since ${n}`):n!==void 0&&r!==void 0&&t.push(n===r?n:`${n} to ${r}`),e.source!==void 0&&t.push(he[e.source]);let i=0;for(let t of e.steps)t.kind===`tools`?i+=t.calls.length:(t.kind===`said`||t.kind===`prompt`||t.kind===`reasoning`||t.kind===`post`)&&i++;t.push(ce(i,`step`,`steps`));let a=e.steps.find(e=>e.kind===`post`&&e.channel!==void 0);return a?.kind===`post`&&t.push(`posted in #${a.channel}`),t.join(` · `)}function _e(e,t,n){let r=A(e.ts);if(t===`called`)return r??``;let i;i=t===`done`||t===`failed`?e.ts===void 0||e.end===void 0?void 0:ye(e.end-e.ts,!0):t===`running`?e.ts===void 0?void 0:ye(n-e.ts,!1):r===void 0?void 0:`started ${r}`;let a=ue(e.name);return i===void 0?a:`${a} · ${i}`}function ve(e,t){if(t){let t=ce(e.length,`step`,`steps`),n=e.length>0&&e.every(e=>e.ts!==void 0&&e.end!==void 0)?ye(Math.max(...e.map(e=>e.end))-e[0].ts,!0):void 0;return n===void 0?t:`${t} · ${n}`}let n=ce(e.length,`call`,`calls`),r=A(e[0]?.ts),i=A(e.at(-1)?.ts),a=r===void 0?i:i===void 0||i===r?r:`${r} to ${i}`;return a===void 0?n:`${n} · ${a}`}function ye(e,t){if(!Number.isFinite(e)||e<0)return;let n=Math.floor(e/1e3);return n<60?t?`${(Math.floor(e/100)/10).toFixed(1)}s`:`${n}s`:n<3600?`${Math.floor(n/60)}m ${n%60}s`:`${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}var be=[`work`,`messages`,`profile`],xe=e=>be.includes(e),Se={view:`activity`},Ce={view:`topology`},we=/^[A-Za-z0-9_]+\.[A-Za-z0-9_]+$/;function Te(e){try{return decodeURIComponent(e)}catch{return}}function Ee(e){let t=e.replace(/^#/,``).split(`/`);if(t[0]!==``)return;let[,n,r,i,a,...o]=t;if(!(o.length>0||a!==void 0&&n!==`agent`))switch(n){case`channel`:{if(!r||i!==void 0)return;let e=Te(r);if(!e)return;let t=ne(e);return t?{view:`agent`,id:t,tab:`work`}:{view:`channel`,channel:e}}case`agent`:{if(!r)return;let e=Te(r);if(!e||!we.test(e))return;if(i===void 0)return{view:`agent`,id:e,tab:`work`};if(a===void 0){if(xe(i))return{view:`agent`,id:e,tab:i};let t=i===``?void 0:Te(i);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}if(i!==`work`)return;let t=a===``?void 0:Te(a);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}case`dm`:{if(!r)return;let e=Te(r);if(!e)return;if(i===void 0)return{view:`dm`,peer:e};let t=i===``?void 0:Te(i);return t?{view:`dm`,peer:e,with:t}:void 0}case`agents`:return i===void 0?r===void 0||r===`status`?{view:`agents`,group:`status`}:r===`host`?{view:`agents`,group:`host`}:void 0:void 0;case`activity`:case`topology`:case`needs`:return r===void 0?{view:n}:void 0;default:return}}function De(e,t){return Ee(e)??(t===`/graph`?Ce:Se)}function Oe(e){switch(e.view){case`channel`:return`#/channel/${encodeURIComponent(e.channel)}`;case`dm`:return`#/dm/${encodeURIComponent(e.peer)}${e.with===void 0?``:`/${encodeURIComponent(e.with)}`}`;case`agents`:return e.group===`status`?`#/agents`:`#/agents/${e.group}`;case`agent`:{let t=`#/agent/${encodeURIComponent(e.id)}`;return e.at===void 0?e.tab===`work`?t:`${t}/${e.tab}`:`${t}/work/${encodeURIComponent(e.at)}`}default:return`#/${e.view}`}}function ke(e){return De(e.location.hash,e.location.pathname)}function Ae(e,t){let n=()=>t(ke(e));return e.addEventListener(`hashchange`,n),()=>e.removeEventListener(`hashchange`,n)}function je(e,t){if(t.view!==`agent`)return;let n=Oe(t);e.location.hash!==n&&e.history.replaceState(null,``,n)}function Me(e,t){e.location.hash=Oe(t)}function Ne(e){return typeof e==`string`&&e.trim()?e:void 0}function Pe(e){let t=new Map;for(let n of e){let e=Ne(n.card?.name);n.card?.id&&e&&t.set(n.card.id,e)}return t}var Fe=`operator (you)`;function Ie(e,t,n){if(!e)return`?`;if(n&&(typeof e==`object`?e.id:e)===n&&!t.has(n))return Fe;if(typeof e==`object`)return Ie(e.id,t);let r=t.get(e);if(Ne(r))return r;let i=/^([A-Za-z0-9_]+)\.([A-Za-z0-9_]+)$/.exec(e);return i&&i[2].length>=32?`${i[1]}.${i[2].slice(0,6)}…`:/^[A-Z2-7]{32,}$/.test(e)?e.slice(0,6)+`…`:e}var Le=``,Re=(e,t)=>[e,t].sort().join(Le);function ze(e){let t=new Map;for(let n of e){let e=n.senderId??n.msg.from?.id,r=typeof n.msg.to==`string`?n.msg.to:void 0;if(!e||!r||e===r)continue;let i=[e,r].sort(),a=i.join(Le),o=t.get(a);o||t.set(a,o={parts:i,messages:[]}),o.messages.push(n)}let n=[];for(let[e,{parts:r,messages:i}]of t){i.sort((e,t)=>e.msg.ts-t.msg.ts);let t=i[0];n.push({key:e,parts:r,opener:t.senderId??t.msg.from?.id??r[0],messages:i,last:i[i.length-1]?.msg.ts??0,verified:i.every(e=>e.senderId!==void 0)})}return n}function Be(e){return ze(e).sort((e,t)=>t.last-e.last)}function Ve(e,t){let n=Pe(t),r=new Map;for(let e of t)e.card?.id&&r.set(e.card.id,e);let i=e=>r.get(e)?.status??`offline`,a=new Map;for(let{key:t,parts:n,messages:r,last:i,verified:o}of ze(e))for(let e of n){let s=n[0]===e?n[1]:n[0],c=a.get(e);c||a.set(e,c={id:e,conversations:[],last:0}),c.conversations.push({key:t,with:s,messages:r,last:i,verified:o}),c.last=Math.max(c.last,i)}return[...a.values()].map(e=>({id:e.id,name:Ie(e.id,n),role:r.get(e.id)?.card?.role,status:i(e.id),conversations:e.conversations.sort((e,t)=>t.last-e.last),threads:e.conversations.length,last:e.last})).sort((e,t)=>t.last-e.last)}var He=[`waiting`,`working`,`idle`,`offline`],Ue=(e,t)=>{let n=e?.[t];return typeof n==`string`?n:void 0},We=e=>{let t=Ue(e,`ai.cotal.events`);return t===`on`||t===`off`?{events:t}:{}},Ge=e=>{let t=He.indexOf(e);return t===-1?He.length:t};function Ke(e,t={}){return e.filter(e=>t.includeOffline||e.status!==`offline`).sort((e,t)=>Ge(e.status)-Ge(t.status)||e.card.name.localeCompare(t.card.name)).map(e=>({id:e.card.id,name:Ne(e.card.name)??e.card.id,role:Ne(e.card.role),status:e.status,activity:e.activity,harness:Ue(e.card.meta,`connector`),host:Ue(e.card.meta,`host`),attention:e.attention,model:Ue(e.card.meta,`model`),ts:e.ts,statusSince:e.statusSince,condition:e.condition,activitySince:e.activitySince,activeAt:e.activeAt,...We(e.card.meta)}))}var qe=e=>e.filter(e=>e.status===`waiting`);function Je(e){let t=e.filter(e=>e.status!==`offline`&&typeof e.ts==`number`).map(e=>e.ts);return t.length?Math.min(...t):void 0}var G=e=>e.status;function Ye(e){if(!e||e.fresh)return;if(e.state===`unpopulated`)return{kind:`refused`,name:`roster`,reason:`observer presence snapshot still loading`};let t={kind:`refused`,name:`roster`,reason:`observer presence watch silent since ${Number.isFinite(e.staleSince)?new Date(e.staleSince).toISOString():`unknown`}`};return Number.isFinite(e.staleSince)?{...t,since:e.staleSince}:t}function Xe(e,t){let n=()=>t(e.get());return(0,o.useSyncExternalStore)(e.subscribe,n,n)}var Ze=48,Qe=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Ze-t;return n},$e=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},et=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Ze;n+=i>>>1^-(i&1),t[r]=n}return t},tt=384,nt=[],rt=$e(Qe(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),it=$e(Qe(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),at=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,ot=(()=>{let e=rt.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=rt[n];i<rt[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(rt[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=rt[i];a<rt[i+1];a++)n[r++]=e,e+=t[e]}return n})(),st=Qe(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),ct=$e(Qe(`123333359346463635126536711576`)),lt=Qe(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ut=Qe(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),dt=et(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),ft=(()=>{let e=new Int32Array(319).fill(-1),t=et(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=et(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),pt=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),mt=et(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),ht=et(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),gt=et(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±`),_t=new Int32Array(987),vt=new Int32Array(987),yt=new Int32Array(987),bt=``,xt=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<mt.length;r++)for(let i of pt[gt[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),xt[a*2]=bt.length,xt[a*2+1]=i.length,bt+=i),_t[n]=mt[r],vt[n]=ht[r],yt[n]=a,n++}}var St=et(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Ct=$e(Qe(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),wt=et(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),Tt=Qe(`ij`),Et=Qe(`—`),Dt=Qe(`1`),Ot={GROUP_COUNT:tt,customValidatorNames:nt,edgeStart:rt,labelStart:it,labelText:at,edgeTarget:ot,nodeGroup:st,nodeVlist:ft,vlistPat:ct,vlistOps:lt,vlistRef:ut,vlistGroup:dt,litAnchor:_t,litGroup:vt,litPool:yt,poolOffsets:xt,poolText:bt,adjGid:St,adjStart:Ct,adjTgt:wt,patGid:Tt,patTgt:Et,postfixLookupGroups:Dt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},kt=`line`in Error(),At=-1,jt=-1,Mt=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Nt=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Pt=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let ee=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Mt(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;ee[n]!==-1;)n=n+1&I-1;ee[n]=e}let L=(e,t,n,r)=>{let i=(Mt(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=ee[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},te=n.cacheSize??8192,ne=n.prefix??e.prefix??``,re=ne===``?``:ne+`:`,ie=re.length,R=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),z=/\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$/,ae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,B=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,V=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,H=0,oe=-1,U=-1,W=-1,se=-1,ce=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,le=e=>/\s/.test(String.fromCharCode(e)),ue=(e,t,n)=>{if(H=0,oe=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)H=1;else if(r===40&&i===41)H=2;else return;W=t+1,se=n-1;let a=t+1;if(ce(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!ce(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(oe=t+1,U=a,W=a+1)}},de=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},fe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,pe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,me=e=>!!e&&!Number.isNaN(Number(e)),he=(e,t,n)=>{if(n-t<11||!de(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&de(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&de(e,t+10,t+18,`-normal/`)},ge=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],_e=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ve=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],ye=(e,t,n,r)=>{if(e>=10){if(e>=25)return R[e-25](t.slice(n,r));let i=e-10;if(H!==ge[i])return!1;if(oe>=0){for(let e of _e[i])if(de(t,oe,U,e))return!0;return!1}switch(ve[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(W,se);return z.test(e)&&!ae.test(e)}case 3:return me(t.slice(W,se));case 4:return V.test(t.slice(W,se));default:return B.test(t.slice(W,se))}}switch(e){case 0:return!0;case 1:return H===0;case 2:return H===1;case 3:return H===2;case 4:return fe.test(t.slice(n,r));case 5:return me(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&me(t.slice(n,r-1));case 8:return pe.test(t.slice(n,r));default:return he(t,n,r)}},be=new Set(typeof E==`string`?E.split(` `):E),xe=(e,t,n,r,i,a)=>{let o=Mt(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Se=new Map,Ce=new Map,we=2,Te=4096,Ee=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||be.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Ce.get(s);return c===void 0&&Ce.set(s,c=we++),c},De=new Map,Oe=r,ke=r+4096,Ae=()=>Oe++,je=2097152,Me=8192,Ne=new Int32Array(Me),Pe=Array(Me).fill(null),Fe=new Int32Array(Me),Ie=new Int32Array(Me),Le=new Uint8Array(Me),Re=0,ze=(e,t,n,r,i,a,o,s)=>{let c=e;if(Pe[e]!==null){if(Pe[e|1]===null)c=e|1;else if(!(Re++&3))c=e|Re>>2&1;else return}Pe[c]=t.slice(n,r),Ne[c]=i,Fe[c]=a,Ie[c]=o,Le[c]=s},Be=()=>Pe.fill(null),Ve=256,He=[new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve)],[Ue,We,Ge,Ke]=He,qe=new Uint8Array(Ve),Je=new Uint8Array(Ve),G=()=>{Ve*=2,He=He.map(e=>{let t=new Int32Array(Ve);return t.set(e),t}),[Ue,We,Ge,Ke]=He;let e=new Uint8Array(Ve);e.set(qe),qe=e,Je=new Uint8Array(Ve)},Ye=64,Xe=new Int32Array(Ye),Ze=new Int32Array(Ye),Qe=new Int32Array(r),$e=2048,et=21,tt=new Float64Array($e),nt=new Int32Array($e),rt=0,it=(e,t)=>{if(e===0&&t<r)return Qe[t]===rt?1:(Qe[t]=rt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>et;for(;nt[i]===rt;){if(tt[i]===n)return 1;i=i+1&$e-1}return tt[i]=n,nt[i]=rt,0},at=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?At:xe(De,e,t+1,r,0,Ae)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Ze[t];if(r>n)continue;let i=Xe[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=L(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;ue(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(ye(d[t],e,r,n))return p[h+t]}return At},ot=e=>{let t=e.length,n=0,c=0,u=!1;(we>Te||Se.size>Te)&&(Se=new Map,Ce=new Map,we=2,Be()),Oe>ke&&(De=new Map,Oe=r,Be());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&le(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&le(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ve&&G();let _=n++;Ue[_]=p,We[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Ne[y]===v&&Pe[y]!==null&&Pe[y].length===g?t=y:Ne[y|1]===v&&Pe[y|1]!==null&&Pe[y|1].length===g&&(t=y|1),t>=0){let n=Pe[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ge[_]=Fe[t],Ke[_]=Ie[t],qe[_]=Le[t];continue}}}let b=p;if(ie!==0){if(h-p<=ie||!e.startsWith(re,p)){Ge[_]=At,ze(y,e,p,h,v,At,0,0);continue}b=p+ie}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,ee=-1,L=0;(l[0]>=0||N[0]===1)&&(Xe[0]=0,Ze[0]=M,L=1);let te=jt,ne=0;for(let t=M;t<D;t++)if(t===A&&(te=F<I?jt:P,ne=L),P!==jt){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=jt;else{let e=i[P],t=i[P+1],c=jt;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],ee=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(L===Ye){Ye*=2;let e=new Int32Array(Ye);e.set(Xe),Xe=e;let t=new Int32Array(Ye);t.set(Ze),Ze=t}Xe[L]=r,Ze[L]=t+2,L++}}A===D&&(te=F<I?jt:P,ne=L);let R=F<I?jt:P,z,ae=!1;if(A>=0){if(ae=!0,z=at(e,E,A,te,ne),z!==At&&z<r&&j[z]){let t=at(e,E,D,R,L);t!==At&&t!==z&&(z=t,ae=!1)}else z===At&&(z=at(e,E,D,R,L),ae=!1)}else z=at(e,E,D,R,L);let B=0,V=0;z===At?Ge[_]=At:(V=+!!ae,B=b>=C?+!!O:xe(Se,e,b,C,+!!O,e=>Ee(e,O)),Ge[_]=z,qe[_]=V,Ke[_]=B),ze(y,e,p,h,v,z,B,V)}if(n===0)return``;if(n===1)return Ue[0]===0&&We[0]===t?e:e.slice(Ue[0],We[0]);if(n*k>$e){for(;n*k>$e;)$e<<=1,et--;tt=new Float64Array($e),nt=new Int32Array($e)}if(we>=je||Oe>=je)throw Error(`cn: too many distinct classes in one merge`);rt=rt+1|0,rt===0&&(Qe.fill(0),nt.fill(0),rt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ge[e];if(t===At){Je[e]=1;continue}let n=Ke[e];if(it(n,t)===1)Je[e]=0,f=!0;else if(Je[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)it(n,x[e]);if(qe[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&it(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Je[m]){m++;continue}let t=Ue[m],r=We[m],i=m+1;for(;i<n&&Je[i]&&Ue[i]===r+1&&e.charCodeAt(r)===32;)r=We[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},st=16384,ct=new Int32Array(st*2),lt=0,ut=1,dt=Object.create(null),ft=Object.create(null),pt=new Map,mt=new Map,ht=0,gt=0,_t=()=>{lt^=st,ut=ut+1|0,gt=0},vt=e=>{let t=dt[e];if(t!==void 0)return t;let n=Nt(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=ft[e],t!==void 0)?(dt[e]=t,t):(t=ot(e),i?(dt[e]=t,++ht>te&&(ht=0,ft=dt,dt=Object.create(null),_t())):(ct[r]=n^ut,++gt>st&&_t()),t)},yt=e=>{let t=pt.get(e);if(t!==void 0)return t;let n=Nt(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=mt.get(e),t!==void 0)?(pt.set(e,t),t):(t=ot(e),i?(pt.set(e,t),++ht>te&&(ht=0,mt=pt,pt=new Map,_t())):(ct[r]=n^ut,++gt>st&&_t()),t)},bt=e=>{let t=Nt(e,0,e.length),n=(t&16383)+lt;return ct[n]===(t^ut)||ct[n^st]===(t^ut-1)||(ct[n]=t^ut,++gt>st&&_t(),!1)},xt=te===0?ot:kt?e=>{let t=pt.get(e);return t===void 0?yt(e):t}:vt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?xt(arguments[0]):xt(Lt.apply(null,arguments))},mergeString:xt,seenBefore:te===0?()=>!1:bt,mergeUncached:ot}},Ft=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Ft(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},It=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Ft(i,t);a&&(n&&(n+=` `),n+=a)}return n},Lt=function(){return It(arguments,!1)},Rt=256,zt=16,Bt=1024,Vt=4096,Ht=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Vt).fill(``),l=Array(Vt).fill(``),u=Array(Vt).fill(``));let i=Nt(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Ft(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>zt&&(_.miss=zt,_.skip=Bt,_.e.length=0,_.at=0);let u=_.e;u.length<Rt?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Ft(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Ut=Pt(Ot),K=Ht(Ut.mergeString,Ut);Ut.merge;var Wt=Object.defineProperty,Gt=(e,t)=>Wt(e,`name`,{value:t,configurable:!0});function Kt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Gt(Kt,`setRef`);function qt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Kt(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():Kt(e[t],null)}}}}Gt(qt,`composeRefs`);function Jt(...e){return o.useCallback(qt(...e),e)}Gt(Jt,`useComposedRefs`);var Yt=Object.defineProperty,Xt=(e,t)=>Yt(e,`name`,{value:t,configurable:!0});function Zt(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];r=ln(r),o.Children.forEach(r,e=>{if(an(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;sn(n)&&typeof pn==`function`;)n=pn(n._payload);a=tn(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=o.cloneElement(a,void 0,c):!s&&o.Children.count(r)===1&&o.isValidElement(r)&&(a=r);let l=a?rn(a):void 0,u=Jt(n,l);if(!a){if(r||r===0)throw Error(s?fn(e):dn(e));return r}let d=nn(i,a.props??{});return a.type!==o.Fragment&&(d.ref=n?u:l),o.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}Xt(Zt,`createSlot`);var Qt=Zt(`Slot`),$t=Symbol.for(`radix.slottable`);function en(e){let t=Xt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=$t,t}Xt(en,`createSlottable`);var tn=Xt((e,t)=>`child`in e.props?o.isValidElement(t)?o.cloneElement(t,void 0,e.props.children(t.props.children)):null:o.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function nn(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=un(a,i))}return{...e,...n}}Xt(nn,`mergeProps`);function rn(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)}Xt(rn,`getElementRef`);function an(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===$t}Xt(an,`isSlottable`);var on=Symbol.for(`react.lazy`);function sn(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===on&&`_payload`in e&&cn(e._payload)}Xt(sn,`isLazyComponent`);function cn(e){return typeof e==`object`&&!!e&&`then`in e}Xt(cn,`isPromiseLike`);function ln(e){let t=e;for(;sn(t)&&typeof pn==`function`;)t=pn(t._payload);return t}Xt(ln,`useUnwrappedLazy`);function un(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Xt(un,`concatAriaDescribedby`);var dn=Xt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),fn=Xt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),pn=o.use,mn=t((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})),hn=t(((e,t)=>{t.exports=mn()})),q=hn(),gn=Object.defineProperty,_n=(e,t)=>gn(e,`name`,{value:t,configurable:!0}),J=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Zt(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vn(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}_n(vn,`dispatchDiscreteCustomEvent`);var yn=Object.defineProperty,bn=(e,t)=>yn(e,`name`,{value:t,configurable:!0}),xn=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`}),Sn=o.forwardRef(bn(function(e,t){return(0,q.jsx)(J.span,{...e,ref:t,style:{...xn,...e.style}})},`VisuallyHidden`)),Cn=Object.defineProperty,wn=(e,t)=>Cn(e,`name`,{value:t,configurable:!0});function Tn(e,t){let n=o.createContext(t);n.displayName=e+`Context`;let r=wn(e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,q.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,s=o.useContext(n);if(s)return s;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return wn(i,`useContext`),[r,i]}wn(Tn,`createContext`);function En(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=wn(t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,q.jsx)(c.Provider,{value:l,children:r})},`Provider`);s.displayName=t+`Provider`;function c(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return wn(c,`useContext`),[s,c]}wn(r,`createContext`);let i=wn(()=>{let t=n.map(e=>o.createContext(e));return wn(function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Dn(i,...t)]}wn(En,`createContextScope`);function Dn(...e){let t=e[0];if(e.length===1)return t;let n=wn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return wn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}wn(Dn,`composeContextScopes`);var On=globalThis?.document?o.useLayoutEffect:()=>{},kn=Object.defineProperty,An=(e,t)=>kn(e,`name`,{value:t,configurable:!0});function jn(e){let t=e+`CollectionProvider`,[n,r]=En(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=An(e=>{let{scope:t,children:n}=e,r=o.useRef(null),a=o.useRef(new Map).current;return(0,q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);s.displayName=t;let c=e+`CollectionSlot`,l=Zt(c),u=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Jt(t,a(c,n).collectionRef);return(0,q.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Zt(d),m=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),c=Jt(t,s),l=a(d,n);return o.useEffect(()=>(l.itemMap.set(s,{ref:s,...i}),()=>void l.itemMap.delete(s))),(0,q.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return o.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return An(h,`useCollection`),[{Provider:s,Slot:u,ItemSlot:m},h,r]}An(jn,`createCollection`);var Mn=new WeakMap,Nn=class e extends Map{static{An(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Mn.set(this,!0)}set(e,t){return Mn.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=In(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Pn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Pn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Pn(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Pn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Fn(e,t);return n===-1?void 0:e[n]}An(Pn,`at`);function Fn(e,t){let n=e.length,r=In(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}An(Fn,`toSafeIndex`);function In(e){return e!==e||e===0?0:Math.trunc(e)}An(In,`toSafeInteger`);function Ln(e){let t=e+`CollectionProvider`,[n,r]=En(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[s,c]=n(t);s.displayName=e+`CollectionStatefulContextProvider`;let l=An(({state:e,...t})=>e?(0,q.jsx)(d,{...t,state:e}):(0,q.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=An(e=>{let t=v();return(0,q.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=e+`CollectionInit`;let d=An(e=>{let{scope:t,children:n,state:r}=e,a=o.useRef(null),[c,l]=o.useState(null),u=Jt(a,l),[d,f]=r,p=o.useRef(new Nn),m=o.useCallback(()=>{let e=p.current;return Bn(e)||e.sort(Vn),e},[]);return o.useEffect(()=>{if(!c)return;let e=Hn(()=>{f(e=>{let t=e.toSorted(Vn);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c,f]),(0,q.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:m,setCollection:f,registryRef:p,children:(0,q.jsx)(s,{scope:t,collectionElement:c,collection:d,children:n})})},`CollectionProviderImpl`);d.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,p=Zt(f),m=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Jt(t,a(f,n).collectionElementRef);return(0,q.jsx)(p,{ref:i,children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=Zt(h),_=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),{setCollection:c,registryRef:l}=a(h,n),u=o.useRef(i);Rn(u.current,i)||(u.current=i);let d=u.current,f=Jt(t,o.useCallback(e=>{let t=l.current;e?t.set(e,{...u.current,element:e}):s.current&&t.delete(s.current)},[l]),s);On(()=>{let e=s.current,t=l.current;e&&t.has(e)&&t.set(e,{...d,element:e})},[d,l]);let p=o.useRef(null);return o.useEffect(()=>{let e=s.current,t=p.current;((t?.element??null)!==e||e&&t?.itemData!==d)&&(p.current=e?{element:e,itemData:d}:null,c(n=>{let r=new Nn(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...d,element:e}),r.sort(Vn)}))}),o.useEffect(()=>()=>{let e=p.current;p.current=null,e&&c(t=>{if(!t.has(e.element))return t;let n=new Nn(t);return n.delete(e.element),n})},[c]),(0,q.jsx)(g,{"data-radix-collection-item":``,ref:f,children:r})});_.displayName=h;function v(){return o.useState(new Nn)}An(v,`useInitCollection`);function y(t){let{collection:n}=c(e+`CollectionConsumer`,t);return n}An(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return An(b,`useGetCollection`),[{Provider:l,Slot:m,ItemSlot:_},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:v}]}An(Ln,`createCollection`);function Rn(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}An(Rn,`shallowEqual`);function zn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}An(zn,`isElementPreceding`);function Bn(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}An(Bn,`isInDocumentOrder`);function Vn(e,t){return!e[1].element||!t[1].element?0:zn(e[1].element,t[1].element)?-1:1}An(Vn,`sortByDocumentPosition`);function Hn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}An(Hn,`getChildListObserver`);var Un=Object.defineProperty,Wn=(e,t)=>Un(e,`name`,{value:t,configurable:!0}),Gn=!!(typeof window<`u`&&window.document&&window.document.createElement);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return Wn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Wn(Y,`composeEventHandlers`);function Kn(e){if(!Gn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Wn(Kn,`getOwnerWindow`);function qn(e){if(!Gn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Wn(qn,`getOwnerDocument`);function Jn(e,t=!1){let{activeElement:n}=qn(e);if(!n?.nodeName)return null;if(Yn(n)&&n.contentDocument)return Jn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=qn(n).getElementById(e);if(t)return t}}return n}Wn(Jn,`getActiveElement`);function Yn(e){return e.tagName===`IFRAME`}Wn(Yn,`isFrame`);var Xn=Object.defineProperty,Zn=(e,t)=>Xn(e,`name`,{value:t,configurable:!0}),Qn=o.useEffectEvent,$n=o.useInsertionEffect;function er(e){if(typeof Qn==`function`)return Qn(e);let t=o.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof $n==`function`?$n(()=>{t.current=e}):On(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Zn(er,`useEffectEvent`);var tr=Object.defineProperty,nr=(e,t)=>tr(e,`name`,{value:t,configurable:!0}),rr=o.useInsertionEffect||On;function ir({prop:e,defaultProp:t,onChange:n=nr(()=>{},`onChange`),caller:r}){let[i,a,s]=ar({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,o.useCallback(t=>{if(c){let n=or(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}nr(ir,`useControllableState`);function ar({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return rr(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}nr(ar,`useUncontrolledState`);function or(e){return typeof e==`function`}nr(or,`isFunction`);var sr=Symbol(`RADIX:SYNC_STATE`);function cr(e,t,n,r){let{prop:i,defaultProp:a,onChange:s,caller:c}=t,l=i!==void 0,u=er(s),d=[{...n,state:a}];r&&d.push(r);let[f,p]=o.useReducer((t,n)=>{if(n.type===sr)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=o.useRef(m);o.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=o.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return o.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:sr,state:i})},[i,f.state,l]),[g,p]}nr(cr,`useControllableStateReducer`);var lr=Object.defineProperty,ur=(e,t)=>lr(e,`name`,{value:t,configurable:!0});function dr(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}ur(dr,`useStateMachine`);var fr=ur(e=>{let{present:t,children:n}=e,r=pr(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=hr(r.ref,_r(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null},`Presence`);function pr(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=dr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??gr(r.current),s.current=void 0):a.current=`none`},[c]),On(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=gr(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),On(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=ur(a=>{let o=gr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=ur(e=>{e.target===t&&(a.current=gr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=gr(t)}else r.current=null;n(e)},[])}}ur(pr,`usePresence`);function mr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ur(mr,`setRef`);function hr(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=mr(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():mr(n[e],null)}}},[])}ur(hr,`useStableComposedRefs`);function gr(e){return e?.animationName||`none`}ur(gr,`getAnimationName`);function _r(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)}ur(_r,`getElementRef`);var vr=Object.defineProperty,yr=(e,t)=>vr(e,`name`,{value:t,configurable:!0}),br=o.useId||(()=>void 0),xr=0;function Sr(e){let[t,n]=o.useState(br());return On(()=>{e||n(e=>e??String(xr++))},[e]),e||(t?`radix-${t}`:``)}yr(Sr,`useId`);var Cr=Object.defineProperty,wr=(e,t)=>Cr(e,`name`,{value:t,configurable:!0}),Tr=`Collapsible`,[Er,Dr]=En(Tr),[Or,kr]=Er(Tr),Ar=o.forwardRef(wr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...c}=e,[l,u]=ir({prop:r,defaultProp:i??!1,onChange:s,caller:Tr});return(0,q.jsx)(Or,{scope:n,disabled:a,contentId:Sr(),open:l,onOpenToggle:o.useCallback(()=>u(e=>!e),[u]),children:(0,q.jsx)(J.div,{"data-state":Ir(l),"data-disabled":a?``:void 0,...c,ref:t})})},`Collapsible`)),jr=`CollapsibleTrigger`,Mr=o.forwardRef(wr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=kr(jr,n);return(0,q.jsx)(J.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Ir(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Y(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Nr=`CollapsibleContent`,Pr=o.forwardRef(wr(function(e,t){let{forceMount:n,...r}=e,i=kr(Nr,e.__scopeCollapsible);return(0,q.jsx)(fr,{present:n||i.open,children:({present:e})=>(0,q.jsx)(Fr,{...r,ref:t,present:e})})},`CollapsibleContent`)),Fr=o.forwardRef(wr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,s=kr(Nr,n),[c,l]=o.useState(r),u=o.useRef(null),d=Jt(t,u),f=o.useRef(0),p=f.current,m=o.useRef(0),h=m.current,g=s.open||c,_=o.useRef(g),v=o.useRef(void 0);return o.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),On(()=>{let e=u.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),l(r)}},[s.open,r]),(0,q.jsx)(J.div,{"data-state":Ir(s.open),"data-disabled":s.disabled?``:void 0,id:s.contentId,hidden:!g,...a,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function Ir(e){return e?`open`:`closed`}wr(Ir,`getState`);var Lr=Object.defineProperty,Rr=(e,t)=>Lr(e,`name`,{value:t,configurable:!0}),zr={LTR:`ltr`,RTL:`rtl`},Br=o.createContext(void 0);function Vr(e){let t=o.useContext(Br);return e||t||zr.LTR}Rr(Vr,`useDirection`);var Hr=Object.defineProperty,Ur=(e,t)=>Hr(e,`name`,{value:t,configurable:!0}),Wr=o.useInsertionEffect;function Gr(e){let t=o.useRef(e);return typeof Wr==`function`?Wr(()=>{t.current=e}):On(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ur(Gr,`useCallbackRef`);var Kr=Object.defineProperty,qr=(e,t)=>Kr(e,`name`,{value:t,configurable:!0}),Jr=`dismissableLayer.update`,Yr=`dismissableLayer.pointerDownOutside`,Xr=`dismissableLayer.focusOutside`,Zr,Qr=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),$r=o.forwardRef(qr(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=o.useContext(Qr),[f,p]=o.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),g=Jt(t,p),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=o.useRef(!1),w=ni(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return S&&!t},[d.branches,S])}),T=ri(e=>{if(r&&C.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m),E=f?b===_.length-1:!1,D=Gr(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return o.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),o.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Zr=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ii(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Zr))}},[f,m,n,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ii())},[f,d]),o.useEffect(()=>{let e=qr(()=>h({}),`handleUpdate`);return document.addEventListener(Jr,e),()=>document.removeEventListener(Jr,e)},[]),(0,q.jsx)(J.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function ei(){let e=o.useContext(Qr),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}qr(ei,`useDismissableLayerSurface`);var ti=qr(()=>!0,`IS_TRUE`);function ni(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=ti}=t,c=Gr(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}qr(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}qr(t,`isOutsideInteractionIntercepted`);function o(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}qr(o,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}qr(p,`handleInteractionBubble`);let m=qr(a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ai(Yr,c,p,{discrete:!0})};if(qr(o,`handleAndDispatchPointerDownOutsideEvent`),!s(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?o():(n.removeEventListener(`click`,f.current),f.current=o,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,o,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:qr(()=>l.current=!0,`onPointerDownCapture`)}}qr(ni,`usePointerDownOutside`);function ri(e,t=globalThis?.document){let n=Gr(e),r=o.useRef(!1);return o.useEffect(()=>{let e=qr(e=>{e.target&&!r.current&&ai(Xr,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:qr(()=>r.current=!0,`onFocusCapture`),onBlurCapture:qr(()=>r.current=!1,`onBlurCapture`)}}qr(ri,`useFocusOutside`);function ii(){let e=new CustomEvent(Jr);document.dispatchEvent(e)}qr(ii,`dispatchUpdate`);function ai(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?vn(i,a):i.dispatchEvent(a)}qr(ai,`handleAndDispatchCustomEvent`);var oi=Object.defineProperty,si=(e,t)=>oi(e,`name`,{value:t,configurable:!0}),ci=`focusScope.autoFocusOnMount`,li=`focusScope.autoFocusOnUnmount`,ui={bubbles:!1,cancelable:!0},di=o.forwardRef(si(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=e,[l,u]=o.useState(null),d=Gr(a),f=Gr(s),p=o.useRef(null),m=Jt(t,u),h=o.useRef(i);o.useEffect(()=>{h.current=i});let g=o.useCallback(e=>e?l?.contains(e)?!0:!!h.current?.some(t=>t.contains(e)):!1,[l]),_=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(_.paused||!l)return;let t=e.target;g(t)?p.current=t:Si(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||Si(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Si(l)};si(e,`handleFocusIn`),si(t,`handleFocusOut`),si(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,_.paused,g]),o.useEffect(()=>{if(l){Ci.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(ci,ui);l.addEventListener(ci,d),l.dispatchEvent(t),t.defaultPrevented||(gi(Ei(vi(l)),{select:!0}),document.activeElement===e&&Si(l))}return()=>{l.removeEventListener(ci,d);let t=l.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(li,ui);l.addEventListener(li,f),l.dispatchEvent(r),r.defaultPrevented||Si(e??t.body,{select:!0}),l.removeEventListener(li,f),Ci.remove(_)},0)}}},[l,d,f,_]);let v=o.useCallback(e=>{if(!n&&!r||_.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]=_i(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Si(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Si(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,q.jsx)(J.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),fi=o.createContext(null);function pi({registry:e,children:t}){return e?(0,q.jsx)(fi.Provider,{value:e,children:t}):t}si(pi,`FocusScopeBranchProvider`);function mi(){let[e,t]=o.useState([]);return{nodes:e,registry:o.useMemo(()=>({add:si(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:si(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}si(mi,`useFocusScopeBranchRegistry`);function hi(e){let t=o.useContext(fi);o.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}si(hi,`useFocusScopeBranch`);function gi(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Si(r,{select:t}),document.activeElement!==n)return}si(gi,`focusFirst`);function _i(e){let t=vi(e);return[yi(t,e),yi(t.reverse(),e)]}si(_i,`getTabbableEdges`);function vi(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:si(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}si(vi,`getTabbableCandidates`);function yi(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):bi(r,{upTo:t})))return r}si(yi,`findVisible`);function bi(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}si(bi,`isHidden`);function xi(e){return e.tagName===`INPUT`&&typeof e.select==`function`}si(xi,`isSelectableInput`);function Si(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&xi(e)&&t&&e.select()}}si(Si,`focus`);var Ci=wi();function wi(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ti(e,t),e.unshift(t)},remove(t){e=Ti(e,t),e[0]?.resume()}}}si(wi,`createFocusScopesStack`);function Ti(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}si(Ti,`arrayRemove`);function Ei(e){return e.filter(e=>e.tagName!==`A`)}si(Ei,`removeLinks`);var Di=Object.defineProperty,Oi=o.forwardRef(((e,t)=>Di(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=o.useState(!1);On(()=>a(!0),[]);let c=n||i&&globalThis?.document?.body;return c?s.createPortal((0,q.jsx)(J.div,{...r,ref:t}),c):null},`Portal`)),ki=Object.defineProperty,Ai=(e,t)=>ki(e,`name`,{value:t,configurable:!0}),ji=0,Mi=null;function Ni(e){return Pi(),e.children}Ai(Ni,`FocusGuards`);function Pi(){o.useEffect(()=>{Mi||={start:Fi(),end:Fi()};let{start:e,end:t}=Mi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ji++,()=>{ji===1&&(Mi?.start.remove(),Mi?.end.remove(),Mi=null),ji=Math.max(0,ji-1)}},[])}Ai(Pi,`useFocusGuards`);function Fi(){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}Ai(Fi,`createFocusGuard`);var Ii=function(){return Ii=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},Ii.apply(this,arguments)};function Li(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 Ri(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 zi=`right-scroll-bar-position`,Bi=`width-before-scroll-bar`,Vi=`with-scroll-bars-hidden`,Hi=`--removed-body-scroll-bar-size`;function Ui(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Wi(e,t){var n=(0,o.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 Gi=typeof window<`u`?o.useLayoutEffect:o.useEffect,Ki=new WeakMap;function qi(e,t){var n=Wi(t||null,function(t){return e.forEach(function(e){return Ui(e,t)})});return Gi(function(){var t=Ki.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ui(e,null)}),i.forEach(function(e){r.has(e)||Ui(e,a)})}Ki.set(n,e)},[e]),n}function Ji(e){return e}function Yi(e,t){t===void 0&&(t=Ji);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 Xi(e){e===void 0&&(e={});var t=Yi(null);return t.options=Ii({async:!0,ssr:!1},e),t}var Zi=function(e){var t=e.sideCar,n=Li(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 o.createElement(r,Ii({},n))};Zi.isSideCarExport=!0;function Qi(e,t){return e.useMedium(t),Zi}var $i=Xi(),ea=function(){},ta=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:ea,onWheelCapture:ea,onTouchMoveCapture:ea}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Li(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=qi([n,t]),w=Ii(Ii({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:$i,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),Ii(Ii({},w),{ref:C})):o.createElement(y,Ii({},w,{className:l,ref:C}),c))});ta.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ta.classNames={fullWidth:Bi,zeroRight:zi};var na=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ra(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=na();return t&&e.setAttribute(`nonce`,t),e}function ia(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function aa(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var oa=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ra())&&(ia(t,n),aa(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sa=function(){var e=oa();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ca=function(){var e=sa();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},la={left:0,top:0,right:0,gap:0},ua=function(e){return parseInt(e||``,10)||0},da=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[ua(n),ua(r),ua(i)]},fa=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return la;var t=da(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])}},pa=ca(),ma=`data-scroll-locked`,ha=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
3
+ .${Vi} {
4
+ overflow: hidden ${r};
5
+ padding-right: ${s}px ${r};
6
+ }
7
+ body[${ma}] {
8
+ overflow: hidden ${r};
9
+ overscroll-behavior: contain;
10
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
11
+ padding-left: ${i}px;
12
+ padding-top: ${a}px;
13
+ padding-right: ${o}px;
14
+ margin-left:0;
15
+ margin-top:0;
16
+ margin-right: ${s}px ${r};
17
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
18
+ }
19
+
20
+ .${zi} {
21
+ right: ${s}px ${r};
22
+ }
23
+
24
+ .${Bi} {
25
+ margin-right: ${s}px ${r};
26
+ }
27
+
28
+ .${zi} .${zi} {
29
+ right: 0 ${r};
30
+ }
31
+
32
+ .${Bi} .${Bi} {
33
+ margin-right: 0 ${r};
34
+ }
35
+
36
+ body[${ma}] {
37
+ ${Hi}: ${s}px;
38
+ }
39
+ `},ga=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},_a=function(){o.useEffect(function(){return document.body.setAttribute(ma,(ga()+1).toString()),function(){var e=ga()-1;e<=0?document.body.removeAttribute(ma):document.body.setAttribute(ma,e.toString())}},[])},va=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;_a();var a=o.useMemo(function(){return fa(i)},[i]);return o.createElement(pa,{styles:ha(a,!t,i,n?``:`!important`)})},ya=!1;if(typeof window<`u`)try{var ba=Object.defineProperty({},"passive",{get:function(){return ya=!0,!0}});window.addEventListener(`test`,ba,ba),window.removeEventListener(`test`,ba,ba)}catch{ya=!1}var xa=ya?{passive:!1}:!1,Sa=function(e){return e.tagName===`TEXTAREA`},Ca=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Sa(e)&&n[t]===`visible`)},wa=function(e){return Ca(e,`overflowY`)},Ta=function(e){return Ca(e,`overflowX`)},Ea=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ka(e,r)){var i=Aa(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Da=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Oa=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ka=function(e,t){return e===`v`?wa(t):Ta(t)},Aa=function(e,t){return e===`v`?Da(t):Oa(t)},ja=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ma=function(e,t,n,r,i){var a=ja(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=Aa(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ka(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},Na=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pa=function(e){return[e.deltaX,e.deltaY]},Fa=function(e){return e&&`current`in e?e.current:e},Ia=function(e,t){return e[0]===t[0]&&e[1]===t[1]},La=function(e){return`
40
+ .block-interactivity-${e} {pointer-events: none;}
41
+ .allow-interactivity-${e} {pointer-events: all;}
42
+ `},Ra=0,za=[];function Ba(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(Ra++)[0],a=o.useState(ca)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ri([e.lockRef.current],(e.shards||[]).map(Fa),!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 c=o.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var i=Na(e),a=n.current,o=`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(o)>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=Ea(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ea(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(o||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ma(h,t,e,h===`h`?o:c,!0)},[]),l=o.useCallback(function(e){var n=e;if(za.length&&za[za.length-1]===a){var r=`deltaY`in n?Pa(n):Na(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ia(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var o=(s.current.shards||[]).map(Fa).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?c(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=o.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Va(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=o.useCallback(function(e){n.current=Na(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,Pa(t),t.target,c(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,Na(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return za.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,xa),document.addEventListener(`touchmove`,l,xa),document.addEventListener(`touchstart`,d,xa),function(){za=za.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,xa),document.removeEventListener(`touchmove`,l,xa),document.removeEventListener(`touchstart`,d,xa)}},[]);var m=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(a,{styles:La(i)}):null,m?o.createElement(va,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Va(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ha=Qi($i,Ba),Ua=o.forwardRef(function(e,t){return o.createElement(ta,Ii({},e,{ref:t,sideCar:Ha}))});Ua.classNames=ta.classNames;var Wa=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ga=new WeakMap,Ka=new WeakMap,qa={},Ja=0,Ya=function(e){return e&&(e.host||Ya(e.parentNode))},Xa=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ya(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})},Za=function(e,t,n,r){var i=Xa(t,Array.isArray(e)?e:[e]);qa[n]||(qa[n]=new WeakMap);var a=qa[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=(Ga.get(e)||0)+1,l=(a.get(e)||0)+1;Ga.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ka.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(),Ja++,function(){o.forEach(function(e){var t=Ga.get(e)-1,i=a.get(e)-1;Ga.set(e,t),a.set(e,i),t||(Ka.has(e)||e.removeAttribute(r),Ka.delete(e)),i||e.removeAttribute(n)}),Ja--,Ja||(Ga=new WeakMap,Ga=new WeakMap,Ka=new WeakMap,qa={})}},Qa=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Wa(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Za(r,i,n,`aria-hidden`)):function(){return null}},$a=Object.defineProperty,eo=(e,t)=>$a(e,`name`,{value:t,configurable:!0}),to=`Dialog`,[no,ro]=En(to),[io,ao]=no(to),oo=eo(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=o.useRef(null),l=o.useRef(null),{nodes:u,registry:d}=mi(),[f,p]=ir({prop:r,defaultProp:i??!1,onChange:a,caller:to}),[m,h]=o.useState(0),[g,_]=o.useState(0);return(0,q.jsx)(io,{scope:t,triggerRef:c,contentRef:l,contentId:Sr(),titleId:Sr(),descriptionId:Sr(),titlePresent:m>0,descriptionPresent:g>0,setTitleCount:h,setDescriptionCount:_,open:f,onOpenChange:p,onOpenToggle:o.useCallback(()=>p(e=>!e),[p]),modal:s,branchNodes:u,branchRegistry:d,children:n})},`Dialog`),so=`DialogTrigger`,co=o.forwardRef(eo(function(e,t){let{__scopeDialog:n,...r}=e,i=ao(so,n),a=Jt(t,i.triggerRef);return(0,q.jsx)(J.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Oo(i.open),...r,ref:a,onClick:Y(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),lo=`DialogPortal`,[uo,fo]=no(lo,{forceMount:void 0}),po=eo(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ao(lo,t);return(0,q.jsx)(uo,{scope:t,forceMount:n,children:o.Children.map(r,e=>(0,q.jsx)(fr,{present:n||a.open,children:(0,q.jsx)(Oi,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),mo=`DialogOverlay`,ho=o.forwardRef(eo(function(e,t){let n=fo(mo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ao(mo,e.__scopeDialog);return a.modal?(0,q.jsx)(fr,{present:r||a.open,children:(0,q.jsx)(_o,{...i,ref:t})}):null},`DialogOverlay`)),go=Zt(`DialogOverlay.RemoveScroll`),_o=o.forwardRef(eo(function(e,t){let{__scopeDialog:n,...r}=e,i=ao(mo,n),a=Jt(t,ei());return(0,q.jsx)(Ua,{as:go,allowPinchZoom:!0,shards:o.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,q.jsx)(J.div,{"data-state":Oo(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),vo=`DialogContent`,yo=o.forwardRef(eo(function(e,t){let n=fo(vo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ao(vo,e.__scopeDialog);return(0,q.jsx)(fr,{present:r||a.open,children:a.modal?(0,q.jsx)(bo,{...i,ref:t}):(0,q.jsx)(xo,{...i,ref:t})})},`DialogContent`)),bo=o.forwardRef(eo(function(e,t){let n=ao(vo,e.__scopeDialog),r=o.useRef(null),i=Jt(t,n.contentRef,r);return o.useEffect(()=>{let e=r.current;if(e)return Qa(e)},[]),(0,q.jsx)(So,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),xo=o.forwardRef(eo(function(e,t){let n=ao(vo,e.__scopeDialog),r=o.useRef(!1),i=o.useRef(!1);return(0,q.jsx)(So,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),So=o.forwardRef(eo(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=ao(vo,n);return Pi(),(0,q.jsx)(pi,{registry:l.branchRegistry,children:(0,q.jsx)(di,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,q.jsx)($r,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Do(o,l.descriptionId):o,"data-state":Oo(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Co=o.forwardRef(eo(function(e,t){let{__scopeDialog:n,...r}=e,i=ao(`DialogTitle`,n),{setTitleCount:a}=i;return On(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,q.jsx)(J.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),wo=o.forwardRef(eo(function(e,t){let{__scopeDialog:n,...r}=e,i=ao(`DialogDescription`,n),{setDescriptionCount:a}=i;return On(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,q.jsx)(J.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),To=`DialogClose`,Eo=o.forwardRef(eo(function(e,t){let{__scopeDialog:n,...r}=e,i=ao(To,n);return(0,q.jsx)(J.button,{type:`button`,...r,ref:t,onClick:Y(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Do(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}eo(Do,`concatAriaDescribedby`);function Oo(e){return e?`open`:`closed`}eo(Oo,`getState`);var ko=Object.defineProperty,Ao=(e,t)=>ko(e,`name`,{value:t,configurable:!0}),jo=`Avatar`,[Mo,No]=En(jo),Po={Idle:`idle`,Loading:`loading`,Loaded:`loaded`,Error:`error`},Fo=[0,()=>void 0],[Io,Lo]=Mo(jo),Ro=o.forwardRef(Ao(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=o.useState(Po.Idle),[s,c]=Uo();return(0,q.jsx)(Io,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:s,setImageCount:c,children:(0,q.jsx)(J.span,{...r,ref:t})})},`Avatar`)),zo=`AvatarFallback`,Bo=o.forwardRef(Ao(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=Lo(zo,n),[s,c]=o.useState(r===void 0);return o.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>c(!0),r);return()=>window.clearTimeout(e)}},[r]),s&&a.imageLoadingStatus!==Po.Loaded?(0,q.jsx)(J.span,{...i,ref:t}):null},`AvatarFallback`));function Vo(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return On(()=>{if(!e){n(Po.Error);return}let t=new window.Image,a=Ao(e=>{let t=e.currentTarget;n(Ho(t))},`handleLoad`),o=Ao(()=>n(Po.Error),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(Ho(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(Po.Idle)}},[e,i,r,n]),t}Ao(Vo,`useImageLoadingStatus`);function Ho(e){return e.complete?e.naturalWidth>0?Po.Loaded:Po.Error:Po.Loading}Ao(Ho,`getImageLoadingStatus`);function Uo(){return Fo}Ao(Uo,`useImageCount`);function Wo(e){}Ao(Wo,`useUpdateImageCount`);var Go=Object.defineProperty,Ko=(e,t)=>Go(e,`name`,{value:t,configurable:!0});function qo(e){let[t,n]=o.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}Ko(qo,`useSize`);var Jo=[`top`,`right`,`bottom`,`left`],Yo=Math.min,Xo=Math.max,Zo=Math.round,Qo=Math.floor,$o=e=>({x:e,y:e}),es={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ts(e,t,n){return Xo(e,Yo(t,n))}function ns(e,t){return typeof e==`function`?e(t):e}function rs(e){return e.split(`-`)[0]}function is(e){return e.split(`-`)[1]}function as(e){return e===`x`?`y`:`x`}function os(e){return e===`y`?`height`:`width`}function ss(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function cs(e){return as(ss(e))}function ls(e,t,n){n===void 0&&(n=!1);let r=is(e),i=cs(e),a=os(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=vs(o)),[o,vs(o)]}function us(e){let t=vs(e);return[ds(e),t,ds(t)]}function ds(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var fs=[`left`,`right`],ps=[`right`,`left`],ms=[`top`,`bottom`],hs=[`bottom`,`top`];function gs(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ps:fs:t?fs:ps;case`left`:case`right`:return t?ms:hs;default:return[]}}function _s(e,t,n,r){let i=is(e),a=gs(rs(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ds)))),a}function vs(e){let t=rs(e);return es[t]+e.slice(t.length)}function ys(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function bs(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ys(e)}function xs(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 Ss(e,t,n){let{reference:r,floating:i}=e,a=ss(t),o=cs(t),s=os(o),c=rs(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=is(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Cs(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}=ns(t,e),p=bs(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=xs(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=xs(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 ws=50,Ts=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Cs},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ss(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<ws&&(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}=Ss(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Es=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}=ns(e,t)||{};if(l==null)return{};let d=bs(u),f={x:n,y:r},p=cs(i),m=os(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=Yo(d[_],T),D=Yo(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=ts(E,k,O),j=!c.arrow&&is(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Ds=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}=ns(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=rs(r),_=ss(o),v=rs(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[vs(o)]:us(o)),x=p!==`none`;!d&&x&&b.push(..._s(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=ls(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`||_===ss(t)||T.every(e=>ss(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ss(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Os(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ks(e){return Jo.some(t=>e[t]>=0)}var As=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ns(e,t);switch(i){case`referenceHidden`:{let e=Os(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ks(e)}}}case`escaped`:{let e=Os(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ks(e)}}}default:return{}}}}},js=new Set([`left`,`top`]);async function Ms(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rs(n),s=is(n),c=ss(n)===`y`,l=js.has(o)?-1:1,u=a&&c?-1:1,d=ns(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 Ns=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 Ms(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}}}}},Ps=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}=ns(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ss(i),p=as(f),m=u[p],h=u[f],g=(e,t)=>ts(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Fs=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}=ns(e,t),u={x:n,y:r},d=ss(i),f=as(d),p=u[f],m=u[d],h=ns(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=js.has(rs(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}}}},Is=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ns(e,t),c=await i.detectOverflow(t,s),l=rs(n),u=is(n),d=ss(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Yo(p-c[m],g),y=Yo(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Xo(c.left,c.right):S=p-2*Xo(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ls(){return typeof window<`u`}function Rs(e){return Vs(e)?(e.nodeName||``).toLowerCase():`#document`}function zs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bs(e){return((Vs(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Vs(e){return Ls()?e instanceof Node||e instanceof zs(e).Node:!1}function Hs(e){return Ls()?e instanceof Element||e instanceof zs(e).Element:!1}function Us(e){return Ls()?e instanceof HTMLElement||e instanceof zs(e).HTMLElement:!1}function Ws(e){return!Ls()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof zs(e).ShadowRoot}function Gs(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=nc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ks(e){return/^(table|td|th)$/.test(Rs(e))}function qs(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Js=/transform|translate|scale|rotate|perspective|filter/,Ys=/paint|layout|strict|content/,Xs=e=>!!e&&e!==`none`,Zs;function Qs(e){let t=Hs(e)?nc(e):e;return Xs(t.transform)||Xs(t.translate)||Xs(t.scale)||Xs(t.rotate)||Xs(t.perspective)||!ec()&&(Xs(t.backdropFilter)||Xs(t.filter))||Js.test(t.willChange||``)||Ys.test(t.contain||``)}function $s(e){let t=ic(e);for(;Us(t)&&!tc(t);){if(Qs(t))return t;if(qs(t))return null;t=ic(t)}return null}function ec(){return Zs??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Zs}function tc(e){return/^(html|body|#document)$/.test(Rs(e))}function nc(e){return zs(e).getComputedStyle(e)}function rc(e){return Hs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ic(e){if(Rs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ws(e)&&e.host||Bs(e);return Ws(t)?t.host:t}function ac(e){let t=ic(e);return tc(t)?(e.ownerDocument||e).body:Us(t)&&Gs(t)?t:ac(t)}function oc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ac(e),i=r===e.ownerDocument?.body,a=zs(r);if(i){let e=sc(a);return t.concat(a,a.visualViewport||[],Gs(r)?r:[],e&&n?oc(e):[])}return t.concat(r,oc(r,[],n))}function sc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cc(e){let t=nc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Us(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Zo(n)!==a||Zo(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function lc(e){return Hs(e)?e:e.contextElement}function uc(e){let t=lc(e);if(!Us(t))return $o(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=cc(t),o=(a?Zo(n.width):n.width)/r,s=(a?Zo(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var dc=$o(0);function fc(e){let t=zs(e);return!ec()||!t.visualViewport?dc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===zs(e)}function mc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=lc(e),o=$o(1);t&&(r?Hs(r)&&(o=uc(r)):o=uc(e));let s=pc(a,n,r)?fc(a):$o(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=zs(a),t=Hs(r)?zs(r):r,n=e,i=sc(n);for(;i&&t!==n;){let e=uc(i),t=i.getBoundingClientRect(),r=nc(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=zs(i),i=sc(n)}}return xs({width:u,height:d,x:c,y:l})}function hc(e,t){let n=rc(e).scrollLeft;return t?t.left+n:mc(Bs(e)).left+n}function gc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-hc(e,n),y:n.top+t.scrollTop}}function _c(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Bs(r),s=t?qs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=$o(1),u=$o(0),d=Us(r);if((d||!a)&&((Rs(r)!==`body`||Gs(o))&&(c=rc(r)),d)){let e=mc(r);l=uc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?gc(o,c):$o(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 vc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function yc(e){let t=rc(e),n=e.ownerDocument.body,r=Xo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Xo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+hc(e),o=-t.scrollTop;return nc(n).direction===`rtl`&&(a+=Xo(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var bc=25;function xc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=zs(e),a=Bs(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ec()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(hc(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=bc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Sc(e,t){let n=mc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=uc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Cc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=xc(e,n,t);else if(t===`document`)r=yc(Bs(e));else if(Hs(t))r=Sc(t,n);else{let n=fc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return xs(r)}function wc(e,t){let n=t.get(e);if(n)return n;let r=oc(e,[],!1).filter(e=>Hs(e)&&Rs(e)!==`body`),i=null,a=nc(e).position===`fixed`,o=a?ic(e):e;for(;Hs(o)&&!tc(o);){let e=nc(o),t=Qs(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ic(o)}return t.set(e,r),r}function Tc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?qs(t)?[]:wc(t,this._c):[].concat(n),r],o=Cc(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=Cc(t,a[e],i);s=Xo(n.top,s),c=Yo(n.right,c),l=Yo(n.bottom,l),u=Xo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ec(e){let{width:t,height:n}=cc(e);return{width:t,height:n}}function Dc(e,t,n){let r=Us(t),i=Bs(t),a=n===`fixed`,o=mc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=$o(0);if((r||!a)&&((Rs(t)!==`body`||Gs(i))&&(s=rc(t)),r)){let e=mc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=hc(i));let l=i&&!r&&!a?gc(i,s):$o(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Oc(e){return nc(e).position===`static`}function kc(e,t){if(!Us(e)||nc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Bs(e)===n&&(n=n.ownerDocument.body),n}function Ac(e,t){let n=zs(e);if(qs(e))return n;if(!Us(e)){let t=ic(e);for(;t&&!tc(t);){if(Hs(t)&&!Oc(t))return t;t=ic(t)}return n}let r=kc(e,t);for(;r&&Ks(r)&&Oc(r);)r=kc(r,t);return r&&tc(r)&&Oc(r)&&!Qs(r)?n:r||$s(e)||n}var jc=async function(e){let t=this.getOffsetParent||Ac,n=this.getDimensions,r=await n(e.floating);return{reference:Dc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mc(e){return nc(e).direction===`rtl`}var Nc={convertOffsetParentRelativeRectToViewportRelativeRect:_c,getDocumentElement:Bs,getClippingRect:Tc,getOffsetParent:Ac,getElementRects:jc,getClientRects:vc,getDimensions:Ec,getScale:uc,isElement:Hs,isRTL:Mc};function Pc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fc(e,t,n){let r=null,i,a=Bs(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Qo(d),h=Qo(a.clientWidth-(u+f)),g=Qo(a.clientHeight-(d+p)),_=Qo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Xo(0,Yo(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Pc(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=zs(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ic(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=lc(e),u=i||a?[...l?oc(l):[],...t?oc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?mc(e):null;c&&g();function g(){let t=mc(e);h&&!Pc(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 Lc=Ns,Rc=Ps,zc=Ds,Bc=Is,Vc=As,Hc=Es,Uc=Fs,Wc=(e,t,n)=>{let r=new Map,i=n??{},a={...Nc,...i.platform,_c:r};return Ts(e,t,{...i,platform:a})},Gc=typeof document<`u`?o.useLayoutEffect:function(){};function Kc(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(!Kc(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)&&!Kc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function qc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jc(e,t){let n=qc(e);return Math.round(t*n)/n}function Yc(e){let t=o.useRef(e);return Gc(()=>{t.current=e}),t}function Xc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=o.useState(r);Kc(m,r)||h(r);let[g,_]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=o.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=c||v,w=o.useRef(null),T=o.useRef(null),E=o.useRef(f),D=u!=null,O=Yc(u),k=Yc(i),A=Yc(d),j=o.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),Wc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Kc(E.current,t)&&(E.current=t,s.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);Gc(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=o.useRef(!1);Gc(()=>(M.current=!0,()=>{M.current=!1}),[]),Gc(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=o.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=o.useMemo(()=>({reference:S,floating:C}),[S,C]),F=o.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Jc(P.floating,f.x),r=Jc(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...qc(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,l,P.floating,f.x,f.y]);return o.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var Zc=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?{}:Hc({element:r.current,padding:i}).fn(n):r?Hc({element:r,padding:i}).fn(n):{}}}},Qc=(e,t)=>{let n=Lc(e);return{name:n.name,fn:n.fn,options:[e,t]}},$c=(e,t)=>{let n=Rc(e);return{name:n.name,fn:n.fn,options:[e,t]}},el=(e,t)=>({fn:Uc(e).fn,options:[e,t]}),tl=(e,t)=>{let n=zc(e);return{name:n.name,fn:n.fn,options:[e,t]}},nl=(e,t)=>{let n=Bc(e);return{name:n.name,fn:n.fn,options:[e,t]}},rl=(e,t)=>{let n=Vc(e);return{name:n.name,fn:n.fn,options:[e,t]}},il=(e,t)=>{let n=Zc(e);return{name:n.name,fn:n.fn,options:[e,t]}},al=Object.defineProperty,ol=o.forwardRef(((e,t)=>al(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,q.jsx)(J.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,q.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),sl=Object.defineProperty,cl=(e,t)=>sl(e,`name`,{value:t,configurable:!0}),ll={Partial:`partial`,Always:`always`},ul={Optimized:`optimized`,Always:`always`},dl=`Popper`,[fl,pl]=En(dl),[ml,hl]=fl(dl),gl=cl(e=>{let{__scopePopper:t,children:n}=e,[r,i]=o.useState(null),[a,s]=o.useState(void 0);return(0,q.jsx)(ml,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:s,children:n})},`Popper`),_l=`PopperAnchor`,vl=o.forwardRef(cl(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=hl(_l,n),s=o.useRef(null),c=a.onAnchorChange,l=Jt(t,o.useCallback(e=>{s.current=e,e&&c(e)},[c])),u=o.useRef(null);o.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=a.placementState&&Ol(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,q.jsx)(J.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),yl=`PopperContent`,[bl,xl]=fl(yl),Sl=o.forwardRef(cl(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=ll.Partial,hideWhenDetached:p=!1,updatePositionStrategy:m=ul.Optimized,onPlaced:h,...g}=e,_=hl(yl,n),[v,y]=o.useState(null),b=Jt(t,y),[x,S]=o.useState(null),C=qo(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(u)?u:[u],k=O.length>0,A={padding:D,boundary:O.filter(El),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Xc({strategy:`fixed`,placement:E,whileElementsMounted:cl((...e)=>Ic(...e,{animationFrame:m===ul.Always}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Qc({mainAxis:i+T,alignmentAxis:s}),l&&$c({mainAxis:!0,crossAxis:!1,...f===ll.Partial?{limiter:el()}:{},...A}),l&&tl({...A}),nl({...A,apply:cl(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&il({element:x,padding:c}),Dl({arrowWidth:w,arrowHeight:T}),p&&rl(k?{strategy:`referenceHidden`,...A}:{strategy:`referenceHidden`,padding:A.padding,altBoundary:A.altBoundary})]}),I=_.setPlacementState;On(()=>(I(N),()=>{I(void 0)}),[N,I]);let[ee,L]=Ol(N),te=Gr(h);On(()=>{P&&te?.()},[P,te]);let ne=F.arrow?.x,re=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[R,z]=o.useState();return On(()=>{v&&z(window.getComputedStyle(v).zIndex)},[v]),(0,q.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:R,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,q.jsx)(bl,{scope:n,placedSide:ee,placedAlign:L,onArrowChange:S,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,q.jsx)(J.div,{"data-side":ee,"data-align":L,...g,ref:b,style:{...g.style,animation:P?g.style?.animation:`none`}})})})},`PopperContent`)),Cl=`PopperArrow`,wl={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Tl=o.forwardRef(cl(function(e,t){let{__scopePopper:n,...r}=e,i=xl(Cl,n),a=wl[i.placedSide];return(0,q.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,q.jsx)(ol,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function El(e){return e!==null}cl(El,`isNotNull`);var Dl=cl(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]=Ol(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Ol(e){let[t,n=`center`]=e.split(`-`);return[t,n]}cl(Ol,`getSideAndAlignFromPlacement`);var kl=Object.defineProperty,Al=(e,t)=>kl(e,`name`,{value:t,configurable:!0}),jl=!1;function Ml(){let[e,t]=o.useState(jl);return o.useEffect(()=>{jl||(jl=!0,t(!0))},[]),e}Al(Ml,`useIsHydrated`);var Nl=o.useSyncExternalStore;function Pl(){return()=>{}}Al(Pl,`subscribe`);function Fl(){return Nl(Pl,()=>!0,()=>!1)}Al(Fl,`useIsHydratedModern`);var Il=typeof Nl==`function`?Fl:Ml,Ll=Object.defineProperty,Rl=(e,t)=>Ll(e,`name`,{value:t,configurable:!0}),zl=`rovingFocusGroup.onEntryFocus`,Bl={bubbles:!1,cancelable:!0},Vl=`RovingFocusGroup`,[Hl,Ul,Wl]=jn(Vl),[Gl,Kl]=En(Vl,[Wl]),ql={Vertical:`vertical`,Horizontal:`horizontal`},Jl={LTR:`ltr`,RTL:`rtl`},[Yl,Xl]=Gl(Vl),Zl=o.forwardRef(Rl(function(e,t){return(0,q.jsx)(Hl.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,q.jsx)(Hl.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,q.jsx)(Ql,{...e,ref:t})})})},`RovingFocusGroup`)),Ql=o.forwardRef(Rl(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=o.useRef(null),m=Jt(t,p),h=Vr(a),[g,_]=ir({prop:s,defaultProp:c??null,onChange:l,caller:Vl}),[v,y]=o.useState(!1),b=Gr(u),x=Ul(n),S=o.useRef(!1),[C,w]=o.useState(0);return o.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(zl,b),()=>e.removeEventListener(zl,b)},[b]),(0,q.jsx)(Yl,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:o.useCallback(e=>_(e),[_]),onItemShiftTab:o.useCallback(()=>y(!0),[]),onFocusableItemAdd:o.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:o.useCallback(()=>w(e=>e-1),[]),children:(0,q.jsx)(J.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:`none`,...e.style},onMouseDown:Y(e.onMouseDown,()=>{S.current=!0}),onFocus:Y(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(zl,Bl);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);iu([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}S.current=!1}),onBlur:Y(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),$l=`RovingFocusGroupItem`,eu=o.forwardRef(Rl(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:s,...c}=e,l=Sr(),u=a||l,d=Xl($l,n),f=d.currentTabStopId===u,p=Ul(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=d,_=Il();return On(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),o.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,q.jsx)(Hl.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,q.jsx)(J.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:Y(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:Y(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ru(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().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=d.loop?au(n,r+1):n.slice(r+1)}setTimeout(()=>iu(n))}}),children:typeof s==`function`?s({isCurrentTabStop:f,hasTabStop:g!=null}):s})})},`RovingFocusGroupItem`)),tu={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function nu(e,t){return t===Jl.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Rl(nu,`getDirectionAwareKey`);function ru(e,t,n){let r=nu(e.key,n);if(!(t===ql.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===ql.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return tu[r]}Rl(ru,`getFocusIntent`);function iu(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Rl(iu,`focusFirst`);function au(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Rl(au,`wrapArray`);var ou=Object.defineProperty,su=o.forwardRef(((e,t)=>ou(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,q.jsx)(J.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),cu=Object.defineProperty,lu=(e,t)=>cu(e,`name`,{value:t,configurable:!0}),uu={Horizontal:`horizontal`,Vertical:`vertical`},du=uu.Horizontal,fu=Object.values(uu),pu=o.forwardRef(lu(function(e,t){let{decorative:n,orientation:r=du,...i}=e,a=mu(r)?r:du,o=a===uu.Vertical?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,q.jsx)(J.div,{"data-orientation":a,...s,...i,ref:t})},`Separator`));function mu(e){return fu.includes(e)}lu(mu,`isValidOrientation`);var hu=Object.defineProperty,gu=(e,t)=>hu(e,`name`,{value:t,configurable:!0}),_u={Automatic:`automatic`,Manual:`manual`},vu=`Tabs`,[yu,bu]=En(vu,[Kl]),xu=Kl(),[Su,Cu]=yu(vu),wu=o.forwardRef(gu(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=_u.Automatic,...l}=e,u=Vr(s),[d,f]=ir({prop:r,onChange:i,defaultProp:a??``,caller:vu});return(0,q.jsx)(Su,{scope:n,baseId:Sr(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,q.jsx)(J.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Tu=`TabsList`,Eu=o.forwardRef(gu(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Cu(Tu,n),o=xu(n);return(0,q.jsx)(Zl,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,q.jsx)(J.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Du=`TabsTrigger`,Ou=o.forwardRef(gu(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Cu(Du,n),s=xu(n),c=ju(o.baseId,r),l=Mu(o.baseId,r),u=r===o.value;return(0,q.jsx)(eu,{asChild:!0,...s,focusable:!i,active:u,children:(0,q.jsx)(J.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:Y(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:Y(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Y(e.onFocus,()=>{let e=o.activationMode!==_u.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),ku=`TabsContent`,Au=o.forwardRef(gu(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=e,c=Cu(ku,n),l=ju(c.baseId,r),u=Mu(c.baseId,r),d=r===c.value,f=o.useRef(d);return o.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,q.jsx)(fr,{present:i||d,children:({present:n})=>(0,q.jsx)(J.div,{"data-state":d?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function ju(e,t){return`${e}-trigger-${t}`}gu(ju,`makeTriggerId`);function Mu(e,t){return`${e}-content-${t}`}gu(Mu,`makeContentId`);var Nu=Object.defineProperty,Pu=(e,t)=>Nu(e,`name`,{value:t,configurable:!0}),Fu=`Toggle`,Iu=o.forwardRef(Pu(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=ir({prop:n,onChange:i,defaultProp:r??!1,caller:Fu});return(0,q.jsx)(J.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:Y(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Lu=Object.defineProperty,Ru=(e,t)=>Lu(e,`name`,{value:t,configurable:!0}),[zu,Bu]=En(`Tooltip`,[pl]),Vu=pl(),Hu=`TooltipProvider`,Uu=700,Wu=`tooltip.open`,[Gu,Ku]=zu(Hu),qu=Ru(e=>{let{__scopeTooltip:t,delayDuration:n=Uu,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,s=o.useRef(!0),c=o.useRef(!1),l=o.useRef(0);return o.useEffect(()=>{let e=l.current;return()=>window.clearTimeout(e)},[]),(0,q.jsx)(Gu,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:o.useCallback(()=>{r<=0||(window.clearTimeout(l.current),s.current=!1)},[r]),onClose:o.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r))},[r]),isPointerInTransitRef:c,onPointerInTransitChange:o.useCallback(e=>{c.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Ju=`Tooltip`,[Yu,Xu]=zu(Ju),Zu=Ru(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,l=Ku(Ju,e.__scopeTooltip),u=Vu(t),[d,f]=o.useState(null),[p,m]=o.useState(void 0),h=Sr(),g=o.useRef(0),_=s??l.disableHoverableContent,v=c??l.delayDuration,y=o.useRef(!1),[b,x]=ir({prop:r,defaultProp:i??!1,onChange:Ru(e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(Wu))):l.onClose(),a?.(e)},`onChange`),caller:Ju}),S=o.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=o.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=o.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=o.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);o.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=p??h;return(0,q.jsx)(gl,{...u,children:(0,q.jsx)(Yu,{scope:t,contentId:E,setContentId:m,open:b,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:o.useCallback(()=>{l.isOpenDelayedRef.current?T():C()},[l.isOpenDelayedRef,T,C]),onTriggerLeave:o.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),Qu=`TooltipTrigger`,$u=o.forwardRef(Ru(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=Xu(Qu,n),s=Ku(Qu,n),c=Vu(n),l=Jt(t,o.useRef(null),a.onTriggerChange),u=o.useRef(!1),d=o.useRef(!1),f=o.useCallback(()=>u.current=!1,[]);return o.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,q.jsx)(vl,{asChild:!0,...c,children:(0,q.jsx)(J.button,{"aria-describedby":a.open?gd(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:l,onPointerMove:Y(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:Y(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:Y(e.onBlur,a.onClose),onClick:Y(e.onClick,a.onClose)})})},`TooltipTrigger`)),ed=`TooltipPortal`,[td,nd]=zu(ed,{forceMount:void 0}),rd=Ru(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Xu(ed,t);return(0,q.jsx)(td,{scope:t,forceMount:n,children:(0,q.jsx)(fr,{present:n||a.open,children:(0,q.jsx)(Oi,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),id=`TooltipContent`,ad=o.forwardRef(Ru(function(e,t){let n=nd(id,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Xu(id,e.__scopeTooltip);return(0,q.jsx)(fr,{present:r||o.open,children:o.disableHoverableContent?(0,q.jsx)(cd,{side:i,...a,ref:t}):(0,q.jsx)(od,{side:i,...a,ref:t})})},`TooltipContent`)),od=o.forwardRef(Ru(function(e,t){let n=Xu(id,e.__scopeTooltip),r=Ku(id,e.__scopeTooltip),i=o.useRef(null),a=Jt(t,i),[s,c]=o.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=o.useCallback(()=>{c(null),f(!1)},[f]),m=o.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=dd(r,ud(r,n.getBoundingClientRect())),a=fd(t.getBoundingClientRect()),o=md([...i,...a]);c(o),f(!0)},[f]);return o.useEffect(()=>()=>p(),[p]),o.useEffect(()=>{if(l&&d){let e=Ru(e=>m(e,d),`handleTriggerLeave`),t=Ru(e=>m(e,l),`handleContentLeave`);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),o.useEffect(()=>{if(s){let e=Ru(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!pd(n,s);r?p():i&&(p(),u())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,s,u,p]),(0,q.jsx)(cd,{...e,ref:a})},`TooltipContentHoverable`)),sd=en(`TooltipContent`),cd=o.forwardRef(Ru(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=Xu(id,n),d=Vu(n),{onClose:f}=u,[p,m]=o.useState(null),h=Jt(t,m);hi(p),o.useEffect(()=>(document.addEventListener(Wu,f),()=>document.removeEventListener(Wu,f)),[f]),o.useEffect(()=>{if(u.trigger){let e=Ru(e=>{e.target instanceof Node&&e.target.contains(u.trigger)&&f()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[u.trigger,f]);let{setContentId:g}=u;return On(()=>(g(a),()=>{g(void 0)}),[a,g]),(0,q.jsx)($r,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,q.jsxs)(Sl,{"data-state":u.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:u.contentId,...d,...l,ref:h,style:{...l.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,q.jsx)(sd,{children:r}),i?(0,q.jsx)(Sn,{id:u.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),ld=o.forwardRef(Ru(function(e,t){let{__scopeTooltip:n,...r}=e,i=Vu(n);return(0,q.jsx)(Tl,{...i,...r,ref:t})},`TooltipArrow`));function ud(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`)}}Ru(ud,`getExitSideFromRect`);function dd(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})}return r}Ru(dd,`getPaddedExitPoints`);function fd(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}]}Ru(fd,`getPointsFromRect`);function pd(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}Ru(pd,`isPointInPolygon`);function md(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)),hd(t)}Ru(md,`getHull`);function hd(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)}Ru(hd,`getHullPresorted`);function gd(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ru(gd,`concatAriaDescribedby`);function _d(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=_d(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function vd(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_d(e))&&(r&&(r+=` `),r+=t);return r}var yd=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,bd=vd,xd=(e,t)=>n=>{if(t?.variants==null)return bd(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=yd(t)||yd(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 bd(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)},Sd=xd(`group/button inline-flex shrink-0 items-center justify-center rounded-2xl 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/30 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:bg-transparent dark:hover:bg-input/30`,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-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5`,xs:`h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,lg:`h-9 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Cd({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?Qt:`button`;return(0,q.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:K(Sd({variant:t,size:n,className:e})),...i})}var wd={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`},Td=(0,o.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n,absoluteStrokeWidth:r=!1,className:i=``,altIcon:a,showAlt:s=!1,icon:c,primaryColor:l,secondaryColor:u,disableSecondaryOpacity:d=!1,...f},p)=>{let m=n===void 0?void 0:r?Number(n)*24/Number(t):n,h=m===void 0?{}:{strokeWidth:m,stroke:`currentColor`},g={ref:p,...wd,width:t,height:t,color:l||e,className:i,...h,...f},_=[...s&&a?a:c].sort(([,e],[,t])=>{let n=e.opacity!==void 0;return t.opacity===void 0?n?-1:0:1}).map(([t,n])=>{let r=n.opacity!==void 0,i=r&&!d?n.opacity:void 0,a=u?{...n.stroke===void 0?{fill:r?u:l||e}:{stroke:r?u:l||e}}:{};return(0,o.createElement)(t,{...n,...h,...a,opacity:i,key:n.key})});return(0,o.createElement)(`svg`,g,_)});Td.displayName=`HugeiconsIcon`;var Ed=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 8V12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Dd=[[`path`,{d:`M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Od=[[`path`,{d:`M12 18.502V5.00195`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 13.002C18 13.002 13.5811 19.0019 12 19.002C10.4188 19.002 6 13.002 6 13.002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],kd=[[`path`,{d:`M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Ad=[[`path`,{d:`M12 5.5V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 11C18 11 13.5811 5.00001 12 5C10.4188 4.99999 6 11 6 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],jd=[[`path`,{d:`M9 6.65032C9 6.65032 15.9383 6.10759 16.9154 7.08463C17.8924 8.06167 17.3496 15 17.3496 15M16.5 7.5L6.5 17.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Md=[[`path`,{d:`M15.6 8.40033V12.9003C15.6 14.3915 16.8088 15.6003 18.3 15.6003C19.7912 15.6003 21 14.3915 21 12.9003V12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C14.0265 21 15.8965 20.3302 17.4009 19.2M15.6 12.0003C15.6 13.9886 13.9882 15.6003 12 15.6003C10.0118 15.6003 8.4 13.9886 8.4 12.0003C8.4 10.0121 10.0118 8.40033 12 8.40033C13.9882 8.40033 15.6 10.0121 15.6 12.0003Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}]],Nd=[[`path`,{d:`M4.22222 21.9948V18.4451C4.22222 17.1737 3.88927 16.5128 3.23482 15.4078C2.4503 14.0833 2 12.5375 2 10.8866C2 5.97866 5.97969 2 10.8889 2C15.7981 2 19.7778 5.97866 19.7778 10.8866C19.7778 11.4663 19.7778 11.7562 19.802 11.9187C19.8598 12.3072 20.0411 12.6414 20.2194 12.9873L22 16.4407L20.6006 17.1402C20.195 17.3429 19.9923 17.4443 19.851 17.6314C19.7097 17.8184 19.67 18.0296 19.5904 18.4519L19.5826 18.4931C19.4004 19.4606 19.1993 20.5286 18.6329 21.2024C18.4329 21.4403 18.1853 21.6336 17.9059 21.7699C17.4447 21.9948 16.8777 21.9948 15.7437 21.9948C15.219 21.9948 14.6928 22.0069 14.1682 21.9942C12.9247 21.9639 12 20.9184 12 19.7044`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14.388 10.5315C13.9617 10.5315 13.5729 10.3702 13.2784 10.1048M14.388 10.5315C14.388 11.6774 13.7241 12.7658 12.4461 12.7658C11.1681 12.7658 10.5043 13.8541 10.5043 15M14.388 10.5315C16.5373 10.5315 16.5373 7.18017 14.388 7.18017C14.1927 7.18017 14.0053 7.21403 13.8312 7.27624C13.9362 4.77819 10.3349 4.1 9.51923 6.44018M10.5043 8.29729C10.5043 7.52323 10.1133 6.8411 9.51923 6.44018M9.51923 6.44018C7.66742 5.19034 5.19883 7.4331 6.37324 9.43277C4.40226 9.72827 4.61299 12.7658 6.6205 12.7658C7.18344 12.7658 7.68111 12.4844 7.98234 12.0538`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Pd=[[`path`,{d:`M12 21.5C17.2467 21.5 21.5 17.2467 21.5 12C21.5 6.75329 17.2467 2.5 12 2.5C6.75329 2.5 2.5 6.75329 2.5 12C2.5 13.3377 2.66372 14.5604 3.1189 15.6954C3.81756 17.4374 3.68195 18.9241 2.5 20.5C3.86146 21.1644 5.86811 21.1419 7 20.0725C8.45323 20.9748 10.1636 21.5 12 21.5Z`,stroke:`currentColor`,strokeLinecap:`square`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12.2 12.0002H12M7.69961 11.9999H7.49961M16.6996 11.9999H16.4996M12.4 12.0002C12.4 12.2212 12.2209 12.4002 12 12.4002C11.7791 12.4002 11.6 12.2212 11.6 12.0002C11.6 11.7793 11.7791 11.6002 12 11.6002C12.2209 11.6002 12.4 11.7793 12.4 12.0002ZM7.89961 11.9999C7.89961 12.2208 7.72052 12.3999 7.49961 12.3999C7.2787 12.3999 7.09961 12.2208 7.09961 11.9999C7.09961 11.7789 7.2787 11.5999 7.49961 11.5999C7.72052 11.5999 7.89961 11.7789 7.89961 11.9999ZM16.8996 11.9999C16.8996 12.2208 16.7205 12.3999 16.4996 12.3999C16.2787 12.3999 16.0996 12.2208 16.0996 11.9999C16.0996 11.7789 16.2787 11.5999 16.4996 11.5999C16.7205 11.5999 16.8996 11.7789 16.8996 11.9999Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Fd=[[`path`,{d:`M18.9991 19L5 5.00098`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 5L5.00092 18.999`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Id=[[`path`,{d:`M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14.9994 15L12 12.0003M12 12.0003L9 9M12 12.0003L9.00064 15M12 12.0003L15 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Ld=[[`path`,{d:`M14 4H10C6.22876 4 4.34315 4 3.17157 5.17157C2 6.34315 2 8.22876 2 12C2 15.7712 2 17.6569 3.17157 18.8284C4.34315 20 6.22876 20 10 20H14C17.7712 20 19.6569 20 20.8284 18.8284C22 17.6569 22 15.7712 22 12C22 8.22876 22 6.34315 20.8284 5.17157C19.6569 4 17.7712 4 14 4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 9L8.83981 10.5858C9.61327 11.2525 10 11.5858 10 12C10 12.4142 9.61327 12.7475 8.83981 13.4142L7 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M13 16H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Rd=[[`path`,{d:`M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],zd=[[`path`,{d:`M8 7L16 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 11L12 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Bd=[[`path`,{d:`M13 20.8268V22H14.1734C14.5827 22 14.7874 22 14.9715 21.9238C15.1555 21.8475 15.3003 21.7028 15.5897 21.4134L20.4133 16.5894C20.6864 16.3164 20.8229 16.1799 20.8959 16.0327C21.0347 15.7525 21.0347 15.4236 20.8959 15.1434C20.8229 14.9961 20.6864 14.8596 20.4133 14.5866C20.1403 14.3136 20.0038 14.1771 19.8565 14.1041C19.5763 13.9653 19.2473 13.9653 18.9671 14.1041C18.8198 14.1771 18.6833 14.3136 18.4103 14.5866L18.4103 14.5866L13.5867 19.4106C13.2972 19.7 13.1525 19.8447 13.0762 20.0287C13 20.2128 13 20.4174 13 20.8268Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 11C19 11 19 9.4306 18.8478 9.06306C18.6955 8.69552 18.4065 8.40649 17.8284 7.82843L13.0919 3.09188C12.593 2.593 12.3436 2.34355 12.0345 2.19575C11.9702 2.165 11.9044 2.13772 11.8372 2.11401C11.5141 2 11.1614 2 10.4558 2C7.21082 2 5.58831 2 4.48933 2.88607C4.26731 3.06508 4.06508 3.26731 3.88607 3.48933C3 4.58831 3 6.21082 3 9.45584V14C3 17.7712 3 19.6569 4.17157 20.8284C5.23467 21.8915 6.8857 21.99 10 21.9991M12 2.5V3C12 5.82843 12 7.24264 12.8787 8.12132C13.7574 9 15.1716 9 18 9H18.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Vd=[[`path`,{d:`M14 21L18 3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6 21L10 3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5 8H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M3 16H19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Hd=[[`path`,{d:`M4 3H20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5.5 3V5.03039C5.5 6.27227 6.07682 7.4437 7.06116 8.20089L12 12L16.9388 8.20089C17.9232 7.44371 18.5 6.27227 18.5 5.03039V3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5.5 21V18.9696C5.5 17.7277 6.07682 16.5563 7.06116 15.7991L12 12L16.9388 15.7991C17.9232 16.5563 18.5 17.7277 18.5 18.9696V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M4 21H20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Ud=[[`path`,{d:`M7 2.5C5.59269 2.66536 4.62427 3.01488 3.89124 3.75363C2.5 5.15575 2.5 7.41242 2.5 11.9258C2.5 16.4391 2.5 18.6958 3.89124 20.0979C5.28249 21.5 7.52166 21.5 12 21.5C16.4783 21.5 18.7175 21.5 20.1088 20.0979C21.5 18.6958 21.5 16.4391 21.5 11.9258C21.5 7.41242 21.5 5.15575 20.1088 3.75363C19.3757 3.01488 18.4073 2.66536 17 2.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 8C9.99153 8.5057 11.2998 10.5 12 10.5M14.5 8C14.0085 8.5057 12.7002 10.5 12 10.5M12 10.5V2.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21.5 13.5H16.5743C15.7322 13.5 15.0706 14.2036 14.6995 14.9472C14.2963 15.7551 13.4889 16.5 12 16.5C10.5111 16.5 9.70373 15.7551 9.30054 14.9472C8.92942 14.2036 8.26777 13.5 7.42566 13.5H2.5`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Wd=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 16V12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12.125 8.25H12M12.25 8.25C12.25 8.11193 12.1381 8 12 8C11.8619 8 11.75 8.11193 11.75 8.25C11.75 8.38807 11.8619 8.5 12 8.5C12.1381 8.5 12.25 8.38807 12.25 8.25Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Gd=[[`path`,{d:`M12 3V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 18V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21 12L18 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6 12L3 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M18.3635 5.63672L16.2422 7.75804`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M7.75804 16.2422L5.63672 18.3635`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M18.3635 18.3635L16.2422 16.2422`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M7.75804 7.75804L5.63672 5.63672`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`7`}]],Kd=[[`path`,{d:`M21.9598 12.9919C21.6856 17.2342 18.3536 20.6134 14.1706 20.8915C13.4574 20.9389 12.7285 21.001 12 21.001C10.4054 21.001 8.95127 20.8637 7.44544 20.2902C7.44544 20.2902 5.56108 21.7589 3.69962 21.4587C3.31009 21.3959 3.11532 21.3644 3.00091 21.1343C2.8865 20.9042 3.00788 20.6756 3.25063 20.2185C3.65964 19.4483 3.92248 18.6737 3.80076 17.8306C3.73703 17.3892 3.50433 16.9974 3.27644 16.6136L3.26529 16.5948C2.62637 15.5188 2.12462 14.2975 2.04024 12.9919C1.98659 12.1617 1.98659 11.3019 2.04024 10.4717C2.31441 6.22935 5.64639 2.85011 9.8294 2.57205C11.2536 2.47738 12.7435 2.47719 14.1706 2.57205C18.3536 2.85011 21.6856 6.22935 21.9598 10.4717C22.0134 11.3019 22.0134 12.1617 21.9598 12.9919Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8.75 14.501H15.25M8.75 9.50098H12.25`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],qd=[[`path`,{d:`M21.5 14.0784C20.3003 14.7189 18.9301 15.0821 17.4751 15.0821C12.7491 15.0821 8.91792 11.2509 8.91792 6.52485C8.91792 5.06986 9.28105 3.69968 9.92163 2.5C5.66765 3.49698 2.5 7.31513 2.5 11.8731C2.5 17.1899 6.8101 21.5 12.1269 21.5C16.6849 21.5 20.503 18.3324 21.5 14.0784Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Jd=[[`path`,{d:`M15.5 18C15.5 19.933 13.933 21.5 12 21.5C10.067 21.5 8.5 19.933 8.5 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 2L22 22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21 16.2311C21 15.762 20.8136 15.3121 20.4819 14.9803L19.8787 14.3771C19.3161 13.8145 19 13.0514 19 12.2558V9.5C19 5.634 15.866 2.5 12 2.5C10.4497 2.5 9.01706 3.00399 7.85707 3.85707M4.76887 18C3.79195 18 3 17.208 3 16.2311C3 15.762 3.18636 15.3121 3.51809 14.9803L4.12132 14.3771C4.68393 13.8145 5 13.0514 5 12.2558V9.5C5 8.20839 5.34981 6.99849 5.95987 5.95987L18 18H4.76887Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Yd=[[`path`,{d:`M21.0477 3.05293C18.8697 0.707363 2.48648 6.4532 2.50001 8.551C2.51535 10.9299 8.89809 11.6617 10.6672 12.1581C11.7311 12.4565 12.016 12.7625 12.2613 13.8781C13.3723 18.9305 13.9301 21.4435 15.2014 21.4996C17.2278 21.5892 23.1733 5.342 21.0477 3.05293Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M11.4999 12.5L14.9999 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Xd=[[`path`,{d:`M2 12C2 8.31087 2 6.4663 2.81382 5.15877C3.1149 4.67502 3.48891 4.25427 3.91891 3.91554C5.08116 3 6.72077 3 10 3H14C17.2792 3 18.9188 3 20.0811 3.91554C20.5111 4.25427 20.8851 4.67502 21.1862 5.15877C22 6.4663 22 8.31087 22 12C22 15.6891 22 17.5337 21.1862 18.8412C20.8851 19.325 20.5111 19.7457 20.0811 20.0845C18.9188 21 17.2792 21 14 21H10C6.72077 21 5.08116 21 3.91891 20.0845C3.48891 19.7457 3.1149 19.325 2.81382 18.8412C2 17.5337 2 15.6891 2 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 3L9.5 21`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5 7H6M5 10H6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Zd=[[`path`,{d:`M2 12C2 8.3109 2 6.46633 2.81382 5.1588C3.1149 4.67505 3.48891 4.2543 3.91891 3.91557C5.08116 3.00003 6.72077 3.00003 10 3.00003H14C17.2792 3.00003 18.9188 3.00003 20.0811 3.91557C20.5111 4.2543 20.8851 4.67505 21.1862 5.1588C22 6.46633 22 8.3109 22 12C22 15.6892 22 17.5337 21.1862 18.8413C20.8851 19.325 20.5111 19.7458 20.0811 20.0845C18.9188 21 17.2792 21 14 21H10C6.72077 21 5.08116 21 3.91891 20.0845C3.48891 19.7458 3.1149 19.325 2.81382 18.8413C2 17.5337 2 15.6892 2 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14.5 3.00003L14.5 21`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M18 7.00006H19M18 10.0001H19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Qd=[[`path`,{d:`M12 14.5V17.5M13 14.5C13 15.0523 12.5523 15.5 12 15.5C11.4477 15.5 11 15.0523 11 14.5C11 13.9477 11.4477 13.5 12 13.5C12.5523 13.5 13 13.9477 13 14.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16.5 9V6.5C16.5 4.01472 14.4853 2 12 2C9.51471 2 7.49999 4.01472 7.49999 6.5V9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M4.2678 18.8447C4.49268 20.515 5.87612 21.8235 7.55965 21.9009C8.97627 21.966 10.4153 22 12 22C13.5847 22 15.0237 21.966 16.4403 21.9009C18.1239 21.8235 19.5073 20.515 19.7322 18.8447C19.8789 17.7547 20 16.6376 20 15.5C20 14.3624 19.8789 13.2453 19.7322 12.1553C19.5073 10.485 18.1239 9.17649 16.4403 9.09909C15.0237 9.03397 13.5847 9 12 9C10.4153 9 8.97627 9.03397 7.55965 9.09909C5.87612 9.17649 4.49268 10.485 4.2678 12.1553C4.12104 13.2453 3.99999 14.3624 3.99999 15.5C3.99999 16.6376 4.12104 17.7547 4.2678 18.8447Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],$d=[[`path`,{d:`M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14 2.20004C13.3538 2.06886 12.6849 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 11.3151 21.9311 10.6462 21.8 10`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12.0303 11.9625L16.5832 7.4096M19.7404 4.34462L19.1872 2.35748C19.0853 2.03011 18.6914 1.89965 18.4259 2.11662C16.9898 3.29018 15.4254 4.87091 16.703 7.36419C19.2771 8.56455 20.7466 6.94584 21.8733 5.5853C22.0975 5.3146 21.9623 4.90767 21.6247 4.81005L19.7404 4.34462Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],ef=[[`path`,{d:`M5 14L8.5 17.5L19 6.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],tf=[[`path`,{d:`M2.25 12C2.25 17.5228 6.72715 22 12.25 22C17.7728 22 22.25 17.5228 22.25 12C22.25 6.47715 17.7728 2 12.25 2C6.72715 2 2.25 6.47715 2.25 12Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5.25 5L19.25 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],nf=[[`path`,{d:`M18.4995 20.5C18.2663 17.5685 15.8417 15.2477 12.808 15.0521L11.9995 15C11.7107 15.0076 11.4416 15.0178 11.1877 15.0298C8.18075 15.1723 5.7304 17.5974 5.49951 20.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15.2495 9.25C15.2495 11.0449 13.7944 12.5 11.9995 12.5C10.2046 12.5 8.74952 11.0449 8.74952 9.25C8.74952 7.45507 10.2046 6 11.9995 6C13.7944 6 15.2495 7.45507 15.2495 9.25Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5.50249 8.5C5.17908 7.99485 4.99158 7.39432 4.99158 6.75C4.99158 4.95507 6.44665 3.5 8.24157 3.5C8.68752 3.5 9.1125 3.58982 9.49939 3.75235`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M18.4963 8.5C18.8197 7.99485 19.0072 7.39432 19.0072 6.75C19.0072 4.95507 17.5521 3.5 15.7572 3.5C15.3113 3.5 14.8863 3.58982 14.4994 3.75235`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M22.0007 17.9996C21.8208 15.7374 19.9995 13.5 17.9995 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M1.99927 17.9996C2.17923 15.7374 4.00049 13.5 6.00049 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],rf=[[`path`,{d:`M3.74416 16.1113L8.66248 12.5982C9.18807 12.2228 9.5 11.6167 9.5 10.9708V7.5C9.5 4.73858 11.7386 2.5 14.5 2.5H18L14.9811 6.81268C14.7029 7.2102 14.7501 7.75013 15.0932 8.09325L15.9068 8.90675C16.2499 9.24987 16.7898 9.29714 17.1873 9.01888L21.5 6V9.5C21.5 12.2614 19.2614 14.5 16.5 14.5H13.0292C12.3833 14.5 11.7772 14.8119 11.4018 15.3375L7.88869 20.2558C7.33099 21.0366 6.43055 21.5 5.47105 21.5C3.83018 21.5 2.5 20.1698 2.5 18.529C2.5 17.5695 2.96338 16.669 3.74416 16.1113Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]];function af({...e}){return(0,q.jsx)(oo,{"data-slot":`sheet`,...e})}function of({...e}){return(0,q.jsx)(po,{"data-slot":`sheet-portal`,...e})}function sf({className:e,...t}){return(0,q.jsx)(ho,{"data-slot":`sheet-overlay`,className:K(`fixed inset-0 z-50 bg-black/30 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function cf({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,q.jsxs)(of,{children:[(0,q.jsx)(sf,{}),(0,q.jsxs)(yo,{"data-slot":`sheet-content`,"data-side":n,className:K(`fixed z-50 flex flex-col bg-popover bg-clip-padding text-sm text-popover-foreground shadow-xl 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,q.jsx)(Eo,{"data-slot":`sheet-close`,asChild:!0,children:(0,q.jsxs)(Cd,{variant:`ghost`,className:`absolute top-4 right-4 bg-secondary`,size:`icon-sm`,children:[(0,q.jsx)(Td,{icon:Fd,strokeWidth:2}),(0,q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function lf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sheet-header`,className:K(`flex flex-col gap-1.5 p-6`,e),...t})}function uf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sheet-footer`,className:K(`mt-auto flex flex-col gap-2 p-6`,e),...t})}function df({className:e,...t}){return(0,q.jsx)(Co,{"data-slot":`sheet-title`,className:K(`text-base font-medium text-foreground`,e),...t})}function ff({className:e,...t}){return(0,q.jsx)(wo,{"data-slot":`sheet-description`,className:K(`text-sm text-muted-foreground`,e),...t})}var pf=768;function mf(){let[e,t]=o.useState(void 0);return o.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<pf)};return e.addEventListener(`change`,n),t(window.innerWidth<pf),()=>e.removeEventListener(`change`,n)},[]),!!e}function hf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`skeleton`,className:K(`animate-pulse rounded-2xl bg-muted`,e),...t})}function gf({delayDuration:e=0,...t}){return(0,q.jsx)(qu,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function _f({...e}){return(0,q.jsx)(Zu,{"data-slot":`tooltip`,...e})}function vf({...e}){return(0,q.jsx)($u,{"data-slot":`tooltip-trigger`,...e})}function yf({className:e,sideOffset:t=0,children:n,...r}){return(0,q.jsx)(rd,{children:(0,q.jsxs)(ad,{"data-slot":`tooltip-content`,sideOffset:t,className:K(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-xl 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-lg 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,q.jsx)(ld,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=left]:translate-x-[-1.5px] data-[side=right]:translate-x-[1.5px]`})]})})}var bf=`sidebar_state`,xf=604800,Sf=`16rem`,Cf=`18rem`,wf=`3rem`,Tf=`b`,Ef=o.createContext(null);function Df(){let e=o.useContext(Ef);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Of({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...s}){let c=mf(),[l,u]=o.useState(!1),[d,f]=o.useState(e),p=t??d,m=o.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`${bf}=${t}; path=/; max-age=${xf}`},[n,p]),h=o.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);o.useEffect(()=>{let e=e=>{e.key===Tf&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=o.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,u,h]);return(0,q.jsx)(Ef.Provider,{value:_,children:(0,q.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":Sf,"--sidebar-width-icon":wf,...i},className:K(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...s,children:a})})}function kf({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=Df();return n===`none`?(0,q.jsx)(`div`,{"data-slot":`sidebar`,className:K(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,q.jsx)(af,{open:l,onOpenChange:u,...o,children:(0,q.jsxs)(cf,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":Cf},side:e,children:[(0,q.jsxs)(lf,{className:`sr-only`,children:[(0,q.jsx)(df,{children:`Sidebar`}),(0,q.jsx)(ff,{children:`Displays the mobile sidebar.`})]}),(0,q.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,q.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,q.jsx)(`div`,{"data-slot":`sidebar-gap`,className:K(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,q.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:K(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,q.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-2xl group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function Af({className:e,onClick:t,...n}){let{toggleSidebar:r}=Df();return(0,q.jsxs)(Cd,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:K(e),onClick:e=>{t?.(e),r()},...n,children:[(0,q.jsx)(Td,{icon:Xd,strokeWidth:2}),(0,q.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function jf({className:e,...t}){return(0,q.jsx)(`main`,{"data-slot":`sidebar-inset`,className:K(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function Mf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:K(`flex flex-col gap-2 p-2 [--radius:var(--radius-xl)]`,e),...t})}function Nf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:K(`flex flex-col gap-2 p-2`,e),...t})}function Pf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:K(`no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto [--radius:var(--radius-xl)] group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function Ff({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:K(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function If({className:e,asChild:t=!1,...n}){let r=t?Qt:`div`;return(0,q.jsx)(r,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:K(`flex h-8 shrink-0 items-center rounded-xl px-3 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-3 [&>svg]:size-4 [&>svg]:shrink-0`,e),...n})}function Lf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:K(`w-full text-sm`,e),...t})}function Rf({className:e,...t}){return(0,q.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:K(`flex w-full min-w-0 flex-col gap-0.5`,e),...t})}function zf({className:e,...t}){return(0,q.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:K(`group/menu-item relative`,e),...t})}var Bf=xd(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-xl px-3 py-2 text-left text-sm whitespace-nowrap ring-sidebar-ring outline-hidden transition-[width,height,padding] duration-200 group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-3 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 has-[>svg:first-child]:pl-2.5 has-[>svg:last-child]:pr-2.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 px-3 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function Vf({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let s=e?Qt:`button`,{isMobile:c,state:l}=Df(),u=(0,q.jsx)(s,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:K(Bf({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:u}),(0,q.jsx)(yf,{side:`right`,align:`center`,hidden:l!==`collapsed`||c,...i})]})):u}function Hf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:K(`pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-xl px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground`,e),...t})}function Uf({className:e,showIcon:t=!1,...n}){let[r]=o.useState(()=>`${Math.floor(Math.random()*40)+50}%`);return(0,q.jsxs)(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:K(`flex h-8 items-center gap-2 rounded-xl px-2`,e),...n,children:[t&&(0,q.jsx)(hf,{className:`size-4 rounded-xl`,"data-sidebar":`menu-skeleton-icon`}),(0,q.jsx)(hf,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":r}})]})}var Wf=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),Gf=function(e){return`/`+e},Kf={},qf=function(e){return e.pathname.endsWith(`.css`)},Jf=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Yf=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Gf(t,n);let r=s(t),i=qf(r);return Jf(Kf,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Wf,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Xf=globalThis;Xf.window??=globalThis,Xf.Path2D??=class{},await Yf(()=>import(`./characters-BsW4RWhl.js`),[]);var Zf=Xf.window.CotalArt;function Qf(e,t){return Zf.body(e,t)}function $f(e){return Zf.mark(e)}function ep(e){return Zf.character({vendor:e,cx:70,cy:66,w:92,look:`right`,mood:`happy`,arms:[{from:[84,50],via:[106,40],to:[112,12],hand:`open`,deg:`auto`}],legs:[{from:[40,94],to:[36,116],dir:-1},{from:[62,94],to:[66,116],dir:1}]})}function tp(){let e=(0,o.useRef)(null);return{onOpenAutoFocus:()=>{e.current=globalThis.document.activeElement},onCloseAutoFocus:t=>{t.preventDefault(),e.current?.focus(),e.current=null}}}function X({icon:e,size:t=18,className:n,"data-icon":r}){return(0,q.jsx)(Td,{icon:e,size:t,strokeWidth:1.5,className:n,"data-icon":r,"aria-hidden":`true`})}var np=xd(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-2xl 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 rp({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?Qt:`span`;return(0,q.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:K(np({variant:t}),e),...r})}function ip({className:e,size:t=`default`,...n}){return(0,q.jsx)(Ro,{"data-slot":`avatar`,"data-size":t,className:K(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function ap({className:e,...t}){return(0,q.jsx)(Bo,{"data-slot":`avatar-fallback`,className:K(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}var op=xd(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function sp({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,q.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:K(op({variant:e}),n),...r})}function cp({asChild:e=!1,className:t,...n}){let r=e?Qt:`div`;return(0,q.jsx)(r,{"data-slot":`bubble-content`,className:K(`w-fit max-w-full min-w-0 overflow-hidden rounded-3xl border border-transparent px-3 py-2.5 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/30`,t),...n})}function lp({className:e,...t}){return(0,q.jsx)(su,{"data-slot":`label`,className:K(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var up=xd(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function dp({className:e,orientation:t=`vertical`,...n}){return(0,q.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:K(up({orientation:t}),e),...n})}function fp({className:e,...t}){return(0,q.jsx)(lp,{"data-slot":`field-label`,className:K(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:bg-input/30 has-[>[data-slot=field]]:rounded-2xl has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-input/40 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-4`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function pp({className:e,...t}){return(0,q.jsx)(`p`,{"data-slot":`field-description`,className:K(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function mp({className:e,children:t,errors:n,...r}){let i=(0,o.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,q.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,q.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,q.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:K(`text-sm font-normal text-destructive`,e),...r,children:i}):null}function hp({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className:K(`flex field-sizing-content min-h-16 w-full resize-none rounded-2xl border border-transparent bg-input/50 px-2.5 py-2 text-base transition-[color,box-shadow] duration-200 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function gp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:K(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-2xl border border-transparent bg-input/50 transition-[color,box-shadow] duration-200 outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var _p=xd(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-2xl **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1.5 [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function vp({className:e,align:t=`inline-start`,...n}){return(0,q.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:K(_p({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var yp=xd(`flex items-center gap-2 rounded-2xl text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-xl px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-xl p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function bp({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,q.jsx)(Cd,{type:t,"data-size":r,variant:n,className:K(yp({size:r}),e),...i})}function xp({className:e,...t}){return(0,q.jsx)(`span`,{className:K(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...t})}function Sp({className:e,...t}){return(0,q.jsx)(hp,{"data-slot":`input-group-control`,className:K(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,e),...t})}function Cp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-group`,className:K(`flex min-w-0 flex-col gap-2`,e),...t})}function wp({className:e,align:t=`start`,...n}){return(0,q.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:K(`group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse`,e),...n})}function Tp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-avatar`,className:K(`flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8`,e),...t})}function Ep({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-content`,className:K(`flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end`,e),...t})}function Dp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-header`,className:K(`flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0`,e),...t})}function Op({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-footer`,className:K(`flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end`,e),...t})}function kp({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=Ap(jp(r,i),t);if(!n)return o.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!o.isValidElement(n))return null;let s=n.props,c={...Ap(a,s),ref:Pp(a.ref,s.ref)};return o.cloneElement(n,c)}function Ap(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];t[n]=n===`className`?[i,r].filter(Boolean).join(` `):n===`style`?{...i,...r}:n===`ref`?Pp(i,r):Np(n)&&typeof i==`function`&&typeof r==`function`?Mp(r,i):r}}return t}function jp(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function Mp(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function Np(e){return/^on[A-Z]/.test(e)}function Pp(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var Fp=8,Ip=64,Lp=0,Rp=.5,zp=180,Bp=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),Vp={start:!1,end:!1},Hp={currentAnchorId:null,visibleMessageIds:[]};function Up({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return Vp;let i=tm({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function Wp({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return Hp;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of Gp(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+Rp&&(u=e)}return l.length===0&&u===null?Hp:{currentAnchorId:u,visibleMessageIds:l}}function Gp(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function Kp(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function qp(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function Jp(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function Yp(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function Xp({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of Gp(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function Zp({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=Qp(t,i),o=t.getBoundingClientRect().height,s=im(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function Qp(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function $p(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function em({content:e,scrollTop:t,spacer:n,viewport:r}){let i=tm({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function tm({content:e,spacer:t,viewport:n}){let r=Gp(e,t),i=rm(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function nm(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function rm(e){let t=window.getComputedStyle(e);return{end:om(t.paddingBlockEnd||t.paddingBottom),start:om(t.paddingBlockStart||t.paddingTop)}}function im(e){let t=e?.parentElement;return t?rm(t):{end:0,start:0}}function am(e){if(!e)return 0;let t=window.getComputedStyle(e);return om(t.rowGap===`normal`?t.gap:t.rowGap)}function om(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function sm(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function cm(e,t){return sm(e,t)}function lm(){return sm(Hp,dm)}function um(e,t){return e.start===t.start&&e.end===t.end}function dm(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function fm({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:r,scrollPreviousItemPeek:i}){let a=o.useRef(e),s=o.useRef(!1),c=o.useRef(null),l=o.useRef(!1),u=o.useRef(n),d=o.useRef(0),f=o.useRef(null),p=o.useRef(0),m=o.useRef(e?`following-bottom`:`free-scrolling`),h=o.useRef(new Map),g=o.useRef(null),_=o.useRef(null),v=o.useRef(null),y=o.useRef(i),b=o.useRef(!0),x=o.useRef(null),S=o.useRef(r),C=o.useRef(null),w=o.useRef(0),T=o.useRef(0),E=o.useRef(null),D=o.useRef(null),O=o.useRef(null),k=o.useRef(null),A=o.useRef(null),j=o.useRef(null),M=o.useRef(null),N=o.useRef(null),P=o.useRef(null),F=o.useRef(new Set),I=o.useRef(new WeakSet);return O.current===null&&(O.current=cm(t===`end`||t===`last-anchor`,(e,t)=>e===t)),k.current===null&&(k.current=cm(Vp,um)),P.current===null&&(P.current=lm()),a.current=e,u.current=n,S.current=r,y.current=i,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:A,streamingTurnRef:v,contentRef:c,defaultScrollPositionAppliedRef:l,firstItemRef:f,itemCountRef:d,lastScrollTopRef:p,messageElementsRef:h,modeRef:m,pendingScrollFrameRef:C,pendingScrollToMessageRef:g,prependRestoreRef:_,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:O.current,rootRef:x,scrollEdgeThresholdRef:u,scrollMarginRef:S,scrollPreviousItemPeekRef:y,spacerGapRef:w,spacerHeightRef:T,spacerRef:E,stateFrameRef:D,stateStore:k.current,viewportRef:j,visibilityFrameRef:M,visibilityObserverRef:N,visibilityStore:P.current,visibleMessageIdsRef:F,handledScrollAnchorsRef:I}}function pm(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function mm(e){e.defaultScrollPositionAppliedRef.current=!0,pm(e)}function hm({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:c,contentRef:l,itemCountRef:u,messageElementsRef:d,modeRef:f,pendingScrollToMessageRef:p,prependRestoreRef:m,scrollMarginRef:h,scrollPreviousItemPeekRef:g,spacerGapRef:_,spacerHeightRef:v,spacerRef:y,viewportRef:b}=e,x=o.useCallback(e=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null),s.current!==e&&(s.current=e,t()),e&&(c.current=window.setTimeout(()=>{c.current=null,s.current=!1,t()},zp))},[t]),S=o.useCallback(e=>{let t=y.current;if(!t)return;let n=Math.max(0,Math.ceil(e));v.current!==n&&(v.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-_.current}px`:``)},[]),C=o.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=b.current;if(!a)return;let o=Math.max(0,e);Math.abs(a.scrollTop-o)<=Rp?(a.scrollTop=o,t()):(i&&x(!0),a.scrollTo({top:o,behavior:r}),n())},[t,n,x]),w=o.useCallback(({behavior:e=`auto`}={})=>b.current?(S(0),i.current=null,f.current=`free-scrolling`,C(0,{behavior:e}),r(),!0):!1,[r,C,S]),T=o.useCallback(({behavior:e=`auto`}={})=>{let t=b.current;return t?(S(0),i.current=null,f.current=a.current?`following-bottom`:`free-scrolling`,C(nm(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,C,S]),E=o.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=h.current}={},{keepPreviousPeek:o=!1}={})=>{let s=l.current,c=b.current;if(!s||!c||!s.contains(e))return!1;let u=Zp({align:t,element:e,scrollMargin:o?a+g.current:a,spacer:y.current,viewport:c}),d=em({content:s,scrollTop:u,spacer:y.current,viewport:c});return S(d),m.current={element:e,viewportTop:$p(e,c)},f.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,C(u,{behavior:n}),r(),!0},[r,C,S]),D=o.useCallback(()=>{let e=i.current;return!e||!e.isConnected||f.current!==`anchored-to-message`?!1:E(e,{align:`start`},{keepPreviousPeek:!0})},[E]),O=o.useCallback((t,n)=>{let r=d.current.get(t);return r?(mm(e),E(r,n)?(p.current=null,!0):(p.current={messageId:t,options:n},!0)):u.current===0&&(p.current={messageId:t,options:n},mm(e),!0)},[E]);return{flushPendingScrollToMessage:o.useCallback(()=>{let t=p.current;if(!t)return!1;let n=d.current.get(t.messageId);return!n||!E(n,t.options)?!1:(p.current=null,mm(e),!0)},[E]),reanchorToAnchoredMessage:D,scrollToElement:E,scrollToEnd:T,scrollToMessage:O,scrollToStart:w}}function gm(e,t){return o.useCallback(n=>{e.current=n,n&&t()},[e,t])}function _m({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=Fp,scrollPreviousItemPeek:r=Ip,scrollMargin:i=Lp}){let a=fm({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:s,autoScrollRef:c,autoscrollingRef:l,autoscrollingTimeoutRef:u,contentRef:d,defaultScrollPositionAppliedRef:f,firstItemRef:p,itemCountRef:m,lastScrollTopRef:h,messageElementsRef:g,modeRef:_,pendingScrollFrameRef:v,pendingScrollToMessageRef:y,prependRestoreRef:b,preserveScrollOnPrependRef:x,pendingDefaultScrollStore:S,rootRef:C,scrollEdgeThresholdRef:w,scrollMarginRef:T,scrollPreviousItemPeekRef:E,spacerGapRef:D,spacerHeightRef:O,spacerRef:k,stateFrameRef:A,stateStore:j,viewportRef:M,visibilityFrameRef:N,visibilityObserverRef:P,visibilityStore:F,visibleMessageIdsRef:I,handledScrollAnchorsRef:ee}=a,L=o.useRef(t);L.current!==t&&(L.current=t,f.current=!1);let te=o.useCallback(e=>{let t=C.current,n=M.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=l.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),ne=o.useCallback(e=>{let t=M.current?.scrollTop??0,n=t<h.current-Rp;h.current=t,c.current&&!e.end&&_.current!==`settling-jump`&&_.current!==`anchored-to-message`?_.current=`following-bottom`:_.current===`following-bottom`&&e.end&&n&&!l.current&&(_.current=`free-scrolling`)},[]),re=o.useCallback(()=>{let e=Up({content:d.current,scrollEdgeThreshold:w.current,spacer:k.current,viewport:M.current});ne(e);let t=_.current===`following-bottom`?{...e,end:!1}:e;te(t),j.setSnapshot(t)},[ne,j,te]),ie=o.useCallback(()=>{A.current===null&&(A.current=window.requestAnimationFrame(()=>{A.current=null,re()}))},[re]),R=o.useCallback(()=>{F.hasListeners()&&N.current===null&&(N.current=window.requestAnimationFrame(()=>{N.current=null,F.hasListeners()&&F.setSnapshot(Wp({content:d.current,scrollMargin:T.current,scrollPreviousItemPeek:E.current,spacer:k.current,viewport:M.current,visibleMessageIds:I.current}))}))},[F]),{flushPendingScrollToMessage:z,reanchorToAnchoredMessage:ae,scrollToElement:B,scrollToEnd:V,scrollToMessage:H,scrollToStart:oe}=hm({refs:a,commitScrollState:re,scheduleStateCommit:ie,scheduleVisibilitySync:R}),U=o.useCallback(()=>{let e=b.current,t=M.current;if(!e||!t||!e.element.isConnected)return!1;let n=$p(e.element,t)-e.viewportTop;return Math.abs(n)<=Rp?!1:(t.scrollTop+=n,e.viewportTop=$p(e.element,t),ie(),R(),!0)},[ie,R]),W=o.useCallback(()=>{let e=d.current,t=M.current;if(!e||!t){b.current=null;return}let n=Xp({content:e,spacer:k.current,viewport:t});b.current=n?{element:n,viewportTop:$p(n,t)}:null},[]),se=o.useCallback(()=>{v.current===null&&(v.current=window.requestAnimationFrame(()=>{v.current=null,z()&&W()}))},[W,z]),ce=o.useCallback(()=>{if(!t||f.current||m.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=d.current,n=M.current,r=t&&n?Yp(Gp(t,k.current)):null;if(!t||!n||!r)e=V({behavior:`auto`});else{let i=Qp(r,n);e=tm({content:t,spacer:k.current,viewport:n})-i<=n.clientHeight?V({behavior:`auto`}):B(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?V({behavior:`auto`}):oe({behavior:`auto`});return e?(mm(a),!0):!1},[t,B,V,oe]),le=o.useCallback(()=>{let e=d.current;if(!e)return;let t=Gp(e,k.current),n=m.current,r=p.current;m.current=t.length,p.current=t[0]??null,(()=>{if(z())return;if(n===0){if(ce()||t.length>0&&c.current&&V({behavior:`auto`}))return;re(),R();return}let e=r?t.indexOf(r):-1;if(x.current&&e>0)U();else{if(t.length>n){let e=Kp(t,n);if(e){if(c.current&&_.current===`following-bottom`&&Jp(t,n)){V({behavior:`auto`});return}B(e,{align:`start`},{keepPreviousPeek:!0}),ee.current.add(e);return}}if(t.length===n){let e=qp(t,ee.current);if(e){B(e,{align:`start`},{keepPreviousPeek:!0}),ee.current.add(e);return}}_.current===`following-bottom`&&c.current?V({behavior:`auto`}):(re(),R())}})(),W()},[ce,W,re,z,U,R,B,V]),ue=o.useCallback(()=>{if(_.current===`following-bottom`&&c.current){V({behavior:`auto`});return}let e=O.current;ae()?c.current&&e>0&&O.current===0&&V({behavior:`auto`}):(ie(),R())},[ae,ie,R,V]),de=o.useCallback(()=>{let e=M.current;if(e&&F.hasListeners()){if(typeof IntersectionObserver>`u`){R();return}P.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?I.current.add(e):I.current.delete(e))}R()},{root:e,rootMargin:`${-(T.current+E.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),g.current.forEach(e=>{P.current?.observe(e)}),R()}},[R,F]),fe=o.useCallback(()=>{N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),P.current?.disconnect(),P.current=null,I.current.clear(),F.setSnapshot(Hp)},[F]),pe=o.useCallback((e,t,n)=>{t?(g.current.set(e,t),P.current?.observe(t),R(),y.current?.messageId===e&&se()):n&&g.current.get(e)===n&&(g.current.delete(e),I.current.delete(e),P.current?.unobserve(n),R())},[se,R]),me=o.useCallback(()=>{(_.current===`following-bottom`||_.current===`anchored-to-message`||_.current===`settling-jump`)&&(s.current=null,_.current=`free-scrolling`)},[]),he=o.useCallback(()=>te(j.getSnapshot()),[j,te]),ge=gm(C,he),_e=gm(M,he),ve=o.useCallback(e=>{d.current=e},[]),ye=o.useCallback(e=>{k.current=e,D.current=am(e?.parentElement??null)},[]),be=o.useCallback(()=>{re(),R(),W()},[W,re,R]),xe=o.useMemo(()=>({handleContentChange:le,handleResize:ue,observeVisibility:de,pendingDefaultScrollStore:S,preserveScrollOnPrependRef:x,scrollToEnd:V,scrollToMessage:H,scrollToStart:oe,setContentElement:ve,setRootElement:ge,setSpacerElement:ye,setViewportElement:_e,stateStore:j,syncAfterScroll:be,unobserveVisibility:fe,userScrollIntent:me,viewportRef:M,visibilityStore:F}),[le,ue,de,S,V,H,oe,ve,ge,ye,_e,j,be,fe,me,F]);return o.useLayoutEffect(()=>{ce()||m.current===0&&pm(a)},[ce]),o.useEffect(()=>()=>{A.current!==null&&(window.cancelAnimationFrame(A.current),A.current=null),N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null),v.current!==null&&(window.cancelAnimationFrame(v.current),v.current=null),P.current?.disconnect(),P.current=null},[]),o.useLayoutEffect(()=>{e&&_.current===`following-bottom`&&m.current>0?V({behavior:`auto`}):re()},[e,re,V]),{context:xe,registerMessage:pe}}function vm(e){let t=o.useRef(e);return t.current=e,t}var ym=o.createContext(null),bm=o.createContext(null);function xm(){let e=o.useContext(ym);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function Sm(){let e=o.useContext(bm);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function Cm(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=xm();return o.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function wm(){let{stateStore:e}=xm();return o.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Tm({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=_m({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,q.jsx)(ym.Provider,{value:o,children:(0,q.jsx)(bm.Provider,{value:s,children:t})})}function Em(){let{pendingDefaultScrollStore:e}=xm();return o.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Dm({children:e,...t}){let{setRootElement:n}=xm(),r=Em();return(0,q.jsx)(`div`,{ref:n,...t,...r?{"data-pending-scroll":``}:null,children:e})}function Om({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:s=!0,ref:c,role:l,tabIndex:u,...d}){let{handleResize:f,preserveScrollOnPrependRef:p,setViewportElement:m,syncAfterScroll:h,userScrollIntent:g,viewportRef:_}=xm(),v=Em();p.current=s;let y=o.useCallback(e=>{m(e),Pp(c)?.(e)},[c,m]);function b(e){h(),r?.(e)}function x(e){g(),a?.(e)}function S(e){g(),i?.(e)}function C(e){Bp.has(e.key)&&g(),n?.(e)}return o.useEffect(()=>{let e=_.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(f)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[f,_]),(0,q.jsx)(`div`,{ref:y,role:l??`region`,"aria-label":e??`Messages`,tabIndex:u??0,onKeyDown:C,onScroll:b,onTouchMove:S,onWheel:x,...d,...v?{"data-pending-scroll":``}:null,children:t})}function km({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:s,handleResize:c,setContentElement:l,setSpacerElement:u}=xm(),d=o.useRef(null),f=o.useCallback(e=>{d.current=e,l(e),Pp(n)?.(e)},[n,l]);return o.useLayoutEffect(()=>{let e=d.current;if(!e||(s(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{s()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[s]),o.useEffect(()=>{let e=d.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(c)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[c]),(0,q.jsxs)(`div`,{ref:f,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,q.jsx)(`div`,{ref:u,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function Am({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=Sm(),a=o.useRef(null),s=o.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),Pp(t)?.(n)},[e,t,i]);return(0,q.jsx)(`div`,{ref:s,"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function jm({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:s=`button`,...c}){let{scrollToEnd:l,scrollToStart:u,stateStore:d}=xm(),f=vm(r),p=o.useCallback(e=>d.subscribe(e),[d]),m=o.useCallback(()=>{let e=d.getSnapshot();return n===`start`?e.start:e.end},[n,d]),h=o.useSyncExternalStore(p,m,m),g=o.useCallback(t=>{h&&(f.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?u({behavior:e}):l({behavior:e})))},[e,n,h,f,l,u]);return kp({defaultTagName:`button`,props:Ap({type:s,inert:!h,tabIndex:h?a:-1,children:t??(0,q.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:g},c),render:i,state:{active:h,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var Mm={Provider:Tm,Root:Dm,Viewport:Om,Content:km,Item:Am,Button:jm};function Nm(e){return(0,q.jsx)(Mm.Provider,{...e})}function Pm({className:e,...t}){return(0,q.jsx)(Mm.Root,{"data-slot":`message-scroller`,className:K(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,e),...t})}function Fm({className:e,...t}){return(0,q.jsx)(Mm.Viewport,{"data-slot":`message-scroller-viewport`,className:K(`size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible`,e),...t})}function Im({className:e,...t}){return(0,q.jsx)(Mm.Content,{"data-slot":`message-scroller-content`,className:K(`flex h-max min-h-full flex-col gap-8`,e),...t})}function Lm({className:e,scrollAnchor:t=!1,...n}){return(0,q.jsx)(Mm.Item,{"data-slot":`message-scroller-item`,scrollAnchor:t,className:K(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,e),...n})}function Rm({direction:e=`end`,className:t,children:n,render:r,variant:i=`secondary`,size:a=`icon-sm`,...o}){return(0,q.jsx)(Mm.Button,{"data-slot":`message-scroller-button`,"data-direction":e,"data-variant":i,"data-size":a,direction:e,className:K(`absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180`,t),render:r??(0,q.jsx)(Cd,{variant:i,size:a}),...o,children:n??(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Td,{icon:Od,strokeWidth:2}),(0,q.jsx)(`span`,{className:`sr-only`,children:e===`end`?`Scroll to end`:`Scroll to start`})]})})}function zm({className:e,...t}){return(0,q.jsx)(Td,{icon:Gd,strokeWidth:2,"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:K(`size-4 animate-spin`,e),...t})}function Bm(e){let t=globalThis.navigator?.clipboard;t?t.writeText(e).catch(e=>console.error(`copying the command failed:`,e)):console.error(`copying needs the clipboard, which this page cannot reach`)}function Vm({command:e,icon:t}){return(0,q.jsxs)(`span`,{className:`ui-cmd`,children:[t&&(0,q.jsx)(X,{icon:t,size:16,className:`ui-ic ui-ic16`}),(0,q.jsx)(`code`,{children:e}),(0,q.jsxs)(Cd,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>Bm(e),children:[(0,q.jsx)(X,{icon:Rd,"data-icon":`inline-start`}),`Copy`]})]})}var Hm=(0,o.createContext)(null),Um=null,Wm=new Set;function Gm(e){Um=c(e);for(let e of Wm)e()}var Km=e=>e.split("`").map((e,t)=>t%2==1?(0,q.jsx)(`code`,{children:e},t):e),qm={text:``,outgoing:[]};function Jm({store:e,target:t,where:n,to:r}){let i=c(t),a=Xe(e,e=>e.post),s=Xe(e,e=>e.drafts[i])??qm,l=(0,o.useContext)(Hm),u=Df().isMobile,f=(0,o.useRef)(null),m=()=>f.current;if((0,o.useLayoutEffect)(()=>{let e=()=>{Um===i&&(Um=null,m()?.focus())};return e(),Wm.add(e),()=>void Wm.delete(e)},[i,a]),a===null)return null;if(a.mode===`off`)return(0,q.jsxs)(dp,{children:[(0,q.jsxs)(gp,{"aria-disabled":`true`,children:[(0,q.jsxs)(vp,{align:`block-start`,children:[(0,q.jsx)(X,{icon:Qd}),(0,q.jsx)(xp,{children:a.reason===`This dashboard was started with --creds, which can only read.`?Km("This dashboard was started with `--creds`, which can only read."):a.reason})]}),(0,q.jsxs)(vp,{align:`block-end`,className:`min-w-0`,children:[(0,q.jsx)(Vm,{command:p(t)}),(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsx)(`span`,{className:`inline-flex shrink-0`,tabIndex:0,children:(0,q.jsx)(bp,{variant:`default`,size:`icon-xs`,disabled:!0,"aria-label":`Send`,children:(0,q.jsx)(X,{icon:Ad})})})}),(0,q.jsx)(yf,{children:a.reason})]})]})]}),(0,q.jsx)(pp,{className:`truncate`,children:Km(d(a))})]});let h=s.outgoing.some(e=>e.id===void 0),g=s.refused,_=l!==null&&!h&&s.text.trim()!==``,v=()=>{_&&l.send(t,s.text).catch(()=>void 0)},y=(0,q.jsxs)(bp,{size:u?`icon-xs`:`xs`,disabled:l===null,onClick:()=>{l?.draft(t,`${s.text}@`),m()?.focus()},"aria-label":u?`Mention`:void 0,children:[(0,q.jsx)(X,{icon:Md,"data-icon":u?void 0:`inline-start`}),!u&&`Mention`]});return(0,q.jsxs)(dp,{"data-invalid":g!==void 0,children:[(0,q.jsxs)(gp,{children:[(0,q.jsx)(Sp,{ref:f,className:`max-h-48`,placeholder:`Message ${n}`,"aria-label":`Message ${n}`,"aria-invalid":g!==void 0,value:s.text,readOnly:l===null,onChange:e=>l?.draft(t,e.currentTarget.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),v())}}),(0,q.jsx)(vp,{align:`block-end`,children:g===void 0?(0,q.jsxs)(q.Fragment,{children:[u?(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsx)(`span`,{className:`inline-flex`,tabIndex:l===null?0:void 0,children:y})}),(0,q.jsx)(yf,{children:`Mention`})]}):y,(0,q.jsxs)(xp,{className:`ml-auto min-w-0`,children:[(0,q.jsx)(`i`,{className:`ui-mode-dot`,style:{background:t.kind===`msg`?`var(--multi)`:`var(--uni)`}}),(0,q.jsx)(`span`,{className:`truncate`,children:r})]}),!u&&(0,q.jsx)(xp,{children:`as operator`}),(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsx)(`span`,{className:`inline-flex`,tabIndex:_?void 0:0,children:(0,q.jsx)(bp,{variant:`default`,size:`icon-xs`,"aria-label":h?`Sending`:`Send`,disabled:!_,onClick:v,children:h?(0,q.jsx)(zm,{}):(0,q.jsx)(X,{icon:Ad})})})}),(0,q.jsx)(yf,{children:h?`Sending`:`Send`})]})]}):(0,q.jsx)(bp,{variant:`outline`,size:`sm`,className:`ml-auto`,disabled:!_,onClick:v,children:`Try again`})})]}),g===void 0?(0,q.jsx)(pp,{className:`truncate`,children:Km(d(a))}):(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsx)(mp,{className:`truncate`,children:g})}),(0,q.jsx)(yf,{children:g})]})]})}function Ym({store:e,target:t,shown:n}){let r=Xe(e,e=>e.drafts[c(t)])??qm;return(0,q.jsx)(q.Fragment,{children:r.outgoing.filter(e=>e.id===void 0||!n.has(e.id)).map(e=>{let t=new Date(e.ts),n=e.id===void 0;return(0,q.jsx)(Lm,{children:(0,q.jsxs)(wp,{align:`end`,children:[(0,q.jsx)(Tp,{children:(0,q.jsx)(ip,{children:(0,q.jsx)(ap,{children:`OP`})})}),(0,q.jsxs)(Ep,{children:[(0,q.jsxs)(Dp,{className:`gap-2`,children:[(0,q.jsx)(`span`,{children:`operator`}),(0,q.jsx)(rp,{variant:`secondary`,children:`operator`}),(0,q.jsx)(`time`,{dateTime:t.toISOString(),children:k(t)}),n&&(0,q.jsx)(`span`,{children:`sending`})]}),(0,q.jsx)(sp,{variant:n?`muted`:`default`,children:(0,q.jsx)(cp,{className:`whitespace-pre-wrap`,children:e.text})})]})]})},e.seq)})})}function Xm({peer:e,name:t,selfId:n}){return(0,q.jsxs)(gp,{children:[(0,q.jsx)(vp,{align:`block-start`,children:(0,q.jsx)(xp,{children:`This conversation is between two agents.`})}),(0,q.jsx)(vp,{align:`block-end`,children:(0,q.jsx)(bp,{asChild:!0,variant:`outline`,size:`sm`,className:`ml-auto`,children:(0,q.jsx)(`a`,{href:Oe(m(e,n)),onClick:()=>Gm({kind:`dm`,to:e}),children:`Message ${t}`})})})]})}function Zm(e){let t=e.snapshot;return t!==void 0&&(t.asOf!==void 0||Array.isArray(t.members)&&t.members.length>0)}function Qm(e,t){if(e.unreadable!==void 0)return`unreadable`;if(!Zm(e))return`traffic-only`;let n=e.snapshot.asOf;return(n?t-n:1/0)<45e3?`live`:`stale`}function $m(e){return Zm(e)&&e.unreadable===void 0}var eh=e=>e.split(`.`).some(e=>e===`*`||e===`>`);function th(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<n.length;e++){if(n[e]===`>`)return e<r.length;if(e>=r.length||n[e]!==`*`&&n[e]!==r[e])return!1}return n.length===r.length}function nh(e,t,n,r=[]){let i=new Map,a=!1;for(let t of e)if(t===`>`||t===`*`)a=!0;else if(eh(t))for(let e of n)th(t,e)&&i.set(e,`live`);else i.set(t,`live`);for(let e of t)if(eh(e))for(let t of r)!i.has(t)&&th(e,t)&&i.set(t,`durable`);else i.has(e)||i.set(e,`durable`);return{channels:i,wide:a}}function rh(e,t,n,r){let i=new Set,a=[],o=(e,t)=>{e&&!i.has(e)&&(i.add(e),a.push({id:e,source:t}))};if($m(t)){let r=[...n,e];for(let n of t.snapshot.members){let{channels:t,wide:i}=nh(n.live??[],n.durable??[],r);(i||t.has(e))&&o(n.id,`membership`)}return a}for(let t of r)t.msg.channel===e&&o(t.senderId??t.msg.from.id,`traffic`);return a}function ih(e,t,n,r,i){let a=new Set,o=!1;if($m(t)){let r=t.snapshot.members.find(t=>t.id===e);if(r){let e=nh(r.live??[],r.durable??[],n);o=e.wide;for(let t of e.channels.keys())a.add(t)}}else for(let t of r)(t.senderId??t.msg.from?.id)===e&&typeof t.msg.channel==`string`&&a.add(t.msg.channel);let s=new Map;for(let[e,t]of Object.entries(i??{}))(t===`quiet`||t===`muted`)&&s.set(e,t);for(let e of s.keys())a.add(e);return{channels:[...a].sort().map(e=>s.has(e)?{channel:e,mode:s.get(e)}:{channel:e}),wide:o}}function ah({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty`,className:K(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-3xl border-dashed p-12 text-center text-balance`,e),...t})}function oh({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-header`,className:K(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var sh=xd(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-foreground [&_svg:not([class*='size-'])]:size-5`}},defaultVariants:{variant:`default`}});function ch({className:e,variant:t=`default`,...n}){return(0,q.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:K(sh({variant:t,className:e})),...n})}function lh({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-title`,className:K(`text-lg font-medium tracking-tight`,e),...t})}function uh({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-description`,className:K(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function dh({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-content`,className:K(`flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance`,e),...t})}var fh=26;function ph({letter:e,slot:t,size:n,offline:r}){let i=n<fh,a=[`ui-idb`,[...e].length>1&&`ui-idb-2`,i&&`ui-idb-dot`,r&&`ui-idb-off`].filter(Boolean).join(` `);return(0,q.jsx)(`i`,{className:a,style:{"--bf":`var(--id-${t})`},"aria-hidden":`true`,children:i?null:e})}var mh={waiting:Hd,working:Gd,idle:qd,offline:tf},hh=e=>e.charAt(0).toUpperCase()+e.slice(1);function gh({status:e}){return(0,q.jsx)(`i`,{className:`ui-st ui-st-${e}`,role:`img`,"aria-label":hh(e)})}var _h=(e,t)=>e===`working`?`${t} ox-spin`:t,vh={waiting:`default`,working:`secondary`,idle:`outline`,offline:`outline`};function yh({row:e}){let t=Object.hasOwn(mh,e.status)?mh[e.status]:void 0,n=Object.hasOwn(vh,e.status)?vh[e.status]:`outline`;return(0,q.jsxs)(rp,{variant:n,children:[t&&(0,q.jsx)(X,{icon:t,"data-icon":`inline-start`,className:e.status===`working`?`ox-spin`:void 0}),hh(G(e))]})}var bh={"claude-code":`claude`,claude:`claude`,opencode:`opencode`,codex:`codex`,hermes:`hermes`,pi:`pi`},xh=`guest`,Sh={working:{look:`down`},waiting:{mood:`surprised`,look:`up`}};function Ch(e,t){return Qf(e!==void 0&&Object.hasOwn(bh,e)?bh[e]:xh,Object.hasOwn(Sh,t)?Sh[t]:{})}function wh({vendor:e,status:t,size:n,badge:r,dot:i=!0}){return(0,q.jsxs)(`span`,{className:t===`offline`?`ui-av ui-av-off`:`ui-av`,style:{"--s":`${n}px`},children:[(0,q.jsx)(`svg`,{viewBox:`-2 -4 112 112`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:Ch(e,t)}}),r&&(0,q.jsx)(ph,{letter:r.letter,slot:r.slot,size:n,offline:t===`offline`}),i&&(0,q.jsx)(gh,{status:t})]})}var Th=8;function Eh(e,t){return e.trim()?e:t}function Dh(e){let t=[...e][0];if(t===void 0)return``;let n=/_(\d+)$/.exec(e);return t.toUpperCase()+(n?n[1]:``)}function Oh(e){let[t,...n]=[...e];if(t===void 0)return``;let r=n.find(e=>/\p{L}/u.test(e))??``,i=/_(\d+)$/.exec(e);return t.toUpperCase()+r+(i?i[1]:``)}function kh(e){let t=new Map;for(let n of e)if(n.status!==`offline`){let e=Dh(Eh(n.name,n.id));t.set(e,(t.get(e)??0)+1)}let n=new Map;for(let r of e){let e=Eh(r.name,r.id),i=Dh(e);n.set(r.id,r.status!==`offline`&&(t.get(i)??0)>1?Oh(e):i)}return n}function Ah(e){let t=7;for(let n of e)t=Math.imul(t,31)+n.charCodeAt(0)>>>0;return t%Th+1}var jh=(e,t)=>e.name<t.name?-1:e.name>t.name?1:e.id<t.id?-1:+(e.id>t.id);function Mh(e){let t=new Map,n=new Set,r=e.filter(e=>e.status!==`offline`).sort(jh);for(let e of r){let r=Ah(Eh(e.name,e.id));if(n.size<Th)for(;n.has(r);)r=r%Th+1;n.add(r),t.set(e.id,r)}for(let n of e)n.status===`offline`&&t.set(n.id,Ah(Eh(n.name,n.id)));return t}var Nh=(0,o.createContext)(()=>void 0);function Ph(){return(0,o.useContext)(Nh)}function Fh(e){let t=Mh(e),n=kh(e),r=new Map;for(let i of e){let e=t.get(i.id);e!==void 0&&r.set(i.id,{letter:n.get(i.id)??``,slot:e})}return e=>r.get(e)}var Ih={claude:{label:`Claude Code`,color:`#d97757`,glyph:`◆`,svg:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"/></svg>`},opencode:{label:`OpenCode`,color:`#cdd6e0`,glyph:`▣`,svg:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M22 24H2V0h20zM17 4.8H7v14.4h10z"/></svg>`},codex:{label:`Codex`,color:`#e5e7eb`,glyph:`◉`,svg:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"/></svg>`},hermes:{label:`Hermes`,color:`#a78bfa`,glyph:`➤`,svg:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 3 3 10.5l7 2.5 2.5 7L21 3Z"/><path d="M21 3 10 13"/></svg>`},jcode:{label:`Jcode`,color:`#4ade80`,glyph:`⟨⟩`,svg:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 4 3 12l5 8"/><path d="m16 4 5 8-5 8"/></svg>`},pi:{label:`Pi`,color:`#7dd3fc`,glyph:`π`,svg:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h16"/><path d="M9 7v12"/><path d="M15 7v12c0 1.5 1.5 2 3 1"/></svg>`}};function Lh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Rh(e){if(Array.isArray(e))return e}function zh(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Bh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
43
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vh(e,t){return Rh(e)||zh(e,t)||Hh(e,t)||Bh()}function Hh(e,t){if(e){if(typeof e==`string`)return Lh(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lh(e,t):void 0}}var Uh=Object.entries,Wh=Object.setPrototypeOf,Gh=Object.isFrozen,Kh=Object.getPrototypeOf,qh=Object.getOwnPropertyDescriptor,Jh=Object.freeze,Yh=Object.seal,Xh=Object.create,Zh=typeof Reflect<`u`&&Reflect,Qh=Zh.apply,$h=Zh.construct;Jh||=function(e){return e},Yh||=function(e){return e},Qh||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},$h||=function(e){return new e(...[...arguments].slice(1))};var eg=bg(Array.prototype.forEach),tg=bg(Array.prototype.lastIndexOf),ng=bg(Array.prototype.pop),rg=bg(Array.prototype.push),ig=bg(Array.prototype.splice),ag=Array.isArray,og=bg(String.prototype.toLowerCase),sg=bg(String.prototype.toString),cg=bg(String.prototype.match),lg=bg(String.prototype.replace),ug=bg(String.prototype.indexOf),dg=bg(String.prototype.trim),fg=bg(Number.prototype.toString),pg=bg(Boolean.prototype.toString),mg=typeof BigInt>`u`?null:bg(BigInt.prototype.toString),hg=typeof Symbol>`u`?null:bg(Symbol.prototype.toString),gg=bg(Object.prototype.hasOwnProperty),_g=bg(Object.prototype.toString),vg=bg(RegExp.prototype.test),yg=xg(TypeError);function bg(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Qh(e,t,n)}}function xg(e){return function(){return $h(e,[...arguments])}}function Z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:og;if(Wh&&Wh(e,null),!ag(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Gh(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Sg(e){for(let t=0;t<e.length;t++)gg(e,t)||(e[t]=null);return e}function Cg(e){let t=Xh(null);for(let r of Uh(e)){var n=Vh(r,2);let i=n[0],a=n[1];gg(e,i)&&(t[i]=ag(a)?Sg(a):a&&typeof a==`object`&&a.constructor===Object?Cg(a):a)}return t}function wg(e){switch(typeof e){case`string`:return e;case`number`:return fg(e);case`boolean`:return pg(e);case`bigint`:return mg?mg(e):`0`;case`symbol`:return hg?hg(e):`Symbol()`;case`undefined`:return _g(e);case`function`:case`object`:{if(e===null)return _g(e);let t=e,n=Tg(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:_g(e)}return _g(e)}default:return _g(e)}}function Tg(e,t){for(;e!==null;){let n=qh(e,t);if(n){if(n.get)return bg(n.get);if(typeof n.value==`function`)return bg(n.value)}e=Kh(e)}function n(){return null}return n}function Eg(e){try{return vg(e,``),!0}catch{return!1}}var Dg=Jh(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Og=Jh(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),kg=Jh([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ag=Jh([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),jg=Jh(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Mg=Jh([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ng=Jh([`#text`]),Pg=Jh(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Fg=Jh(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ig=Jh(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Lg=Jh([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Rg=Yh(/{{[\w\W]*|^[\w\W]*}}/g),zg=Yh(/<%[\w\W]*|^[\w\W]*%>/g),Bg=Yh(/\${[\w\W]*/g),Vg=Yh(/^data-[\-\w.\u00B7-\uFFFF]+$/),Hg=Yh(/^aria-[\-\w]+$/),Ug=Yh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wg=Yh(/^(?:\w+script|data):/i),Gg=Yh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Kg=Yh(/^html$/i),qg=Yh(/^[a-z][.\w]*(-[.\w]+)+$/i),Jg=Yh(/<[/\w!]/g),Yg=Yh(/<[/\w]/g),Xg=Yh(/<\/no(script|embed|frames)/i),Zg=Yh(/\/>/i),Qg={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},$g=function(){return typeof window>`u`?null:window},e_=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},t_=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n_=function(e,t,n,r){return gg(e,t)&&ag(e[t])?Z(r.base?Cg(r.base):{},e[t],r.transform):n};function r_(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$g(),t=e=>r_(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==Qg.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Tg(d,`cloneNode`),p=Tg(d,`remove`),m=Tg(d,`nextSibling`),h=Tg(d,`childNodes`),g=Tg(d,`parentNode`),_=Tg(d,`shadowRoot`),v=Tg(d,`attributes`),y=o&&o.prototype?Tg(o.prototype,`nodeType`):null,b=o&&o.prototype?Tg(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw yg(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},O=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},k=function(){return w||=(C=e_(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,N=A.createDocumentFragment,P=A.getElementsByTagName,F=r.importNode,I=t_();t.isSupported=typeof Uh==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let ee=Rg,L=zg,te=Bg,ne=Vg,re=Hg,ie=Wg,R=Gg,z=qg,ae=Ug,B=null,V=Z({},[...Dg,...Og,...kg,...jg,...Ng]),H=null,oe=Z({},[...Pg,...Fg,...Ig,...Lg]),U=Object.seal(Xh(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),W=null,se=null,ce=Object.seal(Xh(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),le=!0,ue=!0,de=!1,fe=!0,pe=!1,me=!0,he=!1,ge=!1,_e=null,ve=null,ye=!1,be=!1,xe=!1,Se=!1,Ce=!0,we=!1,Te=`user-content-`,Ee=!0,De=!1,Oe={},ke=null,Ae=Z({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),je=null,Me=Z({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ne=null,Pe=Z({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Fe=`http://www.w3.org/1998/Math/MathML`,Ie=`http://www.w3.org/2000/svg`,Le=`http://www.w3.org/1999/xhtml`,Re=Le,ze=!1,Be=null,Ve=Z({},[Fe,Ie,Le],sg),He=Jh([`mi`,`mo`,`mn`,`ms`,`mtext`]),Ue=Z({},He),We=Jh([`annotation-xml`]),Ge=Z({},We),Ke=Z({},[`title`,`style`,`font`,`a`,`script`]),qe=null,Je=[`application/xhtml+xml`,`text/html`],G=null,Ye=null,Xe=n.createElement(`form`),Ze=function(e){return e instanceof RegExp||e instanceof Function},Qe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ye&&Ye===e)return;e&&typeof e==`object`||(e={}),e=Cg(e),qe=Je.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,G=qe===`application/xhtml+xml`?sg:og,B=n_(e,`ALLOWED_TAGS`,V,{transform:G}),H=n_(e,`ALLOWED_ATTR`,oe,{transform:G}),Be=n_(e,`ALLOWED_NAMESPACES`,Ve,{transform:sg}),Ne=n_(e,`ADD_URI_SAFE_ATTR`,Pe,{transform:G,base:Pe}),je=n_(e,`ADD_DATA_URI_TAGS`,Me,{transform:G,base:Me}),ke=n_(e,`FORBID_CONTENTS`,Ae,{transform:G}),W=n_(e,`FORBID_TAGS`,Cg({}),{transform:G}),se=n_(e,`FORBID_ATTR`,Cg({}),{transform:G}),Oe=gg(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Cg(e.USE_PROFILES):e.USE_PROFILES:!1,le=e.ALLOW_ARIA_ATTR!==!1,ue=e.ALLOW_DATA_ATTR!==!1,de=e.ALLOW_UNKNOWN_PROTOCOLS||!1,fe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,pe=e.SAFE_FOR_TEMPLATES||!1,me=e.SAFE_FOR_XML!==!1,he=e.WHOLE_DOCUMENT||!1,be=e.RETURN_DOM||!1,xe=e.RETURN_DOM_FRAGMENT||!1,Se=e.RETURN_TRUSTED_TYPE||!1,ye=e.FORCE_BODY||!1,Ce=e.SANITIZE_DOM!==!1,we=e.SANITIZE_NAMED_PROPS||!1,Ee=e.KEEP_CONTENT!==!1,De=e.IN_PLACE||!1,ae=Eg(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ug,Re=typeof e.NAMESPACE==`string`?e.NAMESPACE:Le,Ue=gg(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Cg(e.MATHML_TEXT_INTEGRATION_POINTS):Z({},He),Ge=gg(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Cg(e.HTML_INTEGRATION_POINTS):Z({},We);let t=gg(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Cg(e.CUSTOM_ELEMENT_HANDLING):Xh(null);if(U=Xh(null),gg(t,`tagNameCheck`)&&Ze(t.tagNameCheck)&&(U.tagNameCheck=t.tagNameCheck),gg(t,`attributeNameCheck`)&&Ze(t.attributeNameCheck)&&(U.attributeNameCheck=t.attributeNameCheck),gg(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(U.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Yh(U),pe&&(ue=!1),xe&&(be=!0),Oe&&(B=Z({},Ng),H=Xh(null),Oe.html===!0&&(Z(B,Dg),Z(H,Pg)),Oe.svg===!0&&(Z(B,Og),Z(H,Fg),Z(H,Lg)),Oe.svgFilters===!0&&(Z(B,kg),Z(H,Fg),Z(H,Lg)),Oe.mathMl===!0&&(Z(B,jg),Z(H,Ig),Z(H,Lg))),ce.tagCheck=null,ce.attributeCheck=null,gg(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ce.tagCheck=e.ADD_TAGS:ag(e.ADD_TAGS)&&(B===V&&(B=Cg(B)),Z(B,e.ADD_TAGS,G))),gg(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ce.attributeCheck=e.ADD_ATTR:ag(e.ADD_ATTR)&&(H===oe&&(H=Cg(H)),Z(H,e.ADD_ATTR,G))),gg(e,`ADD_URI_SAFE_ATTR`)&&ag(e.ADD_URI_SAFE_ATTR)&&Z(Ne,e.ADD_URI_SAFE_ATTR,G),gg(e,`FORBID_CONTENTS`)&&ag(e.FORBID_CONTENTS)&&(ke===Ae&&(ke=Cg(ke)),Z(ke,e.FORBID_CONTENTS,G)),gg(e,`ADD_FORBID_CONTENTS`)&&ag(e.ADD_FORBID_CONTENTS)&&(ke===Ae&&(ke=Cg(ke)),Z(ke,e.ADD_FORBID_CONTENTS,G)),Ee&&(B[`#text`]=!0),he&&Z(B,[`html`,`head`,`body`]),B.table&&(Z(B,[`tbody`]),delete W.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw yg(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw yg(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=D(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=k()),x&&typeof S==`string`&&(S=D(``)));Jh&&Jh(e),Ye=e},$e=Z({},[...Og,...kg,...Ag]),et=Z({},[...jg,...Mg]),tt=function(e,t,n){return t.namespaceURI===Le?e===`svg`:t.namespaceURI===Fe?e===`svg`&&(n===`annotation-xml`||Ue[n]):!!$e[e]},nt=function(e,t,n){return t.namespaceURI===Le?e===`math`:t.namespaceURI===Ie?e===`math`&&Ge[n]:!!et[e]},rt=function(e,t,n){return t.namespaceURI===Ie&&!Ge[n]||t.namespaceURI===Fe&&!Ue[n]?!1:!et[e]&&(Ke[e]||!$e[e])},it=function(e){let t=g(e);t&&t.tagName||(t={namespaceURI:Re,tagName:`template`});let n=og(e.tagName),r=og(t.tagName);return Be[e.namespaceURI]?e.namespaceURI===Ie?tt(n,t,r):e.namespaceURI===Fe?nt(n,t,r):e.namespaceURI===Le?rt(n,t,r):!!(qe===`application/xhtml+xml`&&Be[e.namespaceURI]):!1},at=function(e){rg(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw yg(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},ot=function(e){lt(e);let t=h(e);if(t){let e=[];eg(t,t=>{rg(e,t)}),eg(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},st=function(e,n){try{rg(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{rg(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(be||xe)try{at(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},ct=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||H[G(i)]))try{e.removeAttribute(i)}catch{}}},lt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===Qg.element&&ct(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},ut=function(e){if(!me)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===Qg.processingInstruction||n===Qg.comment&&vg(Yg,e.data)){try{p(e)}catch{}continue}if(n===Qg.element){let t=e,n=G(b?b(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},dt=function(e){let t=null,r=null;if(ye)e=`<remove></remove>`+e;else{let t=cg(e,/^[\r\n\t ]+/);r=t&&t[0]}qe===`application/xhtml+xml`&&Re===Le&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(Re===Le)try{t=new l().parseFromString(i,qe)}catch{}if(!t||!t.documentElement){t=j.createDocument(Re,`template`,null);try{t.documentElement.innerHTML=ze?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Re===Le?P.call(t,he?`html`:`body`)[0]:he?t.documentElement:a},ft=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pt=function(e){return e=lg(e,ee,` `),e=lg(e,L,` `),e=lg(e,te,` `),e},mt=function(e){e.normalize();let t=M.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=pt(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&eg(r,e=>{gt(e.content)&&mt(e.content)})},ht=function(e){let t=b?b(e):null;return typeof t!=`string`||G(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},gt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Qg.documentFragment}catch{return!1}},_t=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function vt(e,n,r){e.length!==0&&eg(e,e=>{e.call(t,n,r,Ye)})}let yt=function(e,t){return!!(me&&e.hasChildNodes()&&!_t(e.firstElementChild)&&vg(Jg,e.textContent)&&vg(Jg,e.innerHTML)||me&&e.namespaceURI===Le&&t===`style`&&_t(e.firstElementChild)||e.nodeType===Qg.processingInstruction||me&&e.nodeType===Qg.comment&&vg(Yg,e.data))},bt=function(e,t){if(!W[t]&&wt(t)&&(U.tagNameCheck instanceof RegExp&&vg(U.tagNameCheck,t)||U.tagNameCheck instanceof Function&&U.tagNameCheck(t)))return!1;if(Ee&&!ke[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=De?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return at(e),!0},xt=function(e,n){if(vt(I.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return!0;if(ht(e))return at(e),!0;let r=G(b?b(e):e.nodeName);if(vt(I.uponSanitizeElement,e,{tagName:r,allowedTags:B}),e!==n&&g(e)===null)return!0;if(yt(e,r))return at(e),!0;if(W[r]||!(ce.tagCheck instanceof Function&&ce.tagCheck(r))&&!B[r]){let t=bt(e,r);return t===!1&&vt(I.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===Qg.element&&!it(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&vg(Xg,e.innerHTML))return at(e),!0;if(pe&&e.nodeType===Qg.text){let n=pt(e.textContent);e.textContent!==n&&(rg(t.removed,{element:e.cloneNode()}),e.textContent=n)}return vt(I.afterSanitizeElements,e,null),!1},St=function(e,t,r){if(se[t]||me&&t===`patchsrc`||me&&t===`for`&&e!==`label`&&e!==`output`||Ce&&(t===`id`||t===`name`)&&(r in n||r in Xe))return!1;let i=H[t]||ce.attributeCheck instanceof Function&&ce.attributeCheck(t,e);if(!(ue&&vg(ne,t))&&!(le&&vg(re,t))){if(!i){if(!(wt(e)&&(U.tagNameCheck instanceof RegExp&&vg(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&vg(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t,e))||t===`is`&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&vg(U.tagNameCheck,r)||U.tagNameCheck instanceof Function&&U.tagNameCheck(r))))return!1}else if(!Ne[t]&&!vg(ae,lg(r,R,``))&&(t!==`src`&&t!==`xlink:href`&&t!==`href`||e===`script`||ug(r,`data:`)!==0||!je[e])&&(!de||vg(ie,lg(r,R,``)))&&r)return!1}return!0},Ct=Z({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),wt=function(e){return!Ct[og(e)]&&vg(z,e)},Tt=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return D(r);case`TrustedScriptURL`:return O(r)}return r},Et=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),ht(e)?at(e):ng(t.removed)}catch{st(n,e)}},Dt=function(e){vt(I.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||ht(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0},r=t.length,i=G(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=G(o),u=c,d=o===`value`?u:dg(u);n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,vt(I.uponSanitizeAttribute,e,n),d=n.attrValue,we&&(l===`id`||l===`name`)&&ug(d,Te)!==0&&(st(o,e),d=Te+d),me&&vg(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||l===`attributename`&&cg(d,`href`)?st(o,e):n.forceKeepAttr||(n.keepAttr?!fe&&vg(Zg,d)?st(o,e):(pe&&(d=pt(d)),St(i,l,d)?(d=Tt(i,l,s,d),d!==u&&Et(e,o,s,d)):st(o,e)):st(o,e))}vt(I.afterSanitizeAttributes,e,null)},Ot=function(e){let t=null,n=ft(e);for(vt(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(vt(I.uponSanitizeShadowNode,t,null),xt(t,e),Dt(t),gt(t.content)&&Ot(t.content),(y?y(t):t.nodeType)===Qg.element){let e=_(t);gt(e)&&(kt(e),Ot(e))}vt(I.afterSanitizeShadowDOM,e,null)},kt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ot(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===Qg.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&G(e)===`template`){let e=n.content;gt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);gt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(ze=!e,ze&&(e=`<!-->`),typeof e!=`string`&&!_t(e)&&(e=wg(e),typeof e!=`string`))throw yg(`dirty is not a string, aborting`);if(!t.isSupported)return e;ge?(B=_e,H=ve):Qe(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(B=Cg(B)),I.uponSanitizeAttribute.length>0&&(H=Cg(H)),t.removed=[];let c=De&&typeof e!=`string`&&_t(e);if(c){ut(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=G(t);if(!B[n]||W[n])throw ot(e),yg(`root node is forbidden and cannot be sanitized in-place`)}if(ht(e))throw ot(e),yg(`root node is clobbered and cannot be sanitized in-place`);try{kt(e)}catch(t){throw ot(e),t}}else if(_t(e))i=dt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Qg.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),kt(a);else{if(!be&&!pe&&!he&&e.indexOf(`<`)===-1)return x&&Se?D(e):e;if(i=dt(e),!i)return be?null:Se?S:``}i&&ye&&at(i.firstChild);let l=c?e:i,u=ft(l);try{for(;o=u.nextNode();)xt(o,l),Dt(o),gt(o.content)&&Ot(o.content)}catch(n){throw c&&(ot(e),eg(t.removed,e=>{e.element&&lt(e.element)})),n}if(c)return eg(t.removed,e=>{e.element&&lt(e.element)}),pe&&mt(e),e;if(be){if(pe&&mt(i),xe)for(s=N.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(H.shadowroot||H.shadowrootmode)&&(s=F.call(r,s,!0)),s}let d=he?i.outerHTML:i.innerHTML;return he&&B[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&vg(Kg,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
44
+ `+d),pe&&(d=pt(d)),x&&Se?D(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qe(e),ge=!0,_e=B,ve=H},t.clearConfig=function(){Ye=null,ge=!1,_e=null,ve=null,x=C,S=``},t.isValidAttribute=function(e,t,n){Ye||Qe({});let r=G(e),i=G(t);return St(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&gg(I,e)&&rg(I[e],t)},t.removeHook=function(e,t){if(gg(I,e)){if(t!==void 0){let n=tg(I[e],t);return n===-1?void 0:ig(I[e],n,1)[0]}return ng(I[e])}},t.removeHooks=function(e){gg(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=t_()},t}var i_=r_();function a_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var o_=a_();function s_(e){o_=e}var c_={exec:()=>null};function l_(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Q(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(d_.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var u_=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),d_={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:l_(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:l_(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:l_(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:l_(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:l_(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:l_(e=>RegExp(`^ {0,${e}}>`))},f_=/^(?:[ \t]*(?:\n|$))+/,p_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,m_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,h_=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,g_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,__=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,v_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,y_=Q(v_).replace(/bull/g,__).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),b_=Q(v_).replace(/bull/g,__).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),x_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,S_=/^[^\n]+/,C_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,w_=Q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,C_).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),T_=Q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,__).getRegex(),E_=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,D_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,O_=Q(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n+|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n+|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n+|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,D_).replace(`tag`,E_).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),k_=e=>Q(x_).replace(`hr`,h_).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,E_).getRegex(),A_=k_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),j_=k_(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/),M_={blockquote:Q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,j_).getRegex(),code:p_,def:w_,fences:m_,heading:g_,hr:h_,html:O_,lheading:y_,list:T_,newline:f_,paragraph:A_,table:c_,text:S_},N_=Q(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,h_).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,E_).getRegex(),P_={...M_,lheading:b_,table:N_,paragraph:Q(x_).replace(`hr`,h_).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,N_).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,E_).getRegex()},F_={...M_,html:Q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,D_).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:c_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Q(x_).replace(`hr`,h_).replace(`heading`,` *#{1,6} *[^
45
+ ]`).replace(`lheading`,y_).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},I_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,L_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,R_=/^( {2,}|\\)\n(?!\s*$)/,z_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,B_=/[\p{P}\p{S}]/u,V_=/[\s\p{P}\p{S}]/u,H_=/[^\s\p{P}\p{S}]/u,U_=Q(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,V_).getRegex(),W_=/(?!~)[\p{P}\p{S}]/u,G_=/(?!~)[\s\p{P}\p{S}]/u,K_=/(?:[^\s\p{P}\p{S}]|~)/u,q_=Q(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,u_?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),J_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Y_=Q(J_,`u`).replace(/punct/g,B_).getRegex(),X_=Q(J_,`u`).replace(/punct/g,W_).getRegex(),Z_=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Q_=Q(Z_,`gu`).replace(/notPunctSpace/g,H_).replace(/punctSpace/g,V_).replace(/punct/g,B_).getRegex(),$_=Q(Z_,`gu`).replace(/notPunctSpace/g,K_).replace(/punctSpace/g,G_).replace(/punct/g,W_).getRegex(),ev=Q(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,H_).replace(/punctSpace/g,V_).replace(/punct/g,B_).getRegex(),tv=Q(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,B_).getRegex(),nv=Q(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,H_).replace(/punctSpace/g,V_).replace(/punct/g,B_).getRegex(),rv=Q(/\\(punct)/,`gu`).replace(/punct/g,B_).getRegex(),iv=Q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),av=Q(D_).replace(`(?:-->|$)`,`-->`).getRegex(),ov=Q(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,av).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sv=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,cv=Q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,sv).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lv=Q(/^!?\[(label)\]\[(ref)\]/).replace(`label`,sv).replace(`ref`,C_).getRegex(),uv=Q(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,C_).getRegex(),dv=Q(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,lv).replace(`nolink`,uv).getRegex(),fv=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,pv={_backpedal:c_,anyPunctuation:rv,autolink:iv,blockSkip:q_,br:R_,code:L_,del:c_,delLDelim:c_,delRDelim:c_,emStrongLDelim:Y_,emStrongRDelimAst:Q_,emStrongRDelimUnd:ev,escape:I_,link:cv,nolink:uv,punctuation:U_,reflink:lv,reflinkSearch:dv,tag:ov,text:z_,url:c_},mv={...pv,link:Q(/^!?\[(label)\]\((.*?)\)/).replace(`label`,sv).getRegex(),reflink:Q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,sv).getRegex()},hv={...pv,emStrongRDelimAst:$_,emStrongLDelim:X_,delLDelim:tv,delRDelim:nv,url:Q(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,fv).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Q(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,fv).getRegex()},gv={...hv,br:Q(R_).replace(`{2,}`,`*`).getRegex(),text:Q(hv.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},_v={normal:M_,gfm:P_,pedantic:F_},vv={normal:pv,gfm:hv,breaks:gv,pedantic:mv},yv={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},bv=e=>yv[e];function xv(e,t){if(t){if(d_.escapeTest.test(e))return e.replace(d_.escapeReplace,bv)}else if(d_.escapeTestNoEncode.test(e))return e.replace(d_.escapeReplaceNoEncode,bv);return e}function Sv(e){try{e=encodeURI(e).replace(d_.percentDecode,`%`)}catch{return null}return e}function Cv(e,t){let n=e.replace(d_.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(d_.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(d_.slashPipe,`|`);return n}function wv(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Tv(e){let t=e.split(`
46
+ `),n=t.length-1;for(;n>=0&&d_.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
47
+ `)}function Ev(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Dv(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Ov(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function kv(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
48
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
49
+ `)}var Av=class{options;rules;lexer;constructor(e){this.options=e||o_}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Tv(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=kv(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=wv(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:wv(t[0],`
50
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:wv(t[0],`
51
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=wv(t[0],`
52
+ `).split(`
53
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
54
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
55
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
56
+ ${s}`:s,r=r?`${r}
57
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
58
+ `+e.join(`
59
+ `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
60
+ `+e.join(`
61
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
62
+ `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=Dv(t[2].split(`
63
+ `,1)[0],t[1].length),l=e.split(`
64
+ `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
65
+ `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
66
+ `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
67
+ `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
68
+ `+l}u=!l.trim(),r+=p+`
69
+ `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Tv(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:wv(t[0],`
70
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Cv(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
71
+ `):[],a={type:`table`,raw:wv(t[0],`
72
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Cv(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:wv(t[0],`
73
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
74
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=wv(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Ev(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Ov(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Ov(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},jv=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||o_,this.options.tokenizer=this.options.tokenizer||new Av,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:d_,block:_v.normal,inline:vv.normal};this.options.pedantic?(t.block=_v.pedantic,t.inline=vv.pedantic):this.options.gfm&&(t.block=_v.gfm,t.inline=this.options.breaks?vv.breaks:vv.gfm),this.tokenizer.rules=t}static get rules(){return{block:_v,inline:vv}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(d_.carriageReturn,`
75
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(d_.tabCharGlobal,` `).replace(d_.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
76
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
77
+ `)?``:`
78
+ `)+i.raw,n.text+=`
79
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
80
+ `)?``:`
81
+ `)+i.raw,n.text+=`
82
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
83
+ `)?``:`
84
+ `)+i.raw,r.text+=`
85
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
86
+ `)?``:`
87
+ `)+i.raw,n.text+=`
88
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``,s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,o))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e,n,o))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Mv=class{options;parser;constructor(e){this.options=e||o_}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(d_.notSpaceStart)?.[0],i=e.replace(d_.endingNewline,``)+`
89
+ `;return r?`<pre><code class="language-`+xv(r)+`">`+(n?i:xv(i,!0))+`</code></pre>
90
+ `:`<pre><code>`+(n?i:xv(i,!0))+`</code></pre>
91
+ `}blockquote({tokens:e}){return`<blockquote>
92
+ ${this.parser.parse(e)}</blockquote>
93
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
94
+ `}hr(e){return`<hr>
95
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
96
+ `+r+`</`+i+`>
97
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
98
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
99
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
100
+ <thead>
101
+ `+t+`</thead>
102
+ `+r+`</table>
103
+ `}tablerow({text:e}){return`<tr>
104
+ ${e}</tr>
105
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
106
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${xv(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Sv(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+xv(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Sv(e);if(i===null)return xv(n);e=i;let a=`<img src="${e}" alt="${xv(n)}"`;return t&&(a+=` title="${xv(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:xv(e.text)}},Nv=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Pv=class e{options;renderer;textRenderer;constructor(e){this.options=e||o_,this.options.renderer=this.options.renderer||new Mv,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Nv}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Fv=class{options;block;constructor(e){this.options=e||o_}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?jv.lex:jv.lexInline}provideParser(e=this.block){return e?Pv.parse:Pv.parseInline}},Iv=new class{defaults=a_();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Pv;Renderer=Mv;TextRenderer=Nv;Lexer=jv;Tokenizer=Av;Hooks=Fv;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Mv(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Av(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Fv;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Fv.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Fv.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return jv.lex(e,t??this.defaults)}parser(e,t){return Pv.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?jv.lex:jv.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Pv.parse:Pv.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?jv.lex:jv.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Pv.parse:Pv.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
107
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+xv(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Iv.parse(e,t)}$.options=$.setOptions=function(e){return Iv.setOptions(e),$.defaults=Iv.defaults,s_($.defaults),$},$.getDefaults=a_,$.defaults=o_,$.use=function(...e){return Iv.use(...e),$.defaults=Iv.defaults,s_($.defaults),$},$.walkTokens=function(e,t){return Iv.walkTokens(e,t)},$.parseInline=Iv.parseInline,$.Parser=Pv,$.parser=Pv.parse,$.Renderer=Mv,$.TextRenderer=Nv,$.Lexer=jv,$.lexer=jv.lex,$.Tokenizer=Av,$.Hooks=Fv,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,Pv.parse,jv.lex,$.setOptions({gfm:!0,breaks:!0});var Lv={ALLOWED_TAGS:[`p`,`br`,`strong`,`em`,`del`,`code`,`pre`,`blockquote`,`ul`,`ol`,`li`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`a`,`hr`,`span`],ALLOWED_ATTR:[`href`,`title`,`target`,`rel`],ALLOWED_URI_REGEXP:/^(?:https?:|mailto:|#|\/)/i},Rv;function zv(){if(Rv)return Rv;let e=i_();if(!e.isSupported)throw Error(`renderMarkdown: DOMPurify cannot sanitize in this environment (no usable DOM), so it refuses to render rather than return unsanitized HTML`);return e.addHook(`afterSanitizeAttributes`,e=>{let t=e;t.tagName===`A`&&t.getAttribute(`href`)&&(t.setAttribute(`target`,`_blank`),t.setAttribute(`rel`,`noopener noreferrer nofollow`))}),Rv=e}function Bv(e){return zv().sanitize(e,Lv)}function Vv(e){return e?Bv($.parse(String(e),{async:!1})):``}function Hv(e){let t=[],n=``,r=()=>{let e=Vv(n);e&&t.push({kind:`html`,html:e}),n=``};for(let i of $.lexer(String(e)))i.type===`code`&&i.codeBlockStyle!==`indented`?(r(),t.push({kind:`code`,lang:String(i.lang??``).trim().split(/\s+/)[0]??``,text:String(i.text)})):n+=i.raw;return r(),t}function Uv({...e}){return(0,q.jsx)(Ar,{"data-slot":`collapsible`,...e})}function Wv({...e}){return(0,q.jsx)(Mr,{"data-slot":`collapsible-trigger`,...e})}function Gv({...e}){return(0,q.jsx)(Pr,{"data-slot":`collapsible-content`,...e})}var Kv=500;function qv(e,t){let n=(0,o.useRef)(t);n.current=t,(0,o.useEffect)(()=>{let t=e.current?.parentElement;if(!t)return;let r,i,a=!1,o,s=()=>{clearTimeout(r),r=void 0,i=void 0},c=e=>{a=!1,s(),e.pointerType===`touch`&&(i={id:e.pointerId,x:e.clientX,y:e.clientY},r=setTimeout(()=>{r=void 0,i=void 0,a=!0,n.current()},Kv))},l=e=>{i!==void 0&&e.pointerId===i.id&&Math.hypot(e.clientX-i.x,e.clientY-i.y)>8&&s()},u=e=>{i!==void 0&&e.pointerId===i.id&&s(),a&&(clearTimeout(o),o=setTimeout(()=>{a=!1},100))},d=e=>{a&&(a=!1,e.preventDefault(),e.stopPropagation())},f=e=>{(r!==void 0||a)&&e.preventDefault()};return t.addEventListener(`pointerdown`,c),t.addEventListener(`pointermove`,l),t.addEventListener(`pointerup`,u),t.addEventListener(`pointercancel`,u),t.addEventListener(`click`,d,!0),t.addEventListener(`contextmenu`,f),()=>{s(),clearTimeout(o),t.removeEventListener(`pointerdown`,c),t.removeEventListener(`pointermove`,l),t.removeEventListener(`pointerup`,u),t.removeEventListener(`pointercancel`,u),t.removeEventListener(`click`,d,!0),t.removeEventListener(`contextmenu`,f)}},[e])}function Jv({msg:e,senderId:t,name:n,peer:r,onViewAgent:i}){let[a,s]=(0,o.useState)(!1),c=(0,o.useRef)(null);qv(c,()=>s(!0));let l=A(e.ts),u=Oe({view:`agent`,id:t,tab:`work`,at:e.id}),d=l?`View ${n}'s work at ${l}`:`View ${n}'s work`,f=(0,o.useId)();return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{ref:c,className:`ui-msg-acts`,children:[(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsxs)(`a`,{href:u,"aria-describedby":f,children:[(0,q.jsx)(X,{icon:jd,size:16,className:`ui-ic ui-ic16`}),`View work`]})}),(0,q.jsx)(yf,{children:d})]}),(0,q.jsx)(`span`,{id:f,className:`ui-sr`,children:d})]}),(0,q.jsx)(Yv,{open:a,onOpenChange:s,msg:e,senderId:t,name:n,peer:r,at:l,href:u,onViewAgent:i})]})}function Yv({open:e,onOpenChange:t,msg:n,senderId:r,name:i,peer:a,at:o,href:s,onViewAgent:c}){let l=Ph(),u=tp(),d=()=>t(!1);return(0,q.jsx)(af,{open:e,onOpenChange:t,children:(0,q.jsxs)(cf,{side:`bottom`,...u,children:[(0,q.jsxs)(lf,{className:`flex-row items-center gap-3`,children:[(0,q.jsx)(wh,{vendor:a.harness,status:a.status,size:28,dot:!1,badge:l(r)}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsx)(df,{children:i}),(0,q.jsx)(ff,{children:o?`Message at ${o}`:`Message`})]})]}),(0,q.jsxs)(uf,{children:[(0,q.jsx)(Cd,{asChild:!0,variant:`ghost`,className:`justify-start`,children:(0,q.jsxs)(`a`,{href:s,onClick:d,children:[(0,q.jsx)(X,{icon:jd,"data-icon":`inline-start`}),`View ${i}'s work here`]})}),(0,q.jsxs)(Cd,{type:`button`,variant:`ghost`,className:`justify-start`,onClick:()=>{d(),c(r)},children:[(0,q.jsx)(X,{icon:nf,"data-icon":`inline-start`}),`View agent`]}),(0,q.jsxs)(Cd,{type:`button`,variant:`ghost`,className:`justify-start`,onClick:()=>{Bm(E(n.parts)),d()},children:[(0,q.jsx)(X,{icon:Rd,"data-icon":`inline-start`}),`Copy text`]})]})]})})}var Xv=(0,o.createContext)(null),Zv=280,Qv=`History does not record who sent this message. The sender shown is the one the message names, and it has not been checked.`,$v=`Anycast: one free agent with this role takes it.`;function ey(){return(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsxs)(rp,{variant:`outline`,children:[`unverified`,(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${Qv}`})]})}),(0,q.jsx)(yf,{children:Qv})]})}function ty(e){let t=e===`claude-code`?`claude`:e;return Object.hasOwn(Ih,t)?Ih[t].label:e}function ny({msg:e,senderId:t,mode:n,idx:r,peers:i,run:a=`alone`,own:s=!1,mention:c,claim:l,place:u}){let[d,f]=(0,o.useState)(!1),p=(0,o.useContext)(Xv),m=Ph(),h=t??e.from?.id,g=h===void 0?void 0:i.get(h),_=E(e.parts),v=_.length>Zv,y=c!==void 0&&(e.mentions??[]).includes(c.toLowerCase()),b=typeof e.toService==`string`?e.toService:void 0,x=Number.isFinite(e.ts)?new Date(e.ts):void 0,S=t===void 0?`alone`:a,C={__html:Vv(_)},w=Ie(t??e.from,r),T=t!==void 0&&i.has(t)?m(t):void 0,D=(0,q.jsx)(wh,{vendor:g?.harness,status:g?.status??`offline`,size:32,dot:!1,badge:T});return(0,q.jsxs)(wp,{align:s?`end`:`start`,children:[(0,q.jsx)(Tp,{className:`overflow-visible`,children:(S===`alone`||S===`last`)&&(p&&t!==void 0?(0,q.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":w,onClick:()=>p(t),children:D}):D)}),(0,q.jsxs)(Ep,{children:[(S===`alone`||S===`first`)&&(0,q.jsxs)(Dp,{className:`flex-wrap gap-2`,children:[p&&t!==void 0?(0,q.jsx)(Cd,{type:`button`,variant:`link`,size:`xs`,className:`h-auto p-0`,onClick:()=>p(t),children:w}):(0,q.jsx)(`span`,{children:w}),t===void 0&&(0,q.jsx)(ey,{}),u&&(0,q.jsx)(rp,{variant:`secondary`,children:u}),u===void 0&&g?.role&&(0,q.jsx)(rp,{variant:`secondary`,children:g.role}),u===void 0&&g?.harness&&(0,q.jsx)(rp,{variant:`outline`,children:ty(g.harness)}),x&&(0,q.jsx)(`time`,{dateTime:x.toISOString(),children:k(x)})]}),(0,q.jsx)(sp,{variant:s?`default`:y?`tinted`:`secondary`,children:(0,q.jsx)(cp,{children:v?(0,q.jsxs)(Uv,{open:d,onOpenChange:f,children:[(0,q.jsx)(Gv,{forceMount:!0,className:d?`ui-tx`:`ui-tx ui-clamp`,dangerouslySetInnerHTML:C}),(0,q.jsx)(Wv,{asChild:!0,children:(0,q.jsxs)(Cd,{type:`button`,variant:`ghost`,size:`xs`,children:[d?`Show less`:`Show more`,(0,q.jsx)(X,{icon:Dd,"data-icon":`inline-end`,className:`group-data-open/button:rotate-180`})]})})]}):(0,q.jsx)(`div`,{className:`ui-tx`,dangerouslySetInnerHTML:C})})}),n===`anycast`&&b!==void 0&&(0,q.jsxs)(Op,{className:`flex-wrap gap-1.5`,children:[(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsxs)(rp,{variant:`outline`,children:[(0,q.jsx)(`i`,{className:`ui-mode-dot`,style:{background:`var(--any)`}}),`To any ${b}`,(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${$v}`})]})}),(0,q.jsx)(yf,{children:$v})]}),l!==void 0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{children:` · claimed by ${Ie(l.id,r)}`}),!l.verified&&(0,q.jsx)(ey,{})]})]})]}),t!==void 0&&g!==void 0&&i.has(t)&&(0,q.jsx)(Jv,{msg:e,senderId:t,name:w,peer:g,onViewAgent:p??ry})]})}var ry=()=>void 0,iy=xd(`group/alert relative grid w-full gap-0.5 rounded-2xl border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function ay({className:e,variant:t,...n}){return(0,q.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:K(iy({variant:t}),e),...n})}function oy({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-title`,className:K(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function sy({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-description`,className:K(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function cy({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-action`,className:K(`absolute top-2.5 right-3`,e),...t})}var ly=xd(`group/toggle inline-flex items-center justify-center gap-1 rounded-2xl text-sm font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function uy({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,q.jsx)(Iu,{"data-slot":`toggle`,className:K(ly({variant:t,size:n,className:e})),...r})}function dy({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,q.jsx)(pu,{"data-slot":`separator`,decorative:n,orientation:t,className:K(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}function fy(){let{isMobile:e,open:t,openMobile:n}=Df(),r=(0,o.useRef)(null),i=(0,o.useRef)(n);(0,o.useEffect)(()=>{i.current&&!n&&r.current?.focus(),i.current=n},[n]);let a=e?`Open sidebar`:`Toggle sidebar`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsx)(Af,{ref:r,"aria-label":a,"aria-haspopup":e?`dialog`:void 0,"aria-expanded":e?n:t})}),(0,q.jsx)(yf,{children:a})]}),(0,q.jsx)(dy,{orientation:`vertical`,className:`data-vertical:h-4 data-vertical:self-auto`})]})}var py=xd(`group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground`,{variants:{variant:{default:``,separator:`before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border`,border:`border-b border-border pb-2`}}});function my({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?Qt:`div`;return(0,q.jsx)(i,{"data-slot":`marker`,"data-variant":t,className:K(py({variant:t,className:e})),...r})}function hy({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`marker-icon`,"aria-hidden":`true`,className:K(`size-4 shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...t})}function gy({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`marker-content`,className:K(`min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function _y(e){let t=Math.floor(Math.max(0,e)/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}var vy=(e,t)=>typeof t==`number`&&Number.isFinite(t)?Math.max(0,e-t):void 0;function yy(e,t){let n=[],r=vy(t,e.condition?.since);e.condition&&n.push(`${e.condition.code}${r===void 0?``:` for ${_y(r)}`}`);let i=vy(t,e.statusSince);i!==void 0&&n.push(`unchanged for ${_y(i)}`);let a=vy(t,e.activeAt);a!==void 0&&n.push(`active ${_y(a)} ago`);let o=e.activity?vy(t,e.activitySince):void 0;return o!==void 0&&n.push(`activity set ${_y(o)} ago`),n.join(` · `)}var by=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0,xy={dnd:{icon:Jd,word:`Do not disturb`,color:`var(--uni-ink)`,title:`Channel messages wait for its next turn. DMs and mentions still wake it.`},focus:{icon:$d,word:`Focus`,color:`var(--multi-ink)`,title:`Channel messages stay in the channel. DMs and role requests still reach it.`}};function Sy({attention:e}){if(e===void 0||!Object.hasOwn(xy,e))return null;let t=xy[e];return(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsxs)(`span`,{className:`v3-meta`,style:{color:t.color},children:[(0,q.jsx)(X,{icon:t.icon,size:16,className:`ui-ic ui-ic16`}),t.word,(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${t.title}`})]})}),(0,q.jsx)(yf,{children:t.title})]})}var Cy=[];function wy(e,t){(0,o.useEffect)(()=>{if(e)return e.openSession(t),()=>e.closeSession(t)},[e,t])}function Ty(e){let t=e?.condition;if(typeof t==`object`&&t&&typeof t.code==`string`)return typeof t.since==`number`?{code:t.code,since:t.since}:{code:t.code}}function Ey(e,t){let n=Xe(e,e=>e.sessions[t]?.posts)??Cy,r=Xe(e,e=>e.dms);return(0,o.useMemo)(()=>{let e=new Set(n.map(e=>e.msg.id)),i=r.filter(n=>n.senderId===t&&typeof n.msg.to==`string`&&!e.has(n.msg.id));return i.length===0?n:[...n,...i]},[n,r,t])}function Dy(e){let[t]=(0,o.useState)(e),[n,r]=(0,o.useState)(!1);return!n&&e!==t&&r(!0),n||e!==t?`ui-xfade`:void 0}function Oy({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`trace`,className:K(`flex w-full min-w-0 flex-col gap-2 *:has-[>[data-slot=trace-line]]:flex *:has-[>[data-slot=trace-line]]:w-fit *:has-[>[data-slot=trace-line]]:max-w-full *:has-[>[data-slot=trace-line]]:min-w-0 *:has-[>[data-slot=trace-line]]:rounded-lg *:has-[>[data-slot=trace-line]]:text-left *:has-[>[data-slot=trace-line]]:outline-none *:has-[>[data-slot=trace-line]]:focus-visible:ring-3 *:has-[>[data-slot=trace-line]]:focus-visible:ring-ring/30`,e),...t})}function ky({className:e,status:t,...n}){return(0,q.jsx)(`span`,{"data-slot":`trace-line`,"data-status":t,className:K(`flex w-fit max-w-full min-w-0 items-center gap-2 text-sm text-muted-foreground transition-colors in-[a,button]:cursor-pointer in-[a:hover,button:hover]:text-foreground data-[status=error]:text-destructive data-[status=error]:in-[a:hover,button:hover]:text-destructive data-[status=pending]:opacity-60 data-[status=running]:*:data-[slot=trace-title]:shimmer`,e),...n})}function Ay({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`trace-icon`,"aria-hidden":`true`,className:K(`flex size-4 shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=trace-title]~&]:-ml-1`,e),...t})}function jy({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`trace-title`,className:K(`min-w-0 truncate motion-reduce:shimmer-none`,e),...t})}function My({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`trace-description`,className:K(`shrink-0 text-muted-foreground/70 tabular-nums`,e),...t})}function Ny({className:e,...t}){return(0,q.jsx)(Uv,{"data-slot":`trace-collapsible`,className:K(`flex w-full min-w-0 flex-col`,e),...t})}function Py({className:e,children:t,...n}){return(0,q.jsxs)(Wv,{"data-slot":`trace-collapsible-trigger`,className:K(`group/trace-collapsible-trigger flex w-fit max-w-full min-w-0 cursor-pointer items-center gap-1 rounded-lg text-left text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30 has-[[data-status=error]]:text-destructive`,e),...n,children:[t,(0,q.jsx)(Ay,{className:`transition-transform group-aria-expanded/trace-collapsible-trigger:rotate-90`,children:(0,q.jsx)(Td,{icon:kd,strokeWidth:2})})]})}function Fy({className:e,children:t,...n}){return(0,q.jsx)(Gv,{"data-slot":`trace-collapsible-content`,className:`min-w-0 overflow-hidden duration-200 [--radix-accordion-content-height:var(--radix-collapsible-content-height)] data-open:animate-accordion-down data-closed:animate-accordion-up`,...n,children:(0,q.jsx)(`div`,{"data-slot":`trace-collapsible-content-inner`,className:K(`mt-2 mb-1 ml-[calc(--spacing(2)-1px)] min-w-0 border-l pr-1 pl-4 leading-relaxed wrap-break-word text-muted-foreground`,e),children:t})})}function Iy({line:e,words:t}){let[n,r]=(0,o.useState)(!1);return(0,q.jsxs)(_f,{open:n,onOpenChange:r,children:[(0,q.jsx)(vf,{type:`button`,className:`ox-tip`,onClick:e=>{e.preventDefault(),r(!n)},children:e}),(0,q.jsx)(yf,{className:`ox-tipc`,sideOffset:4,children:t})]})}function Ly(e){let[t,n]=(0,o.useState)(()=>Date.now()),[r,i]=(0,o.useState)(e);return e!==r&&(i(e),e&&n(Date.now())),(0,o.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function Ry(e){try{let t=JSON.parse(e);if(typeof t==`object`&&t&&`cotalPayloadCut`in t&&t.cotalPayloadCut===!0){let e=t;if(typeof e.originalBytes==`number`&&Number.isSafeInteger(e.originalBytes)&&e.originalBytes>=0&&typeof e.sha256==`string`&&/^[a-f0-9]{64}$/.test(e.sha256))return`Omitted: ${e.originalBytes} bytes, SHA-256 ${e.sha256}`}}catch{}return e.length>32768?`${e.slice(0,32768)}\n[Display cut: showing 32768 of ${e.length} characters]`:e===``?`(empty)`:e}function zy({call:e,payloadRead:t}){let n=t?t.status===`refused`?`read refused`:`read failed`:`not received`;return(0,q.jsx)(`div`,{className:`ox-payloads`,children:[[`Input`,e.input],[`Result`,e.result]].map(([e,r])=>(0,q.jsxs)(`details`,{className:`ox-payload`,children:[(0,q.jsxs)(`summary`,{children:[e,r===void 0?` · ${n}`:``]}),(0,q.jsx)(`pre`,{children:r===void 0?t?.reason??`No payload received. It may be withheld or outside the retained window.`:Ry(r)})]},e))})}var By={command:Ld,edit:Bd,write:Bd,read:zd,send:Yd,dm:Yd,inbox:Ud,other:rf},Vy=e=>By[e],Hy=`The connector reports the call returned an error. Open Input or Result for any received payload.`,Uy=`The connector reports the call returned an error. Open Input or Result for any received payload.`;function Wy(e,t){if(t===`running`)return(0,q.jsx)(zm,{role:void 0,"aria-label":void 0,"aria-hidden":!0});let n=t===`failed`?Id:t===`pending`?Hd:t===`noResult`?tf:Vy(e.kind);return(0,q.jsx)(X,{icon:n,size:16})}function Gy({call:e,state:t,shimmer:n=!0,className:r,payloadRead:i}){let a=Ly(t===`running`),o=Dy(t),s=t===`running`?n?`running`:void 0:t===`failed`?`error`:t===`pending`||t===`noResult`?`pending`:void 0,c=_e(e,t,a),l=ue(e.name),u=[`ox-line`,r,o].filter(Boolean).join(` `),d=e.full===l?void 0:e.full,f=d===void 0?(0,q.jsx)(`code`,{children:l}):(0,q.jsxs)(`code`,{children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,children:l}),(0,q.jsx)(`span`,{className:`ui-sr`,children:d})]}),p=t===`called`&&d!==void 0,m=(0,q.jsxs)(jy,{children:[de(e.kind,t,e.name),p&&(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${d}`})]}),h=(0,q.jsxs)(ky,{status:s,role:s===`running`?`status`:void 0,className:u,children:[(0,q.jsx)(Ay,{children:Wy(e,t)}),p?(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:m}),(0,q.jsx)(yf,{children:d})]}):m,` `,c&&(0,q.jsx)(My,{children:t===`called`?c:(0,q.jsxs)(q.Fragment,{children:[d===void 0||t===`failed`?f:(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:f}),(0,q.jsx)(yf,{children:d})]}),t===`running`?(0,q.jsx)(`span`,{"aria-hidden":`true`,children:c.slice(l.length)}):c.slice(l.length)]})})]},t);return(0,q.jsxs)(`div`,{className:`ox-call`,children:[t===`failed`?(0,q.jsx)(Iy,{line:h,words:e.kind===`command`?Hy:Uy}):h,(0,q.jsx)(zy,{call:e,payloadRead:i})]})}function Ky({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(wu,{"data-slot":`tabs`,"data-orientation":t,className:K(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var qy=xd(`group/tabs-list inline-flex w-fit items-center justify-center rounded-2xl p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col group-data-vertical/tabs:p-1 data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Jy({className:e,variant:t=`default`,...n}){return(0,q.jsx)(Eu,{"data-slot":`tabs-list`,"data-variant":t,className:K(qy({variant:t}),e),...n})}function Yy({className:e,...t}){return(0,q.jsx)(Ou,{"data-slot":`tabs-trigger`,className:K(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-2xl 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 group-data-vertical/tabs:px-3 group-data-vertical/tabs:py-0.5 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 dark:text-muted-foreground dark:hover:text-foreground [&_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 Xy({className:e,...t}){return(0,q.jsx)(Au,{"data-slot":`tabs-content`,className:K(`flex-1 text-sm outline-none`,e),...t})}function Zy({children:e,action:t}){return(0,q.jsxs)(ay,{role:`note`,className:`mb-2`,children:[(0,q.jsx)(X,{icon:Wd}),(0,q.jsx)(sy,{children:e}),t&&(0,q.jsx)(cy,{children:t})]})}function Qy({row:e}){let t=Object.hasOwn(mh,e.status)?mh[e.status]:void 0,n=G(e),r=Dy(e.status),i=e.activity||void 0,a;if(e.status===`working`||e.status===`waiting`){let t=A(e.statusSince);a=[i&&(/[.!?]$/.test(i)?i:`${i}.`),t&&`Reported ${t}.`].filter(Boolean).join(` `)||void 0}else if(e.status===`offline`){let t=A(e.ts);a=t&&`Last heartbeat ${t}.`}else e.status===`idle`&&(a=`No current activity.`);return(0,q.jsxs)(`div`,{className:r?`ox-foot ${r}`:`ox-foot`,children:[(0,q.jsx)(`span`,{className:`v3-spill v3-s-${e.status}`,children:t&&(0,q.jsx)(X,{icon:t,size:16,className:`ui-ic`})}),(0,q.jsx)(`b`,{children:e.name}),` is ${n} `,a&&(0,q.jsx)(`span`,{className:e.status===`waiting`?`ox-foot-wait`:void 0,children:a})]},e.status)}var $y=()=>Promise.all([Yf(()=>import(`./core-Bfff_dYO.js`),__vite__mapDeps([0,1])),Yf(()=>import(`./engine-javascript-C30F4iNc.js`),[])]),eb=new Map([[`javascript`,()=>Yf(()=>import(`./javascript-BgS3c2Ky.js`),[])],[`typescript`,()=>Yf(()=>import(`./typescript-bsJCZSQ-.js`),[])],[`json`,()=>Yf(()=>import(`./json-qhed-kSA.js`),[])],[`bash`,()=>Yf(()=>import(`./bash-CLZ0U2zV.js`),[])],[`diff`,()=>Yf(()=>import(`./diff-woXpYk--.js`),[])],[`python`,()=>Yf(()=>import(`./python-gzcpVVnB.js`),[])],[`yaml`,()=>Yf(()=>import(`./yaml-rwi0_p6S.js`),[])],[`markdown`,()=>Yf(()=>import(`./markdown-BYOwaDjH.js`),[])]]),tb=new Map([[`js`,`javascript`],[`javascript`,`javascript`],[`ts`,`typescript`],[`typescript`,`typescript`],[`json`,`json`],[`bash`,`bash`],[`sh`,`bash`],[`shell`,`bash`],[`zsh`,`bash`],[`diff`,`diff`],[`python`,`python`],[`py`,`python`],[`yaml`,`yaml`],[`yml`,`yaml`],[`markdown`,`markdown`],[`md`,`markdown`]]),nb=`cotal`,rb=1e3,ib,ab=new Map;function ob(){return ib??=$y().then(([{createHighlighterCore:e,createCssVariablesTheme:t},{createJavaScriptRegexEngine:n}])=>e({themes:[t({name:nb,variablePrefix:`--shiki-`,fontStyle:!1})],langs:[],engine:n({forgiving:!0})})).catch(e=>{throw ib=void 0,e}),ib}function sb(e,t){let n=ab.get(t);return n||(n=e.loadLanguage(eb.get(t)).catch(e=>{throw ab.delete(t),e}),ab.set(t,n)),n}async function cb(e,t){let n=tb.get(t.toLowerCase());if(n!==void 0&&!(e.length>2e4))try{let t=await ob();return await sb(t,n),t.codeToTokens(e,{lang:n,theme:nb,tokenizeMaxLineLength:rb}).tokens.map(e=>e.map(e=>e.color===void 0?{content:e.content}:{content:e.content,color:e.color}))}catch(e){console.error(`highlighting a code block failed, so it stays plain:`,e);return}}var lb=xd(`group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-2xl text-sm has-[>[data-slot=code-block-content]:focus-visible]:ring-3 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/30 data-[size=sm]:rounded-xl data-[size=sm]:text-xs`,{variants:{variant:{default:`bg-muted text-foreground ring-1 ring-foreground/5 dark:ring-foreground/10`,destructive:`bg-destructive/5 text-destructive ring-1 ring-destructive/15 dark:bg-destructive/10 dark:ring-destructive/20`}},defaultVariants:{variant:`default`}});function ub({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,q.jsx)(`div`,{"data-slot":`code-block`,"data-variant":t,"data-size":n,className:K(lb({variant:t}),e),...r})}function db({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`code-block-header`,className:K(`flex min-w-0 shrink-0 items-center gap-2 px-4 pt-4 text-muted-foreground group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:pt-3 group-data-[variant=destructive]/code-block:text-destructive *:has-[>[data-slot=code-block-title]]:min-w-0`,e),...t})}function fb({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`code-block-actions`,className:K(`-my-1 ms-auto -me-1.5 flex shrink-0 items-center gap-1 *:data-[slot=button]:hover:bg-foreground/5 dark:*:data-[slot=button]:hover:bg-foreground/10 [[data-slot=code-block]>&]:absolute [[data-slot=code-block]>&]:end-3 [[data-slot=code-block]>&]:top-3 [[data-slot=code-block]>&]:z-10 [[data-slot=code-block]>&]:m-0 [[data-slot=code-block]>&]:opacity-0 [[data-slot=code-block]>&]:transition-opacity [[data-slot=code-block]>&]:group-focus-within/code-block:opacity-100 [[data-slot=code-block]>&]:group-hover/code-block:opacity-100 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:end-2 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:top-2 [[data-slot=code-block]>&]:pointer-coarse:opacity-100 [[data-slot=code-block]>&]:*:[button]:bg-background [[data-slot=code-block]>&]:*:[button]:ring-1 [[data-slot=code-block]>&]:*:[button]:ring-foreground/10`,e),...t})}function pb({className:e,children:t,style:n,wrap:r=!1,lineNumbers:i=!1,startLine:a=1,...o}){return(0,q.jsx)(`pre`,{"data-slot":`code-block-content`,"data-wrap":r||void 0,"data-numbered":i||void 0,dir:`ltr`,tabIndex:0,style:{counterReset:`line ${a-1}`,...n},className:K(`min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto px-4 py-4 text-start font-mono leading-relaxed outline-none group-has-data-[slot=code-block-footer]/code-block:pb-2 group-has-data-[slot=code-block-header]/code-block:pt-2 group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:py-3 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap`,e),...o,children:(0,q.jsx)(`code`,{"data-slot":`code-block-code`,className:`grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0`,children:i&&typeof t==`string`?t.replace(/\n$/,``).split(`
108
+ `).map((e,t)=>(0,q.jsx)(hb,{children:e},t)):t})})}var mb=xd(`relative -mx-4 block min-h-lh px-4 group-data-[size=sm]/code-block:-mx-3 group-data-[size=sm]/code-block:px-3 before:min-w-6 before:text-end before:text-muted-foreground after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3 in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']`,{variants:{variant:{default:``,added:`bg-foreground/5 after:content-['+']`,removed:`bg-destructive/10 after:text-destructive after:content-['−']`,highlighted:`bg-foreground/5`}},defaultVariants:{variant:`default`}});function hb({className:e,variant:t=`default`,children:n,...r}){let i=n==null||n===``||Array.isArray(n)&&n.length===0;return(0,q.jsx)(`span`,{"data-slot":`code-block-line`,"data-variant":t,className:K(mb({variant:t}),e),...r,children:(0,q.jsx)(`span`,{"data-slot":`code-block-line-content`,className:`min-w-0`,children:i?`
109
+ `:n})})}function gb({lang:e,text:t}){let n=(0,o.useRef)(null),[r,i]=(0,o.useState)(void 0);(0,o.useEffect)(()=>{let r=!0,a=()=>void cb(t,e).then(n=>{r&&n&&i({text:t,lang:e,lines:n})}),o=globalThis.IntersectionObserver;if(!o||!n.current)return a(),()=>{r=!1};let s=new o(e=>{e.some(e=>e.isIntersecting)&&(s.disconnect(),a())});return s.observe(n.current),()=>{r=!1,s.disconnect()}},[t,e]);let a=r?.text===t&&r.lang===e?r.lines:void 0,s=e&&ue(e,24);return(0,q.jsxs)(ub,{ref:n,size:`sm`,className:`ox-code`,children:[(0,q.jsxs)(db,{className:`ox-code-h`,children:[s&&(s===e?(0,q.jsx)(`span`,{children:e}):(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,children:s}),(0,q.jsx)(`span`,{className:`ui-sr`,children:e})]})}),(0,q.jsx)(yf,{children:e})]})),` `,(0,q.jsx)(fb,{className:`ox-code-acts`,children:(0,q.jsxs)(Cd,{type:`button`,variant:`ghost`,size:`xs`,onClick:()=>Bm(t),children:[(0,q.jsx)(X,{icon:Rd,"data-icon":`inline-start`}),`Copy`]})})]}),(0,q.jsx)(pb,{className:`ox-code-c`,children:a?a.map((e,t)=>(0,q.jsx)(hb,{children:e.map((e,t)=>(0,q.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))},t)):t})]})}var _b=280,vb=e=>e.replace(/<[^>]*>/g,``).length;function yb({src:e,className:t,clamp:n=!0}){let r=(0,o.useMemo)(()=>Hv(e),[e]),[i,a]=(0,o.useState)(!1),s=n&&r.some(e=>e.kind===`html`&&vb(e.html)>_b);return(0,q.jsxs)(`div`,{className:t,children:[r.map((e,t)=>e.kind===`code`?(0,q.jsx)(gb,{lang:e.lang,text:e.text},t):(0,q.jsx)(`div`,{className:s&&!i&&vb(e.html)>_b?`ox-prose ui-clamp`:`ox-prose`,dangerouslySetInnerHTML:{__html:e.html}},t)),s&&(0,q.jsx)(Cd,{type:`button`,variant:`link`,size:`sm`,className:`px-0`,"aria-expanded":i,onClick:()=>a(!i),children:i?`Show less`:`Show more`})]})}function bb({ts:e}){let t=O(e);return t?(0,q.jsx)(`time`,{dateTime:t.toISOString(),children:k(t)}):null}function xb({msg:e,agent:t,channel:n,to:r,toName:i,compact:a=!1,highlight:o=!1}){let s=n===void 0,c=[`ox-post`,s&&`ox-post-dm`,o&&`ox-post-hl`].filter(Boolean).join(` `),l=Oe(s?{view:`dm`,peer:t,...r===void 0?{}:{with:r}}:{view:`channel`,channel:n});return(0,q.jsxs)(`div`,{className:c,"data-post":e.id,children:[(0,q.jsxs)(`div`,{className:`ox-post-h`,children:[(0,q.jsx)(X,{icon:s?Pd:Vd,size:16}),(0,q.jsx)(`span`,{children:s?`Sent to ${i??r??``}`:`Posted in #${n}`}),(0,q.jsx)(bb,{ts:e.ts}),!a&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`ui-sp`}),(0,q.jsxs)(`a`,{className:`ox-act`,href:l,children:[s?`Open conversation`:`Open in #${n}`,(0,q.jsx)(X,{icon:jd,size:16})]})]})]}),(0,q.jsx)(yb,{className:`ui-tx`,src:E(e.parts),clamp:!a})]})}var Sb=(e,t)=>t?`${e} …`:e,Cb=/^ {0,3}```/gm;function wb(e,t){return t?(e.match(Cb)??[]).length%2==1?`${e}\n\`\`\`\n …`:`${e} …`:e}function Tb({text:e,cut:t,compact:n=!1}){return(0,q.jsx)(yb,{className:`ox-said`,src:wb(e,t),clamp:!n})}var Eb=280;function Db({text:e,cut:t}){let[n,r]=(0,o.useState)(!1),i=wb(e,t),a=i.length>Eb;return(0,q.jsxs)(`div`,{className:`ui-prompt`,children:[(0,q.jsx)(`span`,{children:`Prompt`}),(0,q.jsx)(`div`,{className:a&&!n?`ui-tx ui-clamp`:`ui-tx`,dangerouslySetInnerHTML:{__html:Vv(i)}}),a&&(0,q.jsx)(Cd,{type:`button`,variant:`link`,size:`sm`,className:`px-0`,"aria-expanded":n,onClick:()=>r(!n),children:n?`Show less`:`Show more`})]})}function Ob({text:e,cut:t}){return(0,q.jsxs)(Ny,{children:[(0,q.jsx)(Py,{className:`ox-trig`,children:(0,q.jsxs)(ky,{className:`ox-line`,children:[(0,q.jsx)(Ay,{children:(0,q.jsx)(X,{icon:Nd,size:16})}),(0,q.jsx)(jy,{children:`Reasoning`})]})}),(0,q.jsx)(Fy,{className:`ox-cc`,children:(0,q.jsx)(`div`,{className:`ox-think`,children:Sb(e,t)})})]})}function kb({ts:e,condition:t}){return(0,q.jsxs)(ay,{variant:`destructive`,role:`note`,children:[(0,q.jsx)(X,{icon:Ed}),(0,q.jsx)(oy,{children:O(e)?(0,q.jsxs)(q.Fragment,{children:[`Turn failed at `,(0,q.jsx)(bb,{ts:e})]}):`Turn failed`}),(0,q.jsxs)(sy,{children:[(0,q.jsx)(`div`,{children:`The event plane doesn't say why.`}),t!==void 0&&(0,q.jsxs)(`div`,{children:[`Presence reports `,(0,q.jsx)(`code`,{children:t.code}),O(t.since)&&(0,q.jsxs)(q.Fragment,{children:[` since `,(0,q.jsx)(bb,{ts:t.since})]}),`.`]})]})]})}function Ab(e,t){if(!t)return rf;let n=new Map;for(let t of e)n.set(t.kind,(n.get(t.kind)??0)+1);let r=Math.max(...n.values()),i=[...n].filter(([,e])=>e===r);return i.length===1?Vy(i[0][0]):rf}function jb({calls:e,at:t,toolStatus:n,line:r=!1,className:i,payloadRead:a}){let{title:o,failed:s}=fe(e,n),c=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Ay,{children:(0,q.jsx)(X,{icon:Ab(e,n),size:16})}),(0,q.jsxs)(jy,{children:[o,s>0&&(0,q.jsxs)(q.Fragment,{children:[`, `,(0,q.jsxs)(`span`,{className:`ox-fail`,children:[(0,q.jsx)(X,{icon:Id,size:16}),`${s} failed`]})]})]})]});return r?(0,q.jsx)(ky,{className:i?`ox-line ${i}`:`ox-line`,children:c}):(0,q.jsxs)(Ny,{className:i,children:[(0,q.jsx)(Py,{className:`ox-trig`,children:(0,q.jsxs)(ky,{className:`ox-line`,children:[c,` `,(0,q.jsx)(My,{children:ve(e,n)})]})}),(0,q.jsx)(Fy,{className:`ox-cc`,children:(0,q.jsx)(Oy,{className:`ox-calls`,children:e.map(e=>(0,q.jsx)(Gy,{payloadRead:a,call:e,state:H(e,{...t,toolStatus:n})},e.key))})})]})}var Mb=(0,o.createContext)(()=>!1),Nb=new Set([`done`,`failed`,`called`]);function Pb({step:e,at:t,toolStatus:n,compact:r,payloadRead:i}){let a=(0,o.useContext)(Mb),s=e.calls.map(e=>H(e,{...t,toolStatus:n})),c=e.calls.length>=2&&s.every(e=>Nb.has(e)),l=Dy(c?`group`:`lines`),[u,d]=(0,o.useState)(c),[f,p]=(0,o.useState)(!1);if(u!==c&&(d(c),p(c)),c)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(jb,{payloadRead:i,calls:e.calls,at:t,toolStatus:n,line:r,className:l},`group`),f&&(0,q.jsx)(`div`,{className:`ox-fold`,"aria-hidden":`true`,style:{"--fold-n":e.calls.length-1},onAnimationEnd:()=>p(!1),children:e.calls.slice(1).map((e,t)=>(0,q.jsx)(Gy,{payloadRead:i,call:e,state:s[t+1]},e.key))})]});let m=s.lastIndexOf(`running`);return(0,q.jsx)(q.Fragment,{children:e.calls.map((e,t)=>(0,q.jsx)(Gy,{payloadRead:i,call:e,state:s[t],shimmer:t===m,className:t>0&&a(e)?`ui-in`:void 0},e.key))})}function Fb({ts:e}){return(0,q.jsxs)(ky,{className:`ox-line`,children:[(0,q.jsx)(Ay,{children:(0,q.jsx)(X,{icon:ef,size:16})}),(0,q.jsx)(jy,{children:`Turn ended`}),` `,(0,q.jsx)(My,{children:(0,q.jsx)(bb,{ts:e})})]})}function Ib({label:e,ts:t}){return(0,q.jsxs)(ky,{className:`ox-line`,children:[(0,q.jsx)(Ay,{children:(0,q.jsx)(X,{icon:Wd,size:16})}),(0,q.jsx)(jy,{children:e}),` `,(0,q.jsx)(My,{children:(0,q.jsx)(bb,{ts:t})})]})}function Lb({step:e,turn:t,trailing:n,ctx:r,condition:i}){switch(e.kind){case`prompt`:return r.compact?null:(0,q.jsx)(Db,{text:e.text,cut:e.cut});case`reasoning`:return r.compact?null:(0,q.jsx)(Ob,{text:e.text,cut:e.cut});case`said`:return(0,q.jsx)(Tb,{text:e.text,cut:e.cut,compact:r.compact});case`tools`:return(0,q.jsx)(Pb,{payloadRead:r.payloadRead,step:e,at:{turn:t,trailing:n,status:r.row.status},toolStatus:r.toolStatus,compact:r.compact});case`post`:return(0,q.jsx)(xb,{msg:e.msg,agent:r.row.id,...e.channel===void 0?{to:e.to,toName:r.nameOf(e.to??``)}:{channel:e.channel},compact:r.compact,highlight:r.highlight!==void 0&&e.msg.id===r.highlight});case`runError`:return(0,q.jsx)(kb,{ts:e.ts,condition:i});case`unknown`:return(0,q.jsx)(Ib,{label:e.label,ts:e.ts})}}function Rb({turn:e,row:t}){let n=e.outcome===`open`&&!e.superseded,r=n&&t.status===`working`,i=Ly(n&&(t.status===`working`||t.status===`waiting`)),{title:a,failed:o}=me(e,t.status,i),s=ge(e),c=r?(0,q.jsx)(zm,{className:`ox-live`,role:void 0,"aria-label":void 0,"aria-hidden":!0}):(0,q.jsx)(X,{icon:e.outcome===`finished`?ef:e.outcome===`failed`?Ed:n&&t.status===`waiting`?Hd:tf,size:16});return(0,q.jsxs)(ky,{status:e.outcome===`failed`?`error`:void 0,className:`ox-line`,children:[(0,q.jsx)(Ay,{children:c}),(0,q.jsxs)(jy,{children:[r?(0,q.jsx)(`b`,{children:a}):a,o!==void 0&&(0,q.jsxs)(q.Fragment,{children:[`, `,(0,q.jsxs)(`span`,{className:`ox-fail`,children:[(0,q.jsx)(X,{icon:Id,size:16}),o]})]})]}),` `,s&&(0,q.jsx)(My,{children:s})]})}function zb({turn:e,row:t,toolStatus:n,defaultOpen:r,highlight:i,condition:a,nameOf:s}){let c=(0,o.useContext)(Mb),[l,u]=(0,o.useState)(void 0),d=l??r,f={row:t,toolStatus:n,compact:!1,nameOf:s,...i===void 0?{}:{highlight:i}},p=e.steps.at(-1),m=e.steps.findLast(e=>e.kind!==`runError`);return(0,q.jsxs)(Ny,{open:d,onOpenChange:u,children:[(0,q.jsx)(Py,{className:`ox-trig`,children:(0,q.jsx)(Rb,{turn:e,row:t})}),(0,q.jsx)(Fy,{className:`ox-cc`,children:(0,q.jsx)(Oy,{className:`ox-turn`,children:e.steps.map(t=>(0,q.jsx)(`div`,{className:c(t)?`ox-step ui-in`:`ox-step`,children:(0,q.jsx)(Lb,{step:t,turn:e,trailing:t===m,ctx:f,condition:t===p?a:void 0})},t.key))})})]})}function Bb(e){let t=[],n=e=>{for(let r of e)t.push(r),r.kind===`turn`?n(r.steps):r.kind===`tools`&&t.push(...r.calls)};return n(e),t}function Vb(e,t){let n=(0,o.useRef)(void 0),r=n.current?.id===t?n.current:void 0;return(0,o.useEffect)(()=>{let r=Bb(e),i=n.current;if(i?.id!==t)n.current={id:t,known:new Set(r.map(e=>e.key)),rising:new Set};else for(let e of r)i.known.has(e.key)||(i.known.add(e.key),e.live&&i.rising.add(e.key))}),e=>r!==void 0&&(r.rising.has(e.key)||e.live&&!r.known.has(e.key))}function Hb(e,t){let n=e.filter(e=>e.kind===`turn`);return(t===void 0?void 0:n.find(e=>e.steps.some(e=>e.kind===`post`&&e.msg.id===t)))??n.findLast(e=>e.outcome===`open`&&!e.superseded)??n.at(-1)}function Ub({work:e,row:t,highlight:n,compact:r=!1,condition:i,nameOf:a,payloadRead:o}){let s=Vb(e.items,t.id),c=Hb(e.items,n),l={row:t,payloadRead:o,toolStatus:e.toolStatus,compact:r,nameOf:a,...n===void 0?{}:{highlight:n}},u=e=>!r||e.kind!==`prompt`&&e.kind!==`reasoning`,d=e.items.at(-1),f=(e,t,n,r)=>(0,q.jsx)(`div`,{className:s(e)?`ox-step ui-in`:`ox-step`,children:e.kind===`turnEnd`?(0,q.jsx)(Fb,{ts:e.ts}):(0,q.jsx)(Lb,{step:e,turn:t,trailing:n,ctx:l,condition:r})},e.key);return(0,q.jsx)(Mb.Provider,{value:s,children:(0,q.jsxs)(Oy,{className:r?`ox-work ox-compact`:`ox-work`,children:[o&&(0,q.jsxs)(Zy,{children:[o.reason,` Work metadata is still shown.`]}),!e.toolStatus&&(0,q.jsx)(Zy,{children:`${t.name}'s connector reports which tools it calls but not when they finish, so Work can't show running, done or failed. A connector that reports tool results shows them here once ${t.name} restarts on it.`}),e.items.filter(u).map(o=>{if(o.kind!==`turn`)return f(o,void 0,o===d,o===d?i:void 0);if(r){let e=o.steps.findLast(e=>e.kind!==`runError`),t=o.steps.at(-1);return o.steps.filter(u).map(n=>f(n,o,n===e,o===d&&n===t?i:void 0))}return(0,q.jsx)(`div`,{className:s(o)?`ox-step ui-in`:`ox-step`,children:(0,q.jsx)(zb,{turn:o,row:t,toolStatus:e.toolStatus,defaultOpen:o===c,highlight:n,condition:o===d?i:void 0,nameOf:a})},o.key)}),!r&&(0,q.jsx)(Qy,{row:t})]})})}var Wb=(0,o.createContext)(e=>Me(globalThis,e)),Gb=e=>Number.isSafeInteger(e)&&e>=0,Kb=e=>e&&typeof e==`object`?e.msg||e:void 0;function qb(e){try{let t=Kb(e),n=t&&t.parts;if(!Array.isArray(n))return;for(let e of n)if(e&&typeof e==`object`&&e.kind===`ag-ui.frame`&&Gb(e.seq))return e;return}catch{return}}function Jb(e,t){let n=Kb(e),r=n&&n.from;return JSON.stringify([r&&typeof r.id==`string`?r.id:null,typeof t.epoch==`string`?t.epoch:null,typeof t.threadId==`string`?t.threadId:null])}function Yb(){let e=new Map,t=[],n=!1,r=t=>{let n=e.get(t);return n||(n={baseline:void 0,next:void 0,prefixIncomplete:!1,faulted:!1,released:!1,seen:new Set},e.set(t,n)),n},i=(e,t,n,r)=>{let i=[];if(e.seen.has(n))return{emit:!1,notes:i};if(e.seen.add(n),n>e.next){let a={key:t,expected:e.next,got:n,missing:n-e.next};r?i.push({type:`boundary-hole`,...a}):(i.push({type:`gap`,...a}),e.faulted=!0)}return n>=e.next&&(e.next=n+1),{emit:!0,notes:i}};return{live(e){let a=qb(e);if(!a)return{emit:[e],held:!1,notes:[]};if(!n)return t.push(e),{emit:[],held:!0,notes:[]};let o=Jb(e,a),s=r(o);s.next===void 0&&(s.baseline=a.seq,s.next=a.seq,s.prefixIncomplete=a.seq>1);let c=i(s,o,a.seq);return{emit:c.emit?[e]:[],held:!1,notes:c.notes}},backfill(a){let o=[],s=Array.isArray(a)?a.slice():[];for(let e of s){let t=qb(e);if(!t)continue;let n=r(Jb(e,t));(n.baseline===void 0||t.seq<n.baseline)&&(n.baseline=t.seq),n.seen.add(t.seq)}for(let[t,n]of e){if(n.baseline===void 0)continue;let e=n.baseline;for(let t of n.seen)t>e&&(e=t);n.next=e+1,n.prefixIncomplete=n.baseline>1,n.prefixIncomplete&&o.push({type:`prefix-incomplete`,key:t,baseline:n.baseline});let r=0;for(let i=n.baseline+1;i<=e;i++)n.seen.has(i)?r>0&&(o.push({type:`gap`,key:t,expected:i-r,got:i,missing:r}),n.faulted=!0,r=0):r++}let c=t.map((e,t)=>({entry:e,frame:qb(e),i:t})).filter(e=>e.frame!==void 0);c.sort((e,t)=>e.frame.seq-t.frame.seq||e.i-t.i);for(let e of c){let t=Jb(e.entry,e.frame),n=r(t);n.next===void 0&&(n.baseline=e.frame.seq,n.next=e.frame.seq,n.prefixIncomplete=e.frame.seq>1,n.prefixIncomplete&&o.push({type:`prefix-incomplete`,key:t,baseline:n.baseline}));let a=!n.released;n.released=!0;let c=i(n,t,e.frame.seq,a);for(let e of c.notes)o.push(e);c.emit&&s.push(e.entry)}return t.length=0,n=!0,{emit:s,notes:o}},get settled(){return n},get pendingCount(){return t.length},state(t){let n=e.get(t);return n===void 0?void 0:{baseline:n.baseline,next:n.next,prefixIncomplete:n.prefixIncomplete,faulted:n.faulted}},get chainKeys(){return[...e.keys()]}}}var Xb=500,Zb=200,Qb=250,$b=2e3,ex={text:``,outgoing:[]};function tx(e,...t){let n=new Map;for(let e of t)for(let t of e)t?.msg?.id!==void 0&&t.senderId!==void 0&&n.set(t.msg.id,t);return n.size?e.map(e=>(e?.msg?.id===void 0?void 0:n.get(e.msg.id))??e):e}var nx=e=>typeof e==`number`&&Number.isFinite(e)?e:0;function rx(e,t,n){let r=new Set(e.map(e=>e.id)),i=e;for(let a of t){let t=I(a,n);if(!t.some(e=>r.has(e.id))){i===e&&(i=e.slice());for(let e of t)r.add(e.id),i.push(e)}}return i}function ix(e){let t=re(e),n=0;for(;t>2e3&&n<e.length-1;)t-=e[n++].events.length;return{frames:n?e.slice(n):e,dropped:n>0}}function ax(e,t){let n=new Set,r=[],i=(e,i)=>{e&&i===t&&!n.has(e.id)&&(n.add(e.id),r.push({msg:e,senderId:i}))};for(let t of e.activity)t?.mode===`chat`&&i(t.msg,t.senderId);for(let t of e.open?.messages??[])i(t?.msg,t?.senderId);return r.sort((e,t)=>nx(e.msg.ts)-nx(t.msg.ts)).slice(-500)}async function ox(e,t,n,r,i,a){let o=new Map(e.get().channels.map(e=>[e.channel,e])),[s]=await x([{name:`channels`,read:()=>t.channels(),apply:t=>e.set(e=>{let n=new Map(e.channels.map(e=>[e.channel,e])),r=new Map(t.map(e=>[e.channel,e]));for(let[e,t]of n)o.get(e)!==t&&r.set(e,t);for(let e of o.keys())n.has(e)||r.delete(e);let i=Object.fromEntries(Object.entries(e.unread).filter(([e])=>r.has(e)));return{channels:[...r.values()],unread:i}})}]);if(s){r(`channels`,{...s,lastRead:i.get(`channels`)});return}i.set(`channels`,a()),e.get().stale.some(e=>e.name===`channels`)&&r(`channels`,void 0);let{open:c,channels:l}=e.get();c&&(l.find(e=>e.channel===c.channel)?.messages??0)<Math.max(o.get(c.channel)?.messages??0,c.messages.length)&&await n(c.channel)}function sx(e,t,n={}){let r=n.createOrder??(()=>Yb()),i=n.clock??Date.now,a=r(`feed`),o=r(`open`),s=[],l=[],u=null,d=null,f=0,p=new Set,m=(e,t)=>n=>{p.has(e)||t(n)},h=new Map,g=(t,n)=>e.set(e=>({loading:{roster:e.loading.roster&&!t,channels:e.loading.channels&&!n}})),_=t=>{t.length&&e.set(e=>({orderNotes:[...e.orderNotes,...t].slice(-50)}))},y=(t,n)=>e.set(e=>{let r=e.stale.filter(e=>e.name!==t);return{stale:n?[...r,n]:r}}),b=t=>e.set(e=>({membership:{snapshot:e.membership.snapshot,unreadable:t}})),S=(t,n)=>e.set(e=>({drafts:{...e.drafts,[t]:n(e.drafts[t]??ex)}})),C=new Map,w=null,T=(e,t)=>{let n=(C.get(e)??0)+t;n>0?C.set(e,n):C.delete(e)},E=e=>{if(w!==e){C=new Map;for(let t of e)T(t.msg.id,1);w=e}return C},D=0,O=()=>{let t=e.get();if(!Object.values(t.drafts).some(e=>e.outgoing.some(e=>e.id!==void 0)))return;let n=new Set;for(let e of[t.activity,t.dms,t.open?.messages??[]])for(let t of e)t?.msg?.id&&n.add(t.msg.id);let r=e=>e.id!==void 0&&n.has(e.id);Object.values(t.drafts).some(e=>e.outgoing.some(r))&&e.set(e=>({drafts:Object.fromEntries(Object.entries(e.drafts).map(([e,t])=>[e,{...t,outgoing:t.outgoing.filter(e=>!r(e))}]))}))},k=t=>e.set(e=>({space:t.space,post:t.post,channelDeleteSupported:t.channelDeleteSupported===!0,operatorId:t.operatorId??e.operatorId??null})),A=0,j=-1,M=!1,N=()=>{if(M||j===A)return;let n=e.get();!n.operatorId&&n.roster.some(e=>e.card.name===`operator`&&e.card.role===`operator`)&&(j=A,M=!0,t.meta().then(k,()=>void 0).finally(()=>{M=!1,N()}))},P=null,F=new Map,I=new Map,ee=(e,t)=>{let n=(I.get(e)??Promise.resolve()).then(t),r=n.catch(()=>void 0);return I.set(e,r),r.then(()=>{I.get(e)===r&&I.delete(e)}),n},L=(t,n)=>e.set(e=>{let r=e.sessions[t];return r?{sessions:{...e.sessions,[t]:n(r)}}:{}}),te=({reason:e,grant:t,...n})=>({...n,load:`ok`});async function ne(e,n,r,i){let a=++n.reads,o=()=>F.get(e)===n&&n.reads===a;L(e,e=>({...e,limit:r}));try{let n=P;if(i&&n!==null?await ee(e,()=>t.watch(e,n)):await I.get(e),!o())return;let a=await t.agentEvents(e,r);if(!o())return;if(`refused`in a){L(e,e=>({...e,load:`refused`,reason:a.refused,grant:a.grant}));return}L(e,e=>{let t=rx(e.frames,a.frames,!1),n=ix(t===e.frames?t:t.slice().sort((e,t)=>nx(e.ts)-nx(t.ts)));return te({...e,frames:n.frames,more:a.more||n.dropped,payloadRead:a.payloadRead})})}catch(t){if(!o())return;let n=t instanceof Error?t.message:String(t);L(e,({grant:e,...t})=>({...t,load:`failed`,reason:n}))}}let ie=t=>{let n=e.get().roster.find(e=>e.card.id===t);return n!==void 0&&Ke([n],{includeOffline:!0})[0]?.events===`off`},R=()=>{for(let[n,r]of F){let i=!ie(n);if(i===r.plane)continue;if(r.plane=i,i){L(n,e=>({...e,load:`loading`})),ne(n,r,e.get().sessions[n]?.limit??200,!0);continue}r.reads++,L(n,e=>te({...e,more:!1}));let a=P;a!==null&&ee(n,()=>t.unwatch(n,a)).catch(()=>void 0)}},z=(e,t)=>L(e,e=>e.posts.some(e=>e.msg.id===t.msg.id)?e:{...e,posts:[...e.posts,t].slice(-500)}),ae=()=>{f++,d=null,e.set({open:null})};async function B(n){if(n===null)return ae();if(e.set(e=>({unread:{...e.unread,[n]:0}})),d&&d.key===n)return d.promise;let a=++f,s=e.get().open,c=s?.channel===n?s:void 0,u=c?.messages??[],p=r(`open`);o=p;let m=l=[],g,v={key:n,promise:new Promise(e=>g=e)};d=v,e.set({open:c??{channel:n,messages:u}});let b=[],x=c?.olderRetained,S=null;try{let r=await t.history(n,201);x=r.length>Zb;let i=r.slice(-200).map(e=>({msg:e})),{activity:a,open:o}=e.get();b=tx(i,a.filter(e=>e.mode===`chat`&&e.channel===n),u,o?.channel===n?o.messages:[],m)}catch(e){S=e instanceof Error?e.message:String(e),b=u,_([{type:`backfill-failed`,channel:n,reason:S}])}finally{let t=p.backfill(b);if(a===f){_(t.notes);let r=new Set(u),a=e.get().open?.channel===n?e.get().open.messages.filter(e=>!r.has(e)):[],o=t.emit.slice(),s=new Set(o.map(e=>e.msg.id));for(let e of a)e&&!s.has(e.msg.id)&&o.push(e);e.set({open:{channel:n,messages:o.slice(-500),olderRetained:x}}),O();let c=`#${n} history`;S||h.set(c,i());let l=h.get(c);y(c,S?{kind:`refused`,name:c,reason:S,...l===void 0?{}:{lastRead:l}}:void 0)}d===v&&(d=null),g()}}async function V(){if(u)return u;let n;u=new Promise(e=>n=e),a=r(`feed`),s=[];let o=[],c=null;try{let n=[{name:`space`,read:()=>t.meta(),apply:k},...p.has(`peers`)?[]:[{name:`peers`,read:()=>t.roster(),apply:m(`peers`,t=>e.set({roster:t}))}],{name:`channels`,read:()=>t.channels(),apply:t=>e.set({channels:t})},{name:`direct messages`,read:()=>t.dms(500),apply:t=>e.set(e=>({dms:tx(t.map(e=>({msg:e})),e.dms).slice(-500),dmsCut:t.length>=500}))},{name:`activity`,read:()=>t.activity(200),apply:e=>{o=e.entries,c=e}},...p.has(`membership`)?[]:[{name:`membership`,read:()=>t.membership(),apply:m(`membership`,t=>e.set({membership:{snapshot:t}}))}]],r=await x(n);R();let a=i(),s=new Set(n.map(e=>e.name).filter(e=>!r.some(t=>t.name===e)));for(let e of s)h.set(e,a);g(s.has(`peers`),s.has(`channels`));let l=r.filter(e=>!p.has(e.name));for(let e of l){let t=h.get(e.name);t!==void 0&&(e.lastRead=t)}let u=c;u&&u.partial&&l.push({kind:`partial`,name:`activity`,reason:u.missing.map(e=>`${e}: ${u.reasons[e]}`).join(`
110
+ `),read:u.read,of:u.of,missing:u.missing.slice()});let d=e.get().stale.find(e=>e.name===`roster`);d&&!l.some(e=>e.name===`roster`)&&l.push(d),e.set({stale:l});let f=l.find(e=>e.name===`membership`);f&&b(f.reason);let v=l.find(e=>e.name===`activity`&&e.kind!==`partial`);v&&_([{type:`backfill-failed`,reason:v.reason}]);let y=e.get().open;y&&B(y.channel)}finally{for(let e of o)e?.msg&&(e.msg.channel=e.channel);let t=a.backfill(tx(o,e.get().activity,s));_(t.notes);let r=t.emit.slice(),i=new Set(r.map(e=>e?.msg?.id));for(let t of e.get().activity)t&&t.msg&&!i.has(t.msg.id)&&r.push(t);e.set({activity:r.slice(-500)}),O(),u=null,n()}}let H=!1,oe=new Set,U;function W(n){oe.has(n)||e.get().channels.some(e=>e.channel===n&&e.deliveryClass!==void 0)||(oe.add(n),U===void 0&&(U=setTimeout(()=>{U=void 0,x([{name:`channels`,read:()=>t.channels(),apply:t=>e.set({channels:t})}]).then(e=>{for(let t of e)y(t.name,t)})},Qb)))}function se(t){let n=t.msg;t.arrivedAt=i(),n.channel=t.channel;let r=a.live(t);r.held&&s.push(t),_(r.notes),e.set(e=>{let i=e.activity.slice();for(let e of r.emit)i.some(t=>t.msg.id===e.msg.id)||(i.push(e),i.length>Xb&&i.shift());if(t.mode!==`unicast`||E(e.dms).has(n.id))return{activity:i};let a=Math.max(0,e.dms.length+1-500),o=e.dms.slice(a);o.push({msg:t.msg,senderId:t.senderId});for(let t=0;t<a;t++)T(e.dms[t].msg.id,-1);return T(n.id,1),w=o,{activity:i,dms:o,dmsCut:e.dmsCut||a>0}}),O(),t.mode===`chat`&&t.senderId!==void 0&&e.get().sessions[t.senderId]&&z(t.senderId,{msg:t.msg,senderId:t.senderId});let c=n.channel;if(c){if(e.set(e=>{let t=e.channels.findIndex(e=>e.channel===c),n=e.channels.slice();return t===-1?n.push({channel:c,messages:1}):n[t]={...n[t],messages:(n[t].messages??0)+1},{channels:n}}),W(c),e.get().open?.channel===c){let n={msg:t.msg,senderId:t.senderId},r=o.live(n);r.held&&l.push(n),_(r.notes),e.set(e=>{if(e.open?.channel!==c)return{};let t=e.open.messages.slice();for(let e of r.emit)t.push(e),t.length>Xb&&t.shift();return{open:{...e.open,messages:t}}})}else e.set(e=>({unread:{...e.unread,[c]:(e.unread[c]??0)+1}}))}}return{refresh:V,async refreshChannels(){if(!(u||H)){H=!0;try{await ox(e,t,B,y,h,i)}finally{H=!1}}},open:B,onRoster(t){p.add(`peers`),A++,e.set({roster:t}),g(!0,!1),N(),R()},onPresenceView(t){e.set({presenceView:t}),y(`roster`,Ye(t))},onMessage:se,onMembership(t){p.add(`membership`),e.set({membership:{snapshot:t}});for(let e of t.members)for(let t of[...e.live??[],...e.durable??[]])/[*>]/.test(t)||W(t)},onMembershipFailed(e){p.add(`membership`),b(e)},async deleteChannel(n){n&&(await t.deleteChannel(n),e.set(e=>({channels:e.channels.filter(e=>e.channel!==n),unread:Object.fromEntries(Object.entries(e.unread).filter(([e])=>e!==n)),activity:e.activity.filter(e=>e.msg.channel!==n),stale:e.stale.filter(e=>e.name!==`#${n} history`)})),e.get().open?.channel===n&&ae())},async send(n,r){let a=c(n);if((e.get().drafts[a]??ex).outgoing.some(e=>e.id===void 0))throw Error(`a post to this target is already in flight`);let o={seq:++D,text:r,ts:i()};S(a,e=>({text:``,outgoing:[...e.outgoing,o]}));let s;try{s=await t.send(n,r)}catch(t){let i=e.get(),s=n.kind===`msg`?`#${n.channel}`:Ie(n.to,Pe(i.roster),i.operatorId);throw S(a,e=>({text:e.text?`${r}\n${e.text}`:r,refused:v(s,t),outgoing:e.outgoing.filter(e=>e!==o)})),t}e.set(e=>({operatorId:e.operatorId??s.operatorId,drafts:{...e.drafts,[a]:{...e.drafts[a]??ex,outgoing:(e.drafts[a]??ex).outgoing.map(e=>e===o?{...e,id:s.id}:e)}}})),O()},draft(e,t){S(c(e),e=>({text:t,outgoing:e.outgoing}))},openSession(t){if(e.get().sessions[t])return L(t,e=>({...e,views:e.views+1}));let n=ie(t),r={reads:0,plane:!n};F.set(t,r),e.set(e=>({sessions:{...e.sessions,[t]:{views:1,frames:[],posts:ax(e,t),load:n?`ok`:`loading`,more:!1,limit:200}}})),r.plane&&ne(t,r,200,!0)},closeSession(n){let r=e.get().sessions[n];if(!r)return;if(r.views>1)return L(n,e=>({...e,views:e.views-1}));let i=F.get(n);F.delete(n),e.set(e=>({sessions:Object.fromEntries(Object.entries(e.sessions).filter(([e])=>e!==n))}));let a=P;i?.plane&&a!==null&&ee(n,()=>t.unwatch(n,a)).catch(()=>void 0)},async loadEarlier(t){let n=e.get().sessions[t],r=F.get(t);!n||!r?.plane||!n.more||n.limit>=2e3||re(n.frames)>=2e3||await ne(t,r,Math.min(n.limit+200,$b),!1)},async reloadSession(t){let n=e.get().sessions[t],r=F.get(t);n&&r?.plane&&(L(t,e=>({...e,load:`loading`})),await ne(t,r,n.limit,!0))},onHello(t){P=t;for(let[t,n]of F)n.plane&&ne(t,n,e.get().sessions[t]?.limit??200,!0)},onFeedLost(){P=null},onAgentFrame(t){e.set(e=>{let n=e.sessions[t.id];if(!n)return{};let r=rx(n.frames,[t.msg],!0);if(r===n.frames)return{};let i=ix(r);return{sessions:{...e.sessions,[t.id]:{...n,frames:i.frames,more:n.more||i.dropped}}}})}}}export{Qm as $,K as $n,Zd as $t,ny as A,Qa as An,h as Ar,Lf as At,yh as B,Vr as Bn,Df as Bt,hy as C,yo as Cn,E as Cr,$f as Ct,ay as D,Co as Dn,S as Dr,Pf as Dt,ly as E,po as En,b as Er,kf as Et,Fh as F,pi as Fn,a as Fr,Hf as Ft,uh as G,jn as Gn,hf as Gt,hh as H,fr as Hn,yf as Ht,Ph as I,hi as In,r as Ir,Vf as It,lh as J,vn as Jn,cf as Jt,oh as K,En as Kn,mf as Kt,wh as L,mi as Ln,zf as Lt,ty as M,Pi as Mn,p as Mr,Mf as Mt,Xv as N,Oi as Nn,_ as Nr,jf as Nt,sy as O,co as On,c as Or,Nf as Ot,Nh as P,di as Pn,f as Pr,Rf as Pt,nh as Q,Jt as Qn,Qd as Qt,Ch as R,$r as Rn,Uf as Rt,gy as S,Eo as Sn,D as Sr,tp as St,uy as T,ho as Tn,y as Tr,Yf as Tt,ah as U,ir as Un,gf as Ut,_h as V,Sr as Vn,_f as Vt,dh as W,Y as Wn,vf as Wt,rh as X,Qt as Xn,rf as Xt,ih as Y,hn as Yn,df as Yt,$m as Z,Zt as Zn,ef as Zt,Sy as _,gl as _n,H as _r,fp as _t,bb as a,Id as an,qe as ar,Vm as at,_y as b,pl as bn,me as br,rp as bt,Ky as c,jd as cn,Re as cr,Rm as ct,Yy as d,Cd as dn,ke as dr,Nm as dt,Kd as en,Xe as er,Xm as et,Gy as f,xd as fn,Me as fr,Fm as ft,wy as g,Kl as gn,j as gr,dp as gt,Ey as h,eu as hn,Oe as hr,Cp as ht,Ub as i,Rd as in,G as ir,Gm as it,ey as j,Ua as jn,m as jr,If as jt,oy as k,ro as kn,l as kr,Ff as kt,Xy as l,Od as ln,Ie as lr,Im as lt,Ty as m,Zl as mn,Ae as mr,wm as mt,sx as n,Wd as nn,Je as nr,Jm as nt,yb as o,Fd as on,Be as or,Bm as ot,Ly as p,Iu as pn,je as pr,Cm as pt,ch as q,J as qn,af as qt,Wb as r,Vd as rn,Ke as rr,Ym as rt,Zy as s,Pd as sn,Ve as sr,Pm as st,$b as t,Gd as tn,He as tr,Hm as tt,Jy as u,Td as un,Pe as ur,Lm as ut,by as v,vl as vn,re as vr,ip as vt,fy as w,wo as wn,w as wr,ep as wt,my as x,oo as xn,k as xr,X as xt,yy as y,Sl as yn,V as yr,ap as yt,mh as z,Gr as zn,Of as zt};