@cotal-ai/web 0.165.4 → 0.166.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/service-adapter.d.ts +1 -4
- package/dist/service-adapter.d.ts.map +1 -1
- package/dist/service-adapter.js +2 -2
- package/dist/service-adapter.js.map +1 -1
- package/dist/web/assets/AgentPage-DaXvMTTg.js +1 -0
- package/dist/web/assets/controller-BghUQrbm.js +110 -0
- package/dist/web/assets/index-CRfccAOF.js +14 -0
- package/dist/web/assets/index-DyfxWNjc.css +1 -0
- package/dist/web/index.html +3 -3
- package/dist/web.d.ts +5 -16
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +3 -3
- package/dist/web.js.map +1 -1
- package/package.json +3 -3
- package/dist/web/assets/AgentPage-DND_rpGY.js +0 -1
- package/dist/web/assets/controller-21WQbPde.js +0 -110
- package/dist/web/assets/index-B5afScGX.css +0 -1
- package/dist/web/assets/index-CWg0jnkS.js +0 -14
|
@@ -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.`}async function y(e,t){if(!e.ok){let n=``;try{let t=await e.json();t&&typeof t.error==`string`&&(n=`: ${t.error}`)}catch{}throw Error(`${t} refused with HTTP ${e.status}${n}`)}return e.json()}async function b(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 x(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 S=new Map;function C(e,t){S.set(e,t)}function w(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=S.has(t)?S.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 T(e){return(e||[]).map(e=>w(e)).join(` `)}function E(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))return;let r=Object.keys(n);if(r.length!==2||!r.includes(`toolCallId`)||!r.includes(`isError`))return;let i=n;if(typeof i.toolCallId==`string`&&typeof i.isError==`boolean`)return{toolCallId:i.toolCallId,isError:i.isError}}function D(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}var O=e=>`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`,k=e=>{let t=D(e);return t&&O(t)},A=2e3,j=`ag-ui.frame`,M=e=>typeof e==`string`?e:void 0,N=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,P=class{label;constructor(e){this.label=e}};function F(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!==j)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 P(`A frame with no events`)],live:t})}return r.length>0?r:[{id:e.id,ts:e.ts,events:[new P(T(n))],live:t}]}function I(e){let t=e.lastIndexOf(`__`);return t<0?e:e.slice(t+2)}var ee=new Map([[`Bash`,`command`],[`Edit`,`edit`],[`MultiEdit`,`edit`],[`NotebookEdit`,`edit`],[`Write`,`write`],[`Read`,`read`],[`cotal_send`,`send`],[`cotal_dm`,`dm`],[`cotal_inbox`,`inbox`]]);function L(e){return ee.get(e)??`other`}function te(e){let t=/^events\.([A-Za-z0-9_]+)\.([A-Za-z0-9_]+)$/.exec(e);return t?`${t[1]}.${t[2]}`:void 0}function ne(e){let t=0;for(let n of e)t+=n.events.length;return t}var re=new Map([[`human`,`prompt`],[`sdk`,`prompt`],[`channel`,`mesh`],[`auto-continuation`,`continuation`],[`notification`,`notification`]]);function ie(e){let t=e.cotal,n=typeof t==`object`&&t?M(t.turnSource):void 0;return n===void 0?void 0:re.get(n)}function R(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=N(d.ts);d.events.forEach((f,p)=>{let m=`${d.id}:${p}`,h=d.live;if(f instanceof P){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=_?M(g.type):void 0,y=(_?N(g.timestamp):void 0)??e;switch((v===`RUN_STARTED`||v===`RUN_FINISHED`||v===`RUN_ERROR`)&&u(),v){case`RUN_STARTED`:{let e=ie(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,M(g.messageId)??``,m,y,h).user=M(g.role)===`user`;break;case`TEXT_MESSAGE_CONTENT`:{let e=s(n,M(g.messageId)??``,m,y,h);e.text+=M(g.delta)??``;break}case`TEXT_MESSAGE_END`:l(n,M(g.messageId)??``,`said`,!1,y,h);break;case`REASONING_MESSAGE_START`:c(r,M(g.messageId)??``,m,y,h);break;case`REASONING_MESSAGE_CONTENT`:{let e=s(r,M(g.messageId)??``,m,y,h);e.text+=M(g.delta)??``;break}case`REASONING_MESSAGE_END`:l(r,M(g.messageId)??``,`reasoning`,!1,y,h);break;case`TOOL_CALL_START`:{let e=M(g.toolCallName)??`?`,n=I(e),r={key:m,id:M(g.toolCallId)??``,name:n,full:e,kind:L(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=M(g.toolCallId)??``,t=i.get(e),n=M(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=E(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,t.live=t.live&&h);break}t.push({item:{kind:`unknown`,key:m,label:`Custom event ${M(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 z(e,t){return e.filter(e=>t(e.msg)).map((e,t)=>({msg:e.msg,i:t,at:N(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 ae(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 B(e,t){let{flat:n,marked:r}=R(e),i=z(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 ae(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 V(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 H={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`]}},oe={one:`called another tool`,many:`called # other tools`},U=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)}`:H[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:U([...r].map(([e,t])=>se(e===`other`&&i?oe:H[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?H[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=k(e.start),r=k(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=k(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=k(e[0]?.ts),i=k(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=te(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 Ye=e=>e.status;function W(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
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë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
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_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(`24A;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,se=-1,ce=-1,le=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ue=e=>/\s/.test(String.fromCharCode(e)),de=(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;se=t+1,ce=n-1;let a=t+1;if(le(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!le(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(oe=t+1,U=a,se=a+1)}},fe=(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},pe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,he=e=>!!e&&!Number.isNaN(Number(e)),ge=(e,t,n)=>{if(n-t<11||!fe(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&&fe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&fe(e,t+10,t+18,`-normal/`)},_e=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ve=`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(` `)),ye=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],be=(e,t,n,r)=>{if(e>=10){if(e>=25)return R[e-25](t.slice(n,r));let i=e-10;if(H!==_e[i])return!1;if(oe>=0){for(let e of ve[i])if(fe(t,oe,U,e))return!0;return!1}switch(ye[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(se,ce);return z.test(e)&&!ae.test(e)}case 3:return he(t.slice(se,ce));case 4:return V.test(t.slice(se,ce));default:return B.test(t.slice(se,ce))}}switch(e){case 0:return!0;case 1:return H===0;case 2:return H===1;case 3:return H===2;case 4:return pe.test(t.slice(n,r));case 5:return he(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&&he(t.slice(n,r-1));case 8:return me.test(t.slice(n,r));default:return ge(t,n,r)}},xe=new Set(typeof E==`string`?E.split(` `):E),Se=(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},Ce=new Map,we=new Map,Te=2,Ee=4096,De=(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||xe.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=we.get(s);return c===void 0&&we.set(s,c=Te++),c},Oe=new Map,ke=r,Ae=r+4096,je=()=>ke++,Me=2097152,Ne=8192,Pe=new Int32Array(Ne),Fe=Array(Ne).fill(null),Ie=new Int32Array(Ne),Le=new Int32Array(Ne),Re=new Uint8Array(Ne),ze=0,Be=(e,t,n,r,i,a,o,s)=>{let c=e;if(Fe[e]!==null){if(Fe[e|1]===null)c=e|1;else if(!(ze++&3))c=e|ze>>2&1;else return}Fe[c]=t.slice(n,r),Pe[c]=i,Ie[c]=a,Le[c]=o,Re[c]=s},Ve=()=>Fe.fill(null),He=256,Ue=[new Int32Array(He),new Int32Array(He),new Int32Array(He),new Int32Array(He)],[We,Ge,Ke,qe]=Ue,Je=new Uint8Array(He),Ye=new Uint8Array(He),W=()=>{He*=2,Ue=Ue.map(e=>{let t=new Int32Array(He);return t.set(e),t}),[We,Ge,Ke,qe]=Ue;let e=new Uint8Array(He);e.set(Je),Je=e,Ye=new Uint8Array(He)},Xe=64,Ze=new Int32Array(Xe),Qe=new Int32Array(Xe),$e=new Int32Array(r),et=2048,tt=21,nt=new Float64Array(et),rt=new Int32Array(et),it=0,at=(e,t)=>{if(e===0&&t<r)return $e[t]===it?1:($e[t]=it,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>tt;for(;rt[i]===it;){if(nt[i]===n)return 1;i=i+1&et-1}return nt[i]=n,rt[i]=it,0},ot=(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:Se(Oe,e,t+1,r,0,je)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Qe[t];if(r>n)continue;let i=Ze[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;de(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(be(d[t],e,r,n))return p[h+t]}return At},st=e=>{let t=e.length,n=0,c=0,u=!1;(Te>Ee||Ce.size>Ee)&&(Ce=new Map,we=new Map,Te=2,Ve()),ke>Ae&&(Oe=new Map,ke=r,Ve());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ue(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&&ue(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===He&&W();let _=n++;We[_]=p,Ge[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Pe[y]===v&&Fe[y]!==null&&Fe[y].length===g?t=y:Pe[y|1]===v&&Fe[y|1]!==null&&Fe[y|1].length===g&&(t=y|1),t>=0){let n=Fe[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ke[_]=Ie[t],qe[_]=Le[t],Je[_]=Re[t];continue}}}let b=p;if(ie!==0){if(h-p<=ie||!e.startsWith(re,p)){Ke[_]=At,Be(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)&&(Ze[0]=0,Qe[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===Xe){Xe*=2;let e=new Int32Array(Xe);e.set(Ze),Ze=e;let t=new Int32Array(Xe);t.set(Qe),Qe=t}Ze[L]=r,Qe[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=ot(e,E,A,te,ne),z!==At&&z<r&&j[z]){let t=ot(e,E,D,R,L);t!==At&&t!==z&&(z=t,ae=!1)}else z===At&&(z=ot(e,E,D,R,L),ae=!1)}else z=ot(e,E,D,R,L);let B=0,V=0;z===At?Ke[_]=At:(V=+!!ae,B=b>=C?+!!O:Se(Ce,e,b,C,+!!O,e=>De(e,O)),Ke[_]=z,Je[_]=V,qe[_]=B),Be(y,e,p,h,v,z,B,V)}if(n===0)return``;if(n===1)return We[0]===0&&Ge[0]===t?e:e.slice(We[0],Ge[0]);if(n*k>et){for(;n*k>et;)et<<=1,tt--;nt=new Float64Array(et),rt=new Int32Array(et)}if(Te>=Me||ke>=Me)throw Error(`cn: too many distinct classes in one merge`);it=it+1|0,it===0&&($e.fill(0),rt.fill(0),it=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ke[e];if(t===At){Ye[e]=1;continue}let n=qe[e];if(at(n,t)===1)Ye[e]=0,f=!0;else if(Ye[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)at(n,x[e]);if(Je[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&at(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ye[m]){m++;continue}let t=We[m],r=Ge[m],i=m+1;for(;i<n&&Ye[i]&&We[i]===r+1&&e.charCodeAt(r)===32;)r=Ge[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ct=16384,lt=new Int32Array(ct*2),ut=0,dt=1,ft=Object.create(null),pt=Object.create(null),mt=new Map,ht=new Map,gt=0,_t=0,vt=()=>{ut^=ct,dt=dt+1|0,_t=0},yt=e=>{let t=ft[e];if(t!==void 0)return t;let n=Nt(e,0,e.length),r=(n&16383)+ut,i=lt[r]===(n^dt)||lt[r^ct]===(n^dt-1);return i&&(t=pt[e],t!==void 0)?(ft[e]=t,t):(t=st(e),i?(ft[e]=t,++gt>te&&(gt=0,pt=ft,ft=Object.create(null),vt())):(lt[r]=n^dt,++_t>ct&&vt()),t)},bt=e=>{let t=mt.get(e);if(t!==void 0)return t;let n=Nt(e,0,e.length),r=(n&16383)+ut,i=lt[r]===(n^dt)||lt[r^ct]===(n^dt-1);return i&&(t=ht.get(e),t!==void 0)?(mt.set(e,t),t):(t=st(e),i?(mt.set(e,t),++gt>te&&(gt=0,ht=mt,mt=new Map,vt())):(lt[r]=n^dt,++_t>ct&&vt()),t)},xt=e=>{let t=Nt(e,0,e.length),n=(t&16383)+ut;return lt[n]===(t^dt)||lt[n^ct]===(t^dt-1)||(lt[n]=t^dt,++_t>ct&&vt(),!1)},St=te===0?st:kt?e=>{let t=mt.get(e);return t===void 0?bt(e):t}:yt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?St(arguments[0]):St(Lt.apply(null,arguments))},mergeString:St,seenBefore:te===0?()=>!1:xt,mergeUncached:st}},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),G=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()})),K=hn(),gn=Object.defineProperty,_n=(e,t)=>gn(e,`name`,{value:t,configurable:!0}),q=[`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,K.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,K.jsx)(q.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,K.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,K.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,K.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,K.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,K.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,K.jsx)(d,{...t,state:e}):(0,K.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=An(e=>{let t=v();return(0,K.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,K.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:m,setCollection:f,registryRef:p,children:(0,K.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,K.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,K.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 J(e,t,{checkForDefaultPrevented:n=!0}={}){return Wn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Wn(J,`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,K.jsx)(Or,{scope:n,disabled:a,contentId:Sr(),open:l,onOpenToggle:o.useCallback(()=>u(e=>!e),[u]),children:(0,K.jsx)(q.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,K.jsx)(q.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:J(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,K.jsx)(fr,{present:n||i.open,children:({present:e})=>(0,K.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,K.jsx)(q.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,K.jsx)(q.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:J(e.onFocusCapture,T.onFocusCapture),onBlurCapture:J(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:J(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,Y=(e,t)=>oi(e,`name`,{value:t,configurable:!0}),si=`focusScope.autoFocusOnMount`,ci=`focusScope.autoFocusOnUnmount`,li={bubbles:!1,cancelable:!0},ui=o.forwardRef(Y(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:xi(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||xi(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xi(l)};Y(e,`handleFocusIn`),Y(t,`handleFocusOut`),Y(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){Si.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(si,li);l.addEventListener(si,d),l.dispatchEvent(t),t.defaultPrevented||(hi(Ti(_i(l)),{select:!0}),document.activeElement===e&&xi(l))}return()=>{l.removeEventListener(si,d);let t=l.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(ci,li);l.addEventListener(ci,f),l.dispatchEvent(r),r.defaultPrevented||xi(e??t.body,{select:!0}),l.removeEventListener(ci,f),Si.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]=gi(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xi(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xi(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,K.jsx)(q.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),di=o.createContext(null);function fi({registry:e,children:t}){return e?(0,K.jsx)(di.Provider,{value:e,children:t}):t}Y(fi,`FocusScopeBranchProvider`);function pi(){let[e,t]=o.useState([]);return{nodes:e,registry:o.useMemo(()=>({add:Y(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:Y(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}Y(pi,`useFocusScopeBranchRegistry`);function mi(e){let t=o.useContext(di);o.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}Y(mi,`useFocusScopeBranch`);function hi(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xi(r,{select:t}),document.activeElement!==n)return}Y(hi,`focusFirst`);function gi(e){let t=_i(e);return[vi(t,e),vi(t.reverse(),e)]}Y(gi,`getTabbableEdges`);function _i(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Y(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}Y(_i,`getTabbableCandidates`);function vi(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):yi(r,{upTo:t})))return r}Y(vi,`findVisible`);function yi(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}Y(yi,`isHidden`);function bi(e){return e.tagName===`INPUT`&&typeof e.select==`function`}Y(bi,`isSelectableInput`);function xi(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&bi(e)&&t&&e.select()}}Y(xi,`focus`);var Si=Ci();function Ci(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wi(e,t),e.unshift(t)},remove(t){e=wi(e,t),e[0]?.resume()}}}Y(Ci,`createFocusScopesStack`);function wi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Y(wi,`arrayRemove`);function Ti(e){return e.filter(e=>e.tagName!==`A`)}Y(Ti,`removeLinks`);var Ei=Object.defineProperty,Di=o.forwardRef(((e,t)=>Ei(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,K.jsx)(q.div,{...r,ref:t}),c):null},`Portal`)),Oi=Object.defineProperty,ki=(e,t)=>Oi(e,`name`,{value:t,configurable:!0}),Ai=0,ji=null;function Mi(e){return Ni(),e.children}ki(Mi,`FocusGuards`);function Ni(){o.useEffect(()=>{ji||={start:Pi(),end:Pi()};let{start:e,end:t}=ji;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ai++,()=>{Ai===1&&(ji?.start.remove(),ji?.end.remove(),ji=null),Ai=Math.max(0,Ai-1)}},[])}ki(Ni,`useFocusGuards`);function Pi(){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}ki(Pi,`createFocusGuard`);var Fi=function(){return Fi=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},Fi.apply(this,arguments)};function Ii(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 Li(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 Ri=`right-scroll-bar-position`,zi=`width-before-scroll-bar`,Bi=`with-scroll-bars-hidden`,Vi=`--removed-body-scroll-bar-size`;function Hi(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ui(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 Wi=typeof window<`u`?o.useLayoutEffect:o.useEffect,Gi=new WeakMap;function Ki(e,t){var n=Ui(t||null,function(t){return e.forEach(function(e){return Hi(e,t)})});return Wi(function(){var t=Gi.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Hi(e,null)}),i.forEach(function(e){r.has(e)||Hi(e,a)})}Gi.set(n,e)},[e]),n}function qi(e){return e}function Ji(e,t){t===void 0&&(t=qi);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 Yi(e){e===void 0&&(e={});var t=Ji(null);return t.options=Fi({async:!0,ssr:!1},e),t}var Xi=function(e){var t=e.sideCar,n=Ii(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,Fi({},n))};Xi.isSideCarExport=!0;function Zi(e,t){return e.useMedium(t),Xi}var Qi=Yi(),$i=function(){},ea=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:$i,onWheelCapture:$i,onTouchMoveCapture:$i}),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=Ii(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Ki([n,t]),w=Fi(Fi({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Qi,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),Fi(Fi({},w),{ref:C})):o.createElement(y,Fi({},w,{className:l,ref:C}),c))});ea.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ea.classNames={fullWidth:zi,zeroRight:Ri};var ta=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function na(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ta();return t&&e.setAttribute(`nonce`,t),e}function ra(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ia(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var aa=function(){var e=0,t=null;return{add:function(n){e==0&&(t=na())&&(ra(t,n),ia(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oa=function(){var e=aa();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},sa=function(){var e=oa();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ca={left:0,top:0,right:0,gap:0},la=function(e){return parseInt(e||``,10)||0},ua=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[la(n),la(r),la(i)]},da=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ca;var t=ua(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])}},fa=sa(),pa=`data-scroll-locked`,ma=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
|
+
.${Bi} {
|
|
4
|
+
overflow: hidden ${r};
|
|
5
|
+
padding-right: ${s}px ${r};
|
|
6
|
+
}
|
|
7
|
+
body[${pa}] {
|
|
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
|
+
.${Ri} {
|
|
21
|
+
right: ${s}px ${r};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.${zi} {
|
|
25
|
+
margin-right: ${s}px ${r};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.${Ri} .${Ri} {
|
|
29
|
+
right: 0 ${r};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.${zi} .${zi} {
|
|
33
|
+
margin-right: 0 ${r};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
body[${pa}] {
|
|
37
|
+
${Vi}: ${s}px;
|
|
38
|
+
}
|
|
39
|
+
`},ha=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ga=function(){o.useEffect(function(){return document.body.setAttribute(pa,(ha()+1).toString()),function(){var e=ha()-1;e<=0?document.body.removeAttribute(pa):document.body.setAttribute(pa,e.toString())}},[])},_a=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ga();var a=o.useMemo(function(){return da(i)},[i]);return o.createElement(fa,{styles:ma(a,!t,i,n?``:`!important`)})},va=!1;if(typeof window<`u`)try{var ya=Object.defineProperty({},"passive",{get:function(){return va=!0,!0}});window.addEventListener(`test`,ya,ya),window.removeEventListener(`test`,ya,ya)}catch{va=!1}var ba=va?{passive:!1}:!1,xa=function(e){return e.tagName===`TEXTAREA`},Sa=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!xa(e)&&n[t]===`visible`)},Ca=function(e){return Sa(e,`overflowY`)},wa=function(e){return Sa(e,`overflowX`)},Ta=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Oa(e,r)){var i=ka(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ea=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Da=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Oa=function(e,t){return e===`v`?Ca(t):wa(t)},ka=function(e,t){return e===`v`?Ea(t):Da(t)},Aa=function(e,t){return e===`h`&&t===`rtl`?-1:1},ja=function(e,t,n,r,i){var a=Aa(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=ka(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Oa(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},Ma=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Na=function(e){return[e.deltaX,e.deltaY]},Pa=function(e){return e&&`current`in e?e.current:e},Fa=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ia=function(e){return`
|
|
40
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
41
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
42
|
+
`},La=0,Ra=[];function za(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(La++)[0],a=o.useState(sa)[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=Li([e.lockRef.current],(e.shards||[]).map(Pa),!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=Ma(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=Ta(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ta(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 ja(h,t,e,h===`h`?o:c,!0)},[]),l=o.useCallback(function(e){var n=e;if(Ra.length&&Ra[Ra.length-1]===a){var r=`deltaY`in n?Na(n):Ma(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Fa(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var o=(s.current.shards||[]).map(Pa).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:Ba(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=Ma(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,Na(t),t.target,c(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,Ma(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return Ra.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,ba),document.addEventListener(`touchmove`,l,ba),document.addEventListener(`touchstart`,d,ba),function(){Ra=Ra.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,ba),document.removeEventListener(`touchmove`,l,ba),document.removeEventListener(`touchstart`,d,ba)}},[]);var m=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(a,{styles:Ia(i)}):null,m?o.createElement(_a,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ba(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Va=Zi(Qi,za),Ha=o.forwardRef(function(e,t){return o.createElement(ea,Fi({},e,{ref:t,sideCar:Va}))});Ha.classNames=ea.classNames;var Ua=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Wa=new WeakMap,Ga=new WeakMap,Ka={},qa=0,Ja=function(e){return e&&(e.host||Ja(e.parentNode))},Ya=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ja(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})},Xa=function(e,t,n,r){var i=Ya(t,Array.isArray(e)?e:[e]);Ka[n]||(Ka[n]=new WeakMap);var a=Ka[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=(Wa.get(e)||0)+1,l=(a.get(e)||0)+1;Wa.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ga.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(),qa++,function(){o.forEach(function(e){var t=Wa.get(e)-1,i=a.get(e)-1;Wa.set(e,t),a.set(e,i),t||(Ga.has(e)||e.removeAttribute(r),Ga.delete(e)),i||e.removeAttribute(n)}),qa--,qa||(Wa=new WeakMap,Wa=new WeakMap,Ga=new WeakMap,Ka={})}},Za=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ua(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Xa(r,i,n,`aria-hidden`)):function(){return null}},Qa=Object.defineProperty,$a=(e,t)=>Qa(e,`name`,{value:t,configurable:!0}),eo=`Dialog`,[to,no]=En(eo),[ro,io]=to(eo),ao=$a(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}=pi(),[f,p]=ir({prop:r,defaultProp:i??!1,onChange:a,caller:eo}),[m,h]=o.useState(0),[g,_]=o.useState(0);return(0,K.jsx)(ro,{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`),oo=`DialogTrigger`,so=o.forwardRef($a(function(e,t){let{__scopeDialog:n,...r}=e,i=io(oo,n),a=Jt(t,i.triggerRef);return(0,K.jsx)(q.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Do(i.open),...r,ref:a,onClick:J(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),co=`DialogPortal`,[lo,uo]=to(co,{forceMount:void 0}),fo=$a(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=io(co,t);return(0,K.jsx)(lo,{scope:t,forceMount:n,children:o.Children.map(r,e=>(0,K.jsx)(fr,{present:n||a.open,children:(0,K.jsx)(Di,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),po=`DialogOverlay`,mo=o.forwardRef($a(function(e,t){let n=uo(po,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=io(po,e.__scopeDialog);return a.modal?(0,K.jsx)(fr,{present:r||a.open,children:(0,K.jsx)(go,{...i,ref:t})}):null},`DialogOverlay`)),ho=Zt(`DialogOverlay.RemoveScroll`),go=o.forwardRef($a(function(e,t){let{__scopeDialog:n,...r}=e,i=io(po,n),a=Jt(t,ei());return(0,K.jsx)(Ha,{as:ho,allowPinchZoom:!0,shards:o.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,K.jsx)(q.div,{"data-state":Do(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),_o=`DialogContent`,vo=o.forwardRef($a(function(e,t){let n=uo(_o,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=io(_o,e.__scopeDialog);return(0,K.jsx)(fr,{present:r||a.open,children:a.modal?(0,K.jsx)(yo,{...i,ref:t}):(0,K.jsx)(bo,{...i,ref:t})})},`DialogContent`)),yo=o.forwardRef($a(function(e,t){let n=io(_o,e.__scopeDialog),r=o.useRef(null),i=Jt(t,n.contentRef,r);return o.useEffect(()=>{let e=r.current;if(e)return Za(e)},[]),(0,K.jsx)(xo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:J(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:J(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),bo=o.forwardRef($a(function(e,t){let n=io(_o,e.__scopeDialog),r=o.useRef(!1),i=o.useRef(!1);return(0,K.jsx)(xo,{...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`)),xo=o.forwardRef($a(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=io(_o,n);return Ni(),(0,K.jsx)(fi,{registry:l.branchRegistry,children:(0,K.jsx)(ui,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,K.jsx)($r,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Eo(o,l.descriptionId):o,"data-state":Do(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),So=o.forwardRef($a(function(e,t){let{__scopeDialog:n,...r}=e,i=io(`DialogTitle`,n),{setTitleCount:a}=i;return On(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,K.jsx)(q.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Co=o.forwardRef($a(function(e,t){let{__scopeDialog:n,...r}=e,i=io(`DialogDescription`,n),{setDescriptionCount:a}=i;return On(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,K.jsx)(q.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),wo=`DialogClose`,To=o.forwardRef($a(function(e,t){let{__scopeDialog:n,...r}=e,i=io(wo,n);return(0,K.jsx)(q.button,{type:`button`,...r,ref:t,onClick:J(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Eo(...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}$a(Eo,`concatAriaDescribedby`);function Do(e){return e?`open`:`closed`}$a(Do,`getState`);var Oo=Object.defineProperty,ko=(e,t)=>Oo(e,`name`,{value:t,configurable:!0}),Ao=`Avatar`,[jo,Mo]=En(Ao),No={Idle:`idle`,Loading:`loading`,Loaded:`loaded`,Error:`error`},Po=[0,()=>void 0],[Fo,Io]=jo(Ao),Lo=o.forwardRef(ko(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=o.useState(No.Idle),[s,c]=Ho();return(0,K.jsx)(Fo,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:s,setImageCount:c,children:(0,K.jsx)(q.span,{...r,ref:t})})},`Avatar`)),Ro=`AvatarFallback`,zo=o.forwardRef(ko(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=Io(Ro,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!==No.Loaded?(0,K.jsx)(q.span,{...i,ref:t}):null},`AvatarFallback`));function Bo(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return On(()=>{if(!e){n(No.Error);return}let t=new window.Image,a=ko(e=>{let t=e.currentTarget;n(Vo(t))},`handleLoad`),o=ko(()=>n(No.Error),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(Vo(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(No.Idle)}},[e,i,r,n]),t}ko(Bo,`useImageLoadingStatus`);function Vo(e){return e.complete?e.naturalWidth>0?No.Loaded:No.Error:No.Loading}ko(Vo,`getImageLoadingStatus`);function Ho(){return Po}ko(Ho,`useImageCount`);function Uo(e){}ko(Uo,`useUpdateImageCount`);var Wo=Object.defineProperty,Go=(e,t)=>Wo(e,`name`,{value:t,configurable:!0});function Ko(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}Go(Ko,`useSize`);var qo=[`top`,`right`,`bottom`,`left`],Jo=Math.min,Yo=Math.max,Xo=Math.round,Zo=Math.floor,Qo=e=>({x:e,y:e}),$o={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function es(e,t,n){return Yo(e,Jo(t,n))}function ts(e,t){return typeof e==`function`?e(t):e}function ns(e){return e.split(`-`)[0]}function rs(e){return e.split(`-`)[1]}function is(e){return e===`x`?`y`:`x`}function as(e){return e===`y`?`height`:`width`}function os(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ss(e){return is(os(e))}function cs(e,t,n){n===void 0&&(n=!1);let r=rs(e),i=ss(e),a=as(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_s(o)),[o,_s(o)]}function ls(e){let t=_s(e);return[us(e),t,us(t)]}function us(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ds=[`left`,`right`],fs=[`right`,`left`],ps=[`top`,`bottom`],ms=[`bottom`,`top`];function hs(e,t,n){switch(e){case`top`:case`bottom`:return n?t?fs:ds:t?ds:fs;case`left`:case`right`:return t?ps:ms;default:return[]}}function gs(e,t,n,r){let i=rs(e),a=hs(ns(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(us)))),a}function _s(e){let t=ns(e);return $o[t]+e.slice(t.length)}function vs(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ys(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:vs(e)}function bs(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 xs(e,t,n){let{reference:r,floating:i}=e,a=os(t),o=ss(t),s=as(o),c=ns(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=rs(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ss(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}=ts(t,e),p=ys(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=bs(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=bs(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 Cs=50,ws=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ss},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=xs(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<Cs&&(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}=xs(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ts=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}=ts(e,t)||{};if(l==null)return{};let d=ys(u),f={x:n,y:r},p=ss(i),m=as(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=Jo(d[_],T),D=Jo(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=es(E,k,O),j=!c.arrow&&rs(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}}}),Es=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}=ts(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ns(r),_=os(o),v=ns(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[_s(o)]:ls(o)),x=p!==`none`;!d&&x&&b.push(...gs(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=cs(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`||_===os(t)||T.every(e=>os(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=os(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 Ds(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Os(e){return qo.some(t=>e[t]>=0)}var ks=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ts(e,t);switch(i){case`referenceHidden`:{let e=Ds(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Os(e)}}}case`escaped`:{let e=Ds(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Os(e)}}}default:return{}}}}},As=new Set([`left`,`top`]);async function js(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ns(n),s=rs(n),c=os(n)===`y`,l=As.has(o)?-1:1,u=a&&c?-1:1,d=ts(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 Ms=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 js(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}}}}},Ns=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}=ts(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=os(i),p=is(f),m=u[p],h=u[f],g=(e,t)=>es(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}}}}}},Ps=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}=ts(e,t),u={x:n,y:r},d=os(i),f=is(d),p=u[f],m=u[d],h=ts(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=As.has(ns(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}}}},Fs=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}=ts(e,t),c=await i.detectOverflow(t,s),l=ns(n),u=rs(n),d=os(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=Jo(p-c[m],g),y=Jo(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*Yo(c.left,c.right):S=p-2*Yo(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 Is(){return typeof window<`u`}function Ls(e){return Bs(e)?(e.nodeName||``).toLowerCase():`#document`}function Rs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zs(e){return((Bs(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Bs(e){return Is()?e instanceof Node||e instanceof Rs(e).Node:!1}function Vs(e){return Is()?e instanceof Element||e instanceof Rs(e).Element:!1}function Hs(e){return Is()?e instanceof HTMLElement||e instanceof Rs(e).HTMLElement:!1}function Us(e){return!Is()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Rs(e).ShadowRoot}function Ws(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=tc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Gs(e){return/^(table|td|th)$/.test(Ls(e))}function Ks(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var qs=/transform|translate|scale|rotate|perspective|filter/,Js=/paint|layout|strict|content/,Ys=e=>!!e&&e!==`none`,Xs;function Zs(e){let t=Vs(e)?tc(e):e;return Ys(t.transform)||Ys(t.translate)||Ys(t.scale)||Ys(t.rotate)||Ys(t.perspective)||!$s()&&(Ys(t.backdropFilter)||Ys(t.filter))||qs.test(t.willChange||``)||Js.test(t.contain||``)}function Qs(e){let t=rc(e);for(;Hs(t)&&!ec(t);){if(Zs(t))return t;if(Ks(t))return null;t=rc(t)}return null}function $s(){return Xs??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Xs}function ec(e){return/^(html|body|#document)$/.test(Ls(e))}function tc(e){return Rs(e).getComputedStyle(e)}function nc(e){return Vs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rc(e){if(Ls(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Us(e)&&e.host||zs(e);return Us(t)?t.host:t}function ic(e){let t=rc(e);return ec(t)?(e.ownerDocument||e).body:Hs(t)&&Ws(t)?t:ic(t)}function ac(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ic(e),i=r===e.ownerDocument?.body,a=Rs(r);if(i){let e=oc(a);return t.concat(a,a.visualViewport||[],Ws(r)?r:[],e&&n?ac(e):[])}return t.concat(r,ac(r,[],n))}function oc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sc(e){let t=tc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Hs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Xo(n)!==a||Xo(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function cc(e){return Vs(e)?e:e.contextElement}function lc(e){let t=cc(e);if(!Hs(t))return Qo(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=sc(t),o=(a?Xo(n.width):n.width)/r,s=(a?Xo(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var uc=Qo(0);function dc(e){let t=Rs(e);return!$s()||!t.visualViewport?uc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Rs(e)}function pc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=cc(e),o=Qo(1);t&&(r?Vs(r)&&(o=lc(r)):o=lc(e));let s=fc(a,n,r)?dc(a):Qo(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=Rs(a),t=Vs(r)?Rs(r):r,n=e,i=oc(n);for(;i&&t!==n;){let e=lc(i),t=i.getBoundingClientRect(),r=tc(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=Rs(i),i=oc(n)}}return bs({width:u,height:d,x:c,y:l})}function mc(e,t){let n=nc(e).scrollLeft;return t?t.left+n:pc(zs(e)).left+n}function hc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-mc(e,n),y:n.top+t.scrollTop}}function gc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zs(r),s=t?Ks(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Qo(1),u=Qo(0),d=Hs(r);if((d||!a)&&((Ls(r)!==`body`||Ws(o))&&(c=nc(r)),d)){let e=pc(r);l=lc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?hc(o,c):Qo(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 _c(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function vc(e){let t=nc(e),n=e.ownerDocument.body,r=Yo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Yo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+mc(e),o=-t.scrollTop;return tc(n).direction===`rtl`&&(a+=Yo(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var yc=25;function bc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Rs(e),a=zs(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!$s()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(mc(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<=yc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function xc(e,t){let n=pc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=lc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Sc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=bc(e,n,t);else if(t===`document`)r=vc(zs(e));else if(Vs(t))r=xc(t,n);else{let n=dc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return bs(r)}function Cc(e,t){let n=t.get(e);if(n)return n;let r=ac(e,[],!1).filter(e=>Vs(e)&&Ls(e)!==`body`),i=null,a=tc(e).position===`fixed`,o=a?rc(e):e;for(;Vs(o)&&!ec(o);){let e=tc(o),t=Zs(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=rc(o)}return t.set(e,r),r}function wc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ks(t)?[]:Cc(t,this._c):[].concat(n),r],o=Sc(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=Sc(t,a[e],i);s=Yo(n.top,s),c=Jo(n.right,c),l=Jo(n.bottom,l),u=Yo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Tc(e){let{width:t,height:n}=sc(e);return{width:t,height:n}}function Ec(e,t,n){let r=Hs(t),i=zs(t),a=n===`fixed`,o=pc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Qo(0);if((r||!a)&&((Ls(t)!==`body`||Ws(i))&&(s=nc(t)),r)){let e=pc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=mc(i));let l=i&&!r&&!a?hc(i,s):Qo(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 Dc(e){return tc(e).position===`static`}function Oc(e,t){if(!Hs(e)||tc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zs(e)===n&&(n=n.ownerDocument.body),n}function kc(e,t){let n=Rs(e);if(Ks(e))return n;if(!Hs(e)){let t=rc(e);for(;t&&!ec(t);){if(Vs(t)&&!Dc(t))return t;t=rc(t)}return n}let r=Oc(e,t);for(;r&&Gs(r)&&Dc(r);)r=Oc(r,t);return r&&ec(r)&&Dc(r)&&!Zs(r)?n:r||Qs(e)||n}var Ac=async function(e){let t=this.getOffsetParent||kc,n=this.getDimensions,r=await n(e.floating);return{reference:Ec(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jc(e){return tc(e).direction===`rtl`}var Mc={convertOffsetParentRelativeRectToViewportRelativeRect:gc,getDocumentElement:zs,getClippingRect:wc,getOffsetParent:kc,getElementRects:Ac,getClientRects:_c,getDimensions:Tc,getScale:lc,isElement:Vs,isRTL:jc};function Nc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Pc(e,t,n){let r=null,i,a=zs(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=Zo(d),h=Zo(a.clientWidth-(u+f)),g=Zo(a.clientHeight-(d+p)),_=Zo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Yo(0,Jo(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Nc(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=Rs(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Fc(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=cc(e),u=i||a?[...l?ac(l):[],...t?ac(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Pc(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?pc(e):null;c&&g();function g(){let t=pc(e);h&&!Nc(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 Ic=Ms,Lc=Ns,Rc=Es,zc=Fs,Bc=ks,Vc=Ts,Hc=Ps,Uc=(e,t,n)=>{let r=new Map,i=n??{},a={...Mc,...i.platform,_c:r};return ws(e,t,{...i,platform:a})},Wc=typeof document<`u`?o.useLayoutEffect:function(){};function Gc(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(!Gc(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)&&!Gc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Kc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qc(e,t){let n=Kc(e);return Math.round(t*n)/n}function Jc(e){let t=o.useRef(e);return Wc(()=>{t.current=e}),t}function Yc(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);Gc(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=Jc(u),k=Jc(i),A=Jc(d),j=o.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),Uc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Gc(E.current,t)&&(E.current=t,s.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);Wc(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=o.useRef(!1);Wc(()=>(M.current=!0,()=>{M.current=!1}),[]),Wc(()=>{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=qc(P.floating,f.x),r=qc(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Kc(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 Xc=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?{}:Vc({element:r.current,padding:i}).fn(n):r?Vc({element:r,padding:i}).fn(n):{}}}},Zc=(e,t)=>{let n=Ic(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qc=(e,t)=>{let n=Lc(e);return{name:n.name,fn:n.fn,options:[e,t]}},$c=(e,t)=>({fn:Hc(e).fn,options:[e,t]}),el=(e,t)=>{let n=Rc(e);return{name:n.name,fn:n.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=Xc(e);return{name:n.name,fn:n.fn,options:[e,t]}},il=Object.defineProperty,al=o.forwardRef(((e,t)=>il(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,K.jsx)(q.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,K.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),ol=Object.defineProperty,sl=(e,t)=>ol(e,`name`,{value:t,configurable:!0}),cl={Partial:`partial`,Always:`always`},ll={Optimized:`optimized`,Always:`always`},ul=`Popper`,[dl,fl]=En(ul),[pl,ml]=dl(ul),hl=sl(e=>{let{__scopePopper:t,children:n}=e,[r,i]=o.useState(null),[a,s]=o.useState(void 0);return(0,K.jsx)(pl,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:s,children:n})},`Popper`),gl=`PopperAnchor`,_l=o.forwardRef(sl(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=ml(gl,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&&Dl(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,K.jsx)(q.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),vl=`PopperContent`,[yl,bl]=dl(vl),xl=o.forwardRef(sl(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=cl.Partial,hideWhenDetached:p=!1,updatePositionStrategy:m=ll.Optimized,onPlaced:h,...g}=e,_=ml(vl,n),[v,y]=o.useState(null),b=Jt(t,y),[x,S]=o.useState(null),C=Ko(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(Tl),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Yc({strategy:`fixed`,placement:E,whileElementsMounted:sl((...e)=>Fc(...e,{animationFrame:m===ll.Always}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Zc({mainAxis:i+T,alignmentAxis:s}),l&&Qc({mainAxis:!0,crossAxis:!1,...f===cl.Partial?{limiter:$c()}:{},...A}),l&&el({...A}),tl({...A,apply:sl(({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&&rl({element:x,padding:c}),El({arrowWidth:w,arrowHeight:T}),p&&nl(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]=Dl(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,K.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,K.jsx)(yl,{scope:n,placedSide:ee,placedAlign:L,onArrowChange:S,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,K.jsx)(q.div,{"data-side":ee,"data-align":L,...g,ref:b,style:{...g.style,animation:P?g.style?.animation:`none`}})})})},`PopperContent`)),Sl=`PopperArrow`,Cl={top:`bottom`,right:`left`,bottom:`top`,left:`right`},wl=o.forwardRef(sl(function(e,t){let{__scopePopper:n,...r}=e,i=bl(Sl,n),a=Cl[i.placedSide];return(0,K.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,K.jsx)(al,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Tl(e){return e!==null}sl(Tl,`isNotNull`);var El=sl(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]=Dl(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 Dl(e){let[t,n=`center`]=e.split(`-`);return[t,n]}sl(Dl,`getSideAndAlignFromPlacement`);var Ol=Object.defineProperty,kl=(e,t)=>Ol(e,`name`,{value:t,configurable:!0}),Al=!1;function jl(){let[e,t]=o.useState(Al);return o.useEffect(()=>{Al||(Al=!0,t(!0))},[]),e}kl(jl,`useIsHydrated`);var Ml=o.useSyncExternalStore;function Nl(){return()=>{}}kl(Nl,`subscribe`);function Pl(){return Ml(Nl,()=>!0,()=>!1)}kl(Pl,`useIsHydratedModern`);var Fl=typeof Ml==`function`?Pl:jl,Il=Object.defineProperty,Ll=(e,t)=>Il(e,`name`,{value:t,configurable:!0}),Rl=`rovingFocusGroup.onEntryFocus`,zl={bubbles:!1,cancelable:!0},Bl=`RovingFocusGroup`,[Vl,Hl,Ul]=jn(Bl),[Wl,Gl]=En(Bl,[Ul]),Kl={Vertical:`vertical`,Horizontal:`horizontal`},ql={LTR:`ltr`,RTL:`rtl`},[Jl,Yl]=Wl(Bl),Xl=o.forwardRef(Ll(function(e,t){return(0,K.jsx)(Vl.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,K.jsx)(Vl.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,K.jsx)(Zl,{...e,ref:t})})})},`RovingFocusGroup`)),Zl=o.forwardRef(Ll(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:Bl}),[v,y]=o.useState(!1),b=Gr(u),x=Hl(n),S=o.useRef(!1),[C,w]=o.useState(0);return o.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(Rl,b),()=>e.removeEventListener(Rl,b)},[b]),(0,K.jsx)(Jl,{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,K.jsx)(q.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:`none`,...e.style},onMouseDown:J(e.onMouseDown,()=>{S.current=!0}),onFocus:J(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Rl,zl);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);ru([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}S.current=!1}),onBlur:J(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Ql=`RovingFocusGroupItem`,$l=o.forwardRef(Ll(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:s,...c}=e,l=Sr(),u=a||l,d=Yl(Ql,n),f=d.currentTabStopId===u,p=Hl(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=d,_=Fl();return On(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),o.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,K.jsx)(Vl.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,K.jsx)(q.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:J(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:J(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:J(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=nu(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?iu(n,r+1):n.slice(r+1)}setTimeout(()=>ru(n))}}),children:typeof s==`function`?s({isCurrentTabStop:f,hasTabStop:g!=null}):s})})},`RovingFocusGroupItem`)),eu={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function tu(e,t){return t===ql.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Ll(tu,`getDirectionAwareKey`);function nu(e,t,n){let r=tu(e.key,n);if(!(t===Kl.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Kl.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return eu[r]}Ll(nu,`getFocusIntent`);function ru(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Ll(ru,`focusFirst`);function iu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ll(iu,`wrapArray`);var au=Object.defineProperty,ou=o.forwardRef(((e,t)=>au(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,K.jsx)(q.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),su=Object.defineProperty,cu=(e,t)=>su(e,`name`,{value:t,configurable:!0}),lu={Horizontal:`horizontal`,Vertical:`vertical`},uu=lu.Horizontal,du=Object.values(lu),fu=o.forwardRef(cu(function(e,t){let{decorative:n,orientation:r=uu,...i}=e,a=pu(r)?r:uu,o=a===lu.Vertical?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,K.jsx)(q.div,{"data-orientation":a,...s,...i,ref:t})},`Separator`));function pu(e){return du.includes(e)}cu(pu,`isValidOrientation`);var mu=Object.defineProperty,hu=(e,t)=>mu(e,`name`,{value:t,configurable:!0}),gu={Automatic:`automatic`,Manual:`manual`},_u=`Tabs`,[vu,yu]=En(_u,[Gl]),bu=Gl(),[xu,Su]=vu(_u),Cu=o.forwardRef(hu(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=gu.Automatic,...l}=e,u=Vr(s),[d,f]=ir({prop:r,onChange:i,defaultProp:a??``,caller:_u});return(0,K.jsx)(xu,{scope:n,baseId:Sr(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,K.jsx)(q.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),wu=`TabsList`,Tu=o.forwardRef(hu(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Su(wu,n),o=bu(n);return(0,K.jsx)(Xl,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,K.jsx)(q.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Eu=`TabsTrigger`,Du=o.forwardRef(hu(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Su(Eu,n),s=bu(n),c=Au(o.baseId,r),l=ju(o.baseId,r),u=r===o.value;return(0,K.jsx)($l,{asChild:!0,...s,focusable:!i,active:u,children:(0,K.jsx)(q.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:J(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:J(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:J(e.onFocus,()=>{let e=o.activationMode!==gu.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Ou=`TabsContent`,ku=o.forwardRef(hu(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=e,c=Su(Ou,n),l=Au(c.baseId,r),u=ju(c.baseId,r),d=r===c.value,f=o.useRef(d);return o.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,K.jsx)(fr,{present:i||d,children:({present:n})=>(0,K.jsx)(q.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 Au(e,t){return`${e}-trigger-${t}`}hu(Au,`makeTriggerId`);function ju(e,t){return`${e}-content-${t}`}hu(ju,`makeContentId`);var Mu=Object.defineProperty,Nu=(e,t)=>Mu(e,`name`,{value:t,configurable:!0}),Pu=`Toggle`,Fu=o.forwardRef(Nu(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=ir({prop:n,onChange:i,defaultProp:r??!1,caller:Pu});return(0,K.jsx)(q.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:J(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Iu=Object.defineProperty,Lu=(e,t)=>Iu(e,`name`,{value:t,configurable:!0}),[Ru,zu]=En(`Tooltip`,[fl]),Bu=fl(),Vu=`TooltipProvider`,Hu=700,Uu=`tooltip.open`,[Wu,Gu]=Ru(Vu),Ku=Lu(e=>{let{__scopeTooltip:t,delayDuration:n=Hu,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,K.jsx)(Wu,{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`),qu=`Tooltip`,[Ju,Yu]=Ru(qu),Xu=Lu(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,l=Gu(qu,e.__scopeTooltip),u=Bu(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:Lu(e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(Uu))):l.onClose(),a?.(e)},`onChange`),caller:qu}),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,K.jsx)(hl,{...u,children:(0,K.jsx)(Ju,{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`),Zu=`TooltipTrigger`,Qu=o.forwardRef(Lu(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=Yu(Zu,n),s=Gu(Zu,n),c=Bu(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,K.jsx)(_l,{asChild:!0,...c,children:(0,K.jsx)(q.button,{"aria-describedby":a.open?hd(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:l,onPointerMove:J(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:J(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:J(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:J(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:J(e.onBlur,a.onClose),onClick:J(e.onClick,a.onClose)})})},`TooltipTrigger`)),$u=`TooltipPortal`,[ed,td]=Ru($u,{forceMount:void 0}),nd=Lu(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Yu($u,t);return(0,K.jsx)(ed,{scope:t,forceMount:n,children:(0,K.jsx)(fr,{present:n||a.open,children:(0,K.jsx)(Di,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),rd=`TooltipContent`,id=o.forwardRef(Lu(function(e,t){let n=td(rd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Yu(rd,e.__scopeTooltip);return(0,K.jsx)(fr,{present:r||o.open,children:o.disableHoverableContent?(0,K.jsx)(sd,{side:i,...a,ref:t}):(0,K.jsx)(ad,{side:i,...a,ref:t})})},`TooltipContent`)),ad=o.forwardRef(Lu(function(e,t){let n=Yu(rd,e.__scopeTooltip),r=Gu(rd,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=ud(r,ld(r,n.getBoundingClientRect())),a=dd(t.getBoundingClientRect()),o=pd([...i,...a]);c(o),f(!0)},[f]);return o.useEffect(()=>()=>p(),[p]),o.useEffect(()=>{if(l&&d){let e=Lu(e=>m(e,d),`handleTriggerLeave`),t=Lu(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=Lu(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!fd(n,s);r?p():i&&(p(),u())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,s,u,p]),(0,K.jsx)(sd,{...e,ref:a})},`TooltipContentHoverable`)),od=en(`TooltipContent`),sd=o.forwardRef(Lu(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=Yu(rd,n),d=Bu(n),{onClose:f}=u,[p,m]=o.useState(null),h=Jt(t,m);mi(p),o.useEffect(()=>(document.addEventListener(Uu,f),()=>document.removeEventListener(Uu,f)),[f]),o.useEffect(()=>{if(u.trigger){let e=Lu(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,K.jsx)($r,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,K.jsxs)(xl,{"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,K.jsx)(od,{children:r}),i?(0,K.jsx)(Sn,{id:u.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),cd=o.forwardRef(Lu(function(e,t){let{__scopeTooltip:n,...r}=e,i=Bu(n);return(0,K.jsx)(wl,{...i,...r,ref:t})},`TooltipArrow`));function ld(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`)}}Lu(ld,`getExitSideFromRect`);function ud(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}Lu(ud,`getPaddedExitPoints`);function dd(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}]}Lu(dd,`getPointsFromRect`);function fd(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}Lu(fd,`isPointInPolygon`);function pd(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)),md(t)}Lu(pd,`getHull`);function md(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)}Lu(md,`getHullPresorted`);function hd(...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}Lu(hd,`concatAriaDescribedby`);function gd(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=gd(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function _d(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=gd(e))&&(r&&(r+=` `),r+=t);return r}var vd=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,yd=_d,bd=(e,t)=>n=>{if(t?.variants==null)return yd(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=vd(t)||vd(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 yd(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)},xd=bd(`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 Sd({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?Qt:`button`;return(0,K.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:G(xd({variant:t,size:n,className:e})),...i})}var Cd={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`},wd=(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,...Cd,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,_)});wd.displayName=`HugeiconsIcon`;var Td=[[`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`}]],Ed=[[`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`}]],Dd=[[`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`}]],Od=[[`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`}]],kd=[[`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`}]],Ad=[[`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`}]],jd=[[`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`}]],Md=[[`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`}]],Nd=[[`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`}]],Pd=[[`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`}]],Fd=[[`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`}]],Id=[[`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`}]],Ld=[[`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`}]],Rd=[[`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`}]],zd=[[`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`}]],Bd=[[`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`}]],Vd=[[`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`}]],Hd=[[`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`}]],Ud=[[`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`}]],Wd=[[`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`}]],Gd=[[`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`}]],Kd=[[`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`}]],qd=[[`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`}]],Jd=[[`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`}]],Yd=[[`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`}]],Xd=[[`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`}]],Zd=[[`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`}]],Qd=[[`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`}]],$d=[[`path`,{d:`M5 14L8.5 17.5L19 6.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ef=[[`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`}]],tf=[[`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`}]],nf=[[`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 rf({...e}){return(0,K.jsx)(ao,{"data-slot":`sheet`,...e})}function af({...e}){return(0,K.jsx)(fo,{"data-slot":`sheet-portal`,...e})}function of({className:e,...t}){return(0,K.jsx)(mo,{"data-slot":`sheet-overlay`,className:G(`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 sf({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,K.jsxs)(af,{children:[(0,K.jsx)(of,{}),(0,K.jsxs)(vo,{"data-slot":`sheet-content`,"data-side":n,className:G(`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,K.jsx)(To,{"data-slot":`sheet-close`,asChild:!0,children:(0,K.jsxs)(Sd,{variant:`ghost`,className:`absolute top-4 right-4 bg-secondary`,size:`icon-sm`,children:[(0,K.jsx)(wd,{icon:Pd,strokeWidth:2}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function cf({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sheet-header`,className:G(`flex flex-col gap-1.5 p-6`,e),...t})}function lf({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sheet-footer`,className:G(`mt-auto flex flex-col gap-2 p-6`,e),...t})}function uf({className:e,...t}){return(0,K.jsx)(So,{"data-slot":`sheet-title`,className:G(`text-base font-medium text-foreground`,e),...t})}function df({className:e,...t}){return(0,K.jsx)(Co,{"data-slot":`sheet-description`,className:G(`text-sm text-muted-foreground`,e),...t})}var ff=768;function pf(){let[e,t]=o.useState(void 0);return o.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<ff)};return e.addEventListener(`change`,n),t(window.innerWidth<ff),()=>e.removeEventListener(`change`,n)},[]),!!e}function mf({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`skeleton`,className:G(`animate-pulse rounded-2xl bg-muted`,e),...t})}function hf({delayDuration:e=0,...t}){return(0,K.jsx)(Ku,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function gf({...e}){return(0,K.jsx)(Xu,{"data-slot":`tooltip`,...e})}function _f({...e}){return(0,K.jsx)(Qu,{"data-slot":`tooltip-trigger`,...e})}function vf({className:e,sideOffset:t=0,children:n,...r}){return(0,K.jsx)(nd,{children:(0,K.jsxs)(id,{"data-slot":`tooltip-content`,sideOffset:t,className:G(`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,K.jsx)(cd,{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 yf=`sidebar_state`,bf=604800,xf=`16rem`,Sf=`18rem`,Cf=`3rem`,wf=`b`,Tf=o.createContext(null);function Ef(){let e=o.useContext(Tf);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Df({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...s}){let c=pf(),[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=`${yf}=${t}; path=/; max-age=${bf}`},[n,p]),h=o.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);o.useEffect(()=>{let e=e=>{e.key===wf&&(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,K.jsx)(Tf.Provider,{value:_,children:(0,K.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":xf,"--sidebar-width-icon":Cf,...i},className:G(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...s,children:a})})}function Of({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}=Ef();return n===`none`?(0,K.jsx)(`div`,{"data-slot":`sidebar`,className:G(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,K.jsx)(rf,{open:l,onOpenChange:u,...o,children:(0,K.jsxs)(sf,{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":Sf},side:e,children:[(0,K.jsxs)(cf,{className:`sr-only`,children:[(0,K.jsx)(uf,{children:`Sidebar`}),(0,K.jsx)(df,{children:`Displays the mobile sidebar.`})]}),(0,K.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,K.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,K.jsx)(`div`,{"data-slot":`sidebar-gap`,className:G(`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,K.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:G(`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,K.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 kf({className:e,onClick:t,...n}){let{toggleSidebar:r}=Ef();return(0,K.jsxs)(Sd,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:G(e),onClick:e=>{t?.(e),r()},...n,children:[(0,K.jsx)(wd,{icon:Yd,strokeWidth:2}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function Af({className:e,...t}){return(0,K.jsx)(`main`,{"data-slot":`sidebar-inset`,className:G(`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 jf({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:G(`flex flex-col gap-2 p-2 [--radius:var(--radius-xl)]`,e),...t})}function Mf({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:G(`flex flex-col gap-2 p-2`,e),...t})}function Nf({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:G(`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 Pf({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:G(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function Ff({className:e,asChild:t=!1,...n}){let r=t?Qt:`div`;return(0,K.jsx)(r,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:G(`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 If({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:G(`w-full text-sm`,e),...t})}function Lf({className:e,...t}){return(0,K.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:G(`flex w-full min-w-0 flex-col gap-0.5`,e),...t})}function Rf({className:e,...t}){return(0,K.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:G(`group/menu-item relative`,e),...t})}var zf=bd(`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 Bf({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}=Ef(),u=(0,K.jsx)(s,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:G(zf({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:u}),(0,K.jsx)(vf,{side:`right`,align:`center`,hidden:l!==`collapsed`||c,...i})]})):u}function Vf({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:G(`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 Hf({className:e,showIcon:t=!1,...n}){let[r]=o.useState(()=>`${Math.floor(Math.random()*40)+50}%`);return(0,K.jsxs)(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:G(`flex h-8 items-center gap-2 rounded-xl px-2`,e),...n,children:[t&&(0,K.jsx)(mf,{className:`size-4 rounded-xl`,"data-sidebar":`menu-skeleton-icon`}),(0,K.jsx)(mf,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":r}})]})}var Uf=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),Wf=function(e){return`/`+e},Gf={},Kf=function(e){return e.pathname.endsWith(`.css`)},qf=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},Jf=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=Wf(t,n);let r=s(t),i=Kf(r);return qf(Gf,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`:Uf,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)})},Yf=globalThis;Yf.window??=globalThis,Yf.Path2D??=class{},await Jf(()=>import(`./characters-BsW4RWhl.js`),[]);var Xf=Yf.window.CotalArt;function Zf(e,t){return Xf.body(e,t)}function Qf(e){return Xf.mark(e)}function $f(e){return Xf.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 ep(){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,K.jsx)(wd,{icon:e,size:t,strokeWidth:1.5,className:n,"data-icon":r,"aria-hidden":`true`})}var tp=bd(`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 np({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?Qt:`span`;return(0,K.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:G(tp({variant:t}),e),...r})}function rp({className:e,size:t=`default`,...n}){return(0,K.jsx)(Lo,{"data-slot":`avatar`,"data-size":t,className:G(`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 ip({className:e,...t}){return(0,K.jsx)(zo,{"data-slot":`avatar-fallback`,className:G(`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 ap=bd(`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 op({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,K.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:G(ap({variant:e}),n),...r})}function sp({asChild:e=!1,className:t,...n}){let r=e?Qt:`div`;return(0,K.jsx)(r,{"data-slot":`bubble-content`,className:G(`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 cp({className:e,...t}){return(0,K.jsx)(ou,{"data-slot":`label`,className:G(`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 lp=bd(`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 up({className:e,orientation:t=`vertical`,...n}){return(0,K.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:G(lp({orientation:t}),e),...n})}function dp({className:e,...t}){return(0,K.jsx)(cp,{"data-slot":`field-label`,className:G(`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 fp({className:e,...t}){return(0,K.jsx)(`p`,{"data-slot":`field-description`,className:G(`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 pp({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,K.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,K.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,K.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:G(`text-sm font-normal text-destructive`,e),...r,children:i}):null}function mp({className:e,...t}){return(0,K.jsx)(`textarea`,{"data-slot":`textarea`,className:G(`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 hp({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:G(`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 gp=bd(`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 _p({className:e,align:t=`inline-start`,...n}){return(0,K.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:G(gp({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var vp=bd(`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 yp({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,K.jsx)(Sd,{type:t,"data-size":r,variant:n,className:G(vp({size:r}),e),...i})}function bp({className:e,...t}){return(0,K.jsx)(`span`,{className:G(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...t})}function xp({className:e,...t}){return(0,K.jsx)(mp,{"data-slot":`input-group-control`,className:G(`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 Sp({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`message-group`,className:G(`flex min-w-0 flex-col gap-2`,e),...t})}function Cp({className:e,align:t=`start`,...n}){return(0,K.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:G(`group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse`,e),...n})}function wp({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`message-avatar`,className:G(`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 Tp({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`message-content`,className:G(`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 Ep({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`message-header`,className:G(`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 Dp({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`message-footer`,className:G(`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 Op({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=kp(Ap(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={...kp(a,s),ref:Np(a.ref,s.ref)};return o.cloneElement(n,c)}function kp(...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`?Np(i,r):Mp(n)&&typeof i==`function`&&typeof r==`function`?jp(r,i):r}}return t}function Ap(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 jp(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function Mp(e){return/^on[A-Z]/.test(e)}function Np(...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 Pp=8,Fp=64,Ip=0,Lp=.5,Rp=180,zp=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),Bp={start:!1,end:!1},Vp={currentAnchorId:null,visibleMessageIds:[]};function Hp({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return Bp;let i=em({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function Up({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return Vp;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of Wp(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+Lp&&(u=e)}return l.length===0&&u===null?Vp:{currentAnchorId:u,visibleMessageIds:l}}function Wp(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function Gp(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function Kp(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function qp(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 Jp(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function Yp({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of Wp(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 Xp({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=Zp(t,i),o=t.getBoundingClientRect().height,s=rm(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 Zp(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function Qp(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function $p({content:e,scrollTop:t,spacer:n,viewport:r}){let i=em({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function em({content:e,spacer:t,viewport:n}){let r=Wp(e,t),i=nm(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 tm(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function nm(e){let t=window.getComputedStyle(e);return{end:am(t.paddingBlockEnd||t.paddingBottom),start:am(t.paddingBlockStart||t.paddingTop)}}function rm(e){let t=e?.parentElement;return t?nm(t):{end:0,start:0}}function im(e){if(!e)return 0;let t=window.getComputedStyle(e);return am(t.rowGap===`normal`?t.gap:t.rowGap)}function am(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function om(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 sm(e,t){return om(e,t)}function cm(){return om(Vp,um)}function lm(e,t){return e.start===t.start&&e.end===t.end}function um(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function dm({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=sm(t===`end`||t===`last-anchor`,(e,t)=>e===t)),k.current===null&&(k.current=sm(Bp,lm)),P.current===null&&(P.current=cm()),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 fm(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function pm(e){e.defaultScrollPositionAppliedRef.current=!0,fm(e)}function mm({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()},Rp))},[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)<=Lp?(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(tm(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=Xp({align:t,element:e,scrollMargin:o?a+g.current:a,spacer:y.current,viewport:c}),d=$p({content:s,scrollTop:u,spacer:y.current,viewport:c});return S(d),m.current={element:e,viewportTop:Qp(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?(pm(e),E(r,n)?(p.current=null,!0):(p.current={messageId:t,options:n},!0)):u.current===0&&(p.current={messageId:t,options:n},pm(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,pm(e),!0)},[E]),reanchorToAnchoredMessage:D,scrollToElement:E,scrollToEnd:T,scrollToMessage:O,scrollToStart:w}}function hm(e,t){return o.useCallback(n=>{e.current=n,n&&t()},[e,t])}function gm({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=Pp,scrollPreviousItemPeek:r=Fp,scrollMargin:i=Ip}){let a=dm({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-Lp;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=Hp({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(Up({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}=mm({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=Qp(e.element,t)-e.viewportTop;return Math.abs(n)<=Lp?!1:(t.scrollTop+=n,e.viewportTop=Qp(e.element,t),ie(),R(),!0)},[ie,R]),se=o.useCallback(()=>{let e=d.current,t=M.current;if(!e||!t){b.current=null;return}let n=Yp({content:e,spacer:k.current,viewport:t});b.current=n?{element:n,viewportTop:Qp(n,t)}:null},[]),ce=o.useCallback(()=>{v.current===null&&(v.current=window.requestAnimationFrame(()=>{v.current=null,z()&&se()}))},[se,z]),le=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?Jp(Wp(t,k.current)):null;if(!t||!n||!r)e=V({behavior:`auto`});else{let i=Zp(r,n);e=em({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?(pm(a),!0):!1},[t,B,V,oe]),ue=o.useCallback(()=>{let e=d.current;if(!e)return;let t=Wp(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(le()||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=Gp(t,n);if(e){if(c.current&&_.current===`following-bottom`&&qp(t,n)){V({behavior:`auto`});return}B(e,{align:`start`},{keepPreviousPeek:!0}),ee.current.add(e);return}}if(t.length===n){let e=Kp(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())}})(),se()},[le,se,re,z,U,R,B,V]),de=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]),fe=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]),pe=o.useCallback(()=>{N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),P.current?.disconnect(),P.current=null,I.current.clear(),F.setSnapshot(Vp)},[F]),me=o.useCallback((e,t,n)=>{t?(g.current.set(e,t),P.current?.observe(t),R(),y.current?.messageId===e&&ce()):n&&g.current.get(e)===n&&(g.current.delete(e),I.current.delete(e),P.current?.unobserve(n),R())},[ce,R]),he=o.useCallback(()=>{(_.current===`following-bottom`||_.current===`anchored-to-message`||_.current===`settling-jump`)&&(s.current=null,_.current=`free-scrolling`)},[]),ge=o.useCallback(()=>te(j.getSnapshot()),[j,te]),_e=hm(C,ge),ve=hm(M,ge),ye=o.useCallback(e=>{d.current=e},[]),be=o.useCallback(e=>{k.current=e,D.current=im(e?.parentElement??null)},[]),xe=o.useCallback(()=>{re(),R(),se()},[se,re,R]),Se=o.useMemo(()=>({handleContentChange:ue,handleResize:de,observeVisibility:fe,pendingDefaultScrollStore:S,preserveScrollOnPrependRef:x,scrollToEnd:V,scrollToMessage:H,scrollToStart:oe,setContentElement:ye,setRootElement:_e,setSpacerElement:be,setViewportElement:ve,stateStore:j,syncAfterScroll:xe,unobserveVisibility:pe,userScrollIntent:he,viewportRef:M,visibilityStore:F}),[ue,de,fe,S,V,H,oe,ye,_e,be,ve,j,xe,pe,he,F]);return o.useLayoutEffect(()=>{le()||m.current===0&&fm(a)},[le]),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:Se,registerMessage:me}}function _m(e){let t=o.useRef(e);return t.current=e,t}var vm=o.createContext(null),ym=o.createContext(null);function bm(){let e=o.useContext(vm);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function xm(){let e=o.useContext(ym);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function Sm(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=bm();return o.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function Cm(){let{stateStore:e}=bm();return o.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function wm({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=gm({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,K.jsx)(vm.Provider,{value:o,children:(0,K.jsx)(ym.Provider,{value:s,children:t})})}function Tm(){let{pendingDefaultScrollStore:e}=bm();return o.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Em({children:e,...t}){let{setRootElement:n}=bm(),r=Tm();return(0,K.jsx)(`div`,{ref:n,...t,...r?{"data-pending-scroll":``}:null,children:e})}function Dm({"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:_}=bm(),v=Tm();p.current=s;let y=o.useCallback(e=>{m(e),Np(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){zp.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,K.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 Om({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:s,handleResize:c,setContentElement:l,setSpacerElement:u}=bm(),d=o.useRef(null),f=o.useCallback(e=>{d.current=e,l(e),Np(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,K.jsxs)(`div`,{ref:f,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,K.jsx)(`div`,{ref:u,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function km({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=xm(),a=o.useRef(null),s=o.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),Np(t)?.(n)},[e,t,i]);return(0,K.jsx)(`div`,{ref:s,"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function Am({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}=bm(),f=_m(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 Op({defaultTagName:`button`,props:kp({type:s,inert:!h,tabIndex:h?a:-1,children:t??(0,K.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 jm={Provider:wm,Root:Em,Viewport:Dm,Content:Om,Item:km,Button:Am};function Mm(e){return(0,K.jsx)(jm.Provider,{...e})}function Nm({className:e,...t}){return(0,K.jsx)(jm.Root,{"data-slot":`message-scroller`,className:G(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,e),...t})}function Pm({className:e,...t}){return(0,K.jsx)(jm.Viewport,{"data-slot":`message-scroller-viewport`,className:G(`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 Fm({className:e,...t}){return(0,K.jsx)(jm.Content,{"data-slot":`message-scroller-content`,className:G(`flex h-max min-h-full flex-col gap-8`,e),...t})}function Im({className:e,scrollAnchor:t=!1,...n}){return(0,K.jsx)(jm.Item,{"data-slot":`message-scroller-item`,scrollAnchor:t,className:G(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,e),...n})}function Lm({direction:e=`end`,className:t,children:n,render:r,variant:i=`secondary`,size:a=`icon-sm`,...o}){return(0,K.jsx)(jm.Button,{"data-slot":`message-scroller-button`,"data-direction":e,"data-variant":i,"data-size":a,direction:e,className:G(`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,K.jsx)(Sd,{variant:i,size:a}),...o,children:n??(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(wd,{icon:Dd,strokeWidth:2}),(0,K.jsx)(`span`,{className:`sr-only`,children:e===`end`?`Scroll to end`:`Scroll to start`})]})})}function Rm({className:e,...t}){return(0,K.jsx)(wd,{icon:Wd,strokeWidth:2,"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:G(`size-4 animate-spin`,e),...t})}function zm(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 Bm({command:e,icon:t}){return(0,K.jsxs)(`span`,{className:`ui-cmd`,children:[t&&(0,K.jsx)(X,{icon:t,size:16,className:`ui-ic ui-ic16`}),(0,K.jsx)(`code`,{children:e}),(0,K.jsxs)(Sd,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>zm(e),children:[(0,K.jsx)(X,{icon:Ld,"data-icon":`inline-start`}),`Copy`]})]})}var Vm=(0,o.createContext)(null),Hm=null,Um=new Set;function Wm(e){Hm=c(e);for(let e of Um)e()}var Gm=e=>e.split("`").map((e,t)=>t%2==1?(0,K.jsx)(`code`,{children:e},t):e),Km={text:``,outgoing:[]};function qm({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])??Km,l=(0,o.useContext)(Vm),u=Ef().isMobile,f=(0,o.useRef)(null),m=()=>f.current;if((0,o.useLayoutEffect)(()=>{let e=()=>{Hm===i&&(Hm=null,m()?.focus())};return e(),Um.add(e),()=>void Um.delete(e)},[i,a]),a===null)return null;if(a.mode===`off`)return(0,K.jsxs)(up,{children:[(0,K.jsxs)(hp,{"aria-disabled":`true`,children:[(0,K.jsxs)(_p,{align:`block-start`,children:[(0,K.jsx)(X,{icon:Zd}),(0,K.jsx)(bp,{children:a.reason===`This dashboard was started with --creds, which can only read.`?Gm("This dashboard was started with `--creds`, which can only read."):a.reason})]}),(0,K.jsxs)(_p,{align:`block-end`,className:`min-w-0`,children:[(0,K.jsx)(Bm,{command:p(t)}),(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:(0,K.jsx)(`span`,{className:`inline-flex shrink-0`,tabIndex:0,children:(0,K.jsx)(yp,{variant:`default`,size:`icon-xs`,disabled:!0,"aria-label":`Send`,children:(0,K.jsx)(X,{icon:kd})})})}),(0,K.jsx)(vf,{children:a.reason})]})]})]}),(0,K.jsx)(fp,{className:`truncate`,children:Gm(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,K.jsxs)(yp,{size:u?`icon-xs`:`xs`,disabled:l===null,onClick:()=>{l?.draft(t,`${s.text}@`),m()?.focus()},"aria-label":u?`Mention`:void 0,children:[(0,K.jsx)(X,{icon:jd,"data-icon":u?void 0:`inline-start`}),!u&&`Mention`]});return(0,K.jsxs)(up,{"data-invalid":g!==void 0,children:[(0,K.jsxs)(hp,{children:[(0,K.jsx)(xp,{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,K.jsx)(_p,{align:`block-end`,children:g===void 0?(0,K.jsxs)(K.Fragment,{children:[u?(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:(0,K.jsx)(`span`,{className:`inline-flex`,tabIndex:l===null?0:void 0,children:y})}),(0,K.jsx)(vf,{children:`Mention`})]}):y,(0,K.jsxs)(bp,{className:`ml-auto min-w-0`,children:[(0,K.jsx)(`i`,{className:`ui-mode-dot`,style:{background:t.kind===`msg`?`var(--multi)`:`var(--uni)`}}),(0,K.jsx)(`span`,{className:`truncate`,children:r})]}),!u&&(0,K.jsx)(bp,{children:`as operator`}),(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:(0,K.jsx)(`span`,{className:`inline-flex`,tabIndex:_?void 0:0,children:(0,K.jsx)(yp,{variant:`default`,size:`icon-xs`,"aria-label":h?`Sending`:`Send`,disabled:!_,onClick:v,children:h?(0,K.jsx)(Rm,{}):(0,K.jsx)(X,{icon:kd})})})}),(0,K.jsx)(vf,{children:h?`Sending`:`Send`})]})]}):(0,K.jsx)(yp,{variant:`outline`,size:`sm`,className:`ml-auto`,disabled:!_,onClick:v,children:`Try again`})})]}),g===void 0?(0,K.jsx)(fp,{className:`truncate`,children:Gm(d(a))}):(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:(0,K.jsx)(pp,{className:`truncate`,children:g})}),(0,K.jsx)(vf,{children:g})]})]})}function Jm({store:e,target:t,shown:n}){let r=Xe(e,e=>e.drafts[c(t)])??Km;return(0,K.jsx)(K.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,K.jsx)(Im,{children:(0,K.jsxs)(Cp,{align:`end`,children:[(0,K.jsx)(wp,{children:(0,K.jsx)(rp,{children:(0,K.jsx)(ip,{children:`OP`})})}),(0,K.jsxs)(Tp,{children:[(0,K.jsxs)(Ep,{className:`gap-2`,children:[(0,K.jsx)(`span`,{children:`operator`}),(0,K.jsx)(np,{variant:`secondary`,children:`operator`}),(0,K.jsx)(`time`,{dateTime:t.toISOString(),children:O(t)}),n&&(0,K.jsx)(`span`,{children:`sending`})]}),(0,K.jsx)(op,{variant:n?`muted`:`default`,children:(0,K.jsx)(sp,{className:`whitespace-pre-wrap`,children:e.text})})]})]})},e.seq)})})}function Ym({peer:e,name:t,selfId:n}){return(0,K.jsxs)(hp,{children:[(0,K.jsx)(_p,{align:`block-start`,children:(0,K.jsx)(bp,{children:`This conversation is between two agents.`})}),(0,K.jsx)(_p,{align:`block-end`,children:(0,K.jsx)(yp,{asChild:!0,variant:`outline`,size:`sm`,className:`ml-auto`,children:(0,K.jsx)(`a`,{href:Oe(m(e,n)),onClick:()=>Wm({kind:`dm`,to:e}),children:`Message ${t}`})})})]})}function Xm(e){let t=e.snapshot;return t!==void 0&&(t.asOf!==void 0||Array.isArray(t.members)&&t.members.length>0)}function Zm(e,t){if(e.unreadable!==void 0)return`unreadable`;if(!Xm(e))return`traffic-only`;let n=e.snapshot.asOf;return(n?t-n:1/0)<45e3?`live`:`stale`}function Qm(e){return Xm(e)&&e.unreadable===void 0}var $m=e=>e.split(`.`).some(e=>e===`*`||e===`>`);function eh(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 th(e,t,n,r=[]){let i=new Map,a=!1;for(let t of e)if(t===`>`||t===`*`)a=!0;else if($m(t))for(let e of n)eh(t,e)&&i.set(e,`live`);else i.set(t,`live`);for(let e of t)if($m(e))for(let t of r)!i.has(t)&&eh(e,t)&&i.set(t,`durable`);else i.has(e)||i.set(e,`durable`);return{channels:i,wide:a}}function nh(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(Qm(t)){let r=[...n,e];for(let n of t.snapshot.members){let{channels:t,wide:i}=th(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 rh(e,t,n,r,i){let a=new Set,o=!1;if(Qm(t)){let r=t.snapshot.members.find(t=>t.id===e);if(r){let e=th(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 ih({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`empty`,className:G(`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 ah({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`empty-header`,className:G(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var oh=bd(`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 sh({className:e,variant:t=`default`,...n}){return(0,K.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:G(oh({variant:t,className:e})),...n})}function ch({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`empty-title`,className:G(`text-lg font-medium tracking-tight`,e),...t})}function lh({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`empty-description`,className:G(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function uh({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`empty-content`,className:G(`flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance`,e),...t})}var dh=26;function fh({letter:e,slot:t,size:n,offline:r}){let i=n<dh,a=[`ui-idb`,[...e].length>1&&`ui-idb-2`,i&&`ui-idb-dot`,r&&`ui-idb-off`].filter(Boolean).join(` `);return(0,K.jsx)(`i`,{className:a,style:{"--bf":`var(--id-${t})`},"aria-hidden":`true`,children:i?null:e})}var ph={waiting:Vd,working:Wd,idle:Kd,offline:ef},mh=e=>e.charAt(0).toUpperCase()+e.slice(1);function hh({status:e}){return(0,K.jsx)(`i`,{className:`ui-st ui-st-${e}`,role:`img`,"aria-label":mh(e)})}var gh=(e,t)=>e===`working`?`${t} ox-spin`:t,_h={waiting:`default`,working:`secondary`,idle:`outline`,offline:`outline`};function vh({row:e}){let t=Object.hasOwn(ph,e.status)?ph[e.status]:void 0,n=Object.hasOwn(_h,e.status)?_h[e.status]:`outline`;return(0,K.jsxs)(np,{variant:n,children:[t&&(0,K.jsx)(X,{icon:t,"data-icon":`inline-start`,className:e.status===`working`?`ox-spin`:void 0}),mh(Ye(e))]})}var yh={"claude-code":`claude`,claude:`claude`,opencode:`opencode`,codex:`codex`,hermes:`hermes`,pi:`pi`},bh=`guest`,xh={working:{look:`down`},waiting:{mood:`surprised`,look:`up`}};function Sh(e,t){return Zf(e!==void 0&&Object.hasOwn(yh,e)?yh[e]:bh,Object.hasOwn(xh,t)?xh[t]:{})}function Ch({vendor:e,status:t,size:n,badge:r,dot:i=!0}){return(0,K.jsxs)(`span`,{className:t===`offline`?`ui-av ui-av-off`:`ui-av`,style:{"--s":`${n}px`},children:[(0,K.jsx)(`svg`,{viewBox:`-2 -4 112 112`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:Sh(e,t)}}),r&&(0,K.jsx)(fh,{letter:r.letter,slot:r.slot,size:n,offline:t===`offline`}),i&&(0,K.jsx)(hh,{status:t})]})}var wh=8;function Th(e,t){return e.trim()?e:t}function Eh(e){let t=[...e][0];if(t===void 0)return``;let n=/_(\d+)$/.exec(e);return t.toUpperCase()+(n?n[1]:``)}function Dh(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 Oh(e){let t=new Map;for(let n of e)if(n.status!==`offline`){let e=Eh(Th(n.name,n.id));t.set(e,(t.get(e)??0)+1)}let n=new Map;for(let r of e){let e=Th(r.name,r.id),i=Eh(e);n.set(r.id,r.status!==`offline`&&(t.get(i)??0)>1?Dh(e):i)}return n}function kh(e){let t=7;for(let n of e)t=Math.imul(t,31)+n.charCodeAt(0)>>>0;return t%wh+1}var Ah=(e,t)=>e.name<t.name?-1:e.name>t.name?1:e.id<t.id?-1:+(e.id>t.id);function jh(e){let t=new Map,n=new Set,r=e.filter(e=>e.status!==`offline`).sort(Ah);for(let e of r){let r=kh(Th(e.name,e.id));if(n.size<wh)for(;n.has(r);)r=r%wh+1;n.add(r),t.set(e.id,r)}for(let n of e)n.status===`offline`&&t.set(n.id,kh(Th(n.name,n.id)));return t}var Mh=(0,o.createContext)(()=>void 0);function Nh(){return(0,o.useContext)(Mh)}function Ph(e){let t=jh(e),n=Oh(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 Fh={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 Ih(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 Lh(e){if(Array.isArray(e))return e}function Rh(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 zh(){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 Bh(e,t){return Lh(e)||Rh(e,t)||Vh(e,t)||zh()}function Vh(e,t){if(e){if(typeof e==`string`)return Ih(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)?Ih(e,t):void 0}}var Hh=Object.entries,Uh=Object.setPrototypeOf,Wh=Object.isFrozen,Gh=Object.getPrototypeOf,Kh=Object.getOwnPropertyDescriptor,qh=Object.freeze,Jh=Object.seal,Yh=Object.create,Xh=typeof Reflect<`u`&&Reflect,Zh=Xh.apply,Qh=Xh.construct;qh||=function(e){return e},Jh||=function(e){return e},Zh||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Qh||=function(e){return new e(...[...arguments].slice(1))};var $h=yg(Array.prototype.forEach),eg=yg(Array.prototype.lastIndexOf),tg=yg(Array.prototype.pop),ng=yg(Array.prototype.push),rg=yg(Array.prototype.splice),ig=Array.isArray,ag=yg(String.prototype.toLowerCase),og=yg(String.prototype.toString),sg=yg(String.prototype.match),cg=yg(String.prototype.replace),lg=yg(String.prototype.indexOf),ug=yg(String.prototype.trim),dg=yg(Number.prototype.toString),fg=yg(Boolean.prototype.toString),pg=typeof BigInt>`u`?null:yg(BigInt.prototype.toString),mg=typeof Symbol>`u`?null:yg(Symbol.prototype.toString),hg=yg(Object.prototype.hasOwnProperty),gg=yg(Object.prototype.toString),_g=yg(RegExp.prototype.test),vg=bg(TypeError);function yg(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Zh(e,t,n)}}function bg(e){return function(){return Qh(e,[...arguments])}}function Z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ag;if(Uh&&Uh(e,null),!ig(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Wh(t)||(t[r]=e),i=e)}e[i]=!0}return e}function xg(e){for(let t=0;t<e.length;t++)hg(e,t)||(e[t]=null);return e}function Sg(e){let t=Yh(null);for(let r of Hh(e)){var n=Bh(r,2);let i=n[0],a=n[1];hg(e,i)&&(t[i]=ig(a)?xg(a):a&&typeof a==`object`&&a.constructor===Object?Sg(a):a)}return t}function Cg(e){switch(typeof e){case`string`:return e;case`number`:return dg(e);case`boolean`:return fg(e);case`bigint`:return pg?pg(e):`0`;case`symbol`:return mg?mg(e):`Symbol()`;case`undefined`:return gg(e);case`function`:case`object`:{if(e===null)return gg(e);let t=e,n=wg(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:gg(e)}return gg(e)}default:return gg(e)}}function wg(e,t){for(;e!==null;){let n=Kh(e,t);if(n){if(n.get)return yg(n.get);if(typeof n.value==`function`)return yg(n.value)}e=Gh(e)}function n(){return null}return n}function Tg(e){try{return _g(e,``),!0}catch{return!1}}var Eg=qh(`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(`.`)),Dg=qh(`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(`.`)),Og=qh([`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`]),kg=qh([`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`]),Ag=qh(`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(`.`)),jg=qh([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Mg=qh([`#text`]),Ng=qh(`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(`.`)),Pg=qh(`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(`.`)),Fg=qh(`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(`.`)),Ig=qh([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Lg=Jh(/{{[\w\W]*|^[\w\W]*}}/g),Rg=Jh(/<%[\w\W]*|^[\w\W]*%>/g),zg=Jh(/\${[\w\W]*/g),Bg=Jh(/^data-[\-\w.\u00B7-\uFFFF]+$/),Vg=Jh(/^aria-[\-\w]+$/),Hg=Jh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ug=Jh(/^(?:\w+script|data):/i),Wg=Jh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gg=Jh(/^html$/i),Kg=Jh(/^[a-z][.\w]*(-[.\w]+)+$/i),qg=Jh(/<[/\w!]/g),Jg=Jh(/<[/\w]/g),Yg=Jh(/<\/no(script|embed|frames)/i),Xg=Jh(/\/>/i),Zg={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qg=function(){return typeof window>`u`?null:window},$g=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}},e_=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},t_=function(e,t,n,r){return hg(e,t)&&ig(e[t])?Z(r.base?Sg(r.base):{},e[t],r.transform):n};function n_(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qg(),t=e=>n_(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==Zg.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=wg(d,`cloneNode`),p=wg(d,`remove`),m=wg(d,`nextSibling`),h=wg(d,`childNodes`),g=wg(d,`parentNode`),_=wg(d,`shadowRoot`),v=wg(d,`attributes`),y=o&&o.prototype?wg(o.prototype,`nodeType`):null,b=o&&o.prototype?wg(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 vg(`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=$g(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,N=A.createDocumentFragment,P=A.getElementsByTagName,F=r.importNode,I=e_();t.isSupported=typeof Hh==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let ee=Lg,L=Rg,te=zg,ne=Bg,re=Vg,ie=Ug,R=Wg,z=Kg,ae=Hg,B=null,V=Z({},[...Eg,...Dg,...Og,...Ag,...Mg]),H=null,oe=Z({},[...Ng,...Pg,...Fg,...Ig]),U=Object.seal(Yh(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}})),se=null,ce=null,le=Object.seal(Yh(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ue=!0,de=!0,fe=!1,pe=!0,me=!1,he=!0,ge=!1,_e=!1,ve=null,ye=null,be=!1,xe=!1,Se=!1,Ce=!1,we=!0,Te=!1,Ee=`user-content-`,De=!0,Oe=!1,ke={},Ae=null,je=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(`.`)),Me=null,Ne=Z({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Pe=null,Fe=Z({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ie=`http://www.w3.org/1998/Math/MathML`,Le=`http://www.w3.org/2000/svg`,Re=`http://www.w3.org/1999/xhtml`,ze=Re,Be=!1,Ve=null,He=Z({},[Ie,Le,Re],og),Ue=qh([`mi`,`mo`,`mn`,`ms`,`mtext`]),We=Z({},Ue),Ge=qh([`annotation-xml`]),Ke=Z({},Ge),qe=Z({},[`title`,`style`,`font`,`a`,`script`]),Je=null,Ye=[`application/xhtml+xml`,`text/html`],W=null,Xe=null,Ze=n.createElement(`form`),Qe=function(e){return e instanceof RegExp||e instanceof Function},$e=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Xe&&Xe===e)return;e&&typeof e==`object`||(e={}),e=Sg(e),Je=Ye.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,W=Je===`application/xhtml+xml`?og:ag,B=t_(e,`ALLOWED_TAGS`,V,{transform:W}),H=t_(e,`ALLOWED_ATTR`,oe,{transform:W}),Ve=t_(e,`ALLOWED_NAMESPACES`,He,{transform:og}),Pe=t_(e,`ADD_URI_SAFE_ATTR`,Fe,{transform:W,base:Fe}),Me=t_(e,`ADD_DATA_URI_TAGS`,Ne,{transform:W,base:Ne}),Ae=t_(e,`FORBID_CONTENTS`,je,{transform:W}),se=t_(e,`FORBID_TAGS`,Sg({}),{transform:W}),ce=t_(e,`FORBID_ATTR`,Sg({}),{transform:W}),ke=hg(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Sg(e.USE_PROFILES):e.USE_PROFILES:!1,ue=e.ALLOW_ARIA_ATTR!==!1,de=e.ALLOW_DATA_ATTR!==!1,fe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=e.SAFE_FOR_TEMPLATES||!1,he=e.SAFE_FOR_XML!==!1,ge=e.WHOLE_DOCUMENT||!1,xe=e.RETURN_DOM||!1,Se=e.RETURN_DOM_FRAGMENT||!1,Ce=e.RETURN_TRUSTED_TYPE||!1,be=e.FORCE_BODY||!1,we=e.SANITIZE_DOM!==!1,Te=e.SANITIZE_NAMED_PROPS||!1,De=e.KEEP_CONTENT!==!1,Oe=e.IN_PLACE||!1,ae=Tg(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Hg,ze=typeof e.NAMESPACE==`string`?e.NAMESPACE:Re,We=hg(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Sg(e.MATHML_TEXT_INTEGRATION_POINTS):Z({},Ue),Ke=hg(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Sg(e.HTML_INTEGRATION_POINTS):Z({},Ge);let t=hg(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Sg(e.CUSTOM_ELEMENT_HANDLING):Yh(null);if(U=Yh(null),hg(t,`tagNameCheck`)&&Qe(t.tagNameCheck)&&(U.tagNameCheck=t.tagNameCheck),hg(t,`attributeNameCheck`)&&Qe(t.attributeNameCheck)&&(U.attributeNameCheck=t.attributeNameCheck),hg(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(U.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Jh(U),me&&(de=!1),Se&&(xe=!0),ke&&(B=Z({},Mg),H=Yh(null),ke.html===!0&&(Z(B,Eg),Z(H,Ng)),ke.svg===!0&&(Z(B,Dg),Z(H,Pg),Z(H,Ig)),ke.svgFilters===!0&&(Z(B,Og),Z(H,Pg),Z(H,Ig)),ke.mathMl===!0&&(Z(B,Ag),Z(H,Fg),Z(H,Ig))),le.tagCheck=null,le.attributeCheck=null,hg(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?le.tagCheck=e.ADD_TAGS:ig(e.ADD_TAGS)&&(B===V&&(B=Sg(B)),Z(B,e.ADD_TAGS,W))),hg(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?le.attributeCheck=e.ADD_ATTR:ig(e.ADD_ATTR)&&(H===oe&&(H=Sg(H)),Z(H,e.ADD_ATTR,W))),hg(e,`ADD_URI_SAFE_ATTR`)&&ig(e.ADD_URI_SAFE_ATTR)&&Z(Pe,e.ADD_URI_SAFE_ATTR,W),hg(e,`FORBID_CONTENTS`)&&ig(e.FORBID_CONTENTS)&&(Ae===je&&(Ae=Sg(Ae)),Z(Ae,e.FORBID_CONTENTS,W)),hg(e,`ADD_FORBID_CONTENTS`)&&ig(e.ADD_FORBID_CONTENTS)&&(Ae===je&&(Ae=Sg(Ae)),Z(Ae,e.ADD_FORBID_CONTENTS,W)),De&&(B[`#text`]=!0),ge&&Z(B,[`html`,`head`,`body`]),B.table&&(Z(B,[`tbody`]),delete se.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw vg(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw vg(`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(``)));qh&&qh(e),Xe=e},et=Z({},[...Dg,...Og,...kg]),tt=Z({},[...Ag,...jg]),nt=function(e,t,n){return t.namespaceURI===Re?e===`svg`:t.namespaceURI===Ie?e===`svg`&&(n===`annotation-xml`||We[n]):!!et[e]},rt=function(e,t,n){return t.namespaceURI===Re?e===`math`:t.namespaceURI===Le?e===`math`&&Ke[n]:!!tt[e]},it=function(e,t,n){return t.namespaceURI===Le&&!Ke[n]||t.namespaceURI===Ie&&!We[n]?!1:!tt[e]&&(qe[e]||!et[e])},at=function(e){let t=g(e);t&&t.tagName||(t={namespaceURI:ze,tagName:`template`});let n=ag(e.tagName),r=ag(t.tagName);return Ve[e.namespaceURI]?e.namespaceURI===Le?nt(n,t,r):e.namespaceURI===Ie?rt(n,t,r):e.namespaceURI===Re?it(n,t,r):!!(Je===`application/xhtml+xml`&&Ve[e.namespaceURI]):!1},ot=function(e){ng(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw vg(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},st=function(e){ut(e);let t=h(e);if(t){let e=[];$h(t,t=>{ng(e,t)}),$h(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{}}},ct=function(e,n){try{ng(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{ng(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(xe||Se)try{ot(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},lt=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[W(i)]))try{e.removeAttribute(i)}catch{}}},ut=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===Zg.element&<(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},dt=function(e){if(!he)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===Zg.processingInstruction||n===Zg.comment&&_g(Jg,e.data)){try{p(e)}catch{}continue}if(n===Zg.element){let t=e,n=W(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])}},ft=function(e){let t=null,r=null;if(be)e=`<remove></remove>`+e;else{let t=sg(e,/^[\r\n\t ]+/);r=t&&t[0]}Je===`application/xhtml+xml`&&ze===Re&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(ze===Re)try{t=new l().parseFromString(i,Je)}catch{}if(!t||!t.documentElement){t=j.createDocument(ze,`template`,null);try{t.documentElement.innerHTML=Be?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),ze===Re?P.call(t,ge?`html`:`body`)[0]:ge?t.documentElement:a},pt=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)},mt=function(e){return e=cg(e,ee,` `),e=cg(e,L,` `),e=cg(e,te,` `),e},ht=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=mt(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&$h(r,e=>{_t(e.content)&&ht(e.content)})},gt=function(e){let t=b?b(e):null;return typeof t!=`string`||W(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)},_t=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Zg.documentFragment}catch{return!1}},vt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function yt(e,n,r){e.length!==0&&$h(e,e=>{e.call(t,n,r,Xe)})}let bt=function(e,t){return!!(he&&e.hasChildNodes()&&!vt(e.firstElementChild)&&_g(qg,e.textContent)&&_g(qg,e.innerHTML)||he&&e.namespaceURI===Re&&t===`style`&&vt(e.firstElementChild)||e.nodeType===Zg.processingInstruction||he&&e.nodeType===Zg.comment&&_g(Jg,e.data))},xt=function(e,t){if(!se[t]&&Tt(t)&&(U.tagNameCheck instanceof RegExp&&_g(U.tagNameCheck,t)||U.tagNameCheck instanceof Function&&U.tagNameCheck(t)))return!1;if(De&&!Ae[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=Oe?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return ot(e),!0},St=function(e,n){if(yt(I.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return!0;if(gt(e))return ot(e),!0;let r=W(b?b(e):e.nodeName);if(yt(I.uponSanitizeElement,e,{tagName:r,allowedTags:B}),e!==n&&g(e)===null)return!0;if(bt(e,r))return ot(e),!0;if(se[r]||!(le.tagCheck instanceof Function&&le.tagCheck(r))&&!B[r]){let t=xt(e,r);return t===!1&&yt(I.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===Zg.element&&!at(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&_g(Yg,e.innerHTML))return ot(e),!0;if(me&&e.nodeType===Zg.text){let n=mt(e.textContent);e.textContent!==n&&(ng(t.removed,{element:e.cloneNode()}),e.textContent=n)}return yt(I.afterSanitizeElements,e,null),!1},Ct=function(e,t,r){if(ce[t]||he&&t===`patchsrc`||he&&t===`for`&&e!==`label`&&e!==`output`||we&&(t===`id`||t===`name`)&&(r in n||r in Ze))return!1;let i=H[t]||le.attributeCheck instanceof Function&&le.attributeCheck(t,e);if(!(de&&_g(ne,t))&&!(ue&&_g(re,t))){if(!i){if(!(Tt(e)&&(U.tagNameCheck instanceof RegExp&&_g(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&_g(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t,e))||t===`is`&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&_g(U.tagNameCheck,r)||U.tagNameCheck instanceof Function&&U.tagNameCheck(r))))return!1}else if(!Pe[t]&&!_g(ae,cg(r,R,``))&&(t!==`src`&&t!==`xlink:href`&&t!==`href`||e===`script`||lg(r,`data:`)!==0||!Me[e])&&(!fe||_g(ie,cg(r,R,``)))&&r)return!1}return!0},wt=Z({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Tt=function(e){return!wt[ag(e)]&&_g(z,e)},Et=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},Dt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),gt(e)?ot(e):tg(t.removed)}catch{ct(n,e)}},Ot=function(e){yt(I.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||gt(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0},r=t.length,i=W(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=W(o),u=c,d=o===`value`?u:ug(u);n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,yt(I.uponSanitizeAttribute,e,n),d=n.attrValue,Te&&(l===`id`||l===`name`)&&lg(d,Ee)!==0&&(ct(o,e),d=Ee+d),he&&_g(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||l===`attributename`&&sg(d,`href`)?ct(o,e):n.forceKeepAttr||(n.keepAttr?!pe&&_g(Xg,d)?ct(o,e):(me&&(d=mt(d)),Ct(i,l,d)?(d=Et(i,l,s,d),d!==u&&Dt(e,o,s,d)):ct(o,e)):ct(o,e))}yt(I.afterSanitizeAttributes,e,null)},kt=function(e){let t=null,n=pt(e);for(yt(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(yt(I.uponSanitizeShadowNode,t,null),St(t,e),Ot(t),_t(t.content)&&kt(t.content),(y?y(t):t.nodeType)===Zg.element){let e=_(t);_t(e)&&(At(e),kt(e))}yt(I.afterSanitizeShadowDOM,e,null)},At=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){kt(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===Zg.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`&&W(e)===`template`){let e=n.content;_t(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);_t(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(Be=!e,Be&&(e=`<!-->`),typeof e!=`string`&&!vt(e)&&(e=Cg(e),typeof e!=`string`))throw vg(`dirty is not a string, aborting`);if(!t.isSupported)return e;_e?(B=ve,H=ye):$e(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(B=Sg(B)),I.uponSanitizeAttribute.length>0&&(H=Sg(H)),t.removed=[];let c=Oe&&typeof e!=`string`&&vt(e);if(c){dt(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=W(t);if(!B[n]||se[n])throw st(e),vg(`root node is forbidden and cannot be sanitized in-place`)}if(gt(e))throw st(e),vg(`root node is clobbered and cannot be sanitized in-place`);try{At(e)}catch(t){throw st(e),t}}else if(vt(e))i=ft(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Zg.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),At(a);else{if(!xe&&!me&&!ge&&e.indexOf(`<`)===-1)return x&&Ce?D(e):e;if(i=ft(e),!i)return xe?null:Ce?S:``}i&&be&&ot(i.firstChild);let l=c?e:i,u=pt(l);try{for(;o=u.nextNode();)St(o,l),Ot(o),_t(o.content)&&kt(o.content)}catch(n){throw c&&(st(e),$h(t.removed,e=>{e.element&&ut(e.element)})),n}if(c)return $h(t.removed,e=>{e.element&&ut(e.element)}),me&&ht(e),e;if(xe){if(me&&ht(i),Se)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=ge?i.outerHTML:i.innerHTML;return ge&&B[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&_g(Gg,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
44
|
+
`+d),me&&(d=mt(d)),x&&Ce?D(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$e(e),_e=!0,ve=B,ye=H},t.clearConfig=function(){Xe=null,_e=!1,ve=null,ye=null,x=C,S=``},t.isValidAttribute=function(e,t,n){Xe||$e({});let r=W(e),i=W(t);return Ct(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&hg(I,e)&&ng(I[e],t)},t.removeHook=function(e,t){if(hg(I,e)){if(t!==void 0){let n=eg(I[e],t);return n===-1?void 0:rg(I[e],n,1)[0]}return tg(I[e])}},t.removeHooks=function(e){hg(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=e_()},t}var r_=n_();function i_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var a_=i_();function o_(e){a_=e}var s_={exec:()=>null};function c_(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(u_.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var l_=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),u_={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:c_(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:c_(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:c_(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:c_(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:c_(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:c_(e=>RegExp(`^ {0,${e}}>`))},d_=/^(?:[ \t]*(?:\n|$))+/,f_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,p_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,m_=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,h_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,g_=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,__=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,v_=Q(__).replace(/bull/g,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(),y_=Q(__).replace(/bull/g,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(),b_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,x_=/^[^\n]+/,S_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,C_=Q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,S_).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),w_=Q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,g_).getRegex(),T_=`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`,E_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,D_=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`,E_).replace(`tag`,T_).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),O_=e=>Q(b_).replace(`hr`,m_).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`,T_).getRegex(),k_=O_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),A_=O_(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/),j_={blockquote:Q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,A_).getRegex(),code:f_,def:C_,fences:p_,heading:h_,hr:m_,html:D_,lheading:v_,list:w_,newline:d_,paragraph:k_,table:s_,text:x_},M_=Q(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,m_).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`,T_).getRegex(),N_={...j_,lheading:y_,table:M_,paragraph:Q(b_).replace(`hr`,m_).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,M_).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`,T_).getRegex()},P_={...j_,html:Q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,E_).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:s_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Q(b_).replace(`hr`,m_).replace(`heading`,` *#{1,6} *[^
|
|
45
|
+
]`).replace(`lheading`,v_).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},F_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,I_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,L_=/^( {2,}|\\)\n(?!\s*$)/,R_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,z_=/[\p{P}\p{S}]/u,B_=/[\s\p{P}\p{S}]/u,V_=/[^\s\p{P}\p{S}]/u,H_=Q(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,B_).getRegex(),U_=/(?!~)[\p{P}\p{S}]/u,W_=/(?!~)[\s\p{P}\p{S}]/u,G_=/(?:[^\s\p{P}\p{S}]|~)/u,K_=Q(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,l_?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),q_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,J_=Q(q_,`u`).replace(/punct/g,z_).getRegex(),Y_=Q(q_,`u`).replace(/punct/g,U_).getRegex(),X_=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Z_=Q(X_,`gu`).replace(/notPunctSpace/g,V_).replace(/punctSpace/g,B_).replace(/punct/g,z_).getRegex(),Q_=Q(X_,`gu`).replace(/notPunctSpace/g,G_).replace(/punctSpace/g,W_).replace(/punct/g,U_).getRegex(),$_=Q(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,V_).replace(/punctSpace/g,B_).replace(/punct/g,z_).getRegex(),ev=Q(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,z_).getRegex(),tv=Q(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,V_).replace(/punctSpace/g,B_).replace(/punct/g,z_).getRegex(),nv=Q(/\\(punct)/,`gu`).replace(/punct/g,z_).getRegex(),rv=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(),iv=Q(E_).replace(`(?:-->|$)`,`-->`).getRegex(),av=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`,iv).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ov=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,sv=Q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,ov).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),cv=Q(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ov).replace(`ref`,S_).getRegex(),lv=Q(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,S_).getRegex(),uv=Q(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,cv).replace(`nolink`,lv).getRegex(),dv=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,fv={_backpedal:s_,anyPunctuation:nv,autolink:rv,blockSkip:K_,br:L_,code:I_,del:s_,delLDelim:s_,delRDelim:s_,emStrongLDelim:J_,emStrongRDelimAst:Z_,emStrongRDelimUnd:$_,escape:F_,link:sv,nolink:lv,punctuation:H_,reflink:cv,reflinkSearch:uv,tag:av,text:R_,url:s_},pv={...fv,link:Q(/^!?\[(label)\]\((.*?)\)/).replace(`label`,ov).getRegex(),reflink:Q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,ov).getRegex()},mv={...fv,emStrongRDelimAst:Q_,emStrongLDelim:Y_,delLDelim:ev,delRDelim:tv,url:Q(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,dv).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`,dv).getRegex()},hv={...mv,br:Q(L_).replace(`{2,}`,`*`).getRegex(),text:Q(mv.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},gv={normal:j_,gfm:N_,pedantic:P_},_v={normal:fv,gfm:mv,breaks:hv,pedantic:pv},vv={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},yv=e=>vv[e];function bv(e,t){if(t){if(u_.escapeTest.test(e))return e.replace(u_.escapeReplace,yv)}else if(u_.escapeTestNoEncode.test(e))return e.replace(u_.escapeReplaceNoEncode,yv);return e}function xv(e){try{e=encodeURI(e).replace(u_.percentDecode,`%`)}catch{return null}return e}function Sv(e,t){let n=e.replace(u_.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(u_.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(u_.slashPipe,`|`);return n}function Cv(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 wv(e){let t=e.split(`
|
|
46
|
+
`),n=t.length-1;for(;n>=0&&u_.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
47
|
+
`)}function Tv(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 Ev(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 Dv(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 Ov(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 kv=class{options;rules;lexer;constructor(e){this.options=e||a_}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]:wv(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=Ov(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=Cv(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Cv(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:Cv(t[0],`
|
|
51
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Cv(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=Ev(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=wv(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:Cv(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=Sv(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:Cv(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(Sv(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:Cv(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=Cv(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Tv(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)),Dv(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 Dv(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}}}},Av=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||a_,this.options.tokenizer=this.options.tokenizer||new kv,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:u_,block:gv.normal,inline:_v.normal};this.options.pedantic?(t.block=gv.pedantic,t.inline=_v.pedantic):this.options.gfm&&(t.block=gv.gfm,t.inline=this.options.breaks?_v.breaks:_v.gfm),this.tokenizer.rules=t}static get rules(){return{block:gv,inline:_v}}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(u_.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(u_.tabCharGlobal,` `).replace(u_.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)}},jv=class{options;parser;constructor(e){this.options=e||a_}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(u_.notSpaceStart)?.[0],i=e.replace(u_.endingNewline,``)+`
|
|
89
|
+
`;return r?`<pre><code class="language-`+bv(r)+`">`+(n?i:bv(i,!0))+`</code></pre>
|
|
90
|
+
`:`<pre><code>`+(n?i:bv(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>${bv(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=xv(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+bv(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=xv(e);if(i===null)return bv(n);e=i;let a=`<img src="${e}" alt="${bv(n)}"`;return t&&(a+=` title="${bv(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:bv(e.text)}},Mv=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}},Nv=class e{options;renderer;textRenderer;constructor(e){this.options=e||a_,this.options.renderer=this.options.renderer||new jv,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Mv}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}},Pv=class{options;block;constructor(e){this.options=e||a_}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?Av.lex:Av.lexInline}provideParser(e=this.block){return e?Nv.parse:Nv.parseInline}},Fv=new class{defaults=i_();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Nv;Renderer=jv;TextRenderer=Mv;Lexer=Av;Tokenizer=kv;Hooks=Pv;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 jv(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 kv(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 Pv;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]=Pv.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Pv.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 Av.lex(e,t??this.defaults)}parser(e,t){return Nv.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?Av.lex:Av.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?Nv.parse:Nv.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?Av.lex:Av.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?Nv.parse:Nv.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>`+bv(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Fv.parse(e,t)}$.options=$.setOptions=function(e){return Fv.setOptions(e),$.defaults=Fv.defaults,o_($.defaults),$},$.getDefaults=i_,$.defaults=a_,$.use=function(...e){return Fv.use(...e),$.defaults=Fv.defaults,o_($.defaults),$},$.walkTokens=function(e,t){return Fv.walkTokens(e,t)},$.parseInline=Fv.parseInline,$.Parser=Nv,$.parser=Nv.parse,$.Renderer=jv,$.TextRenderer=Mv,$.Lexer=Av,$.lexer=Av.lex,$.Tokenizer=kv,$.Hooks=Pv,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,Nv.parse,Av.lex,$.setOptions({gfm:!0,breaks:!0});var Iv={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},Lv;function Rv(){if(Lv)return Lv;let e=r_();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`))}),Lv=e}function zv(e){return Rv().sanitize(e,Iv)}function Bv(e){return e?zv($.parse(String(e),{async:!1})):``}function Vv(e){let t=[],n=``,r=()=>{let e=Bv(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 Hv({...e}){return(0,K.jsx)(Ar,{"data-slot":`collapsible`,...e})}function Uv({...e}){return(0,K.jsx)(Mr,{"data-slot":`collapsible-trigger`,...e})}function Wv({...e}){return(0,K.jsx)(Pr,{"data-slot":`collapsible-content`,...e})}var Gv=500;function Kv(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()},Gv))},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 qv({msg:e,senderId:t,name:n,peer:r,onViewAgent:i}){let[a,s]=(0,o.useState)(!1),c=(0,o.useRef)(null);Kv(c,()=>s(!0));let l=k(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,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{ref:c,className:`ui-msg-acts`,children:[(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:(0,K.jsxs)(`a`,{href:u,"aria-describedby":f,children:[(0,K.jsx)(X,{icon:Ad,size:16,className:`ui-ic ui-ic16`}),`View work`]})}),(0,K.jsx)(vf,{children:d})]}),(0,K.jsx)(`span`,{id:f,className:`ui-sr`,children:d})]}),(0,K.jsx)(Jv,{open:a,onOpenChange:s,msg:e,senderId:t,name:n,peer:r,at:l,href:u,onViewAgent:i})]})}function Jv({open:e,onOpenChange:t,msg:n,senderId:r,name:i,peer:a,at:o,href:s,onViewAgent:c}){let l=Nh(),u=ep(),d=()=>t(!1);return(0,K.jsx)(rf,{open:e,onOpenChange:t,children:(0,K.jsxs)(sf,{side:`bottom`,...u,children:[(0,K.jsxs)(cf,{className:`flex-row items-center gap-3`,children:[(0,K.jsx)(Ch,{vendor:a.harness,status:a.status,size:28,dot:!1,badge:l(r)}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsx)(uf,{children:i}),(0,K.jsx)(df,{children:o?`Message at ${o}`:`Message`})]})]}),(0,K.jsxs)(lf,{children:[(0,K.jsx)(Sd,{asChild:!0,variant:`ghost`,className:`justify-start`,children:(0,K.jsxs)(`a`,{href:s,onClick:d,children:[(0,K.jsx)(X,{icon:Ad,"data-icon":`inline-start`}),`View ${i}'s work here`]})}),(0,K.jsxs)(Sd,{type:`button`,variant:`ghost`,className:`justify-start`,onClick:()=>{d(),c(r)},children:[(0,K.jsx)(X,{icon:tf,"data-icon":`inline-start`}),`View agent`]}),(0,K.jsxs)(Sd,{type:`button`,variant:`ghost`,className:`justify-start`,onClick:()=>{zm(T(n.parts)),d()},children:[(0,K.jsx)(X,{icon:Ld,"data-icon":`inline-start`}),`Copy text`]})]})]})})}var Yv=(0,o.createContext)(null),Xv=280,Zv=`History does not record who sent this message. The sender shown is the one the message names, and it has not been checked.`,Qv=`Anycast: one free agent with this role takes it.`;function $v(){return(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:(0,K.jsxs)(np,{variant:`outline`,children:[`unverified`,(0,K.jsx)(`span`,{className:`ui-sr`,children:` ${Zv}`})]})}),(0,K.jsx)(vf,{children:Zv})]})}function ey(e){let t=e===`claude-code`?`claude`:e;return Object.hasOwn(Fh,t)?Fh[t].label:e}function ty({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)(Yv),m=Nh(),h=t??e.from?.id,g=h===void 0?void 0:i.get(h),_=T(e.parts),v=_.length>Xv,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:Bv(_)},w=Ie(t??e.from,r),E=t!==void 0&&i.has(t)?m(t):void 0,D=(0,K.jsx)(Ch,{vendor:g?.harness,status:g?.status??`offline`,size:32,dot:!1,badge:E});return(0,K.jsxs)(Cp,{align:s?`end`:`start`,children:[(0,K.jsx)(wp,{className:`overflow-visible`,children:(S===`alone`||S===`last`)&&(p&&t!==void 0?(0,K.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":w,onClick:()=>p(t),children:D}):D)}),(0,K.jsxs)(Tp,{children:[(S===`alone`||S===`first`)&&(0,K.jsxs)(Ep,{className:`flex-wrap gap-2`,children:[p&&t!==void 0?(0,K.jsx)(Sd,{type:`button`,variant:`link`,size:`xs`,className:`h-auto p-0`,onClick:()=>p(t),children:w}):(0,K.jsx)(`span`,{children:w}),t===void 0&&(0,K.jsx)($v,{}),u&&(0,K.jsx)(np,{variant:`secondary`,children:u}),u===void 0&&g?.role&&(0,K.jsx)(np,{variant:`secondary`,children:g.role}),u===void 0&&g?.harness&&(0,K.jsx)(np,{variant:`outline`,children:ey(g.harness)}),x&&(0,K.jsx)(`time`,{dateTime:x.toISOString(),children:O(x)})]}),(0,K.jsx)(op,{variant:s?`default`:y?`tinted`:`secondary`,children:(0,K.jsx)(sp,{children:v?(0,K.jsxs)(Hv,{open:d,onOpenChange:f,children:[(0,K.jsx)(Wv,{forceMount:!0,className:d?`ui-tx`:`ui-tx ui-clamp`,dangerouslySetInnerHTML:C}),(0,K.jsx)(Uv,{asChild:!0,children:(0,K.jsxs)(Sd,{type:`button`,variant:`ghost`,size:`xs`,children:[d?`Show less`:`Show more`,(0,K.jsx)(X,{icon:Ed,"data-icon":`inline-end`,className:`group-data-open/button:rotate-180`})]})})]}):(0,K.jsx)(`div`,{className:`ui-tx`,dangerouslySetInnerHTML:C})})}),n===`anycast`&&b!==void 0&&(0,K.jsxs)(Dp,{className:`flex-wrap gap-1.5`,children:[(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:(0,K.jsxs)(np,{variant:`outline`,children:[(0,K.jsx)(`i`,{className:`ui-mode-dot`,style:{background:`var(--any)`}}),`To any ${b}`,(0,K.jsx)(`span`,{className:`ui-sr`,children:` ${Qv}`})]})}),(0,K.jsx)(vf,{children:Qv})]}),l!==void 0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{children:` · claimed by ${Ie(l.id,r)}`}),!l.verified&&(0,K.jsx)($v,{})]})]})]}),t!==void 0&&g!==void 0&&i.has(t)&&(0,K.jsx)(qv,{msg:e,senderId:t,name:w,peer:g,onViewAgent:p??ny})]})}var ny=()=>void 0,ry=bd(`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 iy({className:e,variant:t,...n}){return(0,K.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:G(ry({variant:t}),e),...n})}function ay({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`alert-title`,className:G(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function oy({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`alert-description`,className:G(`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 sy({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`alert-action`,className:G(`absolute top-2.5 right-3`,e),...t})}var cy=bd(`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 ly({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,K.jsx)(Fu,{"data-slot":`toggle`,className:G(cy({variant:t,size:n,className:e})),...r})}function uy({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,K.jsx)(fu,{"data-slot":`separator`,decorative:n,orientation:t,className:G(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}function dy(){let{isMobile:e,open:t,openMobile:n}=Ef(),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,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:(0,K.jsx)(kf,{ref:r,"aria-label":a,"aria-haspopup":e?`dialog`:void 0,"aria-expanded":e?n:t})}),(0,K.jsx)(vf,{children:a})]}),(0,K.jsx)(uy,{orientation:`vertical`,className:`data-vertical:h-4 data-vertical:self-auto`})]})}var fy=bd(`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 py({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?Qt:`div`;return(0,K.jsx)(i,{"data-slot":`marker`,"data-variant":t,className:G(fy({variant:t,className:e})),...r})}function my({className:e,...t}){return(0,K.jsx)(`span`,{"data-slot":`marker-icon`,"aria-hidden":`true`,className:G(`size-4 shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...t})}function hy({className:e,...t}){return(0,K.jsx)(`span`,{"data-slot":`marker-content`,className:G(`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 gy(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 _y=(e,t)=>typeof t==`number`&&Number.isFinite(t)?Math.max(0,e-t):void 0;function vy(e,t){let n=[],r=_y(t,e.condition?.since);e.condition&&n.push(`${e.condition.code}${r===void 0?``:` for ${gy(r)}`}`);let i=_y(t,e.statusSince);i!==void 0&&n.push(`unchanged for ${gy(i)}`);let a=_y(t,e.activeAt);a!==void 0&&n.push(`active ${gy(a)} ago`);let o=e.activity?_y(t,e.activitySince):void 0;return o!==void 0&&n.push(`activity set ${gy(o)} ago`),n.join(` · `)}var yy=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0,by={dnd:{icon:qd,word:`Do not disturb`,color:`var(--uni-ink)`,title:`Channel messages wait for its next turn. DMs and mentions still wake it.`},focus:{icon:Qd,word:`Focus`,color:`var(--multi-ink)`,title:`Channel messages stay in the channel. DMs and role requests still reach it.`}};function xy({attention:e}){if(e===void 0||!Object.hasOwn(by,e))return null;let t=by[e];return(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:(0,K.jsxs)(`span`,{className:`v3-meta`,style:{color:t.color},children:[(0,K.jsx)(X,{icon:t.icon,size:16,className:`ui-ic ui-ic16`}),t.word,(0,K.jsx)(`span`,{className:`ui-sr`,children:` ${t.title}`})]})}),(0,K.jsx)(vf,{children:t.title})]})}var Sy=[];function Cy(e,t){(0,o.useEffect)(()=>{if(e)return e.openSession(t),()=>e.closeSession(t)},[e,t])}function wy(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 Ty(e,t){let n=Xe(e,e=>e.sessions[t]?.posts)??Sy,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 Ey(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 Dy({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`trace`,className:G(`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 Oy({className:e,status:t,...n}){return(0,K.jsx)(`span`,{"data-slot":`trace-line`,"data-status":t,className:G(`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 ky({className:e,...t}){return(0,K.jsx)(`span`,{"data-slot":`trace-icon`,"aria-hidden":`true`,className:G(`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 Ay({className:e,...t}){return(0,K.jsx)(`span`,{"data-slot":`trace-title`,className:G(`min-w-0 truncate motion-reduce:shimmer-none`,e),...t})}function jy({className:e,...t}){return(0,K.jsx)(`span`,{"data-slot":`trace-description`,className:G(`shrink-0 text-muted-foreground/70 tabular-nums`,e),...t})}function My({className:e,...t}){return(0,K.jsx)(Hv,{"data-slot":`trace-collapsible`,className:G(`flex w-full min-w-0 flex-col`,e),...t})}function Ny({className:e,children:t,...n}){return(0,K.jsxs)(Uv,{"data-slot":`trace-collapsible-trigger`,className:G(`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,K.jsx)(ky,{className:`transition-transform group-aria-expanded/trace-collapsible-trigger:rotate-90`,children:(0,K.jsx)(wd,{icon:Od,strokeWidth:2})})]})}function Py({className:e,children:t,...n}){return(0,K.jsx)(Wv,{"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,K.jsx)(`div`,{"data-slot":`trace-collapsible-content-inner`,className:G(`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 Fy({line:e,words:t}){let[n,r]=(0,o.useState)(!1);return(0,K.jsxs)(gf,{open:n,onOpenChange:r,children:[(0,K.jsx)(_f,{type:`button`,className:`ox-tip`,onClick:e=>{e.preventDefault(),r(!n)},children:e}),(0,K.jsx)(vf,{className:`ox-tipc`,sideOffset:4,children:t})]})}function Iy(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 Ly(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 Ry({call:e,payloadRead:t}){let n=t?t.status===`refused`?`read refused`:`read failed`:`not received`;return(0,K.jsx)(`div`,{className:`ox-payloads`,children:[[`Input`,e.input],[`Result`,e.result]].map(([e,r])=>(0,K.jsxs)(`details`,{className:`ox-payload`,children:[(0,K.jsxs)(`summary`,{children:[e,r===void 0?` · ${n}`:``]}),(0,K.jsx)(`pre`,{children:r===void 0?t?.reason??`No payload received. It may be withheld or outside the retained window.`:Ly(r)})]},e))})}var zy={command:Id,edit:zd,write:zd,read:Rd,send:Jd,dm:Jd,inbox:Hd,other:nf},By=e=>zy[e],Vy=`The connector reports the call returned an error. Open Input or Result for any received payload.`,Hy=`The connector reports the call returned an error. Open Input or Result for any received payload.`;function Uy(e,t){if(t===`running`)return(0,K.jsx)(Rm,{role:void 0,"aria-label":void 0,"aria-hidden":!0});let n=t===`failed`?Fd:t===`pending`?Vd:t===`noResult`?ef:By(e.kind);return(0,K.jsx)(X,{icon:n,size:16})}function Wy({call:e,state:t,shimmer:n=!0,className:r,payloadRead:i}){let a=Iy(t===`running`),o=Ey(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,K.jsx)(`code`,{children:l}):(0,K.jsxs)(`code`,{children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,children:l}),(0,K.jsx)(`span`,{className:`ui-sr`,children:d})]}),p=t===`called`&&d!==void 0,m=(0,K.jsxs)(Ay,{children:[de(e.kind,t,e.name),p&&(0,K.jsx)(`span`,{className:`ui-sr`,children:` ${d}`})]}),h=(0,K.jsxs)(Oy,{status:s,role:s===`running`?`status`:void 0,className:u,children:[(0,K.jsx)(ky,{children:Uy(e,t)}),p?(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:m}),(0,K.jsx)(vf,{children:d})]}):m,` `,c&&(0,K.jsx)(jy,{children:t===`called`?c:(0,K.jsxs)(K.Fragment,{children:[d===void 0||t===`failed`?f:(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:f}),(0,K.jsx)(vf,{children:d})]}),t===`running`?(0,K.jsx)(`span`,{"aria-hidden":`true`,children:c.slice(l.length)}):c.slice(l.length)]})})]},t);return(0,K.jsxs)(`div`,{className:`ox-call`,children:[t===`failed`?(0,K.jsx)(Fy,{line:h,words:e.kind===`command`?Vy:Hy}):h,(0,K.jsx)(Ry,{call:e,payloadRead:i})]})}function Gy({className:e,orientation:t=`horizontal`,...n}){return(0,K.jsx)(Cu,{"data-slot":`tabs`,"data-orientation":t,className:G(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Ky=bd(`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 qy({className:e,variant:t=`default`,...n}){return(0,K.jsx)(Tu,{"data-slot":`tabs-list`,"data-variant":t,className:G(Ky({variant:t}),e),...n})}function Jy({className:e,...t}){return(0,K.jsx)(Du,{"data-slot":`tabs-trigger`,className:G(`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 Yy({className:e,...t}){return(0,K.jsx)(ku,{"data-slot":`tabs-content`,className:G(`flex-1 text-sm outline-none`,e),...t})}function Xy({children:e,action:t}){return(0,K.jsxs)(iy,{role:`note`,className:`mb-2`,children:[(0,K.jsx)(X,{icon:Ud}),(0,K.jsx)(oy,{children:e}),t&&(0,K.jsx)(sy,{children:t})]})}function Zy({row:e}){let t=Object.hasOwn(ph,e.status)?ph[e.status]:void 0,n=Ye(e),r=Ey(e.status),i=e.activity||void 0,a;if(e.status===`working`||e.status===`waiting`){let t=k(e.statusSince);a=[i&&(/[.!?]$/.test(i)?i:`${i}.`),t&&`Reported ${t}.`].filter(Boolean).join(` `)||void 0}else if(e.status===`offline`){let t=k(e.ts);a=t&&`Last heartbeat ${t}.`}else e.status===`idle`&&(a=`No current activity.`);return(0,K.jsxs)(`div`,{className:r?`ox-foot ${r}`:`ox-foot`,children:[(0,K.jsx)(`span`,{className:`v3-spill v3-s-${e.status}`,children:t&&(0,K.jsx)(X,{icon:t,size:16,className:`ui-ic`})}),(0,K.jsx)(`b`,{children:e.name}),` is ${n} `,a&&(0,K.jsx)(`span`,{className:e.status===`waiting`?`ox-foot-wait`:void 0,children:a})]},e.status)}var Qy=()=>Promise.all([Jf(()=>import(`./core-Bfff_dYO.js`),__vite__mapDeps([0,1])),Jf(()=>import(`./engine-javascript-C30F4iNc.js`),[])]),$y=new Map([[`javascript`,()=>Jf(()=>import(`./javascript-BgS3c2Ky.js`),[])],[`typescript`,()=>Jf(()=>import(`./typescript-bsJCZSQ-.js`),[])],[`json`,()=>Jf(()=>import(`./json-qhed-kSA.js`),[])],[`bash`,()=>Jf(()=>import(`./bash-CLZ0U2zV.js`),[])],[`diff`,()=>Jf(()=>import(`./diff-woXpYk--.js`),[])],[`python`,()=>Jf(()=>import(`./python-gzcpVVnB.js`),[])],[`yaml`,()=>Jf(()=>import(`./yaml-rwi0_p6S.js`),[])],[`markdown`,()=>Jf(()=>import(`./markdown-BYOwaDjH.js`),[])]]),eb=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`]]),tb=`cotal`,nb=1e3,rb,ib=new Map;function ab(){return rb??=Qy().then(([{createHighlighterCore:e,createCssVariablesTheme:t},{createJavaScriptRegexEngine:n}])=>e({themes:[t({name:tb,variablePrefix:`--shiki-`,fontStyle:!1})],langs:[],engine:n({forgiving:!0})})).catch(e=>{throw rb=void 0,e}),rb}function ob(e,t){let n=ib.get(t);return n||(n=e.loadLanguage($y.get(t)).catch(e=>{throw ib.delete(t),e}),ib.set(t,n)),n}async function sb(e,t){let n=eb.get(t.toLowerCase());if(n!==void 0&&!(e.length>2e4))try{let t=await ab();return await ob(t,n),t.codeToTokens(e,{lang:n,theme:tb,tokenizeMaxLineLength:nb}).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 cb=bd(`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 lb({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,K.jsx)(`div`,{"data-slot":`code-block`,"data-variant":t,"data-size":n,className:G(cb({variant:t}),e),...r})}function ub({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`code-block-header`,className:G(`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 db({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`code-block-actions`,className:G(`-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 fb({className:e,children:t,style:n,wrap:r=!1,lineNumbers:i=!1,startLine:a=1,...o}){return(0,K.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:G(`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,K.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,K.jsx)(mb,{children:e},t)):t})})}var pb=bd(`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 mb({className:e,variant:t=`default`,children:n,...r}){let i=n==null||n===``||Array.isArray(n)&&n.length===0;return(0,K.jsx)(`span`,{"data-slot":`code-block-line`,"data-variant":t,className:G(pb({variant:t}),e),...r,children:(0,K.jsx)(`span`,{"data-slot":`code-block-line-content`,className:`min-w-0`,children:i?`
|
|
109
|
+
`:n})})}function hb({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 sb(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,K.jsxs)(lb,{ref:n,size:`sm`,className:`ox-code`,children:[(0,K.jsxs)(ub,{className:`ox-code-h`,children:[s&&(s===e?(0,K.jsx)(`span`,{children:e}):(0,K.jsxs)(gf,{children:[(0,K.jsx)(_f,{asChild:!0,children:(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,children:s}),(0,K.jsx)(`span`,{className:`ui-sr`,children:e})]})}),(0,K.jsx)(vf,{children:e})]})),` `,(0,K.jsx)(db,{className:`ox-code-acts`,children:(0,K.jsxs)(Sd,{type:`button`,variant:`ghost`,size:`xs`,onClick:()=>zm(t),children:[(0,K.jsx)(X,{icon:Ld,"data-icon":`inline-start`}),`Copy`]})})]}),(0,K.jsx)(fb,{className:`ox-code-c`,children:a?a.map((e,t)=>(0,K.jsx)(mb,{children:e.map((e,t)=>(0,K.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))},t)):t})]})}var gb=280,_b=e=>e.replace(/<[^>]*>/g,``).length;function vb({src:e,className:t,clamp:n=!0}){let r=(0,o.useMemo)(()=>Vv(e),[e]),[i,a]=(0,o.useState)(!1),s=n&&r.some(e=>e.kind===`html`&&_b(e.html)>gb);return(0,K.jsxs)(`div`,{className:t,children:[r.map((e,t)=>e.kind===`code`?(0,K.jsx)(hb,{lang:e.lang,text:e.text},t):(0,K.jsx)(`div`,{className:s&&!i&&_b(e.html)>gb?`ox-prose ui-clamp`:`ox-prose`,dangerouslySetInnerHTML:{__html:e.html}},t)),s&&(0,K.jsx)(Sd,{type:`button`,variant:`link`,size:`sm`,className:`px-0`,"aria-expanded":i,onClick:()=>a(!i),children:i?`Show less`:`Show more`})]})}function yb({ts:e}){let t=D(e);return t?(0,K.jsx)(`time`,{dateTime:t.toISOString(),children:O(t)}):null}function bb({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,K.jsxs)(`div`,{className:c,"data-post":e.id,children:[(0,K.jsxs)(`div`,{className:`ox-post-h`,children:[(0,K.jsx)(X,{icon:s?Nd:Bd,size:16}),(0,K.jsx)(`span`,{children:s?`Sent to ${i??r??``}`:`Posted in #${n}`}),(0,K.jsx)(yb,{ts:e.ts}),!a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`ui-sp`}),(0,K.jsxs)(`a`,{className:`ox-act`,href:l,children:[s?`Open conversation`:`Open in #${n}`,(0,K.jsx)(X,{icon:Ad,size:16})]})]})]}),(0,K.jsx)(vb,{className:`ui-tx`,src:T(e.parts),clamp:!a})]})}var xb=(e,t)=>t?`${e} …`:e,Sb=/^ {0,3}```/gm;function Cb(e,t){return t?(e.match(Sb)??[]).length%2==1?`${e}\n\`\`\`\n …`:`${e} …`:e}function wb({text:e,cut:t,compact:n=!1}){return(0,K.jsx)(vb,{className:`ox-said`,src:Cb(e,t),clamp:!n})}var Tb=280;function Eb({text:e,cut:t}){let[n,r]=(0,o.useState)(!1),i=Cb(e,t),a=i.length>Tb;return(0,K.jsxs)(`div`,{className:`ui-prompt`,children:[(0,K.jsx)(`span`,{children:`Prompt`}),(0,K.jsx)(`div`,{className:a&&!n?`ui-tx ui-clamp`:`ui-tx`,dangerouslySetInnerHTML:{__html:Bv(i)}}),a&&(0,K.jsx)(Sd,{type:`button`,variant:`link`,size:`sm`,className:`px-0`,"aria-expanded":n,onClick:()=>r(!n),children:n?`Show less`:`Show more`})]})}function Db({text:e,cut:t}){return(0,K.jsxs)(My,{children:[(0,K.jsx)(Ny,{className:`ox-trig`,children:(0,K.jsxs)(Oy,{className:`ox-line`,children:[(0,K.jsx)(ky,{children:(0,K.jsx)(X,{icon:Md,size:16})}),(0,K.jsx)(Ay,{children:`Reasoning`})]})}),(0,K.jsx)(Py,{className:`ox-cc`,children:(0,K.jsx)(`div`,{className:`ox-think`,children:xb(e,t)})})]})}function Ob({ts:e,condition:t}){return(0,K.jsxs)(iy,{variant:`destructive`,role:`note`,children:[(0,K.jsx)(X,{icon:Td}),(0,K.jsx)(ay,{children:D(e)?(0,K.jsxs)(K.Fragment,{children:[`Turn failed at `,(0,K.jsx)(yb,{ts:e})]}):`Turn failed`}),(0,K.jsxs)(oy,{children:[(0,K.jsx)(`div`,{children:`The event plane doesn't say why.`}),t!==void 0&&(0,K.jsxs)(`div`,{children:[`Presence reports `,(0,K.jsx)(`code`,{children:t.code}),D(t.since)&&(0,K.jsxs)(K.Fragment,{children:[` since `,(0,K.jsx)(yb,{ts:t.since})]}),`.`]})]})]})}function kb(e,t){if(!t)return nf;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?By(i[0][0]):nf}function Ab({calls:e,at:t,toolStatus:n,line:r=!1,className:i,payloadRead:a}){let{title:o,failed:s}=fe(e,n),c=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ky,{children:(0,K.jsx)(X,{icon:kb(e,n),size:16})}),(0,K.jsxs)(Ay,{children:[o,s>0&&(0,K.jsxs)(K.Fragment,{children:[`, `,(0,K.jsxs)(`span`,{className:`ox-fail`,children:[(0,K.jsx)(X,{icon:Fd,size:16}),`${s} failed`]})]})]})]});return r?(0,K.jsx)(Oy,{className:i?`ox-line ${i}`:`ox-line`,children:c}):(0,K.jsxs)(My,{className:i,children:[(0,K.jsx)(Ny,{className:`ox-trig`,children:(0,K.jsxs)(Oy,{className:`ox-line`,children:[c,` `,(0,K.jsx)(jy,{children:ve(e,n)})]})}),(0,K.jsx)(Py,{className:`ox-cc`,children:(0,K.jsx)(Dy,{className:`ox-calls`,children:e.map(e=>(0,K.jsx)(Wy,{payloadRead:a,call:e,state:V(e,{...t,toolStatus:n})},e.key))})})]})}var jb=(0,o.createContext)(()=>!1),Mb=new Set([`done`,`failed`,`called`]);function Nb({step:e,at:t,toolStatus:n,compact:r,payloadRead:i}){let a=(0,o.useContext)(jb),s=e.calls.map(e=>V(e,{...t,toolStatus:n})),c=e.calls.length>=2&&s.every(e=>Mb.has(e)),l=Ey(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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ab,{payloadRead:i,calls:e.calls,at:t,toolStatus:n,line:r,className:l},`group`),f&&(0,K.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,K.jsx)(Wy,{payloadRead:i,call:e,state:s[t+1]},e.key))})]});let m=s.lastIndexOf(`running`);return(0,K.jsx)(K.Fragment,{children:e.calls.map((e,t)=>(0,K.jsx)(Wy,{payloadRead:i,call:e,state:s[t],shimmer:t===m,className:t>0&&a(e)?`ui-in`:void 0},e.key))})}function Pb({ts:e}){return(0,K.jsxs)(Oy,{className:`ox-line`,children:[(0,K.jsx)(ky,{children:(0,K.jsx)(X,{icon:$d,size:16})}),(0,K.jsx)(Ay,{children:`Turn ended`}),` `,(0,K.jsx)(jy,{children:(0,K.jsx)(yb,{ts:e})})]})}function Fb({label:e,ts:t}){return(0,K.jsxs)(Oy,{className:`ox-line`,children:[(0,K.jsx)(ky,{children:(0,K.jsx)(X,{icon:Ud,size:16})}),(0,K.jsx)(Ay,{children:e}),` `,(0,K.jsx)(jy,{children:(0,K.jsx)(yb,{ts:t})})]})}function Ib({step:e,turn:t,trailing:n,ctx:r,condition:i}){switch(e.kind){case`prompt`:return r.compact?null:(0,K.jsx)(Eb,{text:e.text,cut:e.cut});case`reasoning`:return r.compact?null:(0,K.jsx)(Db,{text:e.text,cut:e.cut});case`said`:return(0,K.jsx)(wb,{text:e.text,cut:e.cut,compact:r.compact});case`tools`:return(0,K.jsx)(Nb,{payloadRead:r.payloadRead,step:e,at:{turn:t,trailing:n,status:r.row.status},toolStatus:r.toolStatus,compact:r.compact});case`post`:return(0,K.jsx)(bb,{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,K.jsx)(Ob,{ts:e.ts,condition:i});case`unknown`:return(0,K.jsx)(Fb,{label:e.label,ts:e.ts})}}function Lb({turn:e,row:t}){let n=e.outcome===`open`&&!e.superseded,r=n&&t.status===`working`,i=Iy(n&&(t.status===`working`||t.status===`waiting`)),{title:a,failed:o}=me(e,t.status,i),s=ge(e),c=r?(0,K.jsx)(Rm,{className:`ox-live`,role:void 0,"aria-label":void 0,"aria-hidden":!0}):(0,K.jsx)(X,{icon:e.outcome===`finished`?$d:e.outcome===`failed`?Td:n&&t.status===`waiting`?Vd:ef,size:16});return(0,K.jsxs)(Oy,{status:e.outcome===`failed`?`error`:void 0,className:`ox-line`,children:[(0,K.jsx)(ky,{children:c}),(0,K.jsxs)(Ay,{children:[r?(0,K.jsx)(`b`,{children:a}):a,o!==void 0&&(0,K.jsxs)(K.Fragment,{children:[`, `,(0,K.jsxs)(`span`,{className:`ox-fail`,children:[(0,K.jsx)(X,{icon:Fd,size:16}),o]})]})]}),` `,s&&(0,K.jsx)(jy,{children:s})]})}function Rb({turn:e,row:t,toolStatus:n,defaultOpen:r,highlight:i,condition:a,nameOf:s}){let c=(0,o.useContext)(jb),[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,K.jsxs)(My,{open:d,onOpenChange:u,children:[(0,K.jsx)(Ny,{className:`ox-trig`,children:(0,K.jsx)(Lb,{turn:e,row:t})}),(0,K.jsx)(Py,{className:`ox-cc`,children:(0,K.jsx)(Dy,{className:`ox-turn`,children:e.steps.map(t=>(0,K.jsx)(`div`,{className:c(t)?`ox-step ui-in`:`ox-step`,children:(0,K.jsx)(Ib,{step:t,turn:e,trailing:t===m,ctx:f,condition:t===p?a:void 0})},t.key))})})]})}function zb(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 Bb(e,t){let n=(0,o.useRef)(void 0),r=n.current?.id===t?n.current:void 0;return(0,o.useEffect)(()=>{let r=zb(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 Vb(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 Hb({work:e,row:t,highlight:n,compact:r=!1,condition:i,nameOf:a,payloadRead:o}){let s=Bb(e.items,t.id),c=Vb(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,K.jsx)(`div`,{className:s(e)?`ox-step ui-in`:`ox-step`,children:e.kind===`turnEnd`?(0,K.jsx)(Pb,{ts:e.ts}):(0,K.jsx)(Ib,{step:e,turn:t,trailing:n,ctx:l,condition:r})},e.key);return(0,K.jsx)(jb.Provider,{value:s,children:(0,K.jsxs)(Dy,{className:r?`ox-work ox-compact`:`ox-work`,children:[o&&(0,K.jsxs)(Xy,{children:[o.reason,` Work metadata is still shown.`]}),!e.toolStatus&&(0,K.jsx)(Xy,{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,K.jsx)(`div`,{className:s(o)?`ox-step ui-in`:`ox-step`,children:(0,K.jsx)(Rb,{turn:o,row:t,toolStatus:e.toolStatus,defaultOpen:o===c,highlight:n,condition:o===d?i:void 0,nameOf:a})},o.key)}),!r&&(0,K.jsx)(Zy,{row:t})]})})}var Ub=(0,o.createContext)(e=>Me(globalThis,e)),Wb=e=>Number.isSafeInteger(e)&&e>=0,Gb=e=>e&&typeof e==`object`?e.msg||e:void 0;function Kb(e){try{let t=Gb(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`&&Wb(e.seq))return e;return}catch{return}}function qb(e,t){let n=Gb(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 Jb(){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=Kb(e);if(!a)return{emit:[e],held:!1,notes:[]};if(!n)return t.push(e),{emit:[],held:!0,notes:[]};let o=qb(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=Kb(e);if(!t)continue;let n=r(qb(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:Kb(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=qb(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 Yb=500,Xb=250,Zb=2e3,Qb={text:``,outgoing:[]};function $b(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 ex=e=>typeof e==`number`&&Number.isFinite(e)?e:0;function tx(e,t,n){let r=new Set(e.map(e=>e.id)),i=e;for(let a of t){let t=F(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 nx(e){let t=ne(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 rx(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)=>ex(e.msg.ts)-ex(t.msg.ts)).slice(-500)}function ix(e,t,n={}){let r=n.createOrder??(()=>Jb()),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}}),x=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]??Qb)}})),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,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 re(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=tx(e.frames,a.frames,!1),n=nx(t===e.frames?t:t.slice().sort((e,t)=>ex(e.ts)-ex(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`})),re(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.messages:[],u=r(`open`);o=u;let p=l=[],m,g={key:n,promise:new Promise(e=>m=e)};d=g,e.set({open:{channel:n,messages:c}});let v=[],b=null;try{let r=(await t.history(n,200)).map(e=>({msg:e})),i=e.get().open;v=$b(r,c,i?.channel===n?i.messages:[],p)}catch(e){b=e instanceof Error?e.message:String(e),v=c,_([{type:`backfill-failed`,channel:n,reason:b}])}finally{let t=u.backfill(v);if(a===f){_(t.notes);let r=new Set(c),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)}}),O();let l=`#${n} history`;b||h.set(l,i());let u=h.get(l);y(l,b?{kind:`refused`,name:l,reason:b,...u===void 0?{}:{lastRead:u}}:void 0)}d===g&&(d=null),m()}}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:$b(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 b(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&&x(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($b(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=new Set,oe;function U(n){H.has(n)||e.get().channels.some(e=>e.channel===n&&e.deliveryClass!==void 0)||(H.add(n),oe===void 0&&(oe=setTimeout(()=>{oe=void 0,b([{name:`channels`,read:()=>t.channels(),apply:t=>e.set({channels:t})}]).then(e=>{for(let t of e)y(t.name,t)})},Xb)))}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>Yb&&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}}),U(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>Yb&&t.shift();return{open:{channel:c,messages:t}}})}else e.set(e=>({unread:{...e.unread,[c]:(e.unread[c]??0)+1}}))}}return{refresh:V,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`,W(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)||U(t)},onMembershipFailed(e){p.add(`membership`),x(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]??Qb).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]??Qb,outgoing:(e.drafts[a]??Qb).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:rx(e,t),load:n?`ok`:`loading`,more:!1,limit:200}}})),r.plane&&re(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||ne(n.frames)>=2e3||await re(t,r,Math.min(n.limit+200,Zb),!1)},async reloadSession(t){let n=e.get().sessions[t],r=F.get(t);n&&r?.plane&&(L(t,e=>({...e,load:`loading`})),await re(t,r,n.limit,!0))},onHello(t){P=t;for(let[t,n]of F)n.plane&&re(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=tx(n.frames,[t.msg],!0);if(r===n.frames)return{};let i=nx(r);return{sessions:{...e.sessions,[t.id]:{...n,frames:i.frames,more:n.more||i.dropped}}}})}}}export{Zm as $,G as $n,Xd as $t,ty as A,Za as An,m as Ar,If as At,vh as B,Vr as Bn,Ef as Bt,my as C,vo as Cn,T as Cr,Qf as Ct,iy as D,So as Dn,c as Dr,Nf as Dt,cy as E,fo as En,x as Er,Of as Et,Ph as F,fi as Fn,r as Fr,Vf as Ft,lh as G,jn as Gn,mf as Gt,mh as H,fr as Hn,vf as Ht,Nh as I,mi as In,Bf as It,ch as J,vn as Jn,sf as Jt,ah as K,En as Kn,pf as Kt,Ch as L,pi as Ln,Rf as Lt,ey as M,Ni as Mn,_ as Mr,jf as Mt,Yv as N,Di as Nn,f as Nr,Af as Nt,oy as O,so as On,l as Or,Mf as Ot,Mh as P,ui as Pn,a as Pr,Lf as Pt,th as Q,Jt as Qn,Zd as Qt,Sh as R,$r as Rn,Hf as Rt,hy as S,To as Sn,E as Sr,ep as St,ly as T,mo as Tn,y as Tr,Jf as Tt,ih as U,ir as Un,hf as Ut,gh as V,Sr as Vn,gf as Vt,uh as W,J as Wn,_f as Wt,nh as X,Qt as Xn,nf as Xt,rh as Y,hn as Yn,uf as Yt,Qm as Z,Zt as Zn,$d as Zt,xy as _,hl as _n,V as _r,dp as _t,yb as a,Fd as an,qe as ar,Bm as at,gy as b,fl as bn,me as br,np as bt,Gy as c,Ad as cn,Re as cr,Lm as ct,Jy as d,Sd as dn,ke as dr,Mm as dt,Gd as en,Xe as er,Ym as et,Wy as f,bd as fn,Me as fr,Pm as ft,Cy as g,Gl as gn,A as gr,up as gt,Ty as h,$l as hn,Oe as hr,Sp as ht,Hb as i,Ld as in,Ye as ir,Wm as it,$v as j,Ha as jn,p as jr,Ff as jt,ay as k,no as kn,h as kr,Pf as kt,Yy as l,Dd as ln,Ie as lr,Fm as lt,wy as m,Xl as mn,Ae as mr,Cm as mt,ix as n,Ud as nn,Je as nr,qm as nt,vb as o,Pd as on,Be as or,zm as ot,Iy as p,Fu as pn,je as pr,Sm as pt,sh as q,q as qn,rf as qt,Ub as r,Bd as rn,Ke as rr,Jm as rt,Xy as s,Nd as sn,Ve as sr,Nm as st,Zb as t,Wd as tn,He as tr,Vm as tt,qy as u,wd as un,Pe as ur,Im as ut,yy as v,_l as vn,ne as vr,rp as vt,dy as w,Co as wn,C as wr,$f as wt,py as x,ao as xn,O as xr,X as xt,vy as y,xl as yn,B as yr,ip as yt,ph as z,Gr as zn,Df as zt};
|