@cotal-ai/web 0.165.4 → 0.166.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/service-adapter.d.ts +1 -4
- package/dist/service-adapter.d.ts.map +1 -1
- package/dist/service-adapter.js +18 -14
- 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 +12 -17
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +18 -10
- 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
|
@@ -1,110 +0,0 @@
|
|
|
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}`;function le(e,t=64){let n=Array.from(e);return n.length>t?`${n.slice(0,t).join(``)}…`:e}function ue(e,t,n){return t===`called`?`Called ${le(n)}`:H[e].title[t]}function de(e,t){let n=e.filter(e=>e.failed===!0).length;if(!t){let t=e.map(e=>le(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 fe=e=>e.steps.flatMap(e=>e.kind===`tools`?e.calls:[]);function pe(e,t,n){let r=(e,t)=>e===void 0||t===void 0?void 0:ve(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=fe(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 me={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 he(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(me[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 ge(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:ve(e.end-e.ts,!0):t===`running`?e.ts===void 0?void 0:ve(n-e.ts,!1):r===void 0?void 0:`started ${r}`;let a=le(e.name);return i===void 0?a:`${a} · ${i}`}function _e(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)?ve(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 ve(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 ye=[`work`,`messages`,`profile`],be=e=>ye.includes(e),xe={view:`activity`},Se={view:`topology`},Ce=/^[A-Za-z0-9_]+\.[A-Za-z0-9_]+$/;function we(e){try{return decodeURIComponent(e)}catch{return}}function Te(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=we(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=we(r);if(!e||!Ce.test(e))return;if(i===void 0)return{view:`agent`,id:e,tab:`work`};if(a===void 0){if(be(i))return{view:`agent`,id:e,tab:i};let t=i===``?void 0:we(i);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}if(i!==`work`)return;let t=a===``?void 0:we(a);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}case`dm`:{if(!r)return;let e=we(r);if(!e)return;if(i===void 0)return{view:`dm`,peer:e};let t=i===``?void 0:we(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 Ee(e,t){return Te(e)??(t===`/graph`?Se:xe)}function De(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 Oe(e){return Ee(e.location.hash,e.location.pathname)}function ke(e,t){let n=()=>t(Oe(e));return e.addEventListener(`hashchange`,n),()=>e.removeEventListener(`hashchange`,n)}function Ae(e,t){if(t.view!==`agent`)return;let n=De(t);e.location.hash!==n&&e.history.replaceState(null,``,n)}function je(e,t){e.location.hash=De(t)}function Me(e){return typeof e==`string`&&e.trim()?e:void 0}function Ne(e){let t=new Map;for(let n of e){let e=Me(n.card?.name);n.card?.id&&e&&t.set(n.card.id,e)}return t}var Pe=`operator (you)`;function Fe(e,t,n){if(!e)return`?`;if(n&&(typeof e==`object`?e.id:e)===n&&!t.has(n))return Pe;if(typeof e==`object`)return Fe(e.id,t);let r=t.get(e);if(Me(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 Ie=``,Le=(e,t)=>[e,t].sort().join(Ie);function Re(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(Ie),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 ze(e){return Re(e).sort((e,t)=>t.last-e.last)}function Be(e,t){let n=Ne(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 Re(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:Fe(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 Ve=[`waiting`,`working`,`idle`,`offline`],He=(e,t)=>{let n=e?.[t];return typeof n==`string`?n:void 0},Ue=e=>{let t=He(e,`ai.cotal.events`);return t===`on`||t===`off`?{events:t}:{}},We=e=>{let t=Ve.indexOf(e);return t===-1?Ve.length:t};function Ge(e,t={}){return e.filter(e=>t.includeOffline||e.status!==`offline`).sort((e,t)=>We(e.status)-We(t.status)||e.card.name.localeCompare(t.card.name)).map(e=>({id:e.card.id,name:Me(e.card.name)??e.card.id,role:Me(e.card.role),status:e.status,activity:e.activity,harness:He(e.card.meta,`connector`),host:He(e.card.meta,`host`),attention:e.attention,model:He(e.card.meta,`model`),ts:e.ts,statusSince:e.statusSince,condition:e.condition,activitySince:e.activitySince,activeAt:e.activeAt,...Ue(e.card.meta)}))}var Ke=e=>e.filter(e=>e.status===`waiting`);function qe(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 Je=e=>e.status;function Ye(e){if(!e||e.fresh)return;if(e.state===`unpopulated`)return{kind:`refused`,name:`roster`,reason:`observer presence snapshot still loading`};let t={kind:`refused`,name:`roster`,reason:`observer presence watch silent since ${Number.isFinite(e.staleSince)?new Date(e.staleSince).toISOString():`unknown`}`};return Number.isFinite(e.staleSince)?{...t,since:e.staleSince}:t}function W(e,t){let n=()=>t(e.get());return(0,o.useSyncExternalStore)(e.subscribe,n,n)}var Xe=48,Ze=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Xe-t;return n},Qe=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},$e=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Xe;n+=i>>>1^-(i&1),t[r]=n}return t},et=384,tt=[],nt=Qe(Ze(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),rt=Qe(Ze(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),it=`@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`,at=(()=>{let e=nt.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=nt[n];i<nt[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(nt[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=nt[i];a<nt[i+1];a++)n[r++]=e,e+=t[e]}return n})(),ot=Ze(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),st=Qe(Ze(`123333359346463635126536711576`)),ct=Ze(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),lt=Ze(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ut=$e(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),dt=(()=>{let e=new Int32Array(319).fill(-1),t=$e(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=$e(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),ft=`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}),pt=$e(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),mt=$e(`ɠ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`),ht=$e(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}22
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_1¸222½2¾2222ÇÊ000°2±`),gt=new Int32Array(987),_t=new Int32Array(987),vt=new Int32Array(987),yt=``,bt=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<pt.length;r++)for(let i of ft[ht[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),bt[a*2]=yt.length,bt[a*2+1]=i.length,yt+=i),gt[n]=pt[r],_t[n]=mt[r],vt[n]=a,n++}}var xt=$e(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),St=Qe(Ze(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Ct=$e(`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`),wt=Ze(`ij`),Tt=Ze(``),Et=Ze(`1`),Dt={GROUP_COUNT:et,customValidatorNames:tt,edgeStart:nt,labelStart:rt,labelText:it,edgeTarget:at,nodeGroup:ot,nodeVlist:dt,vlistPat:st,vlistOps:ct,vlistRef:lt,vlistGroup:ut,litAnchor:gt,litGroup:_t,litPool:vt,poolOffsets:bt,poolText:yt,adjGid:xt,adjStart:St,adjTgt:Ct,patGid:wt,patTgt:Tt,postfixLookupGroups:Et,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Ot=`line`in Error(),kt=-1,At=-1,jt=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Mt=(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},Nt=(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=(jt(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=(jt(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=jt(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?kt: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 kt},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[_]=kt,Be(y,e,p,h,v,kt,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=At,ne=0;for(let t=M;t<D;t++)if(t===A&&(te=F<I?At:P,ne=L),P!==At){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=At;else{let e=i[P],t=i[P+1],c=At;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?At:P,ne=L);let R=F<I?At:P,z,ae=!1;if(A>=0){if(ae=!0,z=ot(e,E,A,te,ne),z!==kt&&z<r&&j[z]){let t=ot(e,E,D,R,L);t!==kt&&t!==z&&(z=t,ae=!1)}else z===kt&&(z=ot(e,E,D,R,L),ae=!1)}else z=ot(e,E,D,R,L);let B=0,V=0;z===kt?Ke[_]=kt:(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===kt){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=Mt(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=Mt(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=Mt(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:Ot?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(It.apply(null,arguments))},mergeString:St,seenBefore:te===0?()=>!1:xt,mergeUncached:st}},Pt=(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:Pt(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},Ft=(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:Pt(i,t);a&&(n&&(n+=` `),n+=a)}return n},It=function(){return Ft(arguments,!1)},Lt=256,Rt=16,zt=1024,Bt=4096,Vt=(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(Bt).fill(``),l=Array(Bt).fill(``),u=Array(Bt).fill(``));let i=Mt(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]=Pt(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>Rt&&(_.miss=Rt,_.skip=zt,_.e.length=0,_.at=0);let u=_.e;u.length<Lt?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(Pt(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)}},Ht=Nt(Dt),G=Vt(Ht.mergeString,Ht);Ht.merge;var Ut=Object.defineProperty,Wt=(e,t)=>Ut(e,`name`,{value:t,configurable:!0});function Gt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Wt(Gt,`setRef`);function Kt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Gt(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():Gt(e[t],null)}}}}Wt(Kt,`composeRefs`);function K(...e){return o.useCallback(Kt(...e),e)}Wt(K,`useComposedRefs`);var qt=Object.defineProperty,Jt=(e,t)=>qt(e,`name`,{value:t,configurable:!0});function Yt(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];r=sn(r),o.Children.forEach(r,e=>{if(nn(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;an(n)&&typeof dn==`function`;)n=dn(n._payload);a=$t(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?tn(a):void 0,u=K(n,l);if(!a){if(r||r===0)throw Error(s?un(e):ln(e));return r}let d=en(i,a.props??{});return a.type!==o.Fragment&&(d.ref=n?u:l),o.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}Jt(Yt,`createSlot`);var Xt=Yt(`Slot`),Zt=Symbol.for(`radix.slottable`);function Qt(e){let t=Jt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Zt,t}Jt(Qt,`createSlottable`);var $t=Jt((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 en(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]=cn(a,i))}return{...e,...n}}Jt(en,`mergeProps`);function tn(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)}Jt(tn,`getElementRef`);function nn(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Zt}Jt(nn,`isSlottable`);var rn=Symbol.for(`react.lazy`);function an(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===rn&&`_payload`in e&&on(e._payload)}Jt(an,`isLazyComponent`);function on(e){return typeof e==`object`&&!!e&&`then`in e}Jt(on,`isPromiseLike`);function sn(e){let t=e;for(;an(t)&&typeof dn==`function`;)t=dn(t._payload);return t}Jt(sn,`useUnwrappedLazy`);function cn(...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}Jt(cn,`concatAriaDescribedby`);var ln=Jt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),un=Jt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),dn=o.use,fn=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})),pn=t(((e,t)=>{t.exports=fn()})),q=pn(),mn=Object.defineProperty,hn=(e,t)=>mn(e,`name`,{value:t,configurable:!0}),J=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Yt(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gn(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}hn(gn,`dispatchDiscreteCustomEvent`);var _n=Object.defineProperty,vn=(e,t)=>_n(e,`name`,{value:t,configurable:!0}),yn=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`}),bn=o.forwardRef(vn(function(e,t){return(0,q.jsx)(J.span,{...e,ref:t,style:{...yn,...e.style}})},`VisuallyHidden`)),xn=Object.defineProperty,Sn=(e,t)=>xn(e,`name`,{value:t,configurable:!0});function Cn(e,t){let n=o.createContext(t);n.displayName=e+`Context`;let r=Sn(e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,q.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,s=o.useContext(n);if(s)return s;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Sn(i,`useContext`),[r,i]}Sn(Cn,`createContext`);function wn(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=Sn(t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,q.jsx)(c.Provider,{value:l,children:r})},`Provider`);s.displayName=t+`Provider`;function c(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return Sn(c,`useContext`),[s,c]}Sn(r,`createContext`);let i=Sn(()=>{let t=n.map(e=>o.createContext(e));return Sn(function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Tn(i,...t)]}Sn(wn,`createContextScope`);function Tn(...e){let t=e[0];if(e.length===1)return t;let n=Sn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Sn(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}Sn(Tn,`composeContextScopes`);var En=globalThis?.document?o.useLayoutEffect:()=>{},Dn=Object.defineProperty,On=(e,t)=>Dn(e,`name`,{value:t,configurable:!0});function kn(e){let t=e+`CollectionProvider`,[n,r]=wn(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=On(e=>{let{scope:t,children:n}=e,r=o.useRef(null),a=o.useRef(new Map).current;return(0,q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);s.displayName=t;let c=e+`CollectionSlot`,l=Yt(c),u=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=K(t,a(c,n).collectionRef);return(0,q.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Yt(d),m=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),c=K(t,s),l=a(d,n);return o.useEffect(()=>(l.itemMap.set(s,{ref:s,...i}),()=>void l.itemMap.delete(s))),(0,q.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return o.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return On(h,`useCollection`),[{Provider:s,Slot:u,ItemSlot:m},h,r]}On(kn,`createCollection`);var An=new WeakMap,jn=class e extends Map{static{On(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],An.set(this,!0)}set(e,t){return An.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=Pn(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=Mn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Mn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Mn(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 Mn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Nn(e,t);return n===-1?void 0:e[n]}On(Mn,`at`);function Nn(e,t){let n=e.length,r=Pn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}On(Nn,`toSafeIndex`);function Pn(e){return e!==e||e===0?0:Math.trunc(e)}On(Pn,`toSafeInteger`);function Fn(e){let t=e+`CollectionProvider`,[n,r]=wn(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[s,c]=n(t);s.displayName=e+`CollectionStatefulContextProvider`;let l=On(({state:e,...t})=>e?(0,q.jsx)(d,{...t,state:e}):(0,q.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=On(e=>{let t=v();return(0,q.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=e+`CollectionInit`;let d=On(e=>{let{scope:t,children:n,state:r}=e,a=o.useRef(null),[c,l]=o.useState(null),u=K(a,l),[d,f]=r,p=o.useRef(new jn),m=o.useCallback(()=>{let e=p.current;return Rn(e)||e.sort(zn),e},[]);return o.useEffect(()=>{if(!c)return;let e=Bn(()=>{f(e=>{let t=e.toSorted(zn);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c,f]),(0,q.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:m,setCollection:f,registryRef:p,children:(0,q.jsx)(s,{scope:t,collectionElement:c,collection:d,children:n})})},`CollectionProviderImpl`);d.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,p=Yt(f),m=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=K(t,a(f,n).collectionElementRef);return(0,q.jsx)(p,{ref:i,children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=Yt(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);In(u.current,i)||(u.current=i);let d=u.current,f=K(t,o.useCallback(e=>{let t=l.current;e?t.set(e,{...u.current,element:e}):s.current&&t.delete(s.current)},[l]),s);En(()=>{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 jn(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...d,element:e}),r.sort(zn)}))}),o.useEffect(()=>()=>{let e=p.current;p.current=null,e&&c(t=>{if(!t.has(e.element))return t;let n=new jn(t);return n.delete(e.element),n})},[c]),(0,q.jsx)(g,{"data-radix-collection-item":``,ref:f,children:r})});_.displayName=h;function v(){return o.useState(new jn)}On(v,`useInitCollection`);function y(t){let{collection:n}=c(e+`CollectionConsumer`,t);return n}On(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return On(b,`useGetCollection`),[{Provider:l,Slot:m,ItemSlot:_},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:v}]}On(Fn,`createCollection`);function In(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}On(In,`shallowEqual`);function Ln(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}On(Ln,`isElementPreceding`);function Rn(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}On(Rn,`isInDocumentOrder`);function zn(e,t){return!e[1].element||!t[1].element?0:Ln(e[1].element,t[1].element)?-1:1}On(zn,`sortByDocumentPosition`);function Bn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}On(Bn,`getChildListObserver`);var Vn=Object.defineProperty,Hn=(e,t)=>Vn(e,`name`,{value:t,configurable:!0}),Un=!!(typeof window<`u`&&window.document&&window.document.createElement);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return Hn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Hn(Y,`composeEventHandlers`);function Wn(e){if(!Un)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Hn(Wn,`getOwnerWindow`);function Gn(e){if(!Un)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Hn(Gn,`getOwnerDocument`);function Kn(e,t=!1){let{activeElement:n}=Gn(e);if(!n?.nodeName)return null;if(qn(n)&&n.contentDocument)return Kn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Gn(n).getElementById(e);if(t)return t}}return n}Hn(Kn,`getActiveElement`);function qn(e){return e.tagName===`IFRAME`}Hn(qn,`isFrame`);var Jn=Object.defineProperty,Yn=(e,t)=>Jn(e,`name`,{value:t,configurable:!0}),Xn=o.useEffectEvent,Zn=o.useInsertionEffect;function Qn(e){if(typeof Xn==`function`)return Xn(e);let t=o.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Zn==`function`?Zn(()=>{t.current=e}):En(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Yn(Qn,`useEffectEvent`);var $n=Object.defineProperty,er=(e,t)=>$n(e,`name`,{value:t,configurable:!0}),tr=o.useInsertionEffect||En;function nr({prop:e,defaultProp:t,onChange:n=er(()=>{},`onChange`),caller:r}){let[i,a,s]=rr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,o.useCallback(t=>{if(c){let n=ir(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}er(nr,`useControllableState`);function rr({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return tr(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}er(rr,`useUncontrolledState`);function ir(e){return typeof e==`function`}er(ir,`isFunction`);var ar=Symbol(`RADIX:SYNC_STATE`);function or(e,t,n,r){let{prop:i,defaultProp:a,onChange:s,caller:c}=t,l=i!==void 0,u=Qn(s),d=[{...n,state:a}];r&&d.push(r);let[f,p]=o.useReducer((t,n)=>{if(n.type===ar)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:ar,state:i})},[i,f.state,l]),[g,p]}er(or,`useControllableStateReducer`);var sr=Object.defineProperty,cr=(e,t)=>sr(e,`name`,{value:t,configurable:!0});function lr(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}cr(lr,`useStateMachine`);var ur=cr(e=>{let{present:t,children:n}=e,r=dr(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=pr(r.ref,hr(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null},`Presence`);function dr(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]=lr(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??mr(r.current),s.current=void 0):a.current=`none`},[c]),En(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=mr(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]),En(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=cr(a=>{let o=mr(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=cr(e=>{e.target===t&&(a.current=mr(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=mr(t)}else r.current=null;n(e)},[])}}cr(dr,`usePresence`);function fr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}cr(fr,`setRef`);function pr(...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=fr(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():fr(n[e],null)}}},[])}cr(pr,`useStableComposedRefs`);function mr(e){return e?.animationName||`none`}cr(mr,`getAnimationName`);function hr(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)}cr(hr,`getElementRef`);var gr=Object.defineProperty,_r=(e,t)=>gr(e,`name`,{value:t,configurable:!0}),vr=o.useId||(()=>void 0),yr=0;function br(e){let[t,n]=o.useState(vr());return En(()=>{e||n(e=>e??String(yr++))},[e]),e||(t?`radix-${t}`:``)}_r(br,`useId`);var xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0}),Cr=`Collapsible`,[wr,Tr]=wn(Cr),[Er,Dr]=wr(Cr),Or=o.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...c}=e,[l,u]=nr({prop:r,defaultProp:i??!1,onChange:s,caller:Cr});return(0,q.jsx)(Er,{scope:n,disabled:a,contentId:br(),open:l,onOpenToggle:o.useCallback(()=>u(e=>!e),[u]),children:(0,q.jsx)(J.div,{"data-state":Pr(l),"data-disabled":a?``:void 0,...c,ref:t})})},`Collapsible`)),kr=`CollapsibleTrigger`,Ar=o.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=Dr(kr,n);return(0,q.jsx)(J.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Pr(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Y(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),jr=`CollapsibleContent`,Mr=o.forwardRef(Sr(function(e,t){let{forceMount:n,...r}=e,i=Dr(jr,e.__scopeCollapsible);return(0,q.jsx)(ur,{present:n||i.open,children:({present:e})=>(0,q.jsx)(Nr,{...r,ref:t,present:e})})},`CollapsibleContent`)),Nr=o.forwardRef(Sr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,s=Dr(jr,n),[c,l]=o.useState(r),u=o.useRef(null),d=K(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)},[]),En(()=>{let e=u.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),l(r)}},[s.open,r]),(0,q.jsx)(J.div,{"data-state":Pr(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 Pr(e){return e?`open`:`closed`}Sr(Pr,`getState`);var Fr=Object.defineProperty,Ir=(e,t)=>Fr(e,`name`,{value:t,configurable:!0}),Lr={LTR:`ltr`,RTL:`rtl`},Rr=o.createContext(void 0);function zr(e){let t=o.useContext(Rr);return e||t||Lr.LTR}Ir(zr,`useDirection`);var Br=Object.defineProperty,Vr=(e,t)=>Br(e,`name`,{value:t,configurable:!0}),Hr=o.useInsertionEffect;function Ur(e){let t=o.useRef(e);return typeof Hr==`function`?Hr(()=>{t.current=e}):En(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Vr(Ur,`useCallbackRef`);var Wr=Object.defineProperty,Gr=(e,t)=>Wr(e,`name`,{value:t,configurable:!0}),Kr=`dismissableLayer.update`,qr=`dismissableLayer.pointerDownOutside`,Jr=`dismissableLayer.focusOutside`,Yr,Xr=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Zr=o.forwardRef(Gr(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(Xr),[f,p]=o.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),g=K(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=ei(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=ti(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=Ur(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&&(Yr=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ni(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Yr))}},[f,m,n,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ni())},[f,d]),o.useEffect(()=>{let e=Gr(()=>h({}),`handleUpdate`);return document.addEventListener(Kr,e),()=>document.removeEventListener(Kr,e)},[]),(0,q.jsx)(J.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Qr(){let e=o.useContext(Xr),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Gr(Qr,`useDismissableLayerSurface`);var $r=Gr(()=>!0,`IS_TRUE`);function ei(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=$r}=t,c=Ur(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()}Gr(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}Gr(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)}Gr(o,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}Gr(p,`handleInteractionBubble`);let m=Gr(a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ri(qr,c,p,{discrete:!0})};if(Gr(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:Gr(()=>l.current=!0,`onPointerDownCapture`)}}Gr(ei,`usePointerDownOutside`);function ti(e,t=globalThis?.document){let n=Ur(e),r=o.useRef(!1);return o.useEffect(()=>{let e=Gr(e=>{e.target&&!r.current&&ri(Jr,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Gr(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Gr(()=>r.current=!1,`onBlurCapture`)}}Gr(ti,`useFocusOutside`);function ni(){let e=new CustomEvent(Kr);document.dispatchEvent(e)}Gr(ni,`dispatchUpdate`);function ri(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?gn(i,a):i.dispatchEvent(a)}Gr(ri,`handleAndDispatchCustomEvent`);var ii=Object.defineProperty,ai=(e,t)=>ii(e,`name`,{value:t,configurable:!0}),oi=`focusScope.autoFocusOnMount`,si=`focusScope.autoFocusOnUnmount`,ci={bubbles:!1,cancelable:!0},li=o.forwardRef(ai(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=e,[l,u]=o.useState(null),d=Ur(a),f=Ur(s),p=o.useRef(null),m=K(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:bi(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||bi(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&bi(l)};ai(e,`handleFocusIn`),ai(t,`handleFocusOut`),ai(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){xi.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(oi,ci);l.addEventListener(oi,d),l.dispatchEvent(t),t.defaultPrevented||(mi(wi(gi(l)),{select:!0}),document.activeElement===e&&bi(l))}return()=>{l.removeEventListener(oi,d);let t=l.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(si,ci);l.addEventListener(si,f),l.dispatchEvent(r),r.defaultPrevented||bi(e??t.body,{select:!0}),l.removeEventListener(si,f),xi.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]=hi(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&bi(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&bi(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,q.jsx)(J.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),ui=o.createContext(null);function di({registry:e,children:t}){return e?(0,q.jsx)(ui.Provider,{value:e,children:t}):t}ai(di,`FocusScopeBranchProvider`);function fi(){let[e,t]=o.useState([]);return{nodes:e,registry:o.useMemo(()=>({add:ai(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:ai(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}ai(fi,`useFocusScopeBranchRegistry`);function pi(e){let t=o.useContext(ui);o.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}ai(pi,`useFocusScopeBranch`);function mi(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(bi(r,{select:t}),document.activeElement!==n)return}ai(mi,`focusFirst`);function hi(e){let t=gi(e);return[_i(t,e),_i(t.reverse(),e)]}ai(hi,`getTabbableEdges`);function gi(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ai(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}ai(gi,`getTabbableCandidates`);function _i(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):vi(r,{upTo:t})))return r}ai(_i,`findVisible`);function vi(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}ai(vi,`isHidden`);function yi(e){return e.tagName===`INPUT`&&typeof e.select==`function`}ai(yi,`isSelectableInput`);function bi(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&yi(e)&&t&&e.select()}}ai(bi,`focus`);var xi=Si();function Si(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ci(e,t),e.unshift(t)},remove(t){e=Ci(e,t),e[0]?.resume()}}}ai(Si,`createFocusScopesStack`);function Ci(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ai(Ci,`arrayRemove`);function wi(e){return e.filter(e=>e.tagName!==`A`)}ai(wi,`removeLinks`);var Ti=Object.defineProperty,Ei=o.forwardRef(((e,t)=>Ti(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=o.useState(!1);En(()=>a(!0),[]);let c=n||i&&globalThis?.document?.body;return c?s.createPortal((0,q.jsx)(J.div,{...r,ref:t}),c):null},`Portal`)),Di=Object.defineProperty,Oi=(e,t)=>Di(e,`name`,{value:t,configurable:!0}),ki=0,Ai=null;function ji(e){return Mi(),e.children}Oi(ji,`FocusGuards`);function Mi(){o.useEffect(()=>{Ai||={start:Ni(),end:Ni()};let{start:e,end:t}=Ai;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ki++,()=>{ki===1&&(Ai?.start.remove(),Ai?.end.remove(),Ai=null),ki=Math.max(0,ki-1)}},[])}Oi(Mi,`useFocusGuards`);function Ni(){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}Oi(Ni,`createFocusGuard`);var Pi=function(){return Pi=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},Pi.apply(this,arguments)};function Fi(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 Ii(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 Li=`right-scroll-bar-position`,Ri=`width-before-scroll-bar`,zi=`with-scroll-bars-hidden`,Bi=`--removed-body-scroll-bar-size`;function Vi(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Hi(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 Ui=typeof window<`u`?o.useLayoutEffect:o.useEffect,Wi=new WeakMap;function Gi(e,t){var n=Hi(t||null,function(t){return e.forEach(function(e){return Vi(e,t)})});return Ui(function(){var t=Wi.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Vi(e,null)}),i.forEach(function(e){r.has(e)||Vi(e,a)})}Wi.set(n,e)},[e]),n}function Ki(e){return e}function qi(e,t){t===void 0&&(t=Ki);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 Ji(e){e===void 0&&(e={});var t=qi(null);return t.options=Pi({async:!0,ssr:!1},e),t}var Yi=function(e){var t=e.sideCar,n=Fi(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,Pi({},n))};Yi.isSideCarExport=!0;function Xi(e,t){return e.useMedium(t),Yi}var Zi=Ji(),Qi=function(){},$i=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:Qi,onWheelCapture:Qi,onTouchMoveCapture:Qi}),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=Fi(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Gi([n,t]),w=Pi(Pi({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Zi,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),Pi(Pi({},w),{ref:C})):o.createElement(y,Pi({},w,{className:l,ref:C}),c))});$i.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$i.classNames={fullWidth:Ri,zeroRight:Li};var ea=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ta(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ea();return t&&e.setAttribute(`nonce`,t),e}function na(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ra(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ia=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ta())&&(na(t,n),ra(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aa=function(){var e=ia();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oa=function(){var e=aa();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},sa={left:0,top:0,right:0,gap:0},ca=function(e){return parseInt(e||``,10)||0},la=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[ca(n),ca(r),ca(i)]},ua=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return sa;var t=la(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])}},da=oa(),fa=`data-scroll-locked`,pa=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
|
-
.${zi} {
|
|
4
|
-
overflow: hidden ${r};
|
|
5
|
-
padding-right: ${s}px ${r};
|
|
6
|
-
}
|
|
7
|
-
body[${fa}] {
|
|
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
|
-
.${Li} {
|
|
21
|
-
right: ${s}px ${r};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.${Ri} {
|
|
25
|
-
margin-right: ${s}px ${r};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.${Li} .${Li} {
|
|
29
|
-
right: 0 ${r};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.${Ri} .${Ri} {
|
|
33
|
-
margin-right: 0 ${r};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
body[${fa}] {
|
|
37
|
-
${Bi}: ${s}px;
|
|
38
|
-
}
|
|
39
|
-
`},ma=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ha=function(){o.useEffect(function(){return document.body.setAttribute(fa,(ma()+1).toString()),function(){var e=ma()-1;e<=0?document.body.removeAttribute(fa):document.body.setAttribute(fa,e.toString())}},[])},ga=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ha();var a=o.useMemo(function(){return ua(i)},[i]);return o.createElement(da,{styles:pa(a,!t,i,n?``:`!important`)})},_a=!1;if(typeof window<`u`)try{var va=Object.defineProperty({},"passive",{get:function(){return _a=!0,!0}});window.addEventListener(`test`,va,va),window.removeEventListener(`test`,va,va)}catch{_a=!1}var ya=_a?{passive:!1}:!1,ba=function(e){return e.tagName===`TEXTAREA`},xa=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ba(e)&&n[t]===`visible`)},Sa=function(e){return xa(e,`overflowY`)},Ca=function(e){return xa(e,`overflowX`)},wa=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Da(e,r)){var i=Oa(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ta=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ea=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Da=function(e,t){return e===`v`?Sa(t):Ca(t)},Oa=function(e,t){return e===`v`?Ta(t):Ea(t)},ka=function(e,t){return e===`h`&&t===`rtl`?-1:1},Aa=function(e,t,n,r,i){var a=ka(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=Oa(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Da(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},ja=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ma=function(e){return[e.deltaX,e.deltaY]},Na=function(e){return e&&`current`in e?e.current:e},Pa=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Fa=function(e){return`
|
|
40
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
41
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
42
|
-
`},Ia=0,La=[];function Ra(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(Ia++)[0],a=o.useState(oa)[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=Ii([e.lockRef.current],(e.shards||[]).map(Na),!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=ja(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=wa(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=wa(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 Aa(h,t,e,h===`h`?o:c,!0)},[]),l=o.useCallback(function(e){var n=e;if(La.length&&La[La.length-1]===a){var r=`deltaY`in n?Ma(n):ja(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Pa(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var o=(s.current.shards||[]).map(Na).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:za(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=ja(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,Ma(t),t.target,c(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,ja(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return La.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,ya),document.addEventListener(`touchmove`,l,ya),document.addEventListener(`touchstart`,d,ya),function(){La=La.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,ya),document.removeEventListener(`touchmove`,l,ya),document.removeEventListener(`touchstart`,d,ya)}},[]);var m=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(a,{styles:Fa(i)}):null,m?o.createElement(ga,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function za(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ba=Xi(Zi,Ra),Va=o.forwardRef(function(e,t){return o.createElement($i,Pi({},e,{ref:t,sideCar:Ba}))});Va.classNames=$i.classNames;var Ha=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ua=new WeakMap,Wa=new WeakMap,Ga={},Ka=0,qa=function(e){return e&&(e.host||qa(e.parentNode))},Ja=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=qa(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})},Ya=function(e,t,n,r){var i=Ja(t,Array.isArray(e)?e:[e]);Ga[n]||(Ga[n]=new WeakMap);var a=Ga[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=(Ua.get(e)||0)+1,l=(a.get(e)||0)+1;Ua.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Wa.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(),Ka++,function(){o.forEach(function(e){var t=Ua.get(e)-1,i=a.get(e)-1;Ua.set(e,t),a.set(e,i),t||(Wa.has(e)||e.removeAttribute(r),Wa.delete(e)),i||e.removeAttribute(n)}),Ka--,Ka||(Ua=new WeakMap,Ua=new WeakMap,Wa=new WeakMap,Ga={})}},Xa=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ha(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ya(r,i,n,`aria-hidden`)):function(){return null}},Za=Object.defineProperty,Qa=(e,t)=>Za(e,`name`,{value:t,configurable:!0}),$a=`Dialog`,[eo,to]=wn($a),[no,ro]=eo($a),io=Qa(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}=fi(),[f,p]=nr({prop:r,defaultProp:i??!1,onChange:a,caller:$a}),[m,h]=o.useState(0),[g,_]=o.useState(0);return(0,q.jsx)(no,{scope:t,triggerRef:c,contentRef:l,contentId:br(),titleId:br(),descriptionId:br(),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`),ao=`DialogTrigger`,oo=o.forwardRef(Qa(function(e,t){let{__scopeDialog:n,...r}=e,i=ro(ao,n),a=K(t,i.triggerRef);return(0,q.jsx)(J.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Eo(i.open),...r,ref:a,onClick:Y(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),so=`DialogPortal`,[co,lo]=eo(so,{forceMount:void 0}),uo=Qa(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ro(so,t);return(0,q.jsx)(co,{scope:t,forceMount:n,children:o.Children.map(r,e=>(0,q.jsx)(ur,{present:n||a.open,children:(0,q.jsx)(Ei,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),fo=`DialogOverlay`,po=o.forwardRef(Qa(function(e,t){let n=lo(fo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ro(fo,e.__scopeDialog);return a.modal?(0,q.jsx)(ur,{present:r||a.open,children:(0,q.jsx)(ho,{...i,ref:t})}):null},`DialogOverlay`)),mo=Yt(`DialogOverlay.RemoveScroll`),ho=o.forwardRef(Qa(function(e,t){let{__scopeDialog:n,...r}=e,i=ro(fo,n),a=K(t,Qr());return(0,q.jsx)(Va,{as:mo,allowPinchZoom:!0,shards:o.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,q.jsx)(J.div,{"data-state":Eo(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),go=`DialogContent`,_o=o.forwardRef(Qa(function(e,t){let n=lo(go,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ro(go,e.__scopeDialog);return(0,q.jsx)(ur,{present:r||a.open,children:a.modal?(0,q.jsx)(vo,{...i,ref:t}):(0,q.jsx)(yo,{...i,ref:t})})},`DialogContent`)),vo=o.forwardRef(Qa(function(e,t){let n=ro(go,e.__scopeDialog),r=o.useRef(null),i=K(t,n.contentRef,r);return o.useEffect(()=>{let e=r.current;if(e)return Xa(e)},[]),(0,q.jsx)(bo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),yo=o.forwardRef(Qa(function(e,t){let n=ro(go,e.__scopeDialog),r=o.useRef(!1),i=o.useRef(!1);return(0,q.jsx)(bo,{...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`)),bo=o.forwardRef(Qa(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=ro(go,n);return Mi(),(0,q.jsx)(di,{registry:l.branchRegistry,children:(0,q.jsx)(li,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,q.jsx)(Zr,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?To(o,l.descriptionId):o,"data-state":Eo(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),xo=o.forwardRef(Qa(function(e,t){let{__scopeDialog:n,...r}=e,i=ro(`DialogTitle`,n),{setTitleCount:a}=i;return En(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,q.jsx)(J.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),So=o.forwardRef(Qa(function(e,t){let{__scopeDialog:n,...r}=e,i=ro(`DialogDescription`,n),{setDescriptionCount:a}=i;return En(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,q.jsx)(J.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Co=`DialogClose`,wo=o.forwardRef(Qa(function(e,t){let{__scopeDialog:n,...r}=e,i=ro(Co,n);return(0,q.jsx)(J.button,{type:`button`,...r,ref:t,onClick:Y(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function To(...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}Qa(To,`concatAriaDescribedby`);function Eo(e){return e?`open`:`closed`}Qa(Eo,`getState`);var Do=Object.defineProperty,Oo=(e,t)=>Do(e,`name`,{value:t,configurable:!0}),ko=`Avatar`,[Ao,jo]=wn(ko),Mo={Idle:`idle`,Loading:`loading`,Loaded:`loaded`,Error:`error`},No=[0,()=>void 0],[Po,Fo]=Ao(ko),Io=o.forwardRef(Oo(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=o.useState(Mo.Idle),[s,c]=Vo();return(0,q.jsx)(Po,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:s,setImageCount:c,children:(0,q.jsx)(J.span,{...r,ref:t})})},`Avatar`)),Lo=`AvatarFallback`,Ro=o.forwardRef(Oo(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=Fo(Lo,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!==Mo.Loaded?(0,q.jsx)(J.span,{...i,ref:t}):null},`AvatarFallback`));function zo(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return En(()=>{if(!e){n(Mo.Error);return}let t=new window.Image,a=Oo(e=>{let t=e.currentTarget;n(Bo(t))},`handleLoad`),o=Oo(()=>n(Mo.Error),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(Bo(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(Mo.Idle)}},[e,i,r,n]),t}Oo(zo,`useImageLoadingStatus`);function Bo(e){return e.complete?e.naturalWidth>0?Mo.Loaded:Mo.Error:Mo.Loading}Oo(Bo,`getImageLoadingStatus`);function Vo(){return No}Oo(Vo,`useImageCount`);function Ho(e){}Oo(Ho,`useUpdateImageCount`);var Uo=Object.defineProperty,Wo=(e,t)=>Uo(e,`name`,{value:t,configurable:!0});function Go(e){let[t,n]=o.useState(void 0);return En(()=>{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}Wo(Go,`useSize`);var Ko=[`top`,`right`,`bottom`,`left`],qo=Math.min,Jo=Math.max,Yo=Math.round,Xo=Math.floor,Zo=e=>({x:e,y:e}),Qo={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function $o(e,t,n){return Jo(e,qo(t,n))}function es(e,t){return typeof e==`function`?e(t):e}function ts(e){return e.split(`-`)[0]}function ns(e){return e.split(`-`)[1]}function rs(e){return e===`x`?`y`:`x`}function is(e){return e===`y`?`height`:`width`}function as(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function os(e){return rs(as(e))}function ss(e,t,n){n===void 0&&(n=!1);let r=ns(e),i=os(e),a=is(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=gs(o)),[o,gs(o)]}function cs(e){let t=gs(e);return[ls(e),t,ls(t)]}function ls(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var us=[`left`,`right`],ds=[`right`,`left`],fs=[`top`,`bottom`],ps=[`bottom`,`top`];function ms(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ds:us:t?us:ds;case`left`:case`right`:return t?fs:ps;default:return[]}}function hs(e,t,n,r){let i=ns(e),a=ms(ts(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ls)))),a}function gs(e){let t=ts(e);return Qo[t]+e.slice(t.length)}function _s(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function vs(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_s(e)}function ys(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 bs(e,t,n){let{reference:r,floating:i}=e,a=as(t),o=os(t),s=is(o),c=ts(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=ns(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function xs(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}=es(t,e),p=vs(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ys(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=ys(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 Ss=50,Cs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:xs},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=bs(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<Ss&&(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}=bs(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ws=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}=es(e,t)||{};if(l==null)return{};let d=vs(u),f={x:n,y:r},p=os(i),m=is(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=qo(d[_],T),D=qo(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=$o(E,k,O),j=!c.arrow&&ns(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}}}),Ts=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}=es(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ts(r),_=as(o),v=ts(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[gs(o)]:cs(o)),x=p!==`none`;!d&&x&&b.push(...hs(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=ss(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`||_===as(t)||T.every(e=>as(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=as(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 Es(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ds(e){return Ko.some(t=>e[t]>=0)}var Os=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=es(e,t);switch(i){case`referenceHidden`:{let e=Es(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ds(e)}}}case`escaped`:{let e=Es(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ds(e)}}}default:return{}}}}},ks=new Set([`left`,`top`]);async function As(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ts(n),s=ns(n),c=as(n)===`y`,l=ks.has(o)?-1:1,u=a&&c?-1:1,d=es(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 js=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 As(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}}}}},Ms=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}=es(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=as(i),p=rs(f),m=u[p],h=u[f],g=(e,t)=>$o(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}}}}}},Ns=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}=es(e,t),u={x:n,y:r},d=as(i),f=rs(d),p=u[f],m=u[d],h=es(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=ks.has(ts(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}}}},Ps=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}=es(e,t),c=await i.detectOverflow(t,s),l=ts(n),u=ns(n),d=as(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=qo(p-c[m],g),y=qo(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*Jo(c.left,c.right):S=p-2*Jo(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 Fs(){return typeof window<`u`}function Is(e){return zs(e)?(e.nodeName||``).toLowerCase():`#document`}function Ls(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rs(e){return((zs(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function zs(e){return Fs()?e instanceof Node||e instanceof Ls(e).Node:!1}function Bs(e){return Fs()?e instanceof Element||e instanceof Ls(e).Element:!1}function Vs(e){return Fs()?e instanceof HTMLElement||e instanceof Ls(e).HTMLElement:!1}function Hs(e){return!Fs()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ls(e).ShadowRoot}function Us(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ec(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ws(e){return/^(table|td|th)$/.test(Is(e))}function Gs(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ks=/transform|translate|scale|rotate|perspective|filter/,qs=/paint|layout|strict|content/,Js=e=>!!e&&e!==`none`,Ys;function Xs(e){let t=Bs(e)?ec(e):e;return Js(t.transform)||Js(t.translate)||Js(t.scale)||Js(t.rotate)||Js(t.perspective)||!Qs()&&(Js(t.backdropFilter)||Js(t.filter))||Ks.test(t.willChange||``)||qs.test(t.contain||``)}function Zs(e){let t=nc(e);for(;Vs(t)&&!$s(t);){if(Xs(t))return t;if(Gs(t))return null;t=nc(t)}return null}function Qs(){return Ys??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ys}function $s(e){return/^(html|body|#document)$/.test(Is(e))}function ec(e){return Ls(e).getComputedStyle(e)}function tc(e){return Bs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nc(e){if(Is(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Hs(e)&&e.host||Rs(e);return Hs(t)?t.host:t}function rc(e){let t=nc(e);return $s(t)?(e.ownerDocument||e).body:Vs(t)&&Us(t)?t:rc(t)}function ic(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=rc(e),i=r===e.ownerDocument?.body,a=Ls(r);if(i){let e=ac(a);return t.concat(a,a.visualViewport||[],Us(r)?r:[],e&&n?ic(e):[])}return t.concat(r,ic(r,[],n))}function ac(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oc(e){let t=ec(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Vs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Yo(n)!==a||Yo(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function sc(e){return Bs(e)?e:e.contextElement}function cc(e){let t=sc(e);if(!Vs(t))return Zo(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=oc(t),o=(a?Yo(n.width):n.width)/r,s=(a?Yo(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var lc=Zo(0);function uc(e){let t=Ls(e);return!Qs()||!t.visualViewport?lc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ls(e)}function fc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=sc(e),o=Zo(1);t&&(r?Bs(r)&&(o=cc(r)):o=cc(e));let s=dc(a,n,r)?uc(a):Zo(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=Ls(a),t=Bs(r)?Ls(r):r,n=e,i=ac(n);for(;i&&t!==n;){let e=cc(i),t=i.getBoundingClientRect(),r=ec(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ls(i),i=ac(n)}}return ys({width:u,height:d,x:c,y:l})}function pc(e,t){let n=tc(e).scrollLeft;return t?t.left+n:fc(Rs(e)).left+n}function mc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-pc(e,n),y:n.top+t.scrollTop}}function hc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Rs(r),s=t?Gs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Zo(1),u=Zo(0),d=Vs(r);if((d||!a)&&((Is(r)!==`body`||Us(o))&&(c=tc(r)),d)){let e=fc(r);l=cc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?mc(o,c):Zo(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 gc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function _c(e){let t=tc(e),n=e.ownerDocument.body,r=Jo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Jo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+pc(e),o=-t.scrollTop;return ec(n).direction===`rtl`&&(a+=Jo(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var vc=25;function yc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ls(e),a=Rs(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Qs()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(pc(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<=vc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function bc(e,t){let n=fc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=cc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function xc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=yc(e,n,t);else if(t===`document`)r=_c(Rs(e));else if(Bs(t))r=bc(t,n);else{let n=uc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ys(r)}function Sc(e,t){let n=t.get(e);if(n)return n;let r=ic(e,[],!1).filter(e=>Bs(e)&&Is(e)!==`body`),i=null,a=ec(e).position===`fixed`,o=a?nc(e):e;for(;Bs(o)&&!$s(o);){let e=ec(o),t=Xs(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=nc(o)}return t.set(e,r),r}function Cc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Gs(t)?[]:Sc(t,this._c):[].concat(n),r],o=xc(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=xc(t,a[e],i);s=Jo(n.top,s),c=qo(n.right,c),l=qo(n.bottom,l),u=Jo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function wc(e){let{width:t,height:n}=oc(e);return{width:t,height:n}}function Tc(e,t,n){let r=Vs(t),i=Rs(t),a=n===`fixed`,o=fc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Zo(0);if((r||!a)&&((Is(t)!==`body`||Us(i))&&(s=tc(t)),r)){let e=fc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=pc(i));let l=i&&!r&&!a?mc(i,s):Zo(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 Ec(e){return ec(e).position===`static`}function Dc(e,t){if(!Vs(e)||ec(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Rs(e)===n&&(n=n.ownerDocument.body),n}function Oc(e,t){let n=Ls(e);if(Gs(e))return n;if(!Vs(e)){let t=nc(e);for(;t&&!$s(t);){if(Bs(t)&&!Ec(t))return t;t=nc(t)}return n}let r=Dc(e,t);for(;r&&Ws(r)&&Ec(r);)r=Dc(r,t);return r&&$s(r)&&Ec(r)&&!Xs(r)?n:r||Zs(e)||n}var kc=async function(e){let t=this.getOffsetParent||Oc,n=this.getDimensions,r=await n(e.floating);return{reference:Tc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ac(e){return ec(e).direction===`rtl`}var jc={convertOffsetParentRelativeRectToViewportRelativeRect:hc,getDocumentElement:Rs,getClippingRect:Cc,getOffsetParent:Oc,getElementRects:kc,getClientRects:gc,getDimensions:wc,getScale:cc,isElement:Bs,isRTL:Ac};function Mc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nc(e,t,n){let r=null,i,a=Rs(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=Xo(d),h=Xo(a.clientWidth-(u+f)),g=Xo(a.clientHeight-(d+p)),_=Xo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Jo(0,qo(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Mc(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=Ls(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Pc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=sc(e),u=i||a?[...l?ic(l):[],...t?ic(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Nc(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?fc(e):null;c&&g();function g(){let t=fc(e);h&&!Mc(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 Fc=js,Ic=Ms,Lc=Ts,Rc=Ps,zc=Os,Bc=ws,Vc=Ns,Hc=(e,t,n)=>{let r=new Map,i=n??{},a={...jc,...i.platform,_c:r};return Cs(e,t,{...i,platform:a})},Uc=typeof document<`u`?o.useLayoutEffect:function(){};function Wc(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(!Wc(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)&&!Wc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Gc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kc(e,t){let n=Gc(e);return Math.round(t*n)/n}function qc(e){let t=o.useRef(e);return Uc(()=>{t.current=e}),t}function Jc(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);Wc(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=qc(u),k=qc(i),A=qc(d),j=o.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),Hc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Wc(E.current,t)&&(E.current=t,s.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);Uc(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=o.useRef(!1);Uc(()=>(M.current=!0,()=>{M.current=!1}),[]),Uc(()=>{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=Kc(P.floating,f.x),r=Kc(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Gc(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 Yc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Bc({element:r.current,padding:i}).fn(n):r?Bc({element:r,padding:i}).fn(n):{}}}},Xc=(e,t)=>{let n=Fc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zc=(e,t)=>{let n=Ic(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qc=(e,t)=>({fn:Vc(e).fn,options:[e,t]}),$c=(e,t)=>{let n=Lc(e);return{name:n.name,fn:n.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=Yc(e);return{name:n.name,fn:n.fn,options:[e,t]}},rl=Object.defineProperty,il=o.forwardRef(((e,t)=>rl(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,q.jsx)(J.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,q.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),al=Object.defineProperty,ol=(e,t)=>al(e,`name`,{value:t,configurable:!0}),sl={Partial:`partial`,Always:`always`},cl={Optimized:`optimized`,Always:`always`},ll=`Popper`,[ul,dl]=wn(ll),[fl,pl]=ul(ll),ml=ol(e=>{let{__scopePopper:t,children:n}=e,[r,i]=o.useState(null),[a,s]=o.useState(void 0);return(0,q.jsx)(fl,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:s,children:n})},`Popper`),hl=`PopperAnchor`,gl=o.forwardRef(ol(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=pl(hl,n),s=o.useRef(null),c=a.onAnchorChange,l=K(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&&El(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,q.jsx)(J.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),_l=`PopperContent`,[vl,yl]=ul(_l),bl=o.forwardRef(ol(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=sl.Partial,hideWhenDetached:p=!1,updatePositionStrategy:m=cl.Optimized,onPlaced:h,...g}=e,_=pl(_l,n),[v,y]=o.useState(null),b=K(t,y),[x,S]=o.useState(null),C=Go(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(wl),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Jc({strategy:`fixed`,placement:E,whileElementsMounted:ol((...e)=>Pc(...e,{animationFrame:m===cl.Always}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Xc({mainAxis:i+T,alignmentAxis:s}),l&&Zc({mainAxis:!0,crossAxis:!1,...f===sl.Partial?{limiter:Qc()}:{},...A}),l&&$c({...A}),el({...A,apply:ol(({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&&nl({element:x,padding:c}),Tl({arrowWidth:w,arrowHeight:T}),p&&tl(k?{strategy:`referenceHidden`,...A}:{strategy:`referenceHidden`,padding:A.padding,altBoundary:A.altBoundary})]}),I=_.setPlacementState;En(()=>(I(N),()=>{I(void 0)}),[N,I]);let[ee,L]=El(N),te=Ur(h);En(()=>{P&&te?.()},[P,te]);let ne=F.arrow?.x,re=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[R,z]=o.useState();return En(()=>{v&&z(window.getComputedStyle(v).zIndex)},[v]),(0,q.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:R,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,q.jsx)(vl,{scope:n,placedSide:ee,placedAlign:L,onArrowChange:S,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,q.jsx)(J.div,{"data-side":ee,"data-align":L,...g,ref:b,style:{...g.style,animation:P?g.style?.animation:`none`}})})})},`PopperContent`)),xl=`PopperArrow`,Sl={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Cl=o.forwardRef(ol(function(e,t){let{__scopePopper:n,...r}=e,i=yl(xl,n),a=Sl[i.placedSide];return(0,q.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,q.jsx)(il,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function wl(e){return e!==null}ol(wl,`isNotNull`);var Tl=ol(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]=El(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 El(e){let[t,n=`center`]=e.split(`-`);return[t,n]}ol(El,`getSideAndAlignFromPlacement`);var Dl=Object.defineProperty,Ol=(e,t)=>Dl(e,`name`,{value:t,configurable:!0}),kl=!1;function Al(){let[e,t]=o.useState(kl);return o.useEffect(()=>{kl||(kl=!0,t(!0))},[]),e}Ol(Al,`useIsHydrated`);var jl=o.useSyncExternalStore;function Ml(){return()=>{}}Ol(Ml,`subscribe`);function Nl(){return jl(Ml,()=>!0,()=>!1)}Ol(Nl,`useIsHydratedModern`);var Pl=typeof jl==`function`?Nl:Al,Fl=Object.defineProperty,Il=(e,t)=>Fl(e,`name`,{value:t,configurable:!0}),Ll=`rovingFocusGroup.onEntryFocus`,Rl={bubbles:!1,cancelable:!0},zl=`RovingFocusGroup`,[Bl,Vl,Hl]=kn(zl),[Ul,Wl]=wn(zl,[Hl]),Gl={Vertical:`vertical`,Horizontal:`horizontal`},Kl={LTR:`ltr`,RTL:`rtl`},[ql,Jl]=Ul(zl),Yl=o.forwardRef(Il(function(e,t){return(0,q.jsx)(Bl.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,q.jsx)(Bl.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,q.jsx)(Xl,{...e,ref:t})})})},`RovingFocusGroup`)),Xl=o.forwardRef(Il(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=K(t,p),h=zr(a),[g,_]=nr({prop:s,defaultProp:c??null,onChange:l,caller:zl}),[v,y]=o.useState(!1),b=Ur(u),x=Vl(n),S=o.useRef(!1),[C,w]=o.useState(0);return o.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(Ll,b),()=>e.removeEventListener(Ll,b)},[b]),(0,q.jsx)(ql,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:o.useCallback(e=>_(e),[_]),onItemShiftTab:o.useCallback(()=>y(!0),[]),onFocusableItemAdd:o.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:o.useCallback(()=>w(e=>e-1),[]),children:(0,q.jsx)(J.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:`none`,...e.style},onMouseDown:Y(e.onMouseDown,()=>{S.current=!0}),onFocus:Y(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Ll,Rl);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);nu([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}S.current=!1}),onBlur:Y(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Zl=`RovingFocusGroupItem`,Ql=o.forwardRef(Il(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:s,...c}=e,l=br(),u=a||l,d=Jl(Zl,n),f=d.currentTabStopId===u,p=Vl(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=d,_=Pl();return En(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),o.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,q.jsx)(Bl.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,q.jsx)(J.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:Y(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:Y(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=tu(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?ru(n,r+1):n.slice(r+1)}setTimeout(()=>nu(n))}}),children:typeof s==`function`?s({isCurrentTabStop:f,hasTabStop:g!=null}):s})})},`RovingFocusGroupItem`)),$l={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function eu(e,t){return t===Kl.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Il(eu,`getDirectionAwareKey`);function tu(e,t,n){let r=eu(e.key,n);if(!(t===Gl.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Gl.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return $l[r]}Il(tu,`getFocusIntent`);function nu(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Il(nu,`focusFirst`);function ru(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Il(ru,`wrapArray`);var iu=Object.defineProperty,au=o.forwardRef(((e,t)=>iu(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,q.jsx)(J.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),ou=Object.defineProperty,su=(e,t)=>ou(e,`name`,{value:t,configurable:!0}),cu={Horizontal:`horizontal`,Vertical:`vertical`},lu=cu.Horizontal,uu=Object.values(cu),du=o.forwardRef(su(function(e,t){let{decorative:n,orientation:r=lu,...i}=e,a=fu(r)?r:lu,o=a===cu.Vertical?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,q.jsx)(J.div,{"data-orientation":a,...s,...i,ref:t})},`Separator`));function fu(e){return uu.includes(e)}su(fu,`isValidOrientation`);var pu=Object.defineProperty,mu=(e,t)=>pu(e,`name`,{value:t,configurable:!0}),hu={Automatic:`automatic`,Manual:`manual`},gu=`Tabs`,[_u,vu]=wn(gu,[Wl]),yu=Wl(),[bu,xu]=_u(gu),Su=o.forwardRef(mu(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=hu.Automatic,...l}=e,u=zr(s),[d,f]=nr({prop:r,onChange:i,defaultProp:a??``,caller:gu});return(0,q.jsx)(bu,{scope:n,baseId:br(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,q.jsx)(J.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Cu=`TabsList`,wu=o.forwardRef(mu(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=xu(Cu,n),o=yu(n);return(0,q.jsx)(Yl,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,q.jsx)(J.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Tu=`TabsTrigger`,Eu=o.forwardRef(mu(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=xu(Tu,n),s=yu(n),c=ku(o.baseId,r),l=Au(o.baseId,r),u=r===o.value;return(0,q.jsx)(Ql,{asChild:!0,...s,focusable:!i,active:u,children:(0,q.jsx)(J.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Y(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:Y(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Y(e.onFocus,()=>{let e=o.activationMode!==hu.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Du=`TabsContent`,Ou=o.forwardRef(mu(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=e,c=xu(Du,n),l=ku(c.baseId,r),u=Au(c.baseId,r),d=r===c.value,f=o.useRef(d);return o.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,q.jsx)(ur,{present:i||d,children:({present:n})=>(0,q.jsx)(J.div,{"data-state":d?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function ku(e,t){return`${e}-trigger-${t}`}mu(ku,`makeTriggerId`);function Au(e,t){return`${e}-content-${t}`}mu(Au,`makeContentId`);var ju=Object.defineProperty,Mu=(e,t)=>ju(e,`name`,{value:t,configurable:!0}),Nu=`Toggle`,Pu=o.forwardRef(Mu(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=nr({prop:n,onChange:i,defaultProp:r??!1,caller:Nu});return(0,q.jsx)(J.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:Y(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Fu=Object.defineProperty,Iu=(e,t)=>Fu(e,`name`,{value:t,configurable:!0}),[Lu,Ru]=wn(`Tooltip`,[dl]),zu=dl(),Bu=`TooltipProvider`,Vu=700,Hu=`tooltip.open`,[Uu,Wu]=Lu(Bu),Gu=Iu(e=>{let{__scopeTooltip:t,delayDuration:n=Vu,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,s=o.useRef(!0),c=o.useRef(!1),l=o.useRef(0);return o.useEffect(()=>{let e=l.current;return()=>window.clearTimeout(e)},[]),(0,q.jsx)(Uu,{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`),Ku=`Tooltip`,[qu,Ju]=Lu(Ku),Yu=Iu(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,l=Wu(Ku,e.__scopeTooltip),u=zu(t),[d,f]=o.useState(null),[p,m]=o.useState(void 0),h=br(),g=o.useRef(0),_=s??l.disableHoverableContent,v=c??l.delayDuration,y=o.useRef(!1),[b,x]=nr({prop:r,defaultProp:i??!1,onChange:Iu(e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(Hu))):l.onClose(),a?.(e)},`onChange`),caller:Ku}),S=o.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=o.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=o.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=o.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);o.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=p??h;return(0,q.jsx)(ml,{...u,children:(0,q.jsx)(qu,{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`),Xu=`TooltipTrigger`,Zu=o.forwardRef(Iu(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=Ju(Xu,n),s=Wu(Xu,n),c=zu(n),l=K(t,o.useRef(null),a.onTriggerChange),u=o.useRef(!1),d=o.useRef(!1),f=o.useCallback(()=>u.current=!1,[]);return o.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,q.jsx)(gl,{asChild:!0,...c,children:(0,q.jsx)(J.button,{"aria-describedby":a.open?md(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:l,onPointerMove:Y(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:Y(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:Y(e.onBlur,a.onClose),onClick:Y(e.onClick,a.onClose)})})},`TooltipTrigger`)),Qu=`TooltipPortal`,[$u,ed]=Lu(Qu,{forceMount:void 0}),td=Iu(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Ju(Qu,t);return(0,q.jsx)($u,{scope:t,forceMount:n,children:(0,q.jsx)(ur,{present:n||a.open,children:(0,q.jsx)(Ei,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),nd=`TooltipContent`,rd=o.forwardRef(Iu(function(e,t){let n=ed(nd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Ju(nd,e.__scopeTooltip);return(0,q.jsx)(ur,{present:r||o.open,children:o.disableHoverableContent?(0,q.jsx)(od,{side:i,...a,ref:t}):(0,q.jsx)(id,{side:i,...a,ref:t})})},`TooltipContent`)),id=o.forwardRef(Iu(function(e,t){let n=Ju(nd,e.__scopeTooltip),r=Wu(nd,e.__scopeTooltip),i=o.useRef(null),a=K(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=ld(r,cd(r,n.getBoundingClientRect())),a=ud(t.getBoundingClientRect()),o=fd([...i,...a]);c(o),f(!0)},[f]);return o.useEffect(()=>()=>p(),[p]),o.useEffect(()=>{if(l&&d){let e=Iu(e=>m(e,d),`handleTriggerLeave`),t=Iu(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=Iu(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!dd(n,s);r?p():i&&(p(),u())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,s,u,p]),(0,q.jsx)(od,{...e,ref:a})},`TooltipContentHoverable`)),ad=Qt(`TooltipContent`),od=o.forwardRef(Iu(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=Ju(nd,n),d=zu(n),{onClose:f}=u,[p,m]=o.useState(null),h=K(t,m);pi(p),o.useEffect(()=>(document.addEventListener(Hu,f),()=>document.removeEventListener(Hu,f)),[f]),o.useEffect(()=>{if(u.trigger){let e=Iu(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 En(()=>(g(a),()=>{g(void 0)}),[a,g]),(0,q.jsx)(Zr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,q.jsxs)(bl,{"data-state":u.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:u.contentId,...d,...l,ref:h,style:{...l.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,q.jsx)(ad,{children:r}),i?(0,q.jsx)(bn,{id:u.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),sd=o.forwardRef(Iu(function(e,t){let{__scopeTooltip:n,...r}=e,i=zu(n);return(0,q.jsx)(Cl,{...i,...r,ref:t})},`TooltipArrow`));function cd(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`)}}Iu(cd,`getExitSideFromRect`);function ld(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}Iu(ld,`getPaddedExitPoints`);function ud(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}]}Iu(ud,`getPointsFromRect`);function dd(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}Iu(dd,`isPointInPolygon`);function fd(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)),pd(t)}Iu(fd,`getHull`);function pd(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)}Iu(pd,`getHullPresorted`);function md(...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}Iu(md,`concatAriaDescribedby`);function hd(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=hd(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function gd(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=hd(e))&&(r&&(r+=` `),r+=t);return r}var _d=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,vd=gd,yd=(e,t)=>n=>{if(t?.variants==null)return vd(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=_d(t)||_d(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 vd(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)},bd=yd(`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 xd({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?Xt:`button`;return(0,q.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:G(bd({variant:t,size:n,className:e})),...i})}var Sd={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`},Cd=(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,...Sd,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,_)});Cd.displayName=`HugeiconsIcon`;var wd=[[`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`}]],Td=[[`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`}]],Ed=[[`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`}]],Dd=[[`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`}]],Od=[[`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`}]],kd=[[`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`}]],Ad=[[`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`}]],jd=[[`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`}]],Md=[[`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`}]],Nd=[[`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`}]],Pd=[[`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`}]],Fd=[[`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`}]],Id=[[`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`}]],Ld=[[`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`}]],Rd=[[`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`}]],zd=[[`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`}]],Bd=[[`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`}]],Vd=[[`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`}]],Hd=[[`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`}]],Ud=[[`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`}]],Wd=[[`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`}]],Gd=[[`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`}]],Kd=[[`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`}]],qd=[[`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`}]],Jd=[[`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`}]],Yd=[[`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`}]],Xd=[[`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`}]],Zd=[[`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`}]],Qd=[[`path`,{d:`M5 14L8.5 17.5L19 6.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],$d=[[`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`}]],ef=[[`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`}]],tf=[[`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 nf({...e}){return(0,q.jsx)(io,{"data-slot":`sheet`,...e})}function rf({...e}){return(0,q.jsx)(uo,{"data-slot":`sheet-portal`,...e})}function af({className:e,...t}){return(0,q.jsx)(po,{"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 of({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,q.jsxs)(rf,{children:[(0,q.jsx)(af,{}),(0,q.jsxs)(_o,{"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,q.jsx)(wo,{"data-slot":`sheet-close`,asChild:!0,children:(0,q.jsxs)(xd,{variant:`ghost`,className:`absolute top-4 right-4 bg-secondary`,size:`icon-sm`,children:[(0,q.jsx)(Cd,{icon:Nd,strokeWidth:2}),(0,q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function sf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sheet-header`,className:G(`flex flex-col gap-1.5 p-6`,e),...t})}function cf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sheet-footer`,className:G(`mt-auto flex flex-col gap-2 p-6`,e),...t})}function lf({className:e,...t}){return(0,q.jsx)(xo,{"data-slot":`sheet-title`,className:G(`text-base font-medium text-foreground`,e),...t})}function uf({className:e,...t}){return(0,q.jsx)(So,{"data-slot":`sheet-description`,className:G(`text-sm text-muted-foreground`,e),...t})}var df=768;function ff(){let[e,t]=o.useState(void 0);return o.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<df)};return e.addEventListener(`change`,n),t(window.innerWidth<df),()=>e.removeEventListener(`change`,n)},[]),!!e}function pf({className:e,type:t,...n}){return(0,q.jsx)(`input`,{type:t,"data-slot":`input`,className:G(`h-8 w-full min-w-0 rounded-2xl border border-transparent bg-input/50 px-2.5 py-1 text-base transition-[color,box-shadow] duration-200 outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none 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),...n})}function mf({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,q.jsx)(du,{"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 hf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`skeleton`,className:G(`animate-pulse rounded-2xl bg-muted`,e),...t})}function gf({delayDuration:e=0,...t}){return(0,q.jsx)(Gu,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function _f({...e}){return(0,q.jsx)(Yu,{"data-slot":`tooltip`,...e})}function vf({...e}){return(0,q.jsx)(Zu,{"data-slot":`tooltip-trigger`,...e})}function yf({className:e,sideOffset:t=0,children:n,...r}){return(0,q.jsx)(td,{children:(0,q.jsxs)(rd,{"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,q.jsx)(sd,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=left]:translate-x-[-1.5px] data-[side=right]:translate-x-[1.5px]`})]})})}var bf=`sidebar_state`,xf=604800,Sf=`16rem`,Cf=`18rem`,wf=`3rem`,Tf=`b`,Ef=o.createContext(null);function Df(){let e=o.useContext(Ef);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Of({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...s}){let c=ff(),[l,u]=o.useState(!1),[d,f]=o.useState(e),p=t??d,m=o.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`${bf}=${t}; path=/; max-age=${xf}`},[n,p]),h=o.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);o.useEffect(()=>{let e=e=>{e.key===Tf&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=o.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,u,h]);return(0,q.jsx)(Ef.Provider,{value:_,children:(0,q.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":Sf,"--sidebar-width-icon":wf,...i},className:G(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...s,children:a})})}function kf({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=Df();return n===`none`?(0,q.jsx)(`div`,{"data-slot":`sidebar`,className:G(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,q.jsx)(nf,{open:l,onOpenChange:u,...o,children:(0,q.jsxs)(of,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":Cf},side:e,children:[(0,q.jsxs)(sf,{className:`sr-only`,children:[(0,q.jsx)(lf,{children:`Sidebar`}),(0,q.jsx)(uf,{children:`Displays the mobile sidebar.`})]}),(0,q.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,q.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,q.jsx)(`div`,{"data-slot":`sidebar-gap`,className: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,q.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,q.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-2xl group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function Af({className:e,onClick:t,...n}){let{toggleSidebar:r}=Df();return(0,q.jsxs)(xd,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:G(e),onClick:e=>{t?.(e),r()},...n,children:[(0,q.jsx)(Cd,{icon:Jd,strokeWidth:2}),(0,q.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function jf({className:e,...t}){return(0,q.jsx)(`main`,{"data-slot":`sidebar-inset`,className: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 Mf({className:e,...t}){return(0,q.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 Nf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:G(`flex flex-col gap-2 p-2`,e),...t})}function Pf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className: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 Ff({className:e,...t}){return(0,q.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 If({className:e,asChild:t=!1,...n}){let r=t?Xt:`div`;return(0,q.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 Lf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:G(`w-full text-sm`,e),...t})}function Rf({className:e,...t}){return(0,q.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 zf({className:e,...t}){return(0,q.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:G(`group/menu-item relative`,e),...t})}var Bf=yd(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-xl px-3 py-2 text-left text-sm whitespace-nowrap ring-sidebar-ring outline-hidden transition-[width,height,padding] duration-200 group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-3 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 has-[>svg:first-child]:pl-2.5 has-[>svg:last-child]:pr-2.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 px-3 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function Vf({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let s=e?Xt:`button`,{isMobile:c,state:l}=Df(),u=(0,q.jsx)(s,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:G(Bf({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:u}),(0,q.jsx)(yf,{side:`right`,align:`center`,hidden:l!==`collapsed`||c,...i})]})):u}function Hf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className: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 Uf({className:e,showIcon:t=!1,...n}){let[r]=o.useState(()=>`${Math.floor(Math.random()*40)+50}%`);return(0,q.jsxs)(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:G(`flex h-8 items-center gap-2 rounded-xl px-2`,e),...n,children:[t&&(0,q.jsx)(hf,{className:`size-4 rounded-xl`,"data-sidebar":`menu-skeleton-icon`}),(0,q.jsx)(hf,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":r}})]})}var Wf=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),Gf=function(e){return`/`+e},Kf={},qf=function(e){return e.pathname.endsWith(`.css`)},Jf=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Yf=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Gf(t,n);let r=s(t),i=qf(r);return Jf(Kf,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Wf,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Xf=globalThis;Xf.window??=globalThis,Xf.Path2D??=class{},await Yf(()=>import(`./characters-BsW4RWhl.js`),[]);var Zf=Xf.window.CotalArt;function Qf(e,t){return Zf.body(e,t)}function $f(e){return Zf.mark(e)}function ep(e){return Zf.character({vendor:e,cx:70,cy:66,w:92,look:`right`,mood:`happy`,arms:[{from:[84,50],via:[106,40],to:[112,12],hand:`open`,deg:`auto`}],legs:[{from:[40,94],to:[36,116],dir:-1},{from:[62,94],to:[66,116],dir:1}]})}function tp(){let e=(0,o.useRef)(null);return{onOpenAutoFocus:()=>{e.current=globalThis.document.activeElement},onCloseAutoFocus:t=>{t.preventDefault(),e.current?.focus(),e.current=null}}}function X({icon:e,size:t=18,className:n,"data-icon":r}){return(0,q.jsx)(Cd,{icon:e,size:t,strokeWidth:1.5,className:n,"data-icon":r,"aria-hidden":`true`})}var np=yd(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-2xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function rp({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?Xt:`span`;return(0,q.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:G(np({variant:t}),e),...r})}function ip({className:e,size:t=`default`,...n}){return(0,q.jsx)(Io,{"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 ap({className:e,...t}){return(0,q.jsx)(Ro,{"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 op=yd(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function sp({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,q.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:G(op({variant:e}),n),...r})}function cp({asChild:e=!1,className:t,...n}){let r=e?Xt:`div`;return(0,q.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 lp({className:e,...t}){return(0,q.jsx)(au,{"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 up=yd(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function dp({className:e,orientation:t=`vertical`,...n}){return(0,q.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:G(up({orientation:t}),e),...n})}function fp({className:e,...t}){return(0,q.jsx)(lp,{"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 pp({className:e,...t}){return(0,q.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 mp({className:e,children:t,errors:n,...r}){let i=(0,o.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,q.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,q.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,q.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:G(`text-sm font-normal text-destructive`,e),...r,children:i}):null}function hp({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className: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 gp({className:e,...t}){return(0,q.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 _p=yd(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-2xl **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1.5 [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function vp({className:e,align:t=`inline-start`,...n}){return(0,q.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:G(_p({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var yp=yd(`flex items-center gap-2 rounded-2xl text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-xl px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-xl p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function bp({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,q.jsx)(xd,{type:t,"data-size":r,variant:n,className:G(yp({size:r}),e),...i})}function xp({className:e,...t}){return(0,q.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 Sp({className:e,...t}){return(0,q.jsx)(hp,{"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 Cp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-group`,className:G(`flex min-w-0 flex-col gap-2`,e),...t})}function wp({className:e,align:t=`start`,...n}){return(0,q.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:G(`group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse`,e),...n})}function Tp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-avatar`,className: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 Ep({className:e,...t}){return(0,q.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 Dp({className:e,...t}){return(0,q.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 Op({className:e,...t}){return(0,q.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 kp({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=Ap(jp(r,i),t);if(!n)return o.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!o.isValidElement(n))return null;let s=n.props,c={...Ap(a,s),ref:Pp(a.ref,s.ref)};return o.cloneElement(n,c)}function Ap(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];t[n]=n===`className`?[i,r].filter(Boolean).join(` `):n===`style`?{...i,...r}:n===`ref`?Pp(i,r):Np(n)&&typeof i==`function`&&typeof r==`function`?Mp(r,i):r}}return t}function jp(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function Mp(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function Np(e){return/^on[A-Z]/.test(e)}function Pp(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var Fp=8,Ip=64,Lp=0,Rp=.5,zp=180,Bp=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),Vp={start:!1,end:!1},Hp={currentAnchorId:null,visibleMessageIds:[]};function Up({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return Vp;let i=tm({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function Wp({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return Hp;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of Gp(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+Rp&&(u=e)}return l.length===0&&u===null?Hp:{currentAnchorId:u,visibleMessageIds:l}}function Gp(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function Kp(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function qp(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function Jp(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function Yp(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function Xp({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of Gp(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function Zp({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=Qp(t,i),o=t.getBoundingClientRect().height,s=im(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function Qp(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function $p(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function em({content:e,scrollTop:t,spacer:n,viewport:r}){let i=tm({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function tm({content:e,spacer:t,viewport:n}){let r=Gp(e,t),i=rm(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function nm(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function rm(e){let t=window.getComputedStyle(e);return{end:om(t.paddingBlockEnd||t.paddingBottom),start:om(t.paddingBlockStart||t.paddingTop)}}function im(e){let t=e?.parentElement;return t?rm(t):{end:0,start:0}}function am(e){if(!e)return 0;let t=window.getComputedStyle(e);return om(t.rowGap===`normal`?t.gap:t.rowGap)}function om(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function sm(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function cm(e,t){return sm(e,t)}function lm(){return sm(Hp,dm)}function um(e,t){return e.start===t.start&&e.end===t.end}function dm(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function fm({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:r,scrollPreviousItemPeek:i}){let a=o.useRef(e),s=o.useRef(!1),c=o.useRef(null),l=o.useRef(!1),u=o.useRef(n),d=o.useRef(0),f=o.useRef(null),p=o.useRef(0),m=o.useRef(e?`following-bottom`:`free-scrolling`),h=o.useRef(new Map),g=o.useRef(null),_=o.useRef(null),v=o.useRef(null),y=o.useRef(i),b=o.useRef(!0),x=o.useRef(null),S=o.useRef(r),C=o.useRef(null),w=o.useRef(0),T=o.useRef(0),E=o.useRef(null),D=o.useRef(null),O=o.useRef(null),k=o.useRef(null),A=o.useRef(null),j=o.useRef(null),M=o.useRef(null),N=o.useRef(null),P=o.useRef(null),F=o.useRef(new Set),I=o.useRef(new WeakSet);return O.current===null&&(O.current=cm(t===`end`||t===`last-anchor`,(e,t)=>e===t)),k.current===null&&(k.current=cm(Vp,um)),P.current===null&&(P.current=lm()),a.current=e,u.current=n,S.current=r,y.current=i,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:A,streamingTurnRef:v,contentRef:c,defaultScrollPositionAppliedRef:l,firstItemRef:f,itemCountRef:d,lastScrollTopRef:p,messageElementsRef:h,modeRef:m,pendingScrollFrameRef:C,pendingScrollToMessageRef:g,prependRestoreRef:_,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:O.current,rootRef:x,scrollEdgeThresholdRef:u,scrollMarginRef:S,scrollPreviousItemPeekRef:y,spacerGapRef:w,spacerHeightRef:T,spacerRef:E,stateFrameRef:D,stateStore:k.current,viewportRef:j,visibilityFrameRef:M,visibilityObserverRef:N,visibilityStore:P.current,visibleMessageIdsRef:F,handledScrollAnchorsRef:I}}function pm(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function mm(e){e.defaultScrollPositionAppliedRef.current=!0,pm(e)}function hm({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:c,contentRef:l,itemCountRef:u,messageElementsRef:d,modeRef:f,pendingScrollToMessageRef:p,prependRestoreRef:m,scrollMarginRef:h,scrollPreviousItemPeekRef:g,spacerGapRef:_,spacerHeightRef:v,spacerRef:y,viewportRef:b}=e,x=o.useCallback(e=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null),s.current!==e&&(s.current=e,t()),e&&(c.current=window.setTimeout(()=>{c.current=null,s.current=!1,t()},zp))},[t]),S=o.useCallback(e=>{let t=y.current;if(!t)return;let n=Math.max(0,Math.ceil(e));v.current!==n&&(v.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-_.current}px`:``)},[]),C=o.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=b.current;if(!a)return;let o=Math.max(0,e);Math.abs(a.scrollTop-o)<=Rp?(a.scrollTop=o,t()):(i&&x(!0),a.scrollTo({top:o,behavior:r}),n())},[t,n,x]),w=o.useCallback(({behavior:e=`auto`}={})=>b.current?(S(0),i.current=null,f.current=`free-scrolling`,C(0,{behavior:e}),r(),!0):!1,[r,C,S]),T=o.useCallback(({behavior:e=`auto`}={})=>{let t=b.current;return t?(S(0),i.current=null,f.current=a.current?`following-bottom`:`free-scrolling`,C(nm(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,C,S]),E=o.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=h.current}={},{keepPreviousPeek:o=!1}={})=>{let s=l.current,c=b.current;if(!s||!c||!s.contains(e))return!1;let u=Zp({align:t,element:e,scrollMargin:o?a+g.current:a,spacer:y.current,viewport:c}),d=em({content:s,scrollTop:u,spacer:y.current,viewport:c});return S(d),m.current={element:e,viewportTop:$p(e,c)},f.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,C(u,{behavior:n}),r(),!0},[r,C,S]),D=o.useCallback(()=>{let e=i.current;return!e||!e.isConnected||f.current!==`anchored-to-message`?!1:E(e,{align:`start`},{keepPreviousPeek:!0})},[E]),O=o.useCallback((t,n)=>{let r=d.current.get(t);return r?(mm(e),E(r,n)?(p.current=null,!0):(p.current={messageId:t,options:n},!0)):u.current===0&&(p.current={messageId:t,options:n},mm(e),!0)},[E]);return{flushPendingScrollToMessage:o.useCallback(()=>{let t=p.current;if(!t)return!1;let n=d.current.get(t.messageId);return!n||!E(n,t.options)?!1:(p.current=null,mm(e),!0)},[E]),reanchorToAnchoredMessage:D,scrollToElement:E,scrollToEnd:T,scrollToMessage:O,scrollToStart:w}}function gm(e,t){return o.useCallback(n=>{e.current=n,n&&t()},[e,t])}function _m({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=Fp,scrollPreviousItemPeek:r=Ip,scrollMargin:i=Lp}){let a=fm({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:s,autoScrollRef:c,autoscrollingRef:l,autoscrollingTimeoutRef:u,contentRef:d,defaultScrollPositionAppliedRef:f,firstItemRef:p,itemCountRef:m,lastScrollTopRef:h,messageElementsRef:g,modeRef:_,pendingScrollFrameRef:v,pendingScrollToMessageRef:y,prependRestoreRef:b,preserveScrollOnPrependRef:x,pendingDefaultScrollStore:S,rootRef:C,scrollEdgeThresholdRef:w,scrollMarginRef:T,scrollPreviousItemPeekRef:E,spacerGapRef:D,spacerHeightRef:O,spacerRef:k,stateFrameRef:A,stateStore:j,viewportRef:M,visibilityFrameRef:N,visibilityObserverRef:P,visibilityStore:F,visibleMessageIdsRef:I,handledScrollAnchorsRef:ee}=a,L=o.useRef(t);L.current!==t&&(L.current=t,f.current=!1);let te=o.useCallback(e=>{let t=C.current,n=M.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=l.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),ne=o.useCallback(e=>{let t=M.current?.scrollTop??0,n=t<h.current-Rp;h.current=t,c.current&&!e.end&&_.current!==`settling-jump`&&_.current!==`anchored-to-message`?_.current=`following-bottom`:_.current===`following-bottom`&&e.end&&n&&!l.current&&(_.current=`free-scrolling`)},[]),re=o.useCallback(()=>{let e=Up({content:d.current,scrollEdgeThreshold:w.current,spacer:k.current,viewport:M.current});ne(e);let t=_.current===`following-bottom`?{...e,end:!1}:e;te(t),j.setSnapshot(t)},[ne,j,te]),ie=o.useCallback(()=>{A.current===null&&(A.current=window.requestAnimationFrame(()=>{A.current=null,re()}))},[re]),R=o.useCallback(()=>{F.hasListeners()&&N.current===null&&(N.current=window.requestAnimationFrame(()=>{N.current=null,F.hasListeners()&&F.setSnapshot(Wp({content:d.current,scrollMargin:T.current,scrollPreviousItemPeek:E.current,spacer:k.current,viewport:M.current,visibleMessageIds:I.current}))}))},[F]),{flushPendingScrollToMessage:z,reanchorToAnchoredMessage:ae,scrollToElement:B,scrollToEnd:V,scrollToMessage:H,scrollToStart:oe}=hm({refs:a,commitScrollState:re,scheduleStateCommit:ie,scheduleVisibilitySync:R}),U=o.useCallback(()=>{let e=b.current,t=M.current;if(!e||!t||!e.element.isConnected)return!1;let n=$p(e.element,t)-e.viewportTop;return Math.abs(n)<=Rp?!1:(t.scrollTop+=n,e.viewportTop=$p(e.element,t),ie(),R(),!0)},[ie,R]),se=o.useCallback(()=>{let e=d.current,t=M.current;if(!e||!t){b.current=null;return}let n=Xp({content:e,spacer:k.current,viewport:t});b.current=n?{element:n,viewportTop:$p(n,t)}:null},[]),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?Yp(Gp(t,k.current)):null;if(!t||!n||!r)e=V({behavior:`auto`});else{let i=Qp(r,n);e=tm({content:t,spacer:k.current,viewport:n})-i<=n.clientHeight?V({behavior:`auto`}):B(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?V({behavior:`auto`}):oe({behavior:`auto`});return e?(mm(a),!0):!1},[t,B,V,oe]),ue=o.useCallback(()=>{let e=d.current;if(!e)return;let t=Gp(e,k.current),n=m.current,r=p.current;m.current=t.length,p.current=t[0]??null,(()=>{if(z())return;if(n===0){if(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=Kp(t,n);if(e){if(c.current&&_.current===`following-bottom`&&Jp(t,n)){V({behavior:`auto`});return}B(e,{align:`start`},{keepPreviousPeek:!0}),ee.current.add(e);return}}if(t.length===n){let e=qp(t,ee.current);if(e){B(e,{align:`start`},{keepPreviousPeek:!0}),ee.current.add(e);return}}_.current===`following-bottom`&&c.current?V({behavior:`auto`}):(re(),R())}})(),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(Hp)},[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=gm(C,ge),ve=gm(M,ge),ye=o.useCallback(e=>{d.current=e},[]),be=o.useCallback(e=>{k.current=e,D.current=am(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&&pm(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 vm(e){let t=o.useRef(e);return t.current=e,t}var ym=o.createContext(null),bm=o.createContext(null);function xm(){let e=o.useContext(ym);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function Sm(){let e=o.useContext(bm);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function Cm(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=xm();return o.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function wm(){let{stateStore:e}=xm();return o.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Tm({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=_m({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,q.jsx)(ym.Provider,{value:o,children:(0,q.jsx)(bm.Provider,{value:s,children:t})})}function Em(){let{pendingDefaultScrollStore:e}=xm();return o.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Dm({children:e,...t}){let{setRootElement:n}=xm(),r=Em();return(0,q.jsx)(`div`,{ref:n,...t,...r?{"data-pending-scroll":``}:null,children:e})}function Om({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:s=!0,ref:c,role:l,tabIndex:u,...d}){let{handleResize:f,preserveScrollOnPrependRef:p,setViewportElement:m,syncAfterScroll:h,userScrollIntent:g,viewportRef:_}=xm(),v=Em();p.current=s;let y=o.useCallback(e=>{m(e),Pp(c)?.(e)},[c,m]);function b(e){h(),r?.(e)}function x(e){g(),a?.(e)}function S(e){g(),i?.(e)}function C(e){Bp.has(e.key)&&g(),n?.(e)}return o.useEffect(()=>{let e=_.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(f)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[f,_]),(0,q.jsx)(`div`,{ref:y,role:l??`region`,"aria-label":e??`Messages`,tabIndex:u??0,onKeyDown:C,onScroll:b,onTouchMove:S,onWheel:x,...d,...v?{"data-pending-scroll":``}:null,children:t})}function km({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:s,handleResize:c,setContentElement:l,setSpacerElement:u}=xm(),d=o.useRef(null),f=o.useCallback(e=>{d.current=e,l(e),Pp(n)?.(e)},[n,l]);return o.useLayoutEffect(()=>{let e=d.current;if(!e||(s(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{s()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[s]),o.useEffect(()=>{let e=d.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(c)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[c]),(0,q.jsxs)(`div`,{ref:f,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,q.jsx)(`div`,{ref:u,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function Am({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=Sm(),a=o.useRef(null),s=o.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),Pp(t)?.(n)},[e,t,i]);return(0,q.jsx)(`div`,{ref:s,"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function jm({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:s=`button`,...c}){let{scrollToEnd:l,scrollToStart:u,stateStore:d}=xm(),f=vm(r),p=o.useCallback(e=>d.subscribe(e),[d]),m=o.useCallback(()=>{let e=d.getSnapshot();return n===`start`?e.start:e.end},[n,d]),h=o.useSyncExternalStore(p,m,m),g=o.useCallback(t=>{h&&(f.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?u({behavior:e}):l({behavior:e})))},[e,n,h,f,l,u]);return kp({defaultTagName:`button`,props:Ap({type:s,inert:!h,tabIndex:h?a:-1,children:t??(0,q.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:g},c),render:i,state:{active:h,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var Mm={Provider:Tm,Root:Dm,Viewport:Om,Content:km,Item:Am,Button:jm};function Nm(e){return(0,q.jsx)(Mm.Provider,{...e})}function Pm({className:e,...t}){return(0,q.jsx)(Mm.Root,{"data-slot":`message-scroller`,className:G(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,e),...t})}function Fm({className:e,...t}){return(0,q.jsx)(Mm.Viewport,{"data-slot":`message-scroller-viewport`,className: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 Im({className:e,...t}){return(0,q.jsx)(Mm.Content,{"data-slot":`message-scroller-content`,className:G(`flex h-max min-h-full flex-col gap-8`,e),...t})}function Lm({className:e,scrollAnchor:t=!1,...n}){return(0,q.jsx)(Mm.Item,{"data-slot":`message-scroller-item`,scrollAnchor:t,className:G(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,e),...n})}function Rm({direction:e=`end`,className:t,children:n,render:r,variant:i=`secondary`,size:a=`icon-sm`,...o}){return(0,q.jsx)(Mm.Button,{"data-slot":`message-scroller-button`,"data-direction":e,"data-variant":i,"data-size":a,direction:e,className: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,q.jsx)(xd,{variant:i,size:a}),...o,children:n??(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Cd,{icon:Ed,strokeWidth:2}),(0,q.jsx)(`span`,{className:`sr-only`,children:e===`end`?`Scroll to end`:`Scroll to start`})]})})}function zm({className:e,...t}){return(0,q.jsx)(Cd,{icon:Ud,strokeWidth:2,"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:G(`size-4 animate-spin`,e),...t})}function Bm(e){let t=globalThis.navigator?.clipboard;t?t.writeText(e).catch(e=>console.error(`copying the command failed:`,e)):console.error(`copying needs the clipboard, which this page cannot reach`)}function Vm({command:e,icon:t}){return(0,q.jsxs)(`span`,{className:`ui-cmd`,children:[t&&(0,q.jsx)(X,{icon:t,size:16,className:`ui-ic ui-ic16`}),(0,q.jsx)(`code`,{children:e}),(0,q.jsxs)(xd,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>Bm(e),children:[(0,q.jsx)(X,{icon:Id,"data-icon":`inline-start`}),`Copy`]})]})}var Hm=(0,o.createContext)(null),Um=null,Wm=new Set;function Gm(e){Um=c(e);for(let e of Wm)e()}var Km=e=>e.split("`").map((e,t)=>t%2==1?(0,q.jsx)(`code`,{children:e},t):e),qm={text:``,outgoing:[]};function Jm({store:e,target:t,where:n,to:r}){let i=c(t),a=W(e,e=>e.post),s=W(e,e=>e.drafts[i])??qm,l=(0,o.useContext)(Hm),u=Df().isMobile,f=(0,o.useRef)(null),m=()=>f.current;if((0,o.useLayoutEffect)(()=>{let e=()=>{Um===i&&(Um=null,m()?.focus())};return e(),Wm.add(e),()=>void Wm.delete(e)},[i,a]),a===null)return null;if(a.mode===`off`)return(0,q.jsxs)(dp,{children:[(0,q.jsxs)(gp,{"aria-disabled":`true`,children:[(0,q.jsxs)(vp,{align:`block-start`,children:[(0,q.jsx)(X,{icon:Xd}),(0,q.jsx)(xp,{children:a.reason===`This dashboard was started with --creds, which can only read.`?Km("This dashboard was started with `--creds`, which can only read."):a.reason})]}),(0,q.jsxs)(vp,{align:`block-end`,className:`min-w-0`,children:[(0,q.jsx)(Vm,{command:p(t)}),(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsx)(`span`,{className:`inline-flex shrink-0`,tabIndex:0,children:(0,q.jsx)(bp,{variant:`default`,size:`icon-xs`,disabled:!0,"aria-label":`Send`,children:(0,q.jsx)(X,{icon:Od})})})}),(0,q.jsx)(yf,{children:a.reason})]})]})]}),(0,q.jsx)(pp,{className:`truncate`,children:Km(d(a))})]});let h=s.outgoing.some(e=>e.id===void 0),g=s.refused,_=l!==null&&!h&&s.text.trim()!==``,v=()=>{_&&l.send(t,s.text).catch(()=>void 0)},y=(0,q.jsxs)(bp,{size:u?`icon-xs`:`xs`,disabled:l===null,onClick:()=>{l?.draft(t,`${s.text}@`),m()?.focus()},"aria-label":u?`Mention`:void 0,children:[(0,q.jsx)(X,{icon:Ad,"data-icon":u?void 0:`inline-start`}),!u&&`Mention`]});return(0,q.jsxs)(dp,{"data-invalid":g!==void 0,children:[(0,q.jsxs)(gp,{children:[(0,q.jsx)(Sp,{ref:f,className:`max-h-48`,placeholder:`Message ${n}`,"aria-label":`Message ${n}`,"aria-invalid":g!==void 0,value:s.text,readOnly:l===null,onChange:e=>l?.draft(t,e.currentTarget.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),v())}}),(0,q.jsx)(vp,{align:`block-end`,children:g===void 0?(0,q.jsxs)(q.Fragment,{children:[u?(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsx)(`span`,{className:`inline-flex`,tabIndex:l===null?0:void 0,children:y})}),(0,q.jsx)(yf,{children:`Mention`})]}):y,(0,q.jsxs)(xp,{className:`ml-auto min-w-0`,children:[(0,q.jsx)(`i`,{className:`ui-mode-dot`,style:{background:t.kind===`msg`?`var(--multi)`:`var(--uni)`}}),(0,q.jsx)(`span`,{className:`truncate`,children:r})]}),!u&&(0,q.jsx)(xp,{children:`as operator`}),(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsx)(`span`,{className:`inline-flex`,tabIndex:_?void 0:0,children:(0,q.jsx)(bp,{variant:`default`,size:`icon-xs`,"aria-label":h?`Sending`:`Send`,disabled:!_,onClick:v,children:h?(0,q.jsx)(zm,{}):(0,q.jsx)(X,{icon:Od})})})}),(0,q.jsx)(yf,{children:h?`Sending`:`Send`})]})]}):(0,q.jsx)(bp,{variant:`outline`,size:`sm`,className:`ml-auto`,disabled:!_,onClick:v,children:`Try again`})})]}),g===void 0?(0,q.jsx)(pp,{className:`truncate`,children:Km(d(a))}):(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsx)(mp,{className:`truncate`,children:g})}),(0,q.jsx)(yf,{children:g})]})]})}function Ym({store:e,target:t,shown:n}){let r=W(e,e=>e.drafts[c(t)])??qm;return(0,q.jsx)(q.Fragment,{children:r.outgoing.filter(e=>e.id===void 0||!n.has(e.id)).map(e=>{let t=new Date(e.ts),n=e.id===void 0;return(0,q.jsx)(Lm,{children:(0,q.jsxs)(wp,{align:`end`,children:[(0,q.jsx)(Tp,{children:(0,q.jsx)(ip,{children:(0,q.jsx)(ap,{children:`OP`})})}),(0,q.jsxs)(Ep,{children:[(0,q.jsxs)(Dp,{className:`gap-2`,children:[(0,q.jsx)(`span`,{children:`operator`}),(0,q.jsx)(rp,{variant:`secondary`,children:`operator`}),(0,q.jsx)(`time`,{dateTime:t.toISOString(),children:O(t)}),n&&(0,q.jsx)(`span`,{children:`sending`})]}),(0,q.jsx)(sp,{variant:n?`muted`:`default`,children:(0,q.jsx)(cp,{className:`whitespace-pre-wrap`,children:e.text})})]})]})},e.seq)})})}function Xm({peer:e,name:t,selfId:n}){return(0,q.jsxs)(gp,{children:[(0,q.jsx)(vp,{align:`block-start`,children:(0,q.jsx)(xp,{children:`This conversation is between two agents.`})}),(0,q.jsx)(vp,{align:`block-end`,children:(0,q.jsx)(bp,{asChild:!0,variant:`outline`,size:`sm`,className:`ml-auto`,children:(0,q.jsx)(`a`,{href:De(m(e,n)),onClick:()=>Gm({kind:`dm`,to:e}),children:`Message ${t}`})})})]})}function Zm(e){let t=e.snapshot;return t!==void 0&&(t.asOf!==void 0||Array.isArray(t.members)&&t.members.length>0)}function Qm(e,t){if(e.unreadable!==void 0)return`unreadable`;if(!Zm(e))return`traffic-only`;let n=e.snapshot.asOf;return(n?t-n:1/0)<45e3?`live`:`stale`}function $m(e){return Zm(e)&&e.unreadable===void 0}var eh=e=>e.split(`.`).some(e=>e===`*`||e===`>`);function th(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<n.length;e++){if(n[e]===`>`)return e<r.length;if(e>=r.length||n[e]!==`*`&&n[e]!==r[e])return!1}return n.length===r.length}function nh(e,t,n,r=[]){let i=new Map,a=!1;for(let t of e)if(t===`>`||t===`*`)a=!0;else if(eh(t))for(let e of n)th(t,e)&&i.set(e,`live`);else i.set(t,`live`);for(let e of t)if(eh(e))for(let t of r)!i.has(t)&&th(e,t)&&i.set(t,`durable`);else i.has(e)||i.set(e,`durable`);return{channels:i,wide:a}}function rh(e,t,n,r){let i=new Set,a=[],o=(e,t)=>{e&&!i.has(e)&&(i.add(e),a.push({id:e,source:t}))};if($m(t)){let r=[...n,e];for(let n of t.snapshot.members){let{channels:t,wide:i}=nh(n.live??[],n.durable??[],r);(i||t.has(e))&&o(n.id,`membership`)}return a}for(let t of r)t.msg.channel===e&&o(t.senderId??t.msg.from.id,`traffic`);return a}function ih(e,t,n,r,i){let a=new Set,o=!1;if($m(t)){let r=t.snapshot.members.find(t=>t.id===e);if(r){let e=nh(r.live??[],r.durable??[],n);o=e.wide;for(let t of e.channels.keys())a.add(t)}}else for(let t of r)(t.senderId??t.msg.from?.id)===e&&typeof t.msg.channel==`string`&&a.add(t.msg.channel);let s=new Map;for(let[e,t]of Object.entries(i??{}))(t===`quiet`||t===`muted`)&&s.set(e,t);for(let e of s.keys())a.add(e);return{channels:[...a].sort().map(e=>s.has(e)?{channel:e,mode:s.get(e)}:{channel:e}),wide:o}}function ah({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty`,className: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 oh({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-header`,className:G(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var sh=yd(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-foreground [&_svg:not([class*='size-'])]:size-5`}},defaultVariants:{variant:`default`}});function ch({className:e,variant:t=`default`,...n}){return(0,q.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:G(sh({variant:t,className:e})),...n})}function lh({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-title`,className:G(`text-lg font-medium tracking-tight`,e),...t})}function uh({className:e,...t}){return(0,q.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 dh({className:e,...t}){return(0,q.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 fh=26;function ph({letter:e,slot:t,size:n,offline:r}){let i=n<fh,a=[`ui-idb`,[...e].length>1&&`ui-idb-2`,i&&`ui-idb-dot`,r&&`ui-idb-off`].filter(Boolean).join(` `);return(0,q.jsx)(`i`,{className:a,style:{"--bf":`var(--id-${t})`},"aria-hidden":`true`,children:i?null:e})}var mh={waiting:Bd,working:Ud,idle:Gd,offline:$d},hh=e=>e.charAt(0).toUpperCase()+e.slice(1);function gh({status:e}){return(0,q.jsx)(`i`,{className:`ui-st ui-st-${e}`,role:`img`,"aria-label":hh(e)})}var _h=(e,t)=>e===`working`?`${t} ox-spin`:t,vh={waiting:`default`,working:`secondary`,idle:`outline`,offline:`outline`};function yh({row:e}){let t=Object.hasOwn(mh,e.status)?mh[e.status]:void 0,n=Object.hasOwn(vh,e.status)?vh[e.status]:`outline`;return(0,q.jsxs)(rp,{variant:n,children:[t&&(0,q.jsx)(X,{icon:t,"data-icon":`inline-start`,className:e.status===`working`?`ox-spin`:void 0}),hh(Je(e))]})}var bh={"claude-code":`claude`,claude:`claude`,opencode:`opencode`,codex:`codex`,hermes:`hermes`,pi:`pi`},xh=`guest`,Sh={working:{look:`down`},waiting:{mood:`surprised`,look:`up`}};function Ch(e,t){return Qf(e!==void 0&&Object.hasOwn(bh,e)?bh[e]:xh,Object.hasOwn(Sh,t)?Sh[t]:{})}function wh({vendor:e,status:t,size:n,badge:r,dot:i=!0}){return(0,q.jsxs)(`span`,{className:t===`offline`?`ui-av ui-av-off`:`ui-av`,style:{"--s":`${n}px`},children:[(0,q.jsx)(`svg`,{viewBox:`-2 -4 112 112`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:Ch(e,t)}}),r&&(0,q.jsx)(ph,{letter:r.letter,slot:r.slot,size:n,offline:t===`offline`}),i&&(0,q.jsx)(gh,{status:t})]})}var Th=8;function Eh(e,t){return e.trim()?e:t}function Dh(e){let t=[...e][0];if(t===void 0)return``;let n=/_(\d+)$/.exec(e);return t.toUpperCase()+(n?n[1]:``)}function Oh(e){let[t,...n]=[...e];if(t===void 0)return``;let r=n.find(e=>/\p{L}/u.test(e))??``,i=/_(\d+)$/.exec(e);return t.toUpperCase()+r+(i?i[1]:``)}function kh(e){let t=new Map;for(let n of e)if(n.status!==`offline`){let e=Dh(Eh(n.name,n.id));t.set(e,(t.get(e)??0)+1)}let n=new Map;for(let r of e){let e=Eh(r.name,r.id),i=Dh(e);n.set(r.id,r.status!==`offline`&&(t.get(i)??0)>1?Oh(e):i)}return n}function Ah(e){let t=7;for(let n of e)t=Math.imul(t,31)+n.charCodeAt(0)>>>0;return t%Th+1}var jh=(e,t)=>e.name<t.name?-1:e.name>t.name?1:e.id<t.id?-1:+(e.id>t.id);function Mh(e){let t=new Map,n=new Set,r=e.filter(e=>e.status!==`offline`).sort(jh);for(let e of r){let r=Ah(Eh(e.name,e.id));if(n.size<Th)for(;n.has(r);)r=r%Th+1;n.add(r),t.set(e.id,r)}for(let n of e)n.status===`offline`&&t.set(n.id,Ah(Eh(n.name,n.id)));return t}var Nh=(0,o.createContext)(()=>void 0);function Ph(){return(0,o.useContext)(Nh)}function Fh(e){let t=Mh(e),n=kh(e),r=new Map;for(let i of e){let e=t.get(i.id);e!==void 0&&r.set(i.id,{letter:n.get(i.id)??``,slot:e})}return e=>r.get(e)}var Ih={claude:{label:`Claude Code`,color:`#d97757`,glyph:`◆`,svg:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"/></svg>`},opencode:{label:`OpenCode`,color:`#cdd6e0`,glyph:`▣`,svg:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M22 24H2V0h20zM17 4.8H7v14.4h10z"/></svg>`},codex:{label:`Codex`,color:`#e5e7eb`,glyph:`◉`,svg:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"/></svg>`},hermes:{label:`Hermes`,color:`#a78bfa`,glyph:`➤`,svg:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 3 3 10.5l7 2.5 2.5 7L21 3Z"/><path d="M21 3 10 13"/></svg>`},jcode:{label:`Jcode`,color:`#4ade80`,glyph:`⟨⟩`,svg:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 4 3 12l5 8"/><path d="m16 4 5 8-5 8"/></svg>`},pi:{label:`Pi`,color:`#7dd3fc`,glyph:`π`,svg:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h16"/><path d="M9 7v12"/><path d="M15 7v12c0 1.5 1.5 2 3 1"/></svg>`}};function Lh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Rh(e){if(Array.isArray(e))return e}function zh(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Bh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
43
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vh(e,t){return Rh(e)||zh(e,t)||Hh(e,t)||Bh()}function Hh(e,t){if(e){if(typeof e==`string`)return Lh(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lh(e,t):void 0}}var Uh=Object.entries,Wh=Object.setPrototypeOf,Gh=Object.isFrozen,Kh=Object.getPrototypeOf,qh=Object.getOwnPropertyDescriptor,Jh=Object.freeze,Yh=Object.seal,Xh=Object.create,Zh=typeof Reflect<`u`&&Reflect,Qh=Zh.apply,$h=Zh.construct;Jh||=function(e){return e},Yh||=function(e){return e},Qh||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},$h||=function(e){return new e(...[...arguments].slice(1))};var eg=bg(Array.prototype.forEach),tg=bg(Array.prototype.lastIndexOf),ng=bg(Array.prototype.pop),rg=bg(Array.prototype.push),ig=bg(Array.prototype.splice),ag=Array.isArray,og=bg(String.prototype.toLowerCase),sg=bg(String.prototype.toString),cg=bg(String.prototype.match),lg=bg(String.prototype.replace),ug=bg(String.prototype.indexOf),dg=bg(String.prototype.trim),fg=bg(Number.prototype.toString),pg=bg(Boolean.prototype.toString),mg=typeof BigInt>`u`?null:bg(BigInt.prototype.toString),hg=typeof Symbol>`u`?null:bg(Symbol.prototype.toString),gg=bg(Object.prototype.hasOwnProperty),_g=bg(Object.prototype.toString),vg=bg(RegExp.prototype.test),yg=xg(TypeError);function bg(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Qh(e,t,n)}}function xg(e){return function(){return $h(e,[...arguments])}}function Z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:og;if(Wh&&Wh(e,null),!ag(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Gh(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Sg(e){for(let t=0;t<e.length;t++)gg(e,t)||(e[t]=null);return e}function Cg(e){let t=Xh(null);for(let r of Uh(e)){var n=Vh(r,2);let i=n[0],a=n[1];gg(e,i)&&(t[i]=ag(a)?Sg(a):a&&typeof a==`object`&&a.constructor===Object?Cg(a):a)}return t}function wg(e){switch(typeof e){case`string`:return e;case`number`:return fg(e);case`boolean`:return pg(e);case`bigint`:return mg?mg(e):`0`;case`symbol`:return hg?hg(e):`Symbol()`;case`undefined`:return _g(e);case`function`:case`object`:{if(e===null)return _g(e);let t=e,n=Tg(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:_g(e)}return _g(e)}default:return _g(e)}}function Tg(e,t){for(;e!==null;){let n=qh(e,t);if(n){if(n.get)return bg(n.get);if(typeof n.value==`function`)return bg(n.value)}e=Kh(e)}function n(){return null}return n}function Eg(e){try{return vg(e,``),!0}catch{return!1}}var Dg=Jh(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Og=Jh(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),kg=Jh([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ag=Jh([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),jg=Jh(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Mg=Jh([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ng=Jh([`#text`]),Pg=Jh(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Fg=Jh(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ig=Jh(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Lg=Jh([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Rg=Yh(/{{[\w\W]*|^[\w\W]*}}/g),zg=Yh(/<%[\w\W]*|^[\w\W]*%>/g),Bg=Yh(/\${[\w\W]*/g),Vg=Yh(/^data-[\-\w.\u00B7-\uFFFF]+$/),Hg=Yh(/^aria-[\-\w]+$/),Ug=Yh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wg=Yh(/^(?:\w+script|data):/i),Gg=Yh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Kg=Yh(/^html$/i),qg=Yh(/^[a-z][.\w]*(-[.\w]+)+$/i),Jg=Yh(/<[/\w!]/g),Yg=Yh(/<[/\w]/g),Xg=Yh(/<\/no(script|embed|frames)/i),Zg=Yh(/\/>/i),Qg={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},$g=function(){return typeof window>`u`?null:window},e_=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},t_=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n_=function(e,t,n,r){return gg(e,t)&&ag(e[t])?Z(r.base?Cg(r.base):{},e[t],r.transform):n};function r_(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$g(),t=e=>r_(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==Qg.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Tg(d,`cloneNode`),p=Tg(d,`remove`),m=Tg(d,`nextSibling`),h=Tg(d,`childNodes`),g=Tg(d,`parentNode`),_=Tg(d,`shadowRoot`),v=Tg(d,`attributes`),y=o&&o.prototype?Tg(o.prototype,`nodeType`):null,b=o&&o.prototype?Tg(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw yg(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},O=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},k=function(){return w||=(C=e_(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,N=A.createDocumentFragment,P=A.getElementsByTagName,F=r.importNode,I=t_();t.isSupported=typeof Uh==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let ee=Rg,L=zg,te=Bg,ne=Vg,re=Hg,ie=Wg,R=Gg,z=qg,ae=Ug,B=null,V=Z({},[...Dg,...Og,...kg,...jg,...Ng]),H=null,oe=Z({},[...Pg,...Fg,...Ig,...Lg]),U=Object.seal(Xh(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),se=null,ce=null,le=Object.seal(Xh(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],sg),Ue=Jh([`mi`,`mo`,`mn`,`ms`,`mtext`]),We=Z({},Ue),Ge=Jh([`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=Cg(e),Je=Ye.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,W=Je===`application/xhtml+xml`?sg:og,B=n_(e,`ALLOWED_TAGS`,V,{transform:W}),H=n_(e,`ALLOWED_ATTR`,oe,{transform:W}),Ve=n_(e,`ALLOWED_NAMESPACES`,He,{transform:sg}),Pe=n_(e,`ADD_URI_SAFE_ATTR`,Fe,{transform:W,base:Fe}),Me=n_(e,`ADD_DATA_URI_TAGS`,Ne,{transform:W,base:Ne}),Ae=n_(e,`FORBID_CONTENTS`,je,{transform:W}),se=n_(e,`FORBID_TAGS`,Cg({}),{transform:W}),ce=n_(e,`FORBID_ATTR`,Cg({}),{transform:W}),ke=gg(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Cg(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=Eg(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ug,ze=typeof e.NAMESPACE==`string`?e.NAMESPACE:Re,We=gg(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Cg(e.MATHML_TEXT_INTEGRATION_POINTS):Z({},Ue),Ke=gg(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Cg(e.HTML_INTEGRATION_POINTS):Z({},Ge);let t=gg(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Cg(e.CUSTOM_ELEMENT_HANDLING):Xh(null);if(U=Xh(null),gg(t,`tagNameCheck`)&&Qe(t.tagNameCheck)&&(U.tagNameCheck=t.tagNameCheck),gg(t,`attributeNameCheck`)&&Qe(t.attributeNameCheck)&&(U.attributeNameCheck=t.attributeNameCheck),gg(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(U.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Yh(U),me&&(de=!1),Se&&(xe=!0),ke&&(B=Z({},Ng),H=Xh(null),ke.html===!0&&(Z(B,Dg),Z(H,Pg)),ke.svg===!0&&(Z(B,Og),Z(H,Fg),Z(H,Lg)),ke.svgFilters===!0&&(Z(B,kg),Z(H,Fg),Z(H,Lg)),ke.mathMl===!0&&(Z(B,jg),Z(H,Ig),Z(H,Lg))),le.tagCheck=null,le.attributeCheck=null,gg(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?le.tagCheck=e.ADD_TAGS:ag(e.ADD_TAGS)&&(B===V&&(B=Cg(B)),Z(B,e.ADD_TAGS,W))),gg(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?le.attributeCheck=e.ADD_ATTR:ag(e.ADD_ATTR)&&(H===oe&&(H=Cg(H)),Z(H,e.ADD_ATTR,W))),gg(e,`ADD_URI_SAFE_ATTR`)&&ag(e.ADD_URI_SAFE_ATTR)&&Z(Pe,e.ADD_URI_SAFE_ATTR,W),gg(e,`FORBID_CONTENTS`)&&ag(e.FORBID_CONTENTS)&&(Ae===je&&(Ae=Cg(Ae)),Z(Ae,e.FORBID_CONTENTS,W)),gg(e,`ADD_FORBID_CONTENTS`)&&ag(e.ADD_FORBID_CONTENTS)&&(Ae===je&&(Ae=Cg(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 yg(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw yg(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=D(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=k()),x&&typeof S==`string`&&(S=D(``)));Jh&&Jh(e),Xe=e},et=Z({},[...Og,...kg,...Ag]),tt=Z({},[...jg,...Mg]),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=og(e.tagName),r=og(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){rg(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw yg(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},st=function(e){ut(e);let t=h(e);if(t){let e=[];eg(t,t=>{rg(e,t)}),eg(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},ct=function(e,n){try{rg(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{rg(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(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)===Qg.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===Qg.processingInstruction||n===Qg.comment&&vg(Yg,e.data)){try{p(e)}catch{}continue}if(n===Qg.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=cg(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=lg(e,ee,` `),e=lg(e,L,` `),e=lg(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&&eg(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)===Qg.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&&eg(e,e=>{e.call(t,n,r,Xe)})}let bt=function(e,t){return!!(he&&e.hasChildNodes()&&!vt(e.firstElementChild)&&vg(Jg,e.textContent)&&vg(Jg,e.innerHTML)||he&&e.namespaceURI===Re&&t===`style`&&vt(e.firstElementChild)||e.nodeType===Qg.processingInstruction||he&&e.nodeType===Qg.comment&&vg(Yg,e.data))},xt=function(e,t){if(!se[t]&&Tt(t)&&(U.tagNameCheck instanceof RegExp&&vg(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)===Qg.element&&!at(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&vg(Xg,e.innerHTML))return ot(e),!0;if(me&&e.nodeType===Qg.text){let n=mt(e.textContent);e.textContent!==n&&(rg(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&&vg(ne,t))&&!(ue&&vg(re,t))){if(!i){if(!(Tt(e)&&(U.tagNameCheck instanceof RegExp&&vg(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&vg(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t,e))||t===`is`&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&vg(U.tagNameCheck,r)||U.tagNameCheck instanceof Function&&U.tagNameCheck(r))))return!1}else if(!Pe[t]&&!vg(ae,lg(r,R,``))&&(t!==`src`&&t!==`xlink:href`&&t!==`href`||e===`script`||ug(r,`data:`)!==0||!Me[e])&&(!fe||vg(ie,lg(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[og(e)]&&vg(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):ng(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:dg(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`)&&ug(d,Ee)!==0&&(ct(o,e),d=Ee+d),he&&vg(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||l===`attributename`&&cg(d,`href`)?ct(o,e):n.forceKeepAttr||(n.keepAttr?!pe&&vg(Zg,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)===Qg.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)===Qg.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&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=wg(e),typeof e!=`string`))throw yg(`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=Cg(B)),I.uponSanitizeAttribute.length>0&&(H=Cg(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),yg(`root node is forbidden and cannot be sanitized in-place`)}if(gt(e))throw st(e),yg(`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===Qg.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),eg(t.removed,e=>{e.element&&ut(e.element)})),n}if(c)return eg(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&&vg(Kg,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`&&gg(I,e)&&rg(I[e],t)},t.removeHook=function(e,t){if(gg(I,e)){if(t!==void 0){let n=tg(I[e],t);return n===-1?void 0:ig(I[e],n,1)[0]}return ng(I[e])}},t.removeHooks=function(e){gg(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=t_()},t}var i_=r_();function a_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var o_=a_();function s_(e){o_=e}var c_={exec:()=>null};function l_(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Q(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(d_.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var u_=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),d_={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:l_(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:l_(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:l_(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:l_(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:l_(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:l_(e=>RegExp(`^ {0,${e}}>`))},f_=/^(?:[ \t]*(?:\n|$))+/,p_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,m_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,h_=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,g_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,__=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,v_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,y_=Q(v_).replace(/bull/g,__).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),b_=Q(v_).replace(/bull/g,__).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),x_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,S_=/^[^\n]+/,C_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,w_=Q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,C_).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),T_=Q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,__).getRegex(),E_=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,D_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,O_=Q(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n+|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n+|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n+|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,D_).replace(`tag`,E_).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),k_=e=>Q(x_).replace(`hr`,h_).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,E_).getRegex(),A_=k_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),j_=k_(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/),M_={blockquote:Q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,j_).getRegex(),code:p_,def:w_,fences:m_,heading:g_,hr:h_,html:O_,lheading:y_,list:T_,newline:f_,paragraph:A_,table:c_,text:S_},N_=Q(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,h_).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,E_).getRegex(),P_={...M_,lheading:b_,table:N_,paragraph:Q(x_).replace(`hr`,h_).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,N_).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,E_).getRegex()},F_={...M_,html:Q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,D_).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:c_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Q(x_).replace(`hr`,h_).replace(`heading`,` *#{1,6} *[^
|
|
45
|
-
]`).replace(`lheading`,y_).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},I_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,L_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,R_=/^( {2,}|\\)\n(?!\s*$)/,z_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,B_=/[\p{P}\p{S}]/u,V_=/[\s\p{P}\p{S}]/u,H_=/[^\s\p{P}\p{S}]/u,U_=Q(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,V_).getRegex(),W_=/(?!~)[\p{P}\p{S}]/u,G_=/(?!~)[\s\p{P}\p{S}]/u,K_=/(?:[^\s\p{P}\p{S}]|~)/u,q_=Q(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,u_?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),J_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Y_=Q(J_,`u`).replace(/punct/g,B_).getRegex(),X_=Q(J_,`u`).replace(/punct/g,W_).getRegex(),Z_=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Q_=Q(Z_,`gu`).replace(/notPunctSpace/g,H_).replace(/punctSpace/g,V_).replace(/punct/g,B_).getRegex(),$_=Q(Z_,`gu`).replace(/notPunctSpace/g,K_).replace(/punctSpace/g,G_).replace(/punct/g,W_).getRegex(),ev=Q(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,H_).replace(/punctSpace/g,V_).replace(/punct/g,B_).getRegex(),tv=Q(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,B_).getRegex(),nv=Q(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,H_).replace(/punctSpace/g,V_).replace(/punct/g,B_).getRegex(),rv=Q(/\\(punct)/,`gu`).replace(/punct/g,B_).getRegex(),iv=Q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),av=Q(D_).replace(`(?:-->|$)`,`-->`).getRegex(),ov=Q(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,av).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sv=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,cv=Q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,sv).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lv=Q(/^!?\[(label)\]\[(ref)\]/).replace(`label`,sv).replace(`ref`,C_).getRegex(),uv=Q(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,C_).getRegex(),dv=Q(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,lv).replace(`nolink`,uv).getRegex(),fv=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,pv={_backpedal:c_,anyPunctuation:rv,autolink:iv,blockSkip:q_,br:R_,code:L_,del:c_,delLDelim:c_,delRDelim:c_,emStrongLDelim:Y_,emStrongRDelimAst:Q_,emStrongRDelimUnd:ev,escape:I_,link:cv,nolink:uv,punctuation:U_,reflink:lv,reflinkSearch:dv,tag:ov,text:z_,url:c_},mv={...pv,link:Q(/^!?\[(label)\]\((.*?)\)/).replace(`label`,sv).getRegex(),reflink:Q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,sv).getRegex()},hv={...pv,emStrongRDelimAst:$_,emStrongLDelim:X_,delLDelim:tv,delRDelim:nv,url:Q(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,fv).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Q(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,fv).getRegex()},gv={...hv,br:Q(R_).replace(`{2,}`,`*`).getRegex(),text:Q(hv.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},_v={normal:M_,gfm:P_,pedantic:F_},vv={normal:pv,gfm:hv,breaks:gv,pedantic:mv},yv={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},bv=e=>yv[e];function xv(e,t){if(t){if(d_.escapeTest.test(e))return e.replace(d_.escapeReplace,bv)}else if(d_.escapeTestNoEncode.test(e))return e.replace(d_.escapeReplaceNoEncode,bv);return e}function Sv(e){try{e=encodeURI(e).replace(d_.percentDecode,`%`)}catch{return null}return e}function Cv(e,t){let n=e.replace(d_.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(d_.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(d_.slashPipe,`|`);return n}function wv(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Tv(e){let t=e.split(`
|
|
46
|
-
`),n=t.length-1;for(;n>=0&&d_.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
47
|
-
`)}function Ev(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Dv(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Ov(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function kv(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
48
|
-
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
49
|
-
`)}var Av=class{options;rules;lexer;constructor(e){this.options=e||o_}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Tv(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=kv(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=wv(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:wv(t[0],`
|
|
50
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:wv(t[0],`
|
|
51
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=wv(t[0],`
|
|
52
|
-
`).split(`
|
|
53
|
-
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
54
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
55
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
56
|
-
${s}`:s,r=r?`${r}
|
|
57
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
58
|
-
`+e.join(`
|
|
59
|
-
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
60
|
-
`+e.join(`
|
|
61
|
-
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
62
|
-
`)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=Dv(t[2].split(`
|
|
63
|
-
`,1)[0],t[1].length),l=e.split(`
|
|
64
|
-
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
65
|
-
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
66
|
-
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
67
|
-
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
68
|
-
`+l}u=!l.trim(),r+=p+`
|
|
69
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Tv(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:wv(t[0],`
|
|
70
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Cv(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
71
|
-
`):[],a={type:`table`,raw:wv(t[0],`
|
|
72
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Cv(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:wv(t[0],`
|
|
73
|
-
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
74
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=wv(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Ev(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Ov(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Ov(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},jv=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||o_,this.options.tokenizer=this.options.tokenizer||new Av,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:d_,block:_v.normal,inline:vv.normal};this.options.pedantic?(t.block=_v.pedantic,t.inline=vv.pedantic):this.options.gfm&&(t.block=_v.gfm,t.inline=this.options.breaks?vv.breaks:vv.gfm),this.tokenizer.rules=t}static get rules(){return{block:_v,inline:vv}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(d_.carriageReturn,`
|
|
75
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(d_.tabCharGlobal,` `).replace(d_.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
76
|
-
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
77
|
-
`)?``:`
|
|
78
|
-
`)+i.raw,n.text+=`
|
|
79
|
-
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
80
|
-
`)?``:`
|
|
81
|
-
`)+i.raw,n.text+=`
|
|
82
|
-
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
83
|
-
`)?``:`
|
|
84
|
-
`)+i.raw,r.text+=`
|
|
85
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
86
|
-
`)?``:`
|
|
87
|
-
`)+i.raw,n.text+=`
|
|
88
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``,s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,o))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e,n,o))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Mv=class{options;parser;constructor(e){this.options=e||o_}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(d_.notSpaceStart)?.[0],i=e.replace(d_.endingNewline,``)+`
|
|
89
|
-
`;return r?`<pre><code class="language-`+xv(r)+`">`+(n?i:xv(i,!0))+`</code></pre>
|
|
90
|
-
`:`<pre><code>`+(n?i:xv(i,!0))+`</code></pre>
|
|
91
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
92
|
-
${this.parser.parse(e)}</blockquote>
|
|
93
|
-
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
94
|
-
`}hr(e){return`<hr>
|
|
95
|
-
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
96
|
-
`+r+`</`+i+`>
|
|
97
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
98
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
99
|
-
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
100
|
-
<thead>
|
|
101
|
-
`+t+`</thead>
|
|
102
|
-
`+r+`</table>
|
|
103
|
-
`}tablerow({text:e}){return`<tr>
|
|
104
|
-
${e}</tr>
|
|
105
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
106
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${xv(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Sv(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+xv(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Sv(e);if(i===null)return xv(n);e=i;let a=`<img src="${e}" alt="${xv(n)}"`;return t&&(a+=` title="${xv(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:xv(e.text)}},Nv=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Pv=class e{options;renderer;textRenderer;constructor(e){this.options=e||o_,this.options.renderer=this.options.renderer||new Mv,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Nv}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Fv=class{options;block;constructor(e){this.options=e||o_}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?jv.lex:jv.lexInline}provideParser(e=this.block){return e?Pv.parse:Pv.parseInline}},Iv=new class{defaults=a_();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Pv;Renderer=Mv;TextRenderer=Nv;Lexer=jv;Tokenizer=Av;Hooks=Fv;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Mv(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Av(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Fv;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Fv.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Fv.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return jv.lex(e,t??this.defaults)}parser(e,t){return Pv.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?jv.lex:jv.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Pv.parse:Pv.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?jv.lex:jv.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Pv.parse:Pv.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
107
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+xv(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Iv.parse(e,t)}$.options=$.setOptions=function(e){return Iv.setOptions(e),$.defaults=Iv.defaults,s_($.defaults),$},$.getDefaults=a_,$.defaults=o_,$.use=function(...e){return Iv.use(...e),$.defaults=Iv.defaults,s_($.defaults),$},$.walkTokens=function(e,t){return Iv.walkTokens(e,t)},$.parseInline=Iv.parseInline,$.Parser=Pv,$.parser=Pv.parse,$.Renderer=Mv,$.TextRenderer=Nv,$.Lexer=jv,$.lexer=jv.lex,$.Tokenizer=Av,$.Hooks=Fv,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,Pv.parse,jv.lex,$.setOptions({gfm:!0,breaks:!0});var Lv={ALLOWED_TAGS:[`p`,`br`,`strong`,`em`,`del`,`code`,`pre`,`blockquote`,`ul`,`ol`,`li`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`a`,`hr`,`span`],ALLOWED_ATTR:[`href`,`title`,`target`,`rel`],ALLOWED_URI_REGEXP:/^(?:https?:|mailto:|#|\/)/i},Rv;function zv(){if(Rv)return Rv;let e=i_();if(!e.isSupported)throw Error(`renderMarkdown: DOMPurify cannot sanitize in this environment (no usable DOM), so it refuses to render rather than return unsanitized HTML`);return e.addHook(`afterSanitizeAttributes`,e=>{let t=e;t.tagName===`A`&&t.getAttribute(`href`)&&(t.setAttribute(`target`,`_blank`),t.setAttribute(`rel`,`noopener noreferrer nofollow`))}),Rv=e}function Bv(e){return zv().sanitize(e,Lv)}function Vv(e){return e?Bv($.parse(String(e),{async:!1})):``}function Hv(e){let t=[],n=``,r=()=>{let e=Vv(n);e&&t.push({kind:`html`,html:e}),n=``};for(let i of $.lexer(String(e)))i.type===`code`&&i.codeBlockStyle!==`indented`?(r(),t.push({kind:`code`,lang:String(i.lang??``).trim().split(/\s+/)[0]??``,text:String(i.text)})):n+=i.raw;return r(),t}function Uv({...e}){return(0,q.jsx)(Or,{"data-slot":`collapsible`,...e})}function Wv({...e}){return(0,q.jsx)(Ar,{"data-slot":`collapsible-trigger`,...e})}function Gv({...e}){return(0,q.jsx)(Mr,{"data-slot":`collapsible-content`,...e})}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()},500))},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=De({view:`agent`,id:t,tab:`work`,at:e.id}),d=l?`View ${n}'s work at ${l}`:`View ${n}'s work`,f=(0,o.useId)();return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{ref:c,className:`ui-msg-acts`,children:[(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsxs)(`a`,{href:u,"aria-describedby":f,children:[(0,q.jsx)(X,{icon:kd,size:16,className:`ui-ic ui-ic16`}),`View work`]})}),(0,q.jsx)(yf,{children:d})]}),(0,q.jsx)(`span`,{id:f,className:`ui-sr`,children:d})]}),(0,q.jsx)(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=Ph(),u=tp(),d=()=>t(!1);return(0,q.jsx)(nf,{open:e,onOpenChange:t,children:(0,q.jsxs)(of,{side:`bottom`,...u,children:[(0,q.jsxs)(sf,{className:`flex-row items-center gap-3`,children:[(0,q.jsx)(wh,{vendor:a.harness,status:a.status,size:28,dot:!1,badge:l(r)}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsx)(lf,{children:i}),(0,q.jsx)(uf,{children:o?`Message at ${o}`:`Message`})]})]}),(0,q.jsxs)(cf,{children:[(0,q.jsx)(xd,{asChild:!0,variant:`ghost`,className:`justify-start`,children:(0,q.jsxs)(`a`,{href:s,onClick:d,children:[(0,q.jsx)(X,{icon:kd,"data-icon":`inline-start`}),`View ${i}'s work here`]})}),(0,q.jsxs)(xd,{type:`button`,variant:`ghost`,className:`justify-start`,onClick:()=>{d(),c(r)},children:[(0,q.jsx)(X,{icon:ef,"data-icon":`inline-start`}),`View agent`]}),(0,q.jsxs)(xd,{type:`button`,variant:`ghost`,className:`justify-start`,onClick:()=>{Bm(T(n.parts)),d()},children:[(0,q.jsx)(X,{icon:Id,"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,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsxs)(rp,{variant:`outline`,children:[`unverified`,(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${Zv}`})]})}),(0,q.jsx)(yf,{children:Zv})]})}function ey(e){let t=e===`claude-code`?`claude`:e;return Object.hasOwn(Ih,t)?Ih[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=Ph(),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:Vv(_)},w=Fe(t??e.from,r),E=t!==void 0&&i.has(t)?m(t):void 0,D=(0,q.jsx)(wh,{vendor:g?.harness,status:g?.status??`offline`,size:32,dot:!1,badge:E});return(0,q.jsxs)(wp,{align:s?`end`:`start`,children:[(0,q.jsx)(Tp,{className:`overflow-visible`,children:(S===`alone`||S===`last`)&&(p&&t!==void 0?(0,q.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":w,onClick:()=>p(t),children:D}):D)}),(0,q.jsxs)(Ep,{children:[(S===`alone`||S===`first`)&&(0,q.jsxs)(Dp,{className:`flex-wrap gap-2`,children:[p&&t!==void 0?(0,q.jsx)(xd,{type:`button`,variant:`link`,size:`xs`,className:`h-auto p-0`,onClick:()=>p(t),children:w}):(0,q.jsx)(`span`,{children:w}),t===void 0&&(0,q.jsx)($v,{}),u&&(0,q.jsx)(rp,{variant:`secondary`,children:u}),u===void 0&&g?.role&&(0,q.jsx)(rp,{variant:`secondary`,children:g.role}),u===void 0&&g?.harness&&(0,q.jsx)(rp,{variant:`outline`,children:ey(g.harness)}),x&&(0,q.jsx)(`time`,{dateTime:x.toISOString(),children:O(x)})]}),(0,q.jsx)(sp,{variant:s?`default`:y?`tinted`:`secondary`,children:(0,q.jsx)(cp,{children:v?(0,q.jsxs)(Uv,{open:d,onOpenChange:f,children:[(0,q.jsx)(Gv,{forceMount:!0,className:d?`ui-tx`:`ui-tx ui-clamp`,dangerouslySetInnerHTML:C}),(0,q.jsx)(Wv,{asChild:!0,children:(0,q.jsxs)(xd,{type:`button`,variant:`ghost`,size:`xs`,children:[d?`Show less`:`Show more`,(0,q.jsx)(X,{icon:Td,"data-icon":`inline-end`,className:`group-data-open/button:rotate-180`})]})})]}):(0,q.jsx)(`div`,{className:`ui-tx`,dangerouslySetInnerHTML:C})})}),n===`anycast`&&b!==void 0&&(0,q.jsxs)(Op,{className:`flex-wrap gap-1.5`,children:[(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsxs)(rp,{variant:`outline`,children:[(0,q.jsx)(`i`,{className:`ui-mode-dot`,style:{background:`var(--any)`}}),`To any ${b}`,(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${Qv}`})]})}),(0,q.jsx)(yf,{children:Qv})]}),l!==void 0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{children:` · claimed by ${Fe(l.id,r)}`}),!l.verified&&(0,q.jsx)($v,{})]})]})]}),t!==void 0&&g!==void 0&&i.has(t)&&(0,q.jsx)(qv,{msg:e,senderId:t,name:w,peer:g,onViewAgent:p??ny})]})}var ny=()=>void 0,ry=yd(`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,q.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:G(ry({variant:t}),e),...n})}function ay({className:e,...t}){return(0,q.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,q.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,q.jsx)(`div`,{"data-slot":`alert-action`,className:G(`absolute top-2.5 right-3`,e),...t})}var cy=yd(`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,q.jsx)(Pu,{"data-slot":`toggle`,className:G(cy({variant:t,size:n,className:e})),...r})}function uy(){let{isMobile:e,open:t,openMobile:n}=Df(),r=(0,o.useRef)(null),i=(0,o.useRef)(n);(0,o.useEffect)(()=>{i.current&&!n&&r.current?.focus(),i.current=n},[n]);let a=e?`Open sidebar`:`Toggle sidebar`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsx)(Af,{ref:r,"aria-label":a,"aria-haspopup":e?`dialog`:void 0,"aria-expanded":e?n:t})}),(0,q.jsx)(yf,{children:a})]}),(0,q.jsx)(mf,{orientation:`vertical`,className:`data-vertical:h-4 data-vertical:self-auto`})]})}var dy=yd(`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 fy({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?Xt:`div`;return(0,q.jsx)(i,{"data-slot":`marker`,"data-variant":t,className:G(dy({variant:t,className:e})),...r})}function py({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`marker-icon`,"aria-hidden":`true`,className:G(`size-4 shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...t})}function my({className:e,...t}){return(0,q.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 hy(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 gy=(e,t)=>typeof t==`number`&&Number.isFinite(t)?Math.max(0,e-t):void 0;function _y(e,t){let n=[],r=gy(t,e.condition?.since);e.condition&&n.push(`${e.condition.code}${r===void 0?``:` for ${hy(r)}`}`);let i=gy(t,e.statusSince);i!==void 0&&n.push(`unchanged for ${hy(i)}`);let a=gy(t,e.activeAt);a!==void 0&&n.push(`active ${hy(a)} ago`);let o=e.activity?gy(t,e.activitySince):void 0;return o!==void 0&&n.push(`activity set ${hy(o)} ago`),n.join(` · `)}var vy=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0,yy={dnd:{icon:Kd,word:`Do not disturb`,color:`var(--uni-ink)`,title:`Channel messages wait for its next turn. DMs and mentions still wake it.`},focus:{icon:Zd,word:`Focus`,color:`var(--multi-ink)`,title:`Channel messages stay in the channel. DMs and role requests still reach it.`}};function by({attention:e}){if(e===void 0||!Object.hasOwn(yy,e))return null;let t=yy[e];return(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsxs)(`span`,{className:`v3-meta`,style:{color:t.color},children:[(0,q.jsx)(X,{icon:t.icon,size:16,className:`ui-ic ui-ic16`}),t.word,(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${t.title}`})]})}),(0,q.jsx)(yf,{children:t.title})]})}var xy=[];function Sy(e,t){(0,o.useEffect)(()=>{if(e)return e.openSession(t),()=>e.closeSession(t)},[e,t])}function Cy(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 wy(e,t){let n=W(e,e=>e.sessions[t]?.posts)??xy,r=W(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 Ty(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 Ey({className:e,...t}){return(0,q.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 Dy({className:e,status:t,...n}){return(0,q.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 Oy({className:e,...t}){return(0,q.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 ky({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`trace-title`,className:G(`min-w-0 truncate motion-reduce:shimmer-none`,e),...t})}function Ay({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`trace-description`,className:G(`shrink-0 text-muted-foreground/70 tabular-nums`,e),...t})}function jy({className:e,...t}){return(0,q.jsx)(Uv,{"data-slot":`trace-collapsible`,className:G(`flex w-full min-w-0 flex-col`,e),...t})}function My({className:e,children:t,...n}){return(0,q.jsxs)(Wv,{"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,q.jsx)(Oy,{className:`transition-transform group-aria-expanded/trace-collapsible-trigger:rotate-90`,children:(0,q.jsx)(Cd,{icon:Dd,strokeWidth:2})})]})}function Ny({className:e,children:t,...n}){return(0,q.jsx)(Gv,{"data-slot":`trace-collapsible-content`,className:`min-w-0 overflow-hidden duration-200 [--radix-accordion-content-height:var(--radix-collapsible-content-height)] data-open:animate-accordion-down data-closed:animate-accordion-up`,...n,children:(0,q.jsx)(`div`,{"data-slot":`trace-collapsible-content-inner`,className: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 Py({line:e,words:t}){let[n,r]=(0,o.useState)(!1);return(0,q.jsxs)(_f,{open:n,onOpenChange:r,children:[(0,q.jsx)(vf,{type:`button`,className:`ox-tip`,onClick:e=>{e.preventDefault(),r(!n)},children:e}),(0,q.jsx)(yf,{className:`ox-tipc`,sideOffset:4,children:t})]})}function Fy(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 Iy(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 Ly({call:e,payloadRead:t}){let n=t?t.status===`refused`?`read refused`:`read failed`:`not received`;return(0,q.jsx)(`div`,{className:`ox-payloads`,children:[[`Input`,e.input],[`Result`,e.result]].map(([e,r])=>(0,q.jsxs)(`details`,{className:`ox-payload`,children:[(0,q.jsxs)(`summary`,{children:[e,r===void 0?` · ${n}`:``]}),(0,q.jsx)(`pre`,{children:r===void 0?t?.reason??`No payload received. It may be withheld or outside the retained window.`:Iy(r)})]},e))})}var Ry={command:Fd,edit:Rd,write:Rd,read:Ld,send:qd,dm:qd,inbox:Vd,other:tf},zy=e=>Ry[e],By=`The connector reports the call returned an error. Open Input or Result for any received payload.`,Vy=`The connector reports the call returned an error. Open Input or Result for any received payload.`;function Hy(e,t){if(t===`running`)return(0,q.jsx)(zm,{role:void 0,"aria-label":void 0,"aria-hidden":!0});let n=t===`failed`?Pd:t===`pending`?Bd:t===`noResult`?$d:zy(e.kind);return(0,q.jsx)(X,{icon:n,size:16})}function Uy({call:e,state:t,shimmer:n=!0,className:r,payloadRead:i}){let a=Fy(t===`running`),o=Ty(t),s=t===`running`?n?`running`:void 0:t===`failed`?`error`:t===`pending`||t===`noResult`?`pending`:void 0,c=ge(e,t,a),l=le(e.name),u=[`ox-line`,r,o].filter(Boolean).join(` `),d=e.full===l?void 0:e.full,f=d===void 0?(0,q.jsx)(`code`,{children:l}):(0,q.jsxs)(`code`,{children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,children:l}),(0,q.jsx)(`span`,{className:`ui-sr`,children:d})]}),p=t===`called`&&d!==void 0,m=(0,q.jsxs)(ky,{children:[ue(e.kind,t,e.name),p&&(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${d}`})]}),h=(0,q.jsxs)(Dy,{status:s,role:s===`running`?`status`:void 0,className:u,children:[(0,q.jsx)(Oy,{children:Hy(e,t)}),p?(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:m}),(0,q.jsx)(yf,{children:d})]}):m,` `,c&&(0,q.jsx)(Ay,{children:t===`called`?c:(0,q.jsxs)(q.Fragment,{children:[d===void 0||t===`failed`?f:(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:f}),(0,q.jsx)(yf,{children:d})]}),t===`running`?(0,q.jsx)(`span`,{"aria-hidden":`true`,children:c.slice(l.length)}):c.slice(l.length)]})})]},t);return(0,q.jsxs)(`div`,{className:`ox-call`,children:[t===`failed`?(0,q.jsx)(Py,{line:h,words:e.kind===`command`?By:Vy}):h,(0,q.jsx)(Ly,{call:e,payloadRead:i})]})}function Wy({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(Su,{"data-slot":`tabs`,"data-orientation":t,className:G(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Gy=yd(`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 Ky({className:e,variant:t=`default`,...n}){return(0,q.jsx)(wu,{"data-slot":`tabs-list`,"data-variant":t,className:G(Gy({variant:t}),e),...n})}function qy({className:e,...t}){return(0,q.jsx)(Eu,{"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 Jy({className:e,...t}){return(0,q.jsx)(Ou,{"data-slot":`tabs-content`,className:G(`flex-1 text-sm outline-none`,e),...t})}function Yy({children:e,action:t}){return(0,q.jsxs)(iy,{role:`note`,className:`mb-2`,children:[(0,q.jsx)(X,{icon:Hd}),(0,q.jsx)(oy,{children:e}),t&&(0,q.jsx)(sy,{children:t})]})}function Xy({row:e}){let t=Object.hasOwn(mh,e.status)?mh[e.status]:void 0,n=Je(e),r=Ty(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,q.jsxs)(`div`,{className:r?`ox-foot ${r}`:`ox-foot`,children:[(0,q.jsx)(`span`,{className:`v3-spill v3-s-${e.status}`,children:t&&(0,q.jsx)(X,{icon:t,size:16,className:`ui-ic`})}),(0,q.jsx)(`b`,{children:e.name}),` is ${n} `,a&&(0,q.jsx)(`span`,{className:e.status===`waiting`?`ox-foot-wait`:void 0,children:a})]},e.status)}var Zy=()=>Promise.all([Yf(()=>import(`./core-Bfff_dYO.js`),__vite__mapDeps([0,1])),Yf(()=>import(`./engine-javascript-C30F4iNc.js`),[])]),Qy=new Map([[`javascript`,()=>Yf(()=>import(`./javascript-BgS3c2Ky.js`),[])],[`typescript`,()=>Yf(()=>import(`./typescript-bsJCZSQ-.js`),[])],[`json`,()=>Yf(()=>import(`./json-qhed-kSA.js`),[])],[`bash`,()=>Yf(()=>import(`./bash-CLZ0U2zV.js`),[])],[`diff`,()=>Yf(()=>import(`./diff-woXpYk--.js`),[])],[`python`,()=>Yf(()=>import(`./python-gzcpVVnB.js`),[])],[`yaml`,()=>Yf(()=>import(`./yaml-rwi0_p6S.js`),[])],[`markdown`,()=>Yf(()=>import(`./markdown-BYOwaDjH.js`),[])]]),$y=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`]]),eb=`cotal`,tb=1e3,nb,rb=new Map;function ib(){return nb??=Zy().then(([{createHighlighterCore:e,createCssVariablesTheme:t},{createJavaScriptRegexEngine:n}])=>e({themes:[t({name:eb,variablePrefix:`--shiki-`,fontStyle:!1})],langs:[],engine:n({forgiving:!0})})).catch(e=>{throw nb=void 0,e}),nb}function ab(e,t){let n=rb.get(t);return n||(n=e.loadLanguage(Qy.get(t)).catch(e=>{throw rb.delete(t),e}),rb.set(t,n)),n}async function ob(e,t){let n=$y.get(t.toLowerCase());if(n!==void 0&&!(e.length>2e4))try{let t=await ib();return await ab(t,n),t.codeToTokens(e,{lang:n,theme:eb,tokenizeMaxLineLength:tb}).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 sb=yd(`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 cb({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,q.jsx)(`div`,{"data-slot":`code-block`,"data-variant":t,"data-size":n,className:G(sb({variant:t}),e),...r})}function lb({className:e,...t}){return(0,q.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 ub({className:e,...t}){return(0,q.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 db({className:e,children:t,style:n,wrap:r=!1,lineNumbers:i=!1,startLine:a=1,...o}){return(0,q.jsx)(`pre`,{"data-slot":`code-block-content`,"data-wrap":r||void 0,"data-numbered":i||void 0,dir:`ltr`,tabIndex:0,style:{counterReset:`line ${a-1}`,...n},className: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,q.jsx)(`code`,{"data-slot":`code-block-code`,className:`grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0`,children:i&&typeof t==`string`?t.replace(/\n$/,``).split(`
|
|
108
|
-
`).map((e,t)=>(0,q.jsx)(pb,{children:e},t)):t})})}var fb=yd(`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 pb({className:e,variant:t=`default`,children:n,...r}){let i=n==null||n===``||Array.isArray(n)&&n.length===0;return(0,q.jsx)(`span`,{"data-slot":`code-block-line`,"data-variant":t,className:G(fb({variant:t}),e),...r,children:(0,q.jsx)(`span`,{"data-slot":`code-block-line-content`,className:`min-w-0`,children:i?`
|
|
109
|
-
`:n})})}function mb({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 ob(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&&le(e,24);return(0,q.jsxs)(cb,{ref:n,size:`sm`,className:`ox-code`,children:[(0,q.jsxs)(lb,{className:`ox-code-h`,children:[s&&(s===e?(0,q.jsx)(`span`,{children:e}):(0,q.jsxs)(_f,{children:[(0,q.jsx)(vf,{asChild:!0,children:(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,children:s}),(0,q.jsx)(`span`,{className:`ui-sr`,children:e})]})}),(0,q.jsx)(yf,{children:e})]})),` `,(0,q.jsx)(ub,{className:`ox-code-acts`,children:(0,q.jsxs)(xd,{type:`button`,variant:`ghost`,size:`xs`,onClick:()=>Bm(t),children:[(0,q.jsx)(X,{icon:Id,"data-icon":`inline-start`}),`Copy`]})})]}),(0,q.jsx)(db,{className:`ox-code-c`,children:a?a.map((e,t)=>(0,q.jsx)(pb,{children:e.map((e,t)=>(0,q.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))},t)):t})]})}var hb=280,gb=e=>e.replace(/<[^>]*>/g,``).length;function _b({src:e,className:t,clamp:n=!0}){let r=(0,o.useMemo)(()=>Hv(e),[e]),[i,a]=(0,o.useState)(!1),s=n&&r.some(e=>e.kind===`html`&&gb(e.html)>hb);return(0,q.jsxs)(`div`,{className:t,children:[r.map((e,t)=>e.kind===`code`?(0,q.jsx)(mb,{lang:e.lang,text:e.text},t):(0,q.jsx)(`div`,{className:s&&!i&&gb(e.html)>hb?`ox-prose ui-clamp`:`ox-prose`,dangerouslySetInnerHTML:{__html:e.html}},t)),s&&(0,q.jsx)(xd,{type:`button`,variant:`link`,size:`sm`,className:`px-0`,"aria-expanded":i,onClick:()=>a(!i),children:i?`Show less`:`Show more`})]})}function vb({ts:e}){let t=D(e);return t?(0,q.jsx)(`time`,{dateTime:t.toISOString(),children:O(t)}):null}function yb({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=De(s?{view:`dm`,peer:t,...r===void 0?{}:{with:r}}:{view:`channel`,channel:n});return(0,q.jsxs)(`div`,{className:c,"data-post":e.id,children:[(0,q.jsxs)(`div`,{className:`ox-post-h`,children:[(0,q.jsx)(X,{icon:s?Md:zd,size:16}),(0,q.jsx)(`span`,{children:s?`Sent to ${i??r??``}`:`Posted in #${n}`}),(0,q.jsx)(vb,{ts:e.ts}),!a&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`ui-sp`}),(0,q.jsxs)(`a`,{className:`ox-act`,href:l,children:[s?`Open conversation`:`Open in #${n}`,(0,q.jsx)(X,{icon:kd,size:16})]})]})]}),(0,q.jsx)(_b,{className:`ui-tx`,src:T(e.parts),clamp:!a})]})}var bb=(e,t)=>t?`${e} …`:e,xb=/^ {0,3}```/gm;function Sb(e,t){return t?(e.match(xb)??[]).length%2==1?`${e}\n\`\`\`\n …`:`${e} …`:e}function Cb({text:e,cut:t,compact:n=!1}){return(0,q.jsx)(_b,{className:`ox-said`,src:Sb(e,t),clamp:!n})}var wb=280;function Tb({text:e,cut:t}){let[n,r]=(0,o.useState)(!1),i=Sb(e,t),a=i.length>wb;return(0,q.jsxs)(`div`,{className:`ui-prompt`,children:[(0,q.jsx)(`span`,{children:`Prompt`}),(0,q.jsx)(`div`,{className:a&&!n?`ui-tx ui-clamp`:`ui-tx`,dangerouslySetInnerHTML:{__html:Vv(i)}}),a&&(0,q.jsx)(xd,{type:`button`,variant:`link`,size:`sm`,className:`px-0`,"aria-expanded":n,onClick:()=>r(!n),children:n?`Show less`:`Show more`})]})}function Eb({text:e,cut:t}){return(0,q.jsxs)(jy,{children:[(0,q.jsx)(My,{className:`ox-trig`,children:(0,q.jsxs)(Dy,{className:`ox-line`,children:[(0,q.jsx)(Oy,{children:(0,q.jsx)(X,{icon:jd,size:16})}),(0,q.jsx)(ky,{children:`Reasoning`})]})}),(0,q.jsx)(Ny,{className:`ox-cc`,children:(0,q.jsx)(`div`,{className:`ox-think`,children:bb(e,t)})})]})}function Db({ts:e,condition:t}){return(0,q.jsxs)(iy,{variant:`destructive`,role:`note`,children:[(0,q.jsx)(X,{icon:wd}),(0,q.jsx)(ay,{children:D(e)?(0,q.jsxs)(q.Fragment,{children:[`Turn failed at `,(0,q.jsx)(vb,{ts:e})]}):`Turn failed`}),(0,q.jsxs)(oy,{children:[(0,q.jsx)(`div`,{children:`The event plane doesn't say why.`}),t!==void 0&&(0,q.jsxs)(`div`,{children:[`Presence reports `,(0,q.jsx)(`code`,{children:t.code}),D(t.since)&&(0,q.jsxs)(q.Fragment,{children:[` since `,(0,q.jsx)(vb,{ts:t.since})]}),`.`]})]})]})}function Ob(e,t){if(!t)return tf;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?zy(i[0][0]):tf}function kb({calls:e,at:t,toolStatus:n,line:r=!1,className:i,payloadRead:a}){let{title:o,failed:s}=de(e,n),c=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Oy,{children:(0,q.jsx)(X,{icon:Ob(e,n),size:16})}),(0,q.jsxs)(ky,{children:[o,s>0&&(0,q.jsxs)(q.Fragment,{children:[`, `,(0,q.jsxs)(`span`,{className:`ox-fail`,children:[(0,q.jsx)(X,{icon:Pd,size:16}),`${s} failed`]})]})]})]});return r?(0,q.jsx)(Dy,{className:i?`ox-line ${i}`:`ox-line`,children:c}):(0,q.jsxs)(jy,{className:i,children:[(0,q.jsx)(My,{className:`ox-trig`,children:(0,q.jsxs)(Dy,{className:`ox-line`,children:[c,` `,(0,q.jsx)(Ay,{children:_e(e,n)})]})}),(0,q.jsx)(Ny,{className:`ox-cc`,children:(0,q.jsx)(Ey,{className:`ox-calls`,children:e.map(e=>(0,q.jsx)(Uy,{payloadRead:a,call:e,state:V(e,{...t,toolStatus:n})},e.key))})})]})}var Ab=(0,o.createContext)(()=>!1),jb=new Set([`done`,`failed`,`called`]);function Mb({step:e,at:t,toolStatus:n,compact:r,payloadRead:i}){let a=(0,o.useContext)(Ab),s=e.calls.map(e=>V(e,{...t,toolStatus:n})),c=e.calls.length>=2&&s.every(e=>jb.has(e)),l=Ty(c?`group`:`lines`),[u,d]=(0,o.useState)(c),[f,p]=(0,o.useState)(!1);if(u!==c&&(d(c),p(c)),c)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(kb,{payloadRead:i,calls:e.calls,at:t,toolStatus:n,line:r,className:l},`group`),f&&(0,q.jsx)(`div`,{className:`ox-fold`,"aria-hidden":`true`,style:{"--fold-n":e.calls.length-1},onAnimationEnd:()=>p(!1),children:e.calls.slice(1).map((e,t)=>(0,q.jsx)(Uy,{payloadRead:i,call:e,state:s[t+1]},e.key))})]});let m=s.lastIndexOf(`running`);return(0,q.jsx)(q.Fragment,{children:e.calls.map((e,t)=>(0,q.jsx)(Uy,{payloadRead:i,call:e,state:s[t],shimmer:t===m,className:t>0&&a(e)?`ui-in`:void 0},e.key))})}function Nb({ts:e}){return(0,q.jsxs)(Dy,{className:`ox-line`,children:[(0,q.jsx)(Oy,{children:(0,q.jsx)(X,{icon:Qd,size:16})}),(0,q.jsx)(ky,{children:`Turn ended`}),` `,(0,q.jsx)(Ay,{children:(0,q.jsx)(vb,{ts:e})})]})}function Pb({label:e,ts:t}){return(0,q.jsxs)(Dy,{className:`ox-line`,children:[(0,q.jsx)(Oy,{children:(0,q.jsx)(X,{icon:Hd,size:16})}),(0,q.jsx)(ky,{children:e}),` `,(0,q.jsx)(Ay,{children:(0,q.jsx)(vb,{ts:t})})]})}function Fb({step:e,turn:t,trailing:n,ctx:r,condition:i}){switch(e.kind){case`prompt`:return r.compact?null:(0,q.jsx)(Tb,{text:e.text,cut:e.cut});case`reasoning`:return r.compact?null:(0,q.jsx)(Eb,{text:e.text,cut:e.cut});case`said`:return(0,q.jsx)(Cb,{text:e.text,cut:e.cut,compact:r.compact});case`tools`:return(0,q.jsx)(Mb,{payloadRead:r.payloadRead,step:e,at:{turn:t,trailing:n,status:r.row.status},toolStatus:r.toolStatus,compact:r.compact});case`post`:return(0,q.jsx)(yb,{msg:e.msg,agent:r.row.id,...e.channel===void 0?{to:e.to,toName:r.nameOf(e.to??``)}:{channel:e.channel},compact:r.compact,highlight:r.highlight!==void 0&&e.msg.id===r.highlight});case`runError`:return(0,q.jsx)(Db,{ts:e.ts,condition:i});case`unknown`:return(0,q.jsx)(Pb,{label:e.label,ts:e.ts})}}function Ib({turn:e,row:t}){let n=e.outcome===`open`&&!e.superseded,r=n&&t.status===`working`,i=Fy(n&&(t.status===`working`||t.status===`waiting`)),{title:a,failed:o}=pe(e,t.status,i),s=he(e),c=r?(0,q.jsx)(zm,{className:`ox-live`,role:void 0,"aria-label":void 0,"aria-hidden":!0}):(0,q.jsx)(X,{icon:e.outcome===`finished`?Qd:e.outcome===`failed`?wd:n&&t.status===`waiting`?Bd:$d,size:16});return(0,q.jsxs)(Dy,{status:e.outcome===`failed`?`error`:void 0,className:`ox-line`,children:[(0,q.jsx)(Oy,{children:c}),(0,q.jsxs)(ky,{children:[r?(0,q.jsx)(`b`,{children:a}):a,o!==void 0&&(0,q.jsxs)(q.Fragment,{children:[`, `,(0,q.jsxs)(`span`,{className:`ox-fail`,children:[(0,q.jsx)(X,{icon:Pd,size:16}),o]})]})]}),` `,s&&(0,q.jsx)(Ay,{children:s})]})}function Lb({turn:e,row:t,toolStatus:n,defaultOpen:r,highlight:i,condition:a,nameOf:s}){let c=(0,o.useContext)(Ab),[l,u]=(0,o.useState)(void 0),d=l??r,f={row:t,toolStatus:n,compact:!1,nameOf:s,...i===void 0?{}:{highlight:i}},p=e.steps.at(-1),m=e.steps.findLast(e=>e.kind!==`runError`);return(0,q.jsxs)(jy,{open:d,onOpenChange:u,children:[(0,q.jsx)(My,{className:`ox-trig`,children:(0,q.jsx)(Ib,{turn:e,row:t})}),(0,q.jsx)(Ny,{className:`ox-cc`,children:(0,q.jsx)(Ey,{className:`ox-turn`,children:e.steps.map(t=>(0,q.jsx)(`div`,{className:c(t)?`ox-step ui-in`:`ox-step`,children:(0,q.jsx)(Fb,{step:t,turn:e,trailing:t===m,ctx:f,condition:t===p?a:void 0})},t.key))})})]})}function Rb(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 zb(e,t){let n=(0,o.useRef)(void 0),r=n.current?.id===t?n.current:void 0;return(0,o.useEffect)(()=>{let r=Rb(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 Bb(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 Vb({work:e,row:t,highlight:n,compact:r=!1,condition:i,nameOf:a,payloadRead:o}){let s=zb(e.items,t.id),c=Bb(e.items,n),l={row:t,payloadRead:o,toolStatus:e.toolStatus,compact:r,nameOf:a,...n===void 0?{}:{highlight:n}},u=e=>!r||e.kind!==`prompt`&&e.kind!==`reasoning`,d=e.items.at(-1),f=(e,t,n,r)=>(0,q.jsx)(`div`,{className:s(e)?`ox-step ui-in`:`ox-step`,children:e.kind===`turnEnd`?(0,q.jsx)(Nb,{ts:e.ts}):(0,q.jsx)(Fb,{step:e,turn:t,trailing:n,ctx:l,condition:r})},e.key);return(0,q.jsx)(Ab.Provider,{value:s,children:(0,q.jsxs)(Ey,{className:r?`ox-work ox-compact`:`ox-work`,children:[o&&(0,q.jsxs)(Yy,{children:[o.reason,` Work metadata is still shown.`]}),!e.toolStatus&&(0,q.jsx)(Yy,{children:`${t.name}'s connector reports which tools it calls but not when they finish, so Work can't show running, done or failed. A connector that reports tool results shows them here once ${t.name} restarts on it.`}),e.items.filter(u).map(o=>{if(o.kind!==`turn`)return f(o,void 0,o===d,o===d?i:void 0);if(r){let e=o.steps.findLast(e=>e.kind!==`runError`),t=o.steps.at(-1);return o.steps.filter(u).map(n=>f(n,o,n===e,o===d&&n===t?i:void 0))}return(0,q.jsx)(`div`,{className:s(o)?`ox-step ui-in`:`ox-step`,children:(0,q.jsx)(Lb,{turn:o,row:t,toolStatus:e.toolStatus,defaultOpen:o===c,highlight:n,condition:o===d?i:void 0,nameOf:a})},o.key)}),!r&&(0,q.jsx)(Xy,{row:t})]})})}var Hb=(0,o.createContext)(e=>je(globalThis,e)),Ub=e=>Number.isSafeInteger(e)&&e>=0,Wb=e=>e&&typeof e==`object`?e.msg||e:void 0;function Gb(e){try{let t=Wb(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`&&Ub(e.seq))return e;return}catch{return}}function Kb(e,t){let n=Wb(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 qb(){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=Gb(e);if(!a)return{emit:[e],held:!1,notes:[]};if(!n)return t.push(e),{emit:[],held:!0,notes:[]};let o=Kb(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=Gb(e);if(!t)continue;let n=r(Kb(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:Gb(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=Kb(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 Jb=500,Yb=250,Xb=2e3,Zb={text:``,outgoing:[]};function Qb(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 $b=e=>typeof e==`number`&&Number.isFinite(e)?e:0;function ex(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 tx(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 nx(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)=>$b(e.msg.ts)-$b(t.msg.ts)).slice(-500)}function rx(e,t,n={}){let r=n.createOrder??(()=>qb()),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]??Zb)}})),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=ex(e.frames,a.frames,!1),n=tx(t===e.frames?t:t.slice().sort((e,t)=>$b(e.ts)-$b(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&&Ge([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=Qb(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:Qb(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(Qb(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)})},Yb)))}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>Jb&&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>Jb&&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`,Ye(t))},onMessage:se,onMembership(t){p.add(`membership`),e.set({membership:{snapshot:t}});for(let e of t.members)for(let t of[...e.live??[],...e.durable??[]])/[*>]/.test(t)||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]??Zb).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}`:Fe(n.to,Ne(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]??Zb,outgoing:(e.drafts[a]??Zb).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:nx(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,Xb),!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=ex(n.frames,[t.msg],!0);if(r===n.frames)return{};let i=tx(r);return{sessions:{...e.sessions,[t.id]:{...n,frames:i.frames,more:n.more||i.dropped}}}})}}}export{Qm as $,K as $n,Xd as $t,ty as A,to as An,h as Ar,Lf as At,yh as B,Ur as Bn,Df as Bt,py as C,wo as Cn,E as Cr,$f as Ct,iy as D,uo as Dn,x as Dr,Pf as Dt,cy as E,po as En,y as Er,kf as Et,Fh as F,li as Fn,a as Fr,Hf as Ft,uh as G,Y as Gn,hf as Gt,hh as H,br as Hn,yf as Ht,Ph as I,di as In,r as Ir,Vf as It,lh as J,J as Jn,nf as Jt,oh as K,kn as Kn,pf as Kt,wh as L,pi as Ln,zf as Lt,ey as M,Va as Mn,p as Mr,Mf as Mt,Yv as N,Mi as Nn,_ as Nr,jf as Nt,oy as O,xo as On,c as Or,Nf as Ot,Nh as P,Ei as Pn,f as Pr,Rf as Pt,nh as Q,Yt as Qn,Qd as Qt,Ch as R,fi as Rn,Uf as Rt,my as S,io as Sn,O as Sr,tp as St,ly as T,So as Tn,C as Tr,Yf as Tt,ah as U,ur as Un,gf as Ut,_h as V,zr as Vn,_f as Vt,dh as W,nr as Wn,vf as Wt,rh as X,pn as Xn,lf as Xt,ih as Y,gn as Yn,of as Yt,$m as Z,Xt as Zn,tf as Zt,by as _,Wl as _n,A as _r,fp as _t,vb as a,Id as an,Je as ar,Vm as at,hy as b,bl as bn,B as br,rp as bt,Wy as c,Md as cn,Be as cr,Rm as ct,qy as d,Cd as dn,Ne as dr,Nm as dt,Yd as en,G as er,Xm as et,Uy as f,xd as fn,Oe as fr,Fm as ft,Sy as g,Ql as gn,De as gr,dp as gt,wy as h,Yl as hn,ke as hr,Cp as ht,Vb as i,zd as in,Ge as ir,Gm as it,$v as j,Xa as jn,m as jr,If as jt,ay as k,oo as kn,l as kr,Ff as kt,Jy as l,kd as ln,Le as lr,Im as lt,Cy as m,Pu as mn,Ae as mr,wm as mt,rx as n,Ud as nn,Ve as nr,Jm as nt,_b as o,Pd as on,Ke as or,Bm as ot,Fy as p,yd as pn,je as pr,Cm as pt,ch as q,wn as qn,ff as qt,Hb as r,Hd as rn,qe as rr,Ym as rt,Yy as s,Nd as sn,ze as sr,Pm as st,Xb as t,Wd as tn,W as tr,Hm as tt,Ky as u,Ed as un,Fe as ur,Lm as ut,vy as v,ml as vn,V as vr,ip as vt,uy as w,_o as wn,T as wr,ep as wt,fy as x,dl as xn,pe as xr,X as xt,_y as y,gl as yn,ne as yr,ap as yt,mh as z,Zr as zn,Of as zt};
|