neko-harness 0.4.8 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,396 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.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},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function E(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?E(``+e.key):t.toString(36)}function oe(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 D(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,D(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),D(o,r,i,``,function(e){return e})):o!=null&&(re(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+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+ae(a,u),c+=D(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+ae(a,u++),c+=D(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return D(oe(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 se(e,t,n){if(e==null)return e;var r=[],i=0;return D(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ce(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 le=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 ue(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,le)}catch(e){le(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function de(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 ue(de.bind(null,e))}var fe={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(e,function(e){return e})||[]},only:function(e){if(!re(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=fe,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=de,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)!ee.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 te(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)ee.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 te(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=re,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ce}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ue,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.0`})),d=o(((e,t)=>{t.exports=u()})),f=l(d(),1),p=f.useLayoutEffect;function m(e){return e[e.length-1]}function h(e,t){return typeof e==`function`?e(t):e}var g=Object.prototype.hasOwnProperty;function _(e){for(let t in e)if(g.call(e,t))return!0;return!1}var v=()=>Object.create(null),y=(e,t)=>b(e,t,!0);function b(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(x(e)&&x(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&m(a)!==`${o-1}`||c&&m(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?b(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?b(d,o,n,r):o,i&&=u===d&&(a[l]===f||g.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?v():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?b(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function x(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function S(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!S(a,o,n,r))return!1}return!0}if(x(e)&&x(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!S(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!S(e[a],t[a],n,r)))return!1;return i===0}return!1}var C=/[\x00-\x1f\x7f"<>`{}]/g;function w(e){return e.replace(C,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function T(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return w(t)}var ee=[`http:`,`https:`,`mailto:`,`tel:`];function te(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var ne=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function re(e,t){if(!e)return!1;if(ne.test(e))return!0;let n=te(e);return n?!t.has(n):!1}function E(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=T(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=T(r?e.slice(r):e)}return t}function ie(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ae(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oe(){throw Error(`Invariant failed`)}function D(e){return e.replace(/\/{2,}/g,`/`)}function se(e){return e===`/`?e:e.replace(/^\/+/,``)}function ce(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function le(e){return ce(se(e))}function ue(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function de(e,t,n=`never`,r){if(t.includes(`//`)&&(t=D(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=D(e)),o=e.split(`/`);o.length>1&&m(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(m(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?D(s):s)||`/`;return a&&r&&r.set(a,c),c}function fe(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function pe(e){return e==null||e===``}function me(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function he(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&pe(f)){if(c===`/`&&!d)continue;f=``}o+=c+me(s,f,r)+(d||``)}}return o+a||`/`}function ge(e){return e?.isNotFound===!0}function _e(){try{return sessionStorage}catch{return}}var ve=`tsr-scroll-restoration-v1_3`,ye=_e();function be(){try{return JSON.parse(ye?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var O=be(),k=`data-scroll-restoration-id`,xe=e=>e.state.__TSR_key||e.href;function Se(e){let t=e.getAttribute(k);if(t)return`[${k}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Ce=!1,we=`window`;function Te(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ee(e){let t=new Set;for(let n of e){if(n===we)continue;let e=Te(n);e&&t.add(e)}return t}function De(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||xe,a=new Set,o=e=>{let t=O[e]||={};for(let e of a)e===document?t[we]={scrollX,scrollY}:e.isConnected&&(t[Se(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Ce=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Ce||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{ye?.setItem(ve,JSON.stringify(O))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=O[d];if(e){let t=O[u];for(let n in e){if(n===we){if(s)continue}else{let e=Te(n);if(!e||s&&o&&(l??=Ee(o),l.has(e)))continue}t||=O[u]={},t[n]??=e[n]}}}Ce=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Ee(o));let t=e&&i&&c,s=r.e?O[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===we){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Te(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Ce=!1}}))}function Oe(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function ke(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ae(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=ke(r):Array.isArray(t)?t.push(ke(r)):n[e]=[t,ke(r)]}return n}var je=/^(?:\s|["[{\d-]|fa|nu|tr)/,Me=Pe(JSON.parse),Ne=Fe(JSON.stringify,JSON.parse);function Pe(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=Ae(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!je.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Fe(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!je.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Oe(e,r);return t?`?${t}`:``}}var Ie=`__root__`;function Le(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Re(e){return e instanceof Response&&!!e.options}function ze(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var Be=4,Ve=5;function He(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Ue(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function We(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,h=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=m(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],h=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=Ue(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=Ke(r);c=n,t.set(e,n)}}else{let t=a[0],m=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&h<n&&(h<e-1&&p.push(s.slice(h,e-1)),a[2]=`/`+m,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),h=n),!r)continue;let _=d&&!!(m||g);d||(m=m.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===m&&e.suffix===g);if(y)c=y;else{let e=Ke(r,t,_,m,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&h<u&&p.push(s.slice(h,u));let g=p?.slice();if(!r)return g;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=Ke(r,Ve);(r.pathless??=[]).push(e),r=e}let _=(t.path||!t.children)&&!t.isRoot;if(_&&u<l){let e=Ke(r,Be);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=g,_&&(r.route=t)),[r,o,g]}function Ge(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ke(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function qe(e,t){let n=Ke(),r=[];function i(e,t,n,a){let[o,s,c]=We(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(Ge);t.masksTree=n,t.flatCache=ze(1e3)}function Je(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Qe(e,t.masksTree);return t.flatCache.set(e,r),r}function Ye(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Ke(),We(t,{from:e},1,o),i.singleCache.set(a,o)),Qe(r,o,n)}function Xe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Qe(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=et(a.route)),t.matchCache.set(r,a),a}function Ze(e,t=!1){let n=Ke(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&oe(),i[e.id]=e,o!==0&&e.path){let t=ce(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=We(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(Ge);return{processedTree:{segmentTree:n,singleCache:ze(1e3),matchCache:ze(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Qe(e,t,n=!1){let r=e.split(`/`),i=nt(e,r,t,n);if(!i)return null;let[a]=$e(e,r,i);return{route:i.node.route,rawParams:a}}function $e(e,t,n){let r=tt(n.node),i=n.node.data&&He(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===Be)break;if(u.kind===Ve){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function et(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function tt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function nt(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!m(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!ot(l,n))continue;if(i.parse){if(!at(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==Be&&ot(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===Be||i.kind===2)&&ot(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(at(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&it(f,o))return n;ot(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+rt(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+rt(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+rt(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+rt(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function rt(e,t){return 2**(e-t-1)}function it(e,t){return e===2**(t-1)-1}function at(e,t,n){let r,i;try{[r,i]=$e(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function ot(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Be)>(e.node.kind===Be)||t.node.kind===Be==(e.node.kind===Be)&&t.node.depth>e.node.depth)))}function st(e,t,n){let r=le(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=D(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>ct(n,s.input({url:e})),output:({url:e})=>s.output({url:lt(n,e)})}:s}function ct(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function lt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ut(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{ae(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var dt=`__TSR_index`,ft=`popstate`,pt=`beforeunload`,mt=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function ht(e){let t=mt.exec(e);return t?`/`+e.slice(t[0].length):e}function gt(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
2
+ \r`.includes(e)?``:encodeURIComponent(e))),ht(e)}function _t(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=bt(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[dt];i=vt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[dt];i=vt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[dt]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function vt(e,t){let n=xt();return{...t,key:n,__TSR_key:n,[dt]:e}}function yt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>gt(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>bt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=xt();t.history.replaceState({[dt]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=bt(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[dt]-l.state[dt],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=_t({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(pt,x,{capture:!0}),t.removeEventListener(ft,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(pt,x,{capture:!0}),t.addEventListener(ft,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function bt(e,t){let n=gt(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=xt();t={[dt]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function xt(){return(Math.random()+1).toString(36).slice(7)}function St(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function Ct(e){return e.pathname+e.search+e.hash}function wt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Tt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Et({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Dt(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Ot(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var kt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:yt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&le(n)?st(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ut(this.latestLocation,e),De(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ze(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&qe(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:ze(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:E(e),external:!1,searchStr:o,search:y(t?.search,i),hash:E(r.slice(1)),state:b(t?.state,a)}}let o=ct(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:E(ht(o.pathname)),external:!!this.rewrite&&St(o,this.origin),searchStr:c,search:y(t?.search,s),hash:E(o.hash.slice(1)),state:b(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Xe(ce(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=bt(n.href,{});n={...n,to:ct(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),s=n.to?`${n.to}`:`.`,c=de(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[ce(c)],u=c.includes(`$`),d;if(l)d=l._branch??=et(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??We(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=Pt(n.params,e),!_(p))break;p===e&&(p=Object.assign(v(),p));try{Object.assign(p,t(p))}catch{}}}p??=Pt(n.params,Ft(n.params,f)?o()[3]:It);let m=e.leaveParams?c:ht(E(f?he(c,f,p,this.pathParamsDecoder):c)),h=Lt(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Nt(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},y=h.length?Rt(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||It,b=this.options.stringifySearch(y),x=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,S=x?`#${x}`:``,C=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:It,w=`${m}${b}${S}`,T,ee,te=!1;if(this.rewrite){let e=new URL(w,this.origin),t=e.origin,n=lt(this.rewrite,e);T=Ct(e),St(n,t)?(ee=n.href,te=!0):ee=ht(Ct(n))}else T=ie(w),ee=T;return{publicHref:ee,href:T,pathname:m,search:y,searchStr:b,state:C,hash:x??``,external:te,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Je(r.pathname,this.processedTree);if(t){let i=Object.assign(v(),t.rawParams),{from:a,params:o,...s}=t.route,c=Pt(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return At(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=ce(this.latestLocation.href)===ce(n.href)&&S(Et(n.state),Et(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?te(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return At(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Mn(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Tt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&wt(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(ne.test(n)||(r=te(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:St(e,this.origin)||(n=Ct(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Ut,this.preloadRoute=e=>Nn(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?de(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Ye(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!S(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?S(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=fe(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Ne,parseSearch:e.parseSearch??Me,protocolAllowlist:e.protocolAllowlist??ee}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=We(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:ce(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?zt(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Nt(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof jt||(r=new jt(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=v(),_=i._interpolation?he(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,x=i.id+_+h,S=u(i,n),C=this._cache.get(x)??(S?.id===x?S:void 0);d=C?._strictParams??Object.assign(g,d);let w;if(!C)try{Bt(i,d)}catch(e){if(w=ge(e)||Re(e)?e:new Mt(e.message,{cause:e}),t?.throwOnError)throw w}let T=S?`stay`:`enter`,ee;if(C)ee={...C,cause:T,search:y(S?S.search:C.search,l),_strictSearch:f,searchError:p};else{let e=wt(i)?`pending`:`success`;ee={id:x,ssr:i.options.ssr,index:n,routeId:i.id,params:S?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:S?y(S.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:w,context:{},abortController:t?._controller??new AbortController,cause:T,loaderDeps:S?b(S.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let te=s===i.id;ee._notFound&&!te&&(ee.error=void 0),ee._notFound=te,c[n]=ee}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?y(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=m(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=m(a),c={...e.search};for(let e of a)try{Object.assign(c,Nt(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{Bt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function At(e,t,{replace:n,ignoreBlocker:r}){if(!re(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var jt=class extends Error{},Mt=class extends Error{};function Nt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new jt(`Async validation not supported`);if(n.issues)throw new jt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Pt(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Ft(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!g.call(e,t[1]))}var It=Object.freeze({});function Lt(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Nt(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Rt(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=h(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function zt(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Ie}function Bt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Vt(e,t){return e.options[t]?.preload?.()}function Ht(e,t){let n=Vt(e,`component`),r=Vt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Ut(e,t,n){let r=()=>t===!1?void 0:t?Vt(e,t):Ht(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Wt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Gt(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var Kt=0,qt=1,Jt=2,Yt=3,Xt=[4];function Zt(e){return typeof e[0]==`number`}function Qt(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function $t(e,t){return e.routesById[t.routeId]}function en(e,t,n){return Re(e)?[Yt,e]:ge(e)?(e.routeId||=n,[Jt,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[qt,e]):[Kt,e]}function tn(e,t){let n=en(t,!0,e.id);if(n[0]!==qt)return n;try{e.options.onError?.(n[1])}catch(t){n=en(t,!0,e.id)}return n}function nn(e,t,n,r,i){return i[0].signal.aborted?Xt:yn(e,t,n,tn(n,r),i)}async function rn(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=$t(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return on(e,r),[i,nn(e,t,u,a,n)]}if(c.aborted)return[i,Xt];let p=r.paramsError??r.searchError;if(p!==void 0)return on(e,r),[i,nn(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{ln(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Qt(a,c):a);if(c.aborted)return[i,Xt];let s=yn(e,t,u,en(o,!1,u.id),n);if(s[0]!==Kt)return on(e,r),[i,s];r.context={...r.context,...o}}catch(a){return on(e,r),[i,nn(e,t,u,a,n)]}finally{r.status=h,ln(e,r,!1,n[0])}}i()}function an(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function on(e,t){let n=t._flight;t._flight=void 0,an(e,t,n)?.abort()}function sn(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=an(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function cn(e){for(let t of e){let e=t._flight;e&&e[2]++}}function ln(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function un(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function dn(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Xt;if(!i)return[Kt,void 0];let l=n._flight;ln(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(un(e,t,n,r,s,a,!!o[3]))).then(e=>en(e,!1,r.id),e=>en(e,!0,r.id)).then(t=>(t[0]!==Kt&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===qt&&l[2]?tn(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],yn(e,t,r,await Qt(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return on(e,n),Xt}finally{ln(e,n,!1,s)}}function fn(e,t,n){t[0]!==Yt&&(e.status=`success`,e.error=void 0,t[0]===Kt?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function pn(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&on(e,r)}function mn(e,t){return t[0]===qt||t[0]===Jt?{...e,status:t[0]===qt?`error`:`notFound`,error:t[1],_flight:void 0}:e}function hn(e,t,n,r,i,a,o){let s=t[1][n],c=$t(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(un(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Xt)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,on(e,s),p=nn(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,an(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?dn(e,t,s,c,g,i,a).then(t=>(fn(s,t,l),t[0]===Kt&&(m&&!a[0].signal.aborted&&pn(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[Kt,s.loaderData]),T=(async()=>{try{let e=Ut(c,void 0,C);e&&await Qt(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,nn(e,t,c,r,a)]}let r=await w;x&&r[0]===Kt&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>mn(s,e));let ee={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let te=dn(e,t,ee,c,g,i,a).then(e=>(s.isFetching=!1,fn(ee,e,!1),e));return(t[2]??=[]).push([n,te,T,ee]),te.then(e=>mn(ee,e))}async function gn(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=$t(e,t[n]);try{let e=Ut(i,!1);e&&await Qt(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function _n(e,t){t[2]&&=(sn(e,t[2].map(e=>e[3])),void 0)}async function vn(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Yt)throw[a,t];!i&&t[0]!==Kt&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Yt)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function yn(e,t,n,r,i,a){for(;r[0]===Yt;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[Yt,t]:[Yt,t,a]}return[Yt,o,n]}catch(e){r=a?[qt,e]:tn(n,e),a=!0}}return r}async function bn(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Jt?gn(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Yt)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Kt&&t[0]<Yt&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Yt){let n=s[1];if(n[0]!==Yt||n[1].options.reloadDocument||n[2])return _n(e,t),n;c=!0,s=[0,[qt,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===qt?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=$t(e,u);try{await Qt(i?Promise.resolve().then(()=>Ut(m,l===qt?`errorComponent`:`notFoundComponent`)):Promise.all([Ut(m),Ut(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return _n(e,t),Xt}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),_n(e,t),sn(e,o),p()):u.status=`success`}return t}async function xn(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=$t(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await Qt(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Sn(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await gn(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=hn(e,i,t,u,f,r,l)},m=await rn(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Jt){let t=await gn(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Yt&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=bn(e,i,u,r[0],vn(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=vn(i[2],void 0,void 0,h.then(e=>Zt(e)?0:Wt(n).length,()=>0))),o=await h}catch(t){if(_n(e,i),t===a&&a.aborted)return Xt;throw t}return Zt(o)?o:xn(e,o,a,r[6]===n.length?r[6]:0)}function Cn(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=$t(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Cn(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function wn(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Tn(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Wt(t[3]).some(e=>e.id===n[1]))return;let i;try{await Qt(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function En(e,t){e._committed=t,e.stores.setMatches(t)}function Dn(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Wt(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=$t(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Dt(n);En(e,n),sn(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Ot(e,i,n,a,l,t)}async function On(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function kn(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function An(e,t,n,r,i){let a=n.map(e=>({...e}));cn(a);for(let t of r)on(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await bn(e,o,r,t[0],i)}catch(t){throw sn(e,a),t}if(Zt(s))sn(e,a),s[0]===Yt&&e._tx===t&&e._committed===n&&await kn(e,t,s);else if(await xn(e,s,t[0].signal),e._tx!==t||e._committed!==n)sn(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),on(e,n))}En(e,a),sn(e,n,a)}}async function jn(e,t,n,r,i,a){let o=await Sn(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Zt(o)){let n=o[0]===Yt&&e._tx===t;if((!n||o[1].options.reloadDocument)&&wn(e,t),sn(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){wn(e,t);return}await kn(e,t,o);return}let s=o[1];if(e._tx===t&&await Tn(e,t),e._tx!==t){wn(e,t),sn(e,s),_n(e,o);return}let c=t[2],l=Tt(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Tn(e,t),e._tx!==t){wn(e,t),sn(e,s),_n(e,o);return}let n=await e.startTransition(()=>{wn(e,t),Dn(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&An(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):_n(e,o)})}async function Mn(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Tt(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await On(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});cn(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){sn(e,m),await On(e,n);return}e._preflight=void 0;let g,_=()=>jn(e,y,f,()=>Cn(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>On(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&ln(e,t,!1)}n[0].abort(),sn(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Cn(e,y),g?.(_()),await y[5]):(sn(e,y[3]),y[3]=[],g?.(),await On(e,y))}async function Nn(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),cn(a),o=(e._preloads??=new Map).set(i,a),s=await Sn(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),sn(e,a)),i.abort()}if(!Zt(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){ge(e)||console.error(e);return}}}var Pn=`Error preloading route! ☝️`,Fn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Ie:this.parentRoute||oe();let r=n?Ie:t?.path;r&&r!==`/`&&(r=se(r));let i=t?.id||r,a=n?Ie:D((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:D(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=ce(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Le({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},In=class extends Fn{constructor(e){super(e)}},Ln=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),A=o(((e,t)=>{t.exports=Ln()}))(),Rn=class extends f.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?f.createElement(this.props.errorComponent??zn,{error:e[0],reset:this.reset}):this.props.children}};function zn({error:e}){let[t,n]=f.useState(!1);return(0,A.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,A.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,A.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,A.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,A.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,A.jsx)(`div`,{children:(0,A.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,A.jsx)(`code`,{children:e.message}):null})}):null]})}var Bn=()=>!0,Vn=()=>!1;function Hn({children:e,fallback:t=null}){return(0,A.jsx)(f.Fragment,{children:Un()?e:t})}function Un(e=!0){return f.useSyncExternalStore(Wn,Bn,e?Vn:Bn)}function Wn(){return()=>{}}var Gn=f.createContext(null);function Kn(e){return f.useContext(Gn)}function qn(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Gt(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var Jn=f.createContext(void 0),Yn=f.createContext(void 0);function Xn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Zn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Qn=[],$n=0,{link:er,unlink:tr,propagate:nr,checkDirty:rr,shallowPropagate:ir}=Xn({update(e){return e._update()},notify(e){Qn[or++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ur(e))}}),ar=0,or=0,sr,cr=0;function lr(e){try{++cr,e()}finally{--cr||dr()}}function ur(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=tr(n,e)}function dr(){if(!(cr>0)){for(;ar<or;){let e=Qn[ar];Qn[ar++]=void 0,e.notify()}ar=0,or=0}}function fr(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return sr!==void 0&&er(i,sr,$n),i._snapshot},subscribe(e){let t=Zn(e),n={current:!1},r=pr(()=>{i.get(),n.current?(sr=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=sr,o=t?.compare??Object.is;if(n)sr=i,++$n,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{sr=a,n&&(i.flags&=-5),ur(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&rr(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ir(e)}}else e&32&&(i.flags=e&-33);return sr!==void 0&&er(i,sr,$n),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(nr(e),ir(e),dr())}},i}function pr(e){let t=()=>{let t=sr;sr=n,++$n,n.depsTail=void 0,n.flags=6;try{return e()}finally{sr=t,n.flags&=-5,ur(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&rr(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,ur(this)}};return t(),n}var mr=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),hr=o(((e,t)=>{t.exports=mr()})),gr=o((e=>{var t=d(),n=hr();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),_r=o(((e,t)=>{t.exports=gr()}))();function vr(e,t){return e===t}function yr(e,t=e=>e,n){let r=n?.compare??vr,i=(0,f.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,f.useCallback)(()=>e.get(),[e]);return(0,_r.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var br={};function xr(e,t){let n=f.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=b(n.current,i):i}}function Sr(e){let t=Kn(),n=f.useContext(e.from?Yn:Jn),r=e.from??n,i=t.stores.getMatchStore(r),a=xr(e,t),o=yr(i,e=>e?a(e):br);if(o!==br)return o;(e.shouldThrow??!0)&&oe()}function Cr(e){return Sr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function wr(e){let{select:t,...n}=e;return Sr({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Tr(e){return Sr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Er(e){return Sr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Dr(e){let t=Kn();return f.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Or(e){return Sr({...e,select:t=>e.select?e.select(t.context):t.context})}function kr(...e){let t=f.useRef(e),n=t.current;return e.forEach((e,t)=>{S(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Ar(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(Pn)})}function jr(e,t){let n=typeof e==`string`&&te(e);if(n)return t.has(n)?e:null}function Mr(e,t,n,r){let i=ue(e.pathname,r),a=ue(t.pathname,r);return(n?.exact?i!==a:!i.startsWith(a)||i.length!==a.length&&i[a.length]!==`/`)||(n?.includeSearch??!0)&&!S(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||e.hash===t.hash}function Nr(e,t,n){let r=Kn(),i=f.useRef(null),a=f.useCallback(e=>{if(i.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:o,to:s,preload:c,preloadDelay:l,disabled:u,target:d,onClick:p,onBlur:m,onFocus:h,onMouseEnter:g,onMouseLeave:_,onTouchStart:v}=e,[y,b,x]=kr(e.search,e.params,o),S=f.useContext(Jn),C=(r.stores._linkScopes??={})[S]??=qn(r,S),[w,T,ee]=f.useMemo(()=>{let t=jr(s,r.protocolAllowlist);if(t!==void 0){let n=[t??void 0];return[e,()=>n]}let n={...e},i,a,o,c=()=>{let e=C[0]();if(e!==i){n._fromLocation=e;let t=r.buildLocation(n),o=Vr(t,r,u),s=u||o&&!te(o)?Mr(e,t,x,r.basepath):void 0;(!a||a[0]!==o||a[1]!==s)&&(a=[o,s]),i=e}return a};return[n,c,x?.includeHash&&(()=>{let e=c();return e[1]?o??=[e[0],!1]:e})]},[r,C,e.from,e.hash,e.href,s,y,b,e.state,e.mask,e.unsafeRelative,x,u]),[ne,re]=f.useSyncExternalStore(C[1],T,ee||T),E=re===void 0&&ne,ie=u||ne===void 0,ae=f.useRef(!1),oe=e.reloadDocument||E||ie?!1:c??r.options.defaultPreload,D=l??r.options.defaultPreloadDelay??0,se=f.useCallback(e=>{let t=e?.isIntersecting;t??oe===`intent`?D?i.t??=setTimeout(()=>{i.t=void 0,Ar(r,w)},D):Ar(r,w):t===!1&&zr(i)},[r,w,i,oe,D]);f.useEffect(()=>{if(!oe)return;oe===`render`&&!ae.current&&(ae.current=!0,Ar(r,w));let e=!0,t;return oe===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&se(t.pop())},{rootMargin:`100px`}),t.observe(i.current)),()=>{e=!1,t?.disconnect(),zr(i)}},[r,w,oe,se,i]);let ce=Lr(e,n);if(ce.ref=t?a:i,E)return ce.href=E,ce;let le=t=>{let n=d??t.currentTarget.getAttribute(`target`);!ie&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(!n||n===`_self`)&&t.button===0&&(t.preventDefault(),zr(i),r.navigate({...e,_fromLocation:w._fromLocation}))},ue=()=>{oe===`intent`&&Ar(r,w)},de=()=>{oe===`intent`&&zr(i)};return ce.onClick=Br(p,le),ce.onBlur=Br(m,de),ce.onFocus=Br(h,se),ce.onMouseEnter=Br(g,se),ce.onMouseLeave=Br(_,de),ce.onTouchStart=Br(v,ue),Rr(ce,e,re,ne,ie,n)}var Pr={},Fr={className:`active`},Ir=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function Lr(e,t){let n={};for(let r in e)Ir.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function Rr(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=h(n?o:s,{})??(n?Fr:Pr);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var zr=e=>{clearTimeout(e.t),e.t=void 0},Br=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function Vr(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!re(i,t.protocolAllowlist))return i}var Hr=f.memo(f.forwardRef((e,t)=>{let n=e._asChild||`a`,r=Nr(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return f.createElement(n,r,i)}),Ur);function Ur(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!Ir.has(r)||!S(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}var Wr=class extends Fn{constructor(e){super(e),this.useMatch=e=>Sr({...e,from:this.id}),this.useRouteContext=e=>Or({...e,from:this.id}),this.useSearch=e=>Er({...e,from:this.id}),this.useParams=e=>Tr({...e,from:this.id}),this.useLoaderDeps=e=>wr({...e,from:this.id}),this.useLoaderData=e=>Cr({...e,from:this.id}),this.useNavigate=()=>Dr({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>(0,A.jsx)(Hr,{ref:t,from:this.fullPath,...e}))}};function Gr(e){return new Wr(e)}var Kr=class extends In{constructor(e){super(e),this.useMatch=e=>Sr({...e,from:this.id}),this.useRouteContext=e=>Or({...e,from:this.id}),this.useSearch=e=>Er({...e,from:this.id}),this.useParams=e=>Tr({...e,from:this.id}),this.useLoaderDeps=e=>wr({...e,from:this.id}),this.useLoaderData=e=>Cr({...e,from:this.id}),this.useNavigate=()=>Dr({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>(0,A.jsx)(Hr,{ref:t,from:this.fullPath,...e}))}};function qr(e){return new Kr(e)}function Jr(e){let t=Kn(),n=`not-found-${yr(t.stores.location,e=>e.pathname)}-${yr(t.stores.status)}`;return(0,A.jsx)(Rn,{getResetKey:()=>n,onCatch:(t,n)=>{if(ge(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(ge(t))return e.fallback?.(t);throw t},children:e.children})}function Yr(){return(0,A.jsx)(`p`,{children:`Not Found`})}function Xr(e,t,n){return t.options.notFoundComponent?(0,A.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,A.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,A.jsx)(Yr,{})}function Zr(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,A.jsx)(n,{}):null}var Qr=(e,t)=>e[0]===t[0]&&e[1]===t[1],$r=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,ei=f.memo(function({routeId:e}){let t=Kn();return ti(t,yr(t.stores.getMatchStore(e)))});function ti(e,t){let n=e.routesById[t.routeId],r=Zr(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=$r(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,A.jsx)(ni,{match:t});s&&(l=(0,A.jsx)(Hn,{fallback:r,children:l})),o&&(l=(0,A.jsx)(Jr,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return f.createElement(o,e)},children:l})),i&&(l=(0,A.jsx)(Rn,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(ge(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,A.jsx)(f.Suspense,{fallback:r,children:l}));let u=n.isRoot&&n.options.shellComponent;return u?(0,A.jsx)(Jn.Provider,{value:t.routeId,children:(0,A.jsxs)(u,{children:[l,null]})}):(0,A.jsxs)(Jn.Provider,{value:t.routeId,children:[l,null]})}var ni=f.memo(function({match:e}){let t=Kn(),n=e.routeId,r=t.routesById[n],i=f.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=f.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,A.jsx)(e,{},i):(0,A.jsx)(ri,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!$r(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Zr(t,r)}if(e.status===`notFound`)return Xr(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ri=f.memo(function(){let e=Kn(),t=f.useContext(Jn),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=yr(a,e=>[!!e._notFound,e.error],{compare:Qr}),i=yr(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Xr(e,e.routesById[t],r);if(!i)return null;let a=(0,A.jsx)(ei,{routeId:i});return t===`__root__`?(0,A.jsx)(f.Suspense,{fallback:Zr(e),children:a}):a});function ii(e,t){let n=e[1];e.length=0,n?.(t)}function ai({t:e}){let t=Kn(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{ii(n,!1),n.push(i,a),e(t),f.startTransition(r)}),p(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(ce(r.publicHref)!==ce(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Tt(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function oi(){let e=Kn(),t=e.routesById[Ie],n=Zr(e,t),r=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ai,{t:f.useState()[1]}),e.ssr?(0,A.jsx)(si,{}):(0,A.jsx)(f.Suspense,{fallback:n,children:(0,A.jsx)(si,{})})]});return e.options.InnerWrap?(0,A.jsx)(e.options.InnerWrap,{children:r}):r}function si(){let e=Kn(),t=e._rendered,n=yr(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;p(()=>{t[0]===n&&ii(t,!0)},[t,n]);let a=i?(0,A.jsx)(ei,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,A.jsx)(Rn,{getResetKey:()=>r,onCatch:void 0,children:a})}var ci=e=>({createMutableStore:fr,createReadonlyStore:fr,batch:lr}),li=e=>new ui(e),ui=class extends kt{constructor(e){super(e,ci)}};function di({router:e,children:t,...n}){_(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,A.jsx)(Gn.Provider,{value:e,children:t});return e.options.Wrap?(0,A.jsx)(e.options.Wrap,{children:r}):r}function fi({router:e,...t}){return(0,A.jsx)(di,{router:e,...t,children:(0,A.jsx)(oi,{})})}var pi=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,ne());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function te(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ne():S=!1}}}var ne;if(typeof y==`function`)ne=function(){y(te)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,E=re.port2;re.port1.onmessage=te,ne=function(){E.postMessage(null)}}else ne=function(){_(te,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ne()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),mi=o(((e,t)=>{t.exports=pi()})),hi=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),gi=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=hi()})),_i=o((e=>{var t=mi(),n=d(),r=gi();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,ee=Symbol.for(`react.element`),te=Symbol.for(`react.transitional.element`),ne=Symbol.for(`react.portal`),re=Symbol.for(`react.fragment`),E=Symbol.for(`react.strict_mode`),ie=Symbol.for(`react.profiler`),ae=Symbol.for(`react.consumer`),oe=Symbol.for(`react.context`),D=Symbol.for(`react.forward_ref`),se=Symbol.for(`react.suspense`),ce=Symbol.for(`react.suspense_list`),le=Symbol.for(`react.memo`),ue=Symbol.for(`react.lazy`),de=Symbol.for(`react.activity`),fe=Symbol.for(`react.legacy_hidden`),pe=Symbol.for(`react.memo_cache_sentinel`),me=Symbol.for(`react.view_transition`),he=Symbol.for(`react.recoverable`),ge=Symbol.iterator;function _e(e){return typeof e!=`object`||!e?null:(e=ge&&e[ge]||e[`@@iterator`],typeof e==`function`?e:null)}var ve=Symbol.for(`react.client.reference`);function ye(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ve?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case re:return`Fragment`;case ie:return`Profiler`;case E:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`;case de:return`Activity`;case me:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ne:return`Portal`;case oe:return e.displayName||`Context`;case ae:return(e._context.displayName||`Context`)+`.Consumer`;case D:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case le:return t=e.displayName||null,t===null?ye(e.type)||`Memo`:t;case ue:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var be=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Se=[],Ce=-1;function we(e){return{current:e}}function Te(e){0>Ce||(e.current=Se[Ce],Se[Ce]=null,Ce--)}function Ee(e,t){Ce++,Se[Ce]=e.current,e.current=t}var De=we(null),Oe=we(null),ke=we(null),Ae=we(null);function je(e,t){switch(Ee(ke,t),Ee(Oe,e),Ee(De,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Op(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Op(t),e=kp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Te(De),Ee(De,e)}function Me(){Te(De),Te(Oe),Te(ke)}function Ne(e){var t=e.memoizedState;t!==null&&(Th._currentValue=t.memoizedState,Ee(Ae,e)),t=De.current;var n=kp(t,e.type);t!==n&&(Ee(Oe,e),Ee(De,n))}function Pe(e){Oe.current===e&&(Te(De),Te(Oe)),Ae.current===e&&(Te(Ae),Th._currentValue=xe)}var Fe,Ie;function Le(e){if(Fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Fe=t&&t[1]||``,Ie=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+Fe+e+Ie}var Re=!1;function ze(e,t){if(!e||Re)return``;Re=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
+ `),l=s.split(`
6
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Re=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Le(n):``}function Be(e,t){switch(e.tag){case 26:case 27:case 5:return Le(e.type);case 16:return Le(`Lazy`);case 13:return e.child!==t&&t!==null?Le(`Suspense Fallback`):Le(`Suspense`);case 19:return Le(`SuspenseList`);case 0:case 15:return ze(e.type,!1);case 11:return ze(e.type.render,!1);case 1:return ze(e.type,!0);case 31:return Le(`Activity`);case 30:return Le(`ViewTransition`);default:return``}}function Ve(e){try{var t=``,n=null;do t+=Be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var He=Object.prototype.hasOwnProperty,Ue=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,Ke=t.unstable_requestPaint,qe=t.unstable_now,Je=t.unstable_getCurrentPriorityLevel,Ye=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Ze=t.unstable_NormalPriority,Qe=t.unstable_LowPriority,$e=t.unstable_IdlePriority,et=t.log,tt=t.unstable_setDisableYieldValue,nt=null,rt=null;function it(e){if(typeof et==`function`&&tt(e),rt&&typeof rt.setStrictMode==`function`)try{rt.setStrictMode(nt,e)}catch{}}var at=Math.clz32?Math.clz32:ct,ot=Math.log,st=Math.LN2;function ct(e){return e>>>=0,e===0?32:31-(ot(e)/st|0)|0}var lt=256,ut=262144,dt=4194304;function ft(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function pt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ft(n))):i=ft(o):i=ft(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ft(n))):i=ft(o)):i=ft(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function mt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ht(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-at(n),i=1<<r;t|=e[r],n&=~i}return t}function gt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var e=dt;return dt<<=1,!(dt&62914560)&&(dt=4194304),e}function vt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-at(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&xt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function xt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-at(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function St(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ct(e,t){var n=t&-t;return n=n&42?1:wt(n),(n&(e.suspendedLanes|t))===0?n:0}function wt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Et(){var e=k.p;return e===0?(e=window.event,e===void 0?32:Vh(e.type)):e}function Dt(e,t){var n=k.p;try{return k.p=e,t()}finally{k.p=n}}var Ot=Math.random().toString(36).slice(2),kt=`__reactFiber$`+Ot,At=`__reactProps$`+Ot,jt=`__reactContainer$`+Ot,Mt=`__reactEvents$`+Ot,Nt=`__reactListeners$`+Ot,Pt=`__reactHandles$`+Ot,Ft=`__reactResources$`+Ot,It=`__reactMarker$`+Ot,Lt=`__reactLoad$`+Ot;function Rt(e){delete e[kt],delete e[At],delete e[Nt],delete e[Pt]}function zt(e){var t;if(t=e[kt])return t;for(var n=e.parentNode;n;){if(t=n[jt]||n[kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Am(e);e!==null;){if(n=e[kt])return n;e=Am(e)}return t}e=n,n=e.parentNode}return null}function Bt(e){if(e=e[kt]||e[jt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ht(e){var t=e[Ft];return t||=e[Ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ut(e){e[It]=!0}function Wt(e){e[Lt]=void 0}var Gt=new Set,Kt={};function qt(e,t){Jt(e,t),Jt(e+`Capture`,t)}function Jt(e,t){for(Kt[e]=t,e=0;e<t.length;e++)Gt.add(t[e])}var Yt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Xt={},Zt={};function Qt(e){return He.call(Zt,e)?!0:He.call(Xt,e)?!1:Yt.test(e)?Zt[e]=!0:(Xt[e]=!0,!1)}var $t=!1;function en(){var e=$t;return $t=!1,e}function tn(e,t,n){if(Qt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function nn(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function rn(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function an(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function on(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function sn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cn(e){if(!e._valueTracker){var t=on(e)?`checked`:`value`;e._valueTracker=sn(e,t,``+e[t])}}function ln(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=on(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var un=/[\n"\\]/g;function dn(e){return e.replace(un,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function fn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+an(t)):e.value!==``+an(t)&&(e.value=``+an(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):mn(e,an(n)):o===`number`&&e.value==t?mn(e,an(e.value)):mn(e,an(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+an(s):e.removeAttribute(`name`)}function pn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){cn(e);return}n=n==null?``:``+an(n),t=t==null?n:``+an(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),cn(e)}function mn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function hn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+an(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function gn(e,t,n){t!=null&&(t=``+an(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+an(n)}function _n(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(be(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=an(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),cn(e)}function vn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function bn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||yn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function xn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,$t=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(bn(e,a,r),$t=!0)}else for(var o in t)t.hasOwnProperty(o)&&bn(e,o,t[o])}function Sn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Cn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),wn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Tn(e){return wn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function En(){}var Dn=null;function On(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var kn=null,An=null;function jn(e){var t=Bt(e);if(t&&(e=t.stateNode)){var n=e[At]||null;a:switch(e=t.stateNode,t.type){case`input`:if(fn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+dn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[At]||null;if(!a)throw Error(i(90));fn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&ln(r)}break a;case`textarea`:gn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&hn(e,!!n.multiple,t,!1)}}}var Mn=!1;function Nn(e,t,n){if(Mn)return e(t,n);Mn=!0;try{return e(t)}finally{if(Mn=!1,(kn!==null||An!==null)&&(ef(),kn&&(t=kn,e=An,An=kn=null,jn(t),e)))for(t=0;t<e.length;t++)jn(e[t])}}function Pn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[At]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Fn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,In=!1;if(Fn)try{var Ln={};Object.defineProperty(Ln,"passive",{get:function(){In=!0}}),window.addEventListener(`test`,Ln,Ln),window.removeEventListener(`test`,Ln,Ln)}catch{In=!1}var A=null,Rn=null,zn=null;function Bn(){if(zn)return zn;var e,t=Rn,n=t.length,r,i=`value`in A?A.value:A.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return zn=i.slice(e,1<r?1-r:void 0)}function Vn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Hn(){return!0}function Un(){return!1}function Wn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Hn:Un,this.isPropagationStopped=Un,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Hn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Hn)},persist:function(){},isPersistent:Hn}),t}var Gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kn=Wn(Gn),qn=T({},Gn,{view:0,detail:0}),Jn=Wn(qn),Yn,Xn,Zn,Qn=T({},qn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Zn&&(Zn&&e.type===`mousemove`?(Yn=e.screenX-Zn.screenX,Xn=e.screenY-Zn.screenY):Xn=Yn=0,Zn=e),Yn)},movementY:function(e){return`movementY`in e?e.movementY:Xn}}),$n=Wn(Qn),er=Wn(T({},Qn,{dataTransfer:0})),tr=Wn(T({},qn,{relatedTarget:0})),nr=Wn(T({},Gn,{animationName:0,elapsedTime:0,pseudoElement:0})),rr=Wn(T({},Gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),ir=Wn(T({},Gn,{data:0})),ar={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},or={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},sr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function cr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sr[e])?!!t[e]:!1}function lr(){return cr}var ur=Wn(T({},qn,{key:function(e){if(e.key){var t=ar[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?or[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lr,charCode:function(e){return e.type===`keypress`?Vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),dr=Wn(T({},Qn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),fr=Wn(T({},Gn,{submitter:0})),pr=Wn(T({},qn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lr})),mr=Wn(T({},Gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),hr=Wn(T({},Qn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),gr=Wn(T({},Gn,{newState:0,oldState:0,source:0})),_r=[9,13,27,32],vr=Fn&&`CompositionEvent`in window,yr=null;Fn&&`documentMode`in document&&(yr=document.documentMode);var br=Fn&&`TextEvent`in window&&!yr,xr=Fn&&(!vr||yr&&8<yr&&11>=yr),Sr=` `,Cr=!1;function wr(e,t){switch(e){case`keyup`:return _r.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Er=!1;function Dr(e,t){switch(e){case`compositionend`:return Tr(t);case`keypress`:return t.which===32?(Cr=!0,Sr):null;case`textInput`:return e=t.data,e===Sr&&Cr?null:e;default:return null}}function Or(e,t){if(Er)return e===`compositionend`||!vr&&wr(e,t)?(e=Bn(),zn=Rn=A=null,Er=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return xr&&t.locale!==`ko`?null:t.data;default:return null}}var kr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!kr[e.type]:t===`textarea`}function jr(e,t,n,r){kn?An?An.push(r):An=[r]:kn=r,t=dp(t,`onChange`),0<t.length&&(n=new Kn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Mr=null,Nr=null;function Pr(e){rp(e,0)}function Fr(e){if(ln(Vt(e)))return e}function Ir(e,t){if(e===`change`)return t}var Lr=!1;if(Fn){var Rr;if(Fn){var zr=`oninput`in document;if(!zr){var Br=document.createElement(`div`);Br.setAttribute(`oninput`,`return;`),zr=typeof Br.oninput==`function`}Rr=zr}else Rr=!1;Lr=Rr&&(!document.documentMode||9<document.documentMode)}function Vr(){Mr&&(Mr.detachEvent(`onpropertychange`,Hr),Nr=Mr=null)}function Hr(e){if(e.propertyName===`value`&&Fr(Nr)){var t=[];jr(t,Nr,e,On(e)),Nn(Pr,t)}}function Ur(e,t,n){e===`focusin`?(Vr(),Mr=t,Nr=n,Mr.attachEvent(`onpropertychange`,Hr)):e===`focusout`&&Vr()}function Wr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Fr(Nr)}function Gr(e,t){if(e===`click`)return Fr(t)}function Kr(e,t){if(e===`input`||e===`change`)return Fr(t)}function qr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Jr=typeof Object.is==`function`?Object.is:qr;function Yr(e,t){if(Jr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!He.call(t,i)||!Jr(e[i],t[i]))return!1}return!0}function Xr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qr(e,t){var n=Zr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Zr(n)}}function $r(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$r(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ei(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xr(e.document)}return t}function ti(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var ni=Fn&&`documentMode`in document&&11>=document.documentMode,ri=null,ii=null,ai=null,oi=!1;function si(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oi||ri==null||ri!==Xr(r)||(r=ri,`selectionStart`in r&&ti(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ai&&Yr(ai,r)||(ai=r,r=dp(ii,`onSelect`),0<r.length&&(t=new Kn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ri)))}function ci(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var li={animationend:ci(`Animation`,`AnimationEnd`),animationiteration:ci(`Animation`,`AnimationIteration`),animationstart:ci(`Animation`,`AnimationStart`),transitionrun:ci(`Transition`,`TransitionRun`),transitionstart:ci(`Transition`,`TransitionStart`),transitioncancel:ci(`Transition`,`TransitionCancel`),transitionend:ci(`Transition`,`TransitionEnd`)},ui={},di={};Fn&&(di=document.createElement(`div`).style,`AnimationEvent`in window||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),`TransitionEvent`in window||delete li.transitionend.transition);function fi(e){if(ui[e])return ui[e];if(!li[e])return e;var t=li[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in di)return ui[e]=t[n];return e}var pi=fi(`animationend`),hi=fi(`animationiteration`),_i=fi(`animationstart`),vi=fi(`transitionrun`),yi=fi(`transitionstart`),bi=fi(`transitioncancel`),xi=fi(`transitionend`),Si=new Map,Ci=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ci.push(`scrollEnd`);function wi(e,t){Si.set(e,t),qt(t,[e])}var Ti=0;function Ei(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Fd.identifierPrefix;var n=Ti++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Di(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ud;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function Oi(e,t){return e=Di(e),t=Di(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var ki=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)},Ai=[],ji=0,Mi=0;function Ni(){for(var e=ji,t=Mi=ji=0;t<e;){var n=Ai[t];Ai[t++]=null;var r=Ai[t];Ai[t++]=null;var i=Ai[t];Ai[t++]=null;var a=Ai[t];if(Ai[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Li(n,i,a)}}function Pi(e,t,n,r){Ai[ji++]=e,Ai[ji++]=t,Ai[ji++]=n,Ai[ji++]=r,Mi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Fi(e,t,n,r){return Pi(e,t,n,r),Ri(e)}function Ii(e,t){return Pi(e,null,null,t),Ri(e)}function Li(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-at(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ri(e){if(50<Wd)throw Wd=0,Gd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zi={};function Bi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vi(e,t,n,r){return new Bi(e,t,n,r)}function Hi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ui(e,t){var n=e.alternate;return n===null?(n=Vi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Wi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Gi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Hi(r)&&(s=1);else if(typeof r==`string`)s=dh(e,n,De.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case de:return e=Vi(31,n,t,a),e.elementType=de,e.lanes=o,e;case re:return Ki(n.children,a,o,t);case E:s=8,a|=24;break;case ie:return e=Vi(12,n,t,a|2),e.elementType=ie,e.lanes=o,e;case se:return e=Vi(13,n,t,a),e.elementType=se,e.lanes=o,e;case ce:return e=Vi(19,n,t,a),e.elementType=ce,e.lanes=o,e;case fe:case me:return e=a|32,e=Vi(30,n,t,e),e.elementType=me,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case oe:s=10;break a;case ae:s=9;break a;case D:s=11;break a;case le:s=14;break a;case ue:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Vi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ki(e,t,n,r){return e=Vi(7,e,r,t),e.lanes=n,e}function qi(e,t,n){return e=Vi(6,e,null,t),e.lanes=n,e}function Ji(e){var t=Vi(18,null,null,0);return t.stateNode=e,t}function Yi(e,t,n){return t=Vi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Xi=new WeakMap;function Zi(e,t){if(typeof e==`object`&&e){var n=Xi.get(e);return n===void 0?(t={value:e,source:t,stack:Ve(t)},Xi.set(e,t),t):n}return{value:e,source:t,stack:Ve(t)}}var Qi=[],$i=0,ea=null,ta=0,na=[],ra=0,ia=null,aa=1,oa=``;function sa(e,t){Qi[$i++]=ta,Qi[$i++]=ea,ea=e,ta=t}function ca(e,t,n){na[ra++]=aa,na[ra++]=oa,na[ra++]=ia,ia=e;var r=aa;e=oa;var i=32-at(r)-1;r&=~(1<<i),n+=1;var a=32-at(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,aa=1<<32-at(t)+i|n<<i|r,oa=a+e}else aa=1<<a|n<<i|r,oa=e}function la(e){e.return!==null&&(sa(e,1),ca(e,1,0))}function ua(e){for(;e===ea;)ea=Qi[--$i],Qi[$i]=null,ta=Qi[--$i],Qi[$i]=null;for(;e===ia;)ia=na[--ra],na[ra]=null,oa=na[--ra],na[ra]=null,aa=na[--ra],na[ra]=null}function da(e,t){na[ra++]=aa,na[ra++]=oa,na[ra++]=ia,aa=t.id,oa=t.overflow,ia=e}var fa=null,pa=null,ma=!1,ha=null,ga=!1,_a=Error(i(519));function va(e){throw wa(Zi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),_a}function ya(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[kt]=e,t[At]=r,n){case`dialog`:ip(`cancel`,t),ip(`close`,t);break;case`iframe`:case`object`:case`embed`:ip(`load`,t);break;case`video`:case`audio`:for(n=0;n<tp.length;n++)ip(tp[n],t);break;case`source`:ip(`error`,t);break;case`img`:case`image`:case`link`:ip(`error`,t),ip(`load`,t);break;case`details`:ip(`toggle`,t);break;case`input`:ip(`invalid`,t),pn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:ip(`invalid`,t);break;case`textarea`:ip(`invalid`,t),_n(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||_p(t.textContent,n)?(r.popover!=null&&(ip(`beforetoggle`,t),ip(`toggle`,t)),r.onScroll!=null&&ip(`scroll`,t),r.onScrollEnd!=null&&ip(`scrollend`,t),r.onClick!=null&&(t.onclick=En),t=!0):t=!1,t||va(e,!0)}function ba(e){for(fa=e.return;fa;)switch(fa.tag){case 5:case 31:case 13:ga=!1;return;case 27:case 3:ga=!0;return;default:fa=fa.return}}function xa(e){if(e!==fa)return!1;if(!ma)return ba(e),ma=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||jp(e.type,e.memoizedProps)),n=!n),n&&pa&&va(e),ba(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));pa=km(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));pa=km(e)}else t===27?(t=pa,Bp(e.type)?(e=Om,Om=null,pa=e):pa=t):pa=fa?Dm(e.stateNode.nextSibling):null;return!0}function Sa(){pa=fa=null,ma=!1}function Ca(){var e=ha;return e!==null&&(Dd===null?Dd=e:Dd.push.apply(Dd,e),ha=null),e}function wa(e){ha===null?ha=[e]:ha.push(e)}var Ta=we(null),Ea=null,Da=null;function Oa(e,t,n){Ee(Ta,t._currentValue),t._currentValue=n}function ka(e){e._currentValue=Ta.current,Te(Ta)}function Aa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ja(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Aa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Aa(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Aa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function j(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Jr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ae.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Th]:e.push(Th))}a=a.return}return e!==null&&ja(t,e,n,r),t.flags|=262144,e!==null}function Ma(e){for(e=e.firstContext;e!==null;){if(!Jr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Na(e){Ea=e,Da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pa(e){return Ia(Ea,e)}function Fa(e,t){return Ea===null&&Na(e),Ia(e,t)}function Ia(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Da===null){if(e===null)throw Error(i(308));Da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Da=Da.next=t;return n}var La=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ra=t.unstable_scheduleCallback,za=t.unstable_NormalPriority,Ba={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Va(){return{controller:new La,data:new Map,refCount:0}}function Ha(e){e.refCount--,e.refCount===0&&Ra(za,function(){e.controller.abort()})}function Ua(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Wa=null;function Ga(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ka=null,qa=0,Ja=0,M=null;function Ya(e,t){if(Ka===null){var n=Ka=[];qa=0,Ja=Xf(),M={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return qa++,t.then(Xa,Xa),t}function Xa(){if(--qa===0&&(Wa=null,Ka!==null)){M!==null&&(M.status=`fulfilled`);var e=Ka;Ka=null,Ja=0,M=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Za(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Qa=O.S;O.S=function(e,t){if(Ad=qe(),typeof t==`object`&&t&&typeof t.then==`function`&&Ya(e,t),Wa!==null)for(var n=If;n!==null;)Ua(n,Wa),n=n.next;if(n=e.types,n!==null){for(var r=If;r!==null;)Ua(r,n),r=r.next;if(Ja!==0){r=Wa,r===null&&(r=Wa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Qa!==null&&Qa(e,t)};var $a=we(null);function eo(){var e=$a.current;return e===null?dd.pooledCache:e}function to(e,t){t===null?Ee($a,$a.current):Ee($a,t.pool)}function no(){var e=eo();return e===null?null:{parent:Ba._currentValue,pool:e}}var ro=Error(i(460)),io=Error(i(474)),ao=Error(i(542)),oo={then:function(){}};function so(e){return e=e.status,e===`fulfilled`||e===`rejected`}function co(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(En,En),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,po(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(En,En);else{if(e=dd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,po(e),e}throw uo=t,ro}}function lo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(uo=e,ro):e}}var uo=null;function fo(){if(uo===null)throw Error(i(459));var e=uo;return uo=null,e}function po(e){if(e===ro||e===ao)throw Error(i(483))}var mo=null,ho=0;function go(e){var t=ho;return ho+=1,mo===null&&(mo=[]),co(mo,e,t)}function _o(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function vo(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function yo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ui(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=qi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===re?(e=d(e,t,n.props.children,r,n.key),_o(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ue&&lo(i)===t.type)?(t=a(t,n.props),_o(t,n),t.return=e,t):(t=Gi(n.type,n.key,n.props,null,e.mode,r),_o(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Yi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ki(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=qi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case te:return n=Gi(t.type,t.key,t.props,null,e.mode,n),_o(n,t),n.return=e,n;case ne:return t=Yi(t,e.mode,n),t.return=e,t;case ue:return t=lo(t),f(e,t,n)}if(be(t)||_e(t))return t=Ki(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,go(t),n);if(t.$$typeof===oe)return f(e,Fa(e,t),n);vo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case te:return n.key===i?l(e,t,n,r):null;case ne:return n.key===i?u(e,t,n,r):null;case ue:return n=lo(n),p(e,t,n,r)}if(be(n)||_e(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,go(n),r);if(n.$$typeof===oe)return p(e,t,Fa(e,n),r);vo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case te:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ne:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ue:return r=lo(r),m(e,t,n,r,i)}if(be(r)||_e(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,go(r),i);if(r.$$typeof===oe)return m(e,t,n,Fa(t,r),i);vo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ma&&sa(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ma&&sa(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ma&&sa(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ma&&sa(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ma&&sa(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ma&&sa(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===re&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case te:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===re){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),_o(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ue&&lo(l)===r.type){n(e,r.sibling),c=a(r,o.props),_o(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===re?(c=Ki(o.props.children,e.mode,c,o.key),_o(c,o),c.return=e,e=c):(c=Gi(o.type,o.key,o.props,null,e.mode,c),_o(c,o),c.return=e,e=c)}return s(e);case ne:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Yi(o,e.mode,c),c.return=e,e=c}return s(e);case ue:return o=lo(o),_(e,r,o,c)}if(be(o))return h(e,r,o,c);if(_e(o)){if(l=_e(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,go(o),c);if(o.$$typeof===oe)return _(e,r,Fa(e,o),c);vo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=qi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ho=0;var i=_(e,t,n,r);return mo=null,i}catch(t){if(t===ro||t===ao)throw t;var a=Vi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var bo=yo(!0),xo=yo(!1),So=!1;function Co(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function To(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Eo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ud&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ri(e),Li(e,null,n),t}return Pi(e,r,t,n),Ri(e)}function Do(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,St(e,n)}}function Oo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ko=!1;function Ao(){if(ko){var e=M;if(e!==null)throw e}}function jo(e,t,n,r){ko=!1;var i=e.updateQueue;So=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(pd&f)===f:(r&f)===f){f!==0&&f===Ja&&(ko=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:So=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),xd|=o,e.lanes=o,e.memoizedState=d}}function Mo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function No(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Mo(n[e],t)}var Po=we(null),Fo=we(0);function Io(e,t){e=yd,Ee(Fo,e),Ee(Po,t),yd=e|t.baseLanes}function Lo(){Ee(Fo,yd),Ee(Po,Po.current)}function Ro(){yd=Fo.current,Te(Po),Te(Fo)}var zo=we(null),Bo=null;function Vo(e){var t=e.alternate;Ee(Ko,Ko.current&1),Ee(zo,e),Bo===null&&(t===null||Po.current!==null||t.memoizedState!==null)&&(Bo=e)}function Ho(e){Ee(Ko,Ko.current),Ee(zo,e),Bo===null&&(Bo=e)}function Uo(e){e.tag===22?(Ee(Ko,Ko.current),Ee(zo,e),Bo===null&&(Bo=e)):Wo()}function Wo(){Ee(Ko,Ko.current),Ee(zo,zo.current)}function Go(e){Te(zo),Bo===e&&(Bo=null),Te(Ko)}var Ko=we(0);function qo(e,t){Ee(zo,zo.current),Ee(Ko,t)}function Jo(e){Te(Ko),Te(zo),Bo===e&&(Bo=null)}function Yo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||wm(n)||Tm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Xo=0,Zo=null,Qo=null,$o=null,es=!1,ts=!1,ns=!1,rs=0,is=0,as=null,os=0;function ss(){throw Error(i(321))}function cs(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Jr(e[n],t[n]))return!1;return!0}function N(e,t,n,r,i,a){return Xo=a,Zo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?wc:Tc,ns=!1,a=n(r,i),ns=!1,ts&&(a=us(t,n,r,i)),ls(e),a}function ls(e){O.H=Cc;var t=Qo!==null&&Qo.next!==null;if(Xo=0,$o=Qo=Zo=null,es=!1,is=0,as=null,t)throw Error(i(300));e===null||Vc||(e=e.dependencies,e!==null&&Ma(e)&&(Vc=!0))}function us(e,t,n,r){Zo=e;var a=0;do{if(ts&&(as=null),is=0,ts=!1,25<=a)throw Error(i(301));if(a+=1,$o=Qo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=F,o=t(n,r)}while(ts);return o}function ds(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?_s(t):t,e=e.useState()[0],(Qo===null?null:Qo.memoizedState)!==e&&(Zo.flags|=1024),t}function fs(){var e=rs!==0;return rs=0,e}function P(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ps(e){if(es){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}es=!1}Xo=0,$o=Qo=Zo=null,ts=!1,is=rs=0,as=null}function ms(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $o===null?Zo.memoizedState=$o=e:$o=$o.next=e,$o}function hs(){if(Qo===null){var e=Zo.alternate;e=e===null?null:e.memoizedState}else e=Qo.next;var t=$o===null?Zo.memoizedState:$o.next;if(t!==null)$o=t,Qo=e;else{if(e===null)throw Zo.alternate===null?Error(i(467)):Error(i(310));Qo=e,e={memoizedState:Qo.memoizedState,baseState:Qo.baseState,baseQueue:Qo.baseQueue,queue:Qo.queue,next:null},$o===null?Zo.memoizedState=$o=e:$o=$o.next=e}return $o}function gs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _s(e){var t=is;return is+=1,as===null&&(as=[]),e=co(as,e,t),t=Zo,($o===null?t.memoizedState:$o.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?wc:Tc),e}function vs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return _s(e);if(e.$$typeof===he)return;if(e.$$typeof===oe)return Pa(e)}throw Error(i(438,String(e)))}function ys(e){var t=null,n=Zo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Zo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=gs(),Zo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=pe;return t.index++,n}function bs(e,t){return typeof t==`function`?t(e):t}function xs(e){return Ss(hs(),Qo,e)}function Ss(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Xo&f)===f:(pd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ja&&(d=!0);else if((Xo&p)===p){u=u.next,p===Ja&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Zo.lanes|=p,xd|=p;f=u.action,ns&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Zo.lanes|=f,xd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Jr(o,e.memoizedState)&&(Vc=!0,d&&(n=M,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Cs(e){var t=hs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Jr(o,t.memoizedState)||(Vc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ws(e,t,n){var r=Zo,a=hs(),o=ma;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Jr((Qo||a).memoizedState,n);if(s&&(a.memoizedState=n,Vc=!0),a=a.queue,Ys(Ds.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||$o!==null&&!!($o.memoizedState.tag&1),Ws(e?9:8,{destroy:void 0},Es.bind(null,r,a,n,t),null),e){if(r.flags|=2048,dd===null)throw Error(i(349));o||Xo&127||Ts(r,t,n)}return n}function Ts(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Zo.updateQueue,t===null?(t=gs(),Zo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Es(e,t,n,r){t.value=n,t.getSnapshot=r,Os(t)&&ks(e)}function Ds(e,t,n){return n(function(){Os(t)&&ks(e)})}function Os(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Jr(e,n)}catch{return!0}}function ks(e){var t=Ii(e,2);t!==null&&Yd(t,e,2)}function As(e){var t=ms();if(typeof e==`function`){var n=e;if(e=n(),ns){it(!0);try{n()}finally{it(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:e},t}function js(e,t,n,r){return e.baseState=n,Ss(e,Qo,typeof r==`function`?r:bs)}function Ms(e,t,n,r,a){if(bc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ns(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ns(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=O.T,o={};o.types=a===null?null:a.types,O.T=o;try{var s=n(i,r),c=O.S;c!==null&&c(o,s),Ps(e,t,s)}catch(n){Is(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),O.T=a}}else try{a=n(i,r),Ps(e,t,a)}catch(n){Is(e,t,n)}}function Ps(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Fs(e,t,n)},function(n){return Is(e,t,n)}):Fs(e,t,n)}function Fs(e,t,n){t.status=`fulfilled`,t.value=n,Ls(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ns(e,n)))}function Is(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ls(t),t=t.next;while(t!==r)}e.action=null}function Ls(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Rs(e,t){return t}function zs(e,t){if(ma){var n=dd.formState;if(n!==null){a:{var r=Zo;if(ma){if(pa){b:{for(var i=pa,a=ga;i.nodeType!==8;)if(!a||(i=Dm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){pa=Dm(i.nextSibling),r=i.data===`F!`;break a}}va(r)}r=!1}r&&(t=n[0])}}return n=ms(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:t},n.queue=r,n=_c.bind(null,Zo,r),r.dispatch=n,r=As(!1),a=yc.bind(null,Zo,!1,r.queue),r=ms(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ms.bind(null,Zo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Bs(e){return Vs(hs(),Qo,e)}function Vs(e,t,n){if(t=Ss(e,t,Rs)[0],e=xs(bs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=_s(t)}catch(e){throw e===ro?ao:e}else r=t;t=hs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Zo.flags|=2048,Ws(9,{destroy:void 0},Hs.bind(null,i,n),null)),[r,a,e]}function Hs(e,t){e.action=t}function Us(e){var t=hs(),n=Qo;if(n!==null)return Vs(t,n,e);hs(),t=t.memoizedState,n=hs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ws(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Zo.updateQueue,t===null&&(t=gs(),Zo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Gs(){return hs().memoizedState}function Ks(e,t,n,r){var i=ms();Zo.flags|=e,i.memoizedState=Ws(1|t,{destroy:void 0},n,r===void 0?null:r)}function qs(e,t,n,r){var i=hs();r=r===void 0?null:r;var a=i.memoizedState.inst;Qo!==null&&r!==null&&cs(r,Qo.memoizedState.deps)?i.memoizedState=Ws(t,a,n,r):(Zo.flags|=e,i.memoizedState=Ws(1|t,a,n,r))}function Js(e,t){Ks(8390656,8,e,t)}function Ys(e,t){qs(2048,8,e,t)}function Xs(e){Zo.flags|=4;var t=Zo.updateQueue;if(t===null)t=gs(),Zo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Zs(e){var t=hs().memoizedState;return Xs({ref:t,nextImpl:e}),function(){if(ud&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Qs(e,t){return qs(4,2,e,t)}function $s(e,t){return qs(4,4,e,t)}function ec(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function tc(e,t,n){n=n==null?null:n.concat([e]),qs(4,4,ec.bind(null,t,e),n)}function nc(){}function rc(e,t){var n=hs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&cs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ic(e,t){var n=hs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&cs(t,r[1]))return r[0];if(r=e(),ns){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r}function ac(e,t,n){return n===void 0||Xo&1073741824&&!(pd&261930)?e.memoizedState=t:(e.memoizedState=n,e=qd(),Zo.lanes|=e,xd|=e,n)}function oc(e,t,n,r){return Jr(n,t)?n:Po.current===null?!(Xo&106)||Xo&1073741824&&!(pd&261930)?(Vc=!0,e.memoizedState=n):(e=qd(),Zo.lanes|=e,xd|=e,t):(e=ac(e,n,r),Jr(e,t)||(Vc=!0),e)}function sc(e,t,n,r,i){var a=k.p;k.p=a!==0&&8>a?a:8;var o=O.T,s={};s.types=o===null?null:o.types,O.T=s,yc(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?vc(e,t,Za(c,r),Kd(e)):vc(e,t,r,Kd(e))}catch(n){vc(e,t,{then:function(){},status:`rejected`,reason:n},Kd())}finally{k.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function cc(){}function lc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=uc(e).queue;sc(e,a,t,xe,n===null?cc:function(){return dc(e),n(r)})}function uc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:xe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function dc(e){var t=uc(e);t.next===null&&(t=e.alternate.memoizedState),vc(e,t.next.queue,{},Kd())}function fc(){return Pa(Th)}function pc(){return hs().memoizedState}function mc(){return hs().memoizedState}function hc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Kd();e=To(n);var r=Eo(t,e,n);r!==null&&(Yd(r,t,n),Do(r,t,n)),t={cache:Va()},e.payload=t;return}t=t.return}}function gc(e,t,n){var r=Kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bc(e)?xc(t,n):(n=Fi(e,t,n,r),n!==null&&(Yd(n,e,r),Sc(n,t,r)))}function _c(e,t,n){vc(e,t,n,Kd())}function vc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bc(e))xc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Jr(s,o))return Pi(e,t,i,0),dd===null&&Ni(),!1}catch{}if(n=Fi(e,t,i,r),n!==null)return Yd(n,e,r),Sc(n,t,r),!0}return!1}function yc(e,t,n,r){if(r={lane:2,revertLane:Xf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bc(e)){if(t)throw Error(i(479))}else t=Fi(e,n,r,2),t!==null&&Yd(t,e,2)}function bc(e){var t=e.alternate;return e===Zo||t!==null&&t===Zo}function xc(e,t){ts=es=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,St(e,n)}}var Cc={readContext:Pa,use:vs,useCallback:ss,useContext:ss,useEffect:ss,useImperativeHandle:ss,useLayoutEffect:ss,useInsertionEffect:ss,useMemo:ss,useReducer:ss,useRef:ss,useState:ss,useDebugValue:ss,useDeferredValue:ss,useTransition:ss,useSyncExternalStore:ss,useId:ss,useHostTransitionStatus:ss,useFormState:ss,useActionState:ss,useOptimistic:ss,useMemoCache:ss,useCacheRefresh:ss,useEffectEvent:ss},wc={readContext:Pa,use:vs,useCallback:function(e,t){return ms().memoizedState=[e,t===void 0?null:t],e},useContext:Pa,useEffect:Js,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ks(4194308,4,ec.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ks(4194308,4,e,t)},useInsertionEffect:function(e,t){Ks(4,2,e,t)},useMemo:function(e,t){var n=ms();t=t===void 0?null:t;var r=e();if(ns){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ms();if(n!==void 0){var i=n(t);if(ns){it(!0);try{n(t)}finally{it(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=gc.bind(null,Zo,e),[r.memoizedState,e]},useRef:function(e){var t=ms();return e={current:e},t.memoizedState=e},useState:function(e){e=As(e);var t=e.queue,n=_c.bind(null,Zo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:nc,useDeferredValue:function(e,t){return ac(ms(),e,t)},useTransition:function(){var e=As(!1);return e=sc.bind(null,Zo,e.queue,!0,!1),ms().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Zo,a=ms();if(ma){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),dd===null)throw Error(i(349));pd&127||Ts(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Js(Ds.bind(null,r,o,e),[e]),r.flags|=2048,Ws(9,{destroy:void 0},Es.bind(null,r,o,n,t),null),n},useId:function(){var e=ms(),t=dd.identifierPrefix;if(ma){var n=oa,r=aa;n=(r&~(1<<32-at(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=rs++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=os++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:fc,useFormState:zs,useActionState:zs,useOptimistic:function(e){var t=ms();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=yc.bind(null,Zo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ys,useCacheRefresh:function(){return ms().memoizedState=hc.bind(null,Zo)},useEffectEvent:function(e){var t=ms(),n={impl:e};return t.memoizedState=n,function(){if(ud&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Tc={readContext:Pa,use:vs,useCallback:rc,useContext:Pa,useEffect:Ys,useImperativeHandle:tc,useInsertionEffect:Qs,useLayoutEffect:$s,useMemo:ic,useReducer:xs,useRef:Gs,useState:function(){return xs(bs)},useDebugValue:nc,useDeferredValue:function(e,t){return oc(hs(),Qo.memoizedState,e,t)},useTransition:function(){var e=xs(bs)[0],t=hs().memoizedState;return[typeof e==`boolean`?e:_s(e),t]},useSyncExternalStore:ws,useId:pc,useHostTransitionStatus:fc,useFormState:Bs,useActionState:Bs,useOptimistic:function(e,t){return js(hs(),Qo,e,t)},useMemoCache:ys,useCacheRefresh:mc,useEffectEvent:Zs},F={readContext:Pa,use:vs,useCallback:rc,useContext:Pa,useEffect:Ys,useImperativeHandle:tc,useInsertionEffect:Qs,useLayoutEffect:$s,useMemo:ic,useReducer:Cs,useRef:Gs,useState:function(){return Cs(bs)},useDebugValue:nc,useDeferredValue:function(e,t){var n=hs();return Qo===null?ac(n,e,t):oc(n,Qo.memoizedState,e,t)},useTransition:function(){var e=Cs(bs)[0],t=hs().memoizedState;return[typeof e==`boolean`?e:_s(e),t]},useSyncExternalStore:ws,useId:pc,useHostTransitionStatus:fc,useFormState:Us,useActionState:Us,useOptimistic:function(e,t){var n=hs();return Qo===null?(n.baseState=e,[e,n.queue.dispatch]):js(n,Qo,e,t)},useMemoCache:ys,useCacheRefresh:mc,useEffectEvent:Zs};function Ec(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Dc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Kd(),i=To(r);i.payload=t,n!=null&&(i.callback=n),t=Eo(e,i,r),t!==null&&(Yd(t,e,r),Do(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Kd(),i=To(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Eo(e,i,r),t!==null&&(Yd(t,e,r),Do(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Kd(),r=To(n);r.tag=2,t!=null&&(r.callback=t),t=Eo(e,r,n),t!==null&&(Yd(t,e,n),Do(t,e,n))}};function Oc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Yr(n,r)||!Yr(i,a):!0}function kc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Dc.enqueueReplaceState(t,t.state,null)}function Ac(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function jc(e){ki(e)}function Mc(e){console.error(e)}function Nc(e){ki(e)}function Pc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Fc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ic(e,t,n){return n=To(n),n.tag=3,n.payload={element:null},n.callback=function(){Pc(e,t)},n}function Lc(e){return e=To(e),e.tag=3,e}function Rc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Fc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Fc(t,n,r),typeof i!=`function`&&(Nd===null?Nd=new Set([this]):Nd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function zc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&j(t,n,a,!0),n=zo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Bo===null?cf():n.alternate===null&&bd===0&&(bd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===oo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Af(e,r,a)),!1;case 22:return n.flags|=65536,r===oo?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Af(e,r,a)),!1}throw Error(i(435,n.tag))}return Af(e,r,a),cf(),!1}if(ma)return t=zo.current,t===null?(r!==_a&&(t=Error(i(423),{cause:r}),wa(Zi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Zi(r,n),a=Ic(e.stateNode,r,a),Oo(e,a),bd!==4&&(bd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==_a&&(e=Error(i(422),{cause:r}),wa(Zi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Zi(o,n),Ed===null?Ed=[o]:Ed.push(o),bd!==4&&(bd=2),t===null)return!0;r=Zi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ic(n.stateNode,r,e),Oo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Nd===null||!Nd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Lc(a),Rc(a,e,n,r),Oo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Bc=Error(i(461)),Vc=!1;function Hc(e,t,n,r){t.child=e===null?xo(t,null,n,r):bo(t,e.child,n,r)}function Uc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Na(t),r=N(e,t,n,o,a,i),s=fs(),e!==null&&!Vc?(P(e,t,i),_l(e,t,i)):(ma&&s&&la(t),t.flags|=1,Hc(e,t,r,i),t.child)}function Wc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Hi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Gc(e,t,a,r,i)):(e=Gi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!vl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Yr:n,n(o,r)&&e.ref===t.ref)return _l(e,t,i)}return t.flags|=1,e=Ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function Gc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Yr(a,r)&&e.ref===t.ref){if(Vc=!1,t.pendingProps=r=a,vl(e,i))e.flags&131072&&(Vc=!0);else return t.lanes=e.lanes,_l(e,t,i)}}return $c(e,t,n,r,i)}function Kc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Jc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&to(t,a===null?null:a.cachePool),a===null?Lo():Io(t,a),Uo(t);else return r=t.lanes=536870912,Jc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&to(t,null),Lo(),Wo()):(to(t,a.cachePool),Io(t,a),Wo(),t.memoizedState=null);return Hc(e,t,i,n),t.child}function qc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Jc(e,t,n,r,i){var a=eo();return a=a===null?null:{parent:Ba._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&to(t,null),Lo(),Uo(t),e!==null&&j(e,t,r,!0),t.childLanes=i,null}function Yc(e,t){return t=cl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xc(e,t,n){return bo(t,e.child,null,n),e=Yc(t,t.pendingProps),e.flags|=2,Go(t),t.memoizedState=null,e}function Zc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ma){if(r.mode===`hidden`)return e=Yc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},qc(null,e);if(Ho(t),(e=pa)?(e=Cm(e,ga),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ia===null?null:{id:aa,overflow:oa},retryLane:536870912,hydrationErrors:null},n=Ji(e),n.return=t,t.child=n,fa=t,pa=null)):e=null,e===null)throw va(t);return t.lanes=536870912,null}return Yc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ho(t),a){if(t.flags&256)t.flags&=-257,t=Xc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Vc||j(e,t,n,!1),a=(n&e.childLanes)!==0,Vc||a){if(Po.current===null){if(r=dd,r!==null&&(s=Ct(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ii(e,s),Yd(r,e,s),Bc;cf()}t=Xc(e,t,n)}else e=o.treeContext,pa=Dm(s.nextSibling),fa=t,ma=!0,ha=null,ga=!1,e!==null&&da(t,e),t=Yc(t,r),t.flags|=134221824;return t}return e=Ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Qc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function $c(e,t,n,r,i){return Na(t),n=N(e,t,n,r,void 0,i),r=fs(),e!==null&&!Vc?(P(e,t,i),_l(e,t,i)):(ma&&r&&la(t),t.flags|=1,Hc(e,t,n,i),t.child)}function el(e,t,n,r,i,a){return Na(t),t.updateQueue=null,n=us(t,r,n,i),ls(e),r=fs(),e!==null&&!Vc?(P(e,t,a),_l(e,t,a)):(ma&&r&&la(t),t.flags|=1,Hc(e,t,n,a),t.child)}function tl(e,t,n,r,i){if(Na(t),t.stateNode===null){var a=zi,o=n.contextType;typeof o==`object`&&o&&(a=Pa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Dc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Co(t),o=n.contextType,a.context=typeof o==`object`&&o?Pa(o):zi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ec(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Dc.enqueueReplaceState(a,a.state,null),jo(t,r,a,i),Ao(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ac(n,s);a.props=c;var l=a.context,u=n.contextType;o=zi,typeof u==`object`&&u&&(o=Pa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&kc(t,a,r,o),So=!1;var f=t.memoizedState;a.state=f,jo(t,r,a,i),Ao(),l=t.memoizedState,s||f!==l||So?(typeof d==`function`&&(Ec(t,n,d,r),l=t.memoizedState),(c=So||Oc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,wo(e,t),o=t.memoizedProps,u=Ac(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=zi,typeof l==`object`&&l&&(c=Pa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&kc(t,a,r,c),So=!1,f=t.memoizedState,a.state=f,jo(t,r,a,i),Ao();var p=t.memoizedState;o!==d||f!==p||So||e!==null&&e.dependencies!==null&&Ma(e.dependencies)?(typeof s==`function`&&(Ec(t,n,s,r),p=t.memoizedState),(u=So||Oc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ma(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Qc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=bo(t,e.child,null,i),t.child=bo(t,null,n,i)):Hc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=_l(e,t,i),e}function nl(e,t,n,r){return Sa(),t.flags|=256,Hc(e,t,n,r),t.child}var rl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function il(e){return{baseLanes:e,cachePool:no()}}function al(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=wd),e}function ol(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ko.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ma){if(i?Vo(t):Wo(),(e=pa)?(e=Cm(e,ga),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ia===null?null:{id:aa,overflow:oa},retryLane:536870912,hydrationErrors:null},n=Ji(e),n.return=t,t.child=n,fa=t,pa=null)):e=null,e===null)throw va(t);return t.lanes=Tm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Wo(),i=t.mode,a=cl({mode:`hidden`,children:a},i),r=Ki(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=il(n),r.childLanes=al(e,o,n),t.memoizedState=rl,qc(null,r)):(Vo(t),sl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return ul(e,t,a,o,r,c,s,n)}return i?(Wo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ui(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ki(i,a,n,null),i.flags|=2):i=Ui(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,qc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=il(n):(a=i.cachePool,a===null?a=no():(s=Ba._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=al(e,o,n),t.memoizedState=rl,qc(e.child,r)):(Vo(t),n=e.child,e=n.sibling,n=Ui(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function sl(e,t){return t=cl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function cl(e,t){return e=Vi(22,e,null,t),e.lanes=0,e}function ll(e,t,n){return bo(t,e.child,null,n),e=sl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ul(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Vo(t),t.flags&=-257,ll(e,t,c)):t.memoizedState===null?(Wo(),o=a.fallback,s=t.mode,a=cl({mode:`visible`,children:a.children},s),o=Ki(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,bo(t,e.child,null,c),a=t.child,a.memoizedState=il(c),a.childLanes=al(e,r,c),t.memoizedState=rl,qc(null,a)):(Wo(),t.child=e.child,t.flags|=128,null);if(Vo(t),Tm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,wa({value:a,source:null,stack:null})),ll(e,t,c)}if(Vc||j(e,t,c,!1),r=(c&e.childLanes)!==0,Vc||r){if(Po.current!==null)return ll(e,t,c);if(r=dd,r!==null&&(a=Ct(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ii(e,a),Yd(r,e,a),Bc;return wm(o)||cf(),ll(e,t,c)}return wm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,pa=Dm(o.nextSibling),fa=t,ma=!0,ha=null,ga=!1,e!==null&&da(t,e),t=sl(t,a.children),t.flags|=134221824,t)}function dl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Aa(e.return,t,n)}function fl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Yo(n)===null&&(t=e),e=e.sibling}return t}function pl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ml(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function hl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ko.current;if(t.flags&128)return qo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,qo(t,o),i===`backwards`&&e!==null?(ml(e),Hc(e,t,r,n),ml(e)):Hc(e,t,r,n),r=ma?ta:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dl(e,n,t);else if(e.tag===19)dl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=fl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ml(t)),pl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Yo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}pl(t,!0,n,null,a,r);break;case`together`:pl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=fl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),pl(t,!1,i,n,a,r)}return t.child}function gl(e,t,n){var r=t.pendingProps;return Oa(t,t.type,r.value),Hc(e,t,r.children,n),t.child}function _l(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(j(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function vl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ma(e)))}function yl(e,t,n){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),Oa(t,Ba,e.memoizedState.cache),Sa();break;case 27:case 5:Ne(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:Oa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ho(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Vo(t),t.flags|=128,null;r=j(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?ol(e,t,n):(Vo(t),e=_l(e,t,n),e===null?null:e.sibling)}Vo(t);break;case 19:if(t.flags&128)return hl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(j(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return hl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),qo(t,Ko.current),r)break;return null;case 22:return t.lanes=0,Kc(e,t,n,t.pendingProps);case 24:Oa(t,Ba,e.memoizedState.cache)}return _l(e,t,n)}function bl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Vc=!0;else{if(!vl(e,n)&&!(t.flags&128))return Vc=!1,yl(e,t,n);Vc=!!(e.flags&131072)}}else Vc=!1,ma&&t.flags&1048576&&ca(t,ta,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=lo(t.elementType),t.type=e,typeof e==`function`)Hi(e)?(r=Ac(e,r),t.tag=1,t=tl(null,t,e,r,n)):(t.tag=0,t=$c(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===D){t.tag=11,t=Uc(null,t,e,r,n);break a}if(a===le){t.tag=14,t=Wc(null,t,e,r,n);break a}if(a===oe){t.tag=10,t.type=e,t=gl(null,t,n);break a}}throw t=ye(e)||e,Error(i(306,t,``))}}return t;case 0:return $c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ac(r,t.pendingProps),tl(e,t,r,a,n);case 3:a:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,wo(e,t),jo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Oa(t,Ba,r),r!==o.cache&&ja(t,[Ba],n,!0),Ao(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=nl(e,t,r,n);break a}if(r!==a){a=Zi(Error(i(424)),t),wa(a),t=nl(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(pa=Dm(e.firstChild),fa=t,ma=!0,ha=null,ga=!0,n=xo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Sa(),r===a){t=_l(e,t,n);break a}Hc(e,t,r,n)}t=t.child}return t;case 26:return Qc(e,t),e===null?(n=Zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ma||(t.stateNode=Ap(t.type,t.pendingProps,ke.current,t)):t.memoizedState=Zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&ma&&(r=t.stateNode=Nm(t.type,t.pendingProps,ke.current),fa=t,ga=!0,a=pa,Bp(t.type)?(Om=a,pa=Dm(r.firstChild)):pa=a),Hc(e,t,t.pendingProps.children,n),Qc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ma&&((a=r=pa)&&(r=xm(r,t.type,t.pendingProps,ga),r===null?a=!1:(t.stateNode=r,fa=t,pa=Dm(r.firstChild),ga=!1,a=!0)),a||va(t)),Ne(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,jp(a,o)?r=null:s!==null&&jp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=N(e,t,ds,null,null,n),Th._currentValue=a),Qc(e,t),Hc(e,t,r,n),t.child;case 6:return e===null&&ma&&((e=n=pa)&&(n=Sm(n,t.pendingProps,ga),n===null?e=!1:(t.stateNode=n,fa=t,pa=null,e=!0)),e||va(t)),null;case 13:return ol(e,t,n);case 4:return je(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bo(t,null,r,n):Hc(e,t,r,n),t.child;case 11:return Uc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Qc(e,t),Hc(e,t,r,n),t.child;case 8:return Hc(e,t,t.pendingProps.children,n),t.child;case 12:return Hc(e,t,t.pendingProps.children,n),t.child;case 10:return gl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Na(t),a=Pa(a),r=r(a),t.flags|=1,Hc(e,t,r,n),t.child;case 14:return Wc(e,t,t.type,t.pendingProps,n);case 15:return Gc(e,t,t.type,t.pendingProps,n);case 19:return hl(e,t,n);case 31:return Zc(e,t,n);case 22:return Kc(e,t,n,t.pendingProps);case 24:return Na(t),r=Pa(Ba),e===null?(a=eo(),a===null&&(a=dd,o=Va(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Co(t),Oa(t,Ba,a)):((e.lanes&n)!==0&&(wo(e,t),jo(t,null,null,n),Ao()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Oa(t,Ba,r),r!==a.cache&&ja(t,[Ba],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Oa(t,Ba,r))),Hc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:ma&&la(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Qc(e,t),Hc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function xl(e){e.flags|=4}function Sl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?fh(t,r):fh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(af())e.flags|=8192;else throw uo=oo,io}}else e.flags&=-16777217}function Cl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ph(t)){if(af())e.flags|=8192;else throw uo=oo,io}}function wl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:_t(),e.lanes|=t,Td|=t)}function Tl(e,t){if(!ma)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function El(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Dl(e,t,n){var r=t.pendingProps;switch(ua(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return El(t),null;case 1:return El(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ka(Ba),Me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xa(t)?xl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ca())),El(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(xl(t),o===null?(El(t),Sl(t,a,null,r,n)):(El(t),Cl(t,o))):o?o===e.memoizedState?(El(t),t.flags&=-16777217):(xl(t),El(t),Cl(t,o)):(e=e.memoizedProps,e!==r&&xl(t),El(t),Sl(t,a,e,r,n)),null;case 27:if(Pe(t),n=ke.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&xl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return El(t),t.subtreeFlags&=-33554433,null}e=De.current,xa(t)?ya(t,e):(e=Nm(a,r,n),t.stateNode=e,xl(t))}return El(t),t.subtreeFlags&=-33554433,null;case 5:if(Pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&xl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return El(t),t.subtreeFlags&=-33554433,null}if(o=De.current,xa(t))ya(t,o);else{var s=Dp(ke.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[kt]=t,o[At]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(bp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&xl(t)}}return El(t),t.subtreeFlags&=-33554433,Sl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&xl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ke.current,xa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=fa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[kt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||_p(e.nodeValue,n)),e||va(t,!0)}else e=Dp(e).createTextNode(r),e[kt]=t,t.stateNode=e}return El(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=xa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[kt]=t}else Sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;El(t),e=!1}else n=Ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Go(t),t):(Go(t),null);if(t.flags&128)throw Error(i(558))}return El(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=xa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[kt]=t}else Sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;El(t),a=!1}else a=Ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Go(t),t):(Go(t),null)}return Go(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),wl(t,t.updateQueue),El(t),null);case 4:return Me(),e===null&&sp(t.stateNode.containerInfo),t.flags|=67108864,El(t),null;case 10:return ka(t.type),El(t),null;case 19:if(Jo(t),r=t.memoizedState,r===null)return El(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Tl(r,!1);else{if(bd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Yo(e),o!==null){for(t.flags|=128,Tl(r,!1),e=o.updateQueue,t.updateQueue=e,wl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Wi(n,e),n=n.sibling;return qo(t,Ko.current&1|2),ma&&sa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&qe()>jd&&(t.flags|=128,a=!0,Tl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Yo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,wl(t,e),Tl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ma)return El(t),null}else 2*qe()-r.renderingStartTime>jd&&n!==536870912&&(t.flags|=128,a=!0,Tl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=qe(),e.sibling=null,o=Ko.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ma?qo(t,o):(n=o,Ee(zo,t),Ee(Ko,n),Bo===null&&(Bo=t)),ma&&sa(t,r.treeForkCount),e}return El(t),null;case 22:case 23:return Go(t),Ro(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(El(t),t.subtreeFlags&6&&(t.flags|=8192)):El(t),n=t.updateQueue,n!==null&&wl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Te($a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ka(Ba),El(t),null;case 25:return null;case 30:return t.flags|=33554432,El(t),null}throw Error(i(156,t.tag))}function Ol(e,t){switch(ua(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ka(Ba),Me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pe(t),null;case 31:if(t.memoizedState!==null){if(Go(t),t.alternate===null)throw Error(i(340));Sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Go(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Jo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Me(),null;case 10:return ka(t.type),null;case 22:case 23:return Go(t),Ro(),e!==null&&Te($a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ka(Ba),null;case 25:return null;default:return null}}function kl(e,t){switch(ua(t),t.tag){case 3:ka(Ba),Me();break;case 26:case 27:case 5:Pe(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Go(t);break;case 13:Go(t);break;case 19:Jo(t);break;case 10:ka(t.type);break;case 22:case 23:Go(t),Ro(),e!==null&&Te($a);break;case 24:ka(Ba)}}function Al(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){kf(t,t.return,e)}}function jl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){kf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){kf(t,t.return,e)}}function Ml(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{No(t,n)}catch(t){kf(e,e.return,t)}}}function Nl(e,t,n){n.props=Ac(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){kf(e,t,n)}}function Pl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Ei(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Qp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new $p(e);p(e.child,!1,gm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){kf(e,t,n)}}function Fl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){kf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){kf(e,t,n)}else n.current=null}}function Il(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)vm(e.stateNode,t[n])}function Ll(e){for(var t=e.return;t!==null&&(Bl(t)&&vm(e.stateNode,t.stateNode),!zl(t));)t=t.return}function Rl(e){for(var t=e.return;t!==null&&(Bl(t)&&ym(e.stateNode,t.stateNode),!zl(t));)t=t.return}function zl(e){return e.tag===5||e.tag===3||e.tag===27}function Bl(e){return e&&e.tag===7&&e.stateNode!==null}function Vl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){kf(e,e.return,t)}}function Hl(e,t,n){try{var r=e.stateNode;Sp(r,e.type,n,t),r[At]=t}catch(t){kf(e,e.return,t)}}function Ul(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Bp(e.type)||e.tag===4}function Wl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ul(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Bp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=En)),Il(e,r),$t=!0;else if(i!==4&&(i===27&&(Il(e,r),r=null,Bp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Gl(e,t,n,r),e=e.sibling;e!==null;)Gl(e,t,n,r),e=e.sibling}function Kl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Il(e,r),$t=!0;else if(i!==4&&(i===27&&(Il(e,r),r=null,Bp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Kl(e,t,n,r),e=e.sibling;e!==null;)Kl(e,t,n,r),e=e.sibling}function ql(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);bp(t,r,n),t[kt]=e,t[At]=n}catch(t){kf(e,e.return,t)}}var Jl=!1,Yl=null;function Xl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Jl=!0)}var Zl=null;function Ql(){var e=Zl;return Zl=null,e}var $l=0;function eu(e,t,n,r,i){return $l=0,tu(e.child,t,n,r,i)}function tu(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Kp(o);r.push(s),s.view&&(a=!0)}else a||Kp(o).view&&(a=!0);Jl=!0,Up(o,$l===0?t:t+`_`+$l,n),$l++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||tu(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function nu(e,t){for(;e!==null;)e.tag===5?Wp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||nu(e.child,t)),e=e.sibling}function ru(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ru(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Oi(t.default,t.share),t!==`none`&&(eu(e,n,t,null,!1)||nu(e.child,!1))}e=e.sibling}}function iu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Ei(r,n),a=Oi(r.default,n.paired?r.share:r.enter);a===`none`?ru(e):eu(e,i,a,null,!1)?(ru(e),n.paired||t||Jd(e,r.onEnter)):nu(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)iu(e,t),e=e.sibling;else ru(e)}function au(e){if(Yl!==null&&Yl.size!==0){var t=Yl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=Oi(n.default,n.share);if(a!==`none`&&(eu(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Jd(e,n.onShare)):nu(e.child,!1)),t.delete(r),t.size===0)break}}}au(e)}e=e.sibling}}}function ou(e){if(e.tag===30){var t=e.memoizedProps,n=Ei(t,e.stateNode),r=Yl===null?void 0:Yl.get(n),i=Oi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(eu(e,n,i,null,!1)?r===void 0?Jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Yl.delete(n),Jd(e,t.onShare)):nu(e.child,!1)),Yl!==null&&au(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ou(e),e=e.sibling;else Yl!==null&&au(e)}function su(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Ei(t,e.stateNode);t=Oi(t.default,t.update),e.flags&=-5,t!==`none`&&eu(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&su(e);e=e.sibling}}function cu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,nu(e.child,!1))}cu(e)}e=e.sibling}}function lu(e){if(e.tag===30)e.stateNode.paired=null,nu(e.child,!1),cu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)lu(e),e=e.sibling;else cu(e)}function uu(e){for(e=e.child;e!==null;)e.tag===30?nu(e.child,!1):e.subtreeFlags&33554432&&uu(e),e=e.sibling}function du(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&$l<a.length){var l=a[$l],u=Kp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Up(c,$l===0?n:n+`_`+$l,i),s&&e.flags&4||(Zl===null&&(Zl=[]),Zl.push(c,$l===0?r:r+`_`+$l,t.memoizedProps)),$l++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:du(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function fu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Ei(n,r),a=Oi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(qp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;$l=0,i=du(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&fu(e,t);e=e.sibling}}var pu=!1,mu=!1,hu=!1,gu=!1,_u=typeof WeakSet==`function`?WeakSet:Set,vu=null,yu=!1,bu=!1,xu=!1,Su=!1;function Cu(e,t,n){if(e=e.containerInfo,Tp=Ph,e=ei(e),ti(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(Ep={focusedElem:e,selectionRange:r},Ph=!1,n=(n&335544064)===n,vu=t,t=n?9270:1024;vu!==null;){if(e=vu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ou(r[a]);if(e.alternate===null&&e.flags&2)n&&Xl(e),wu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ou(r),wu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Xl(e),wu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,vu=r):(n&&su(e),wu(n))}}Yl=null}function wu(e){for(;vu!==null;){var t=vu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Ac(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){kf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)bm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:bm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=Ei(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Oi(a.default,a.update),a!==`none`&&eu(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,vu=r;break}vu=t.return}}function Tu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Gu(e,n),r&4&&Al(5,n);break;case 1:if(Gu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){kf(n,n.return,e)}else{var i=Ac(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){kf(n,n.return,e)}}}r&64&&Ml(n),r&512&&Pl(n,n.return);break;case 3:if(Gu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{No(e,t)}catch(e){kf(n,n.return,e)}}break;case 27:t===null&&r&4&&ql(n);case 26:case 5:Gu(e,n),t===null&&r&4&&Vl(n),r&512&&Pl(n,n.return);break;case 12:Gu(e,n);break;case 31:Gu(e,n),r&4&&Pu(e,n);break;case 13:Gu(e,n),r&4&&Fu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Nf.bind(null,n),Em(e,n))));break;case 22:if(r=n.memoizedState!==null||pu,!r){var a=t!==null&&t.memoizedState!==null||mu;t=pu,i=mu,pu=r,(mu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),qu(e,n,r)):Gu(e,n),pu=t,mu=i}break;case 30:Gu(e,n),r&512&&Pl(n,n.return);break;case 7:r&512&&Pl(n,n.return);default:Gu(e,n)}}function Eu(e,t){for(e=e.child;e!==null;)Du(e,t),e=e.sibling}function Du(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){kf(e,e.return,t)}Ou(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,$t=!0}catch(t){kf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Hp(s,!0):Hp(e.stateNode,!1)}catch(t){kf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Eu(e,t);break;default:Eu(e,t)}}function Ou(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Du(n,r);break a;case 22:n.memoizedState===null&&Ou(n,r);break a;default:Ou(n,r)}}e=e.sibling}}function ku(e){var t=e.alternate;t!==null&&(e.alternate=null,ku(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Au=null,ju=!1;function Mu(e,t,n){for(n=n.child;n!==null;)Nu(e,t,n),n=n.sibling}function Nu(e,t,n){if(rt&&typeof rt.onCommitFiberUnmount==`function`)try{rt.onCommitFiberUnmount(nt,n)}catch{}switch(n.tag){case 26:mu||Fl(n,t),Mu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!mu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:mu||Fl(n,t),Rl(n);var r=Au,i=ju;Bp(n.type)&&(Au=n.stateNode,ju=!1),Mu(e,t,n),Pm(n.stateNode,n.type,n.memoizedProps),Au=r,ju=i;break;case 5:mu||Fl(n,t),Rl(n);case 6:if(n.tag===6&&Rl(n),r=Au,i=ju,Au=null,Mu(e,t,n),Au=r,ju=i,Au!==null){if(ju)try{(Au.nodeType===9?Au.body:Au.nodeName===`HTML`?Au.ownerDocument.body:Au).removeChild(n.stateNode),$t=!0}catch(e){kf(n,t,e)}else try{Au.removeChild(n.stateNode),$t=!0}catch(e){kf(n,t,e)}}break;case 18:Au!==null&&(ju?(e=Au,Vp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),og(e)):Vp(Au,n.stateNode));break;case 4:r=Au,i=ju,Au=n.stateNode.containerInfo,ju=!0,Mu(e,t,n),Au=r,ju=i;break;case 0:case 11:case 14:case 15:jl(2,n,t),mu||jl(4,n,t),Mu(e,t,n);break;case 1:mu||(Fl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Nl(n,t,r)),Mu(e,t,n);break;case 21:Mu(e,t,n);break;case 22:mu=(r=mu)||n.memoizedState!==null,Mu(e,t,n),mu=r;break;case 30:Fl(n,t),Mu(e,t,n);break;case 7:mu||Fl(n,t),Mu(e,t,n);break;default:Mu(e,t,n)}}function Pu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{og(e)}catch(e){kf(t,t.return,e)}}}function Fu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{og(e)}catch(e){kf(t,t.return,e)}}function Iu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _u),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _u),t;default:throw Error(i(435,e.tag))}}function Lu(e,t){var n=Iu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Pf.bind(null,e,t);t.then(r,r)}})}function Ru(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Bp(l.type)){Au=l.stateNode,ju=!1;break a}break;case 5:Au=l.stateNode,ju=!1;break a;case 3:case 4:Au=l.stateNode.containerInfo,ju=!0;break a}l=l.return}if(Au===null)throw Error(i(160));Nu(s,c,o),Au=null,ju=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Bu(t,e,n),t=t.sibling}var zu=null;function Bu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Ru(t,e,n),Vu(e),a&4&&(jl(3,e,e.return),Al(3,e),jl(5,e,e.return));break;case 1:Ru(t,e,n),Vu(e),a&512&&(mu||r===null||Fl(r,r.return)),a&64&&pu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=zu,Ru(t,e,n),Vu(e),a&512&&(mu||r===null||Fl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(pu)e.stateNode=Ap(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[It]||r[kt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),bp(r,t,n),r[kt]=e,Ut(r),t=r;break a;case`link`:if(o=lh(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),bp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=lh(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),bp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[kt]=e,Ut(r),t=r}e.stateNode=t}}else pu||uh(o,e.type,e.stateNode)}else e.stateNode=ih(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Hl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||mu||t.parentNode.removeChild(t)):a.count--,n===null?pu||uh(o,e.type,e.stateNode):ih(o,n,e.memoizedProps))}break;case 27:Ru(t,e,n),Vu(e),a&512&&(mu||r===null||Fl(r,r.return)),r!==null&&a&4&&Hl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=hu,hu=!1,Ru(t,e,n),hu=o,Vu(e),a&512&&(mu||r===null||Fl(r,r.return)),e.flags&32){t=e.stateNode;try{vn(t,``),$t=!0}catch(t){kf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Hl(e,t,r===null?t:r.memoizedProps)),a&1024&&(gu=!0);break;case 6:if(Ru(t,e,n),Vu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,$t=!0}catch(t){kf(e,e.return,t)}}break;case 3:if($t=!1,ch=null,o=zu,zu=Rm(t.containerInfo),Ru(t,e,n),zu=o,Vu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{og(t.containerInfo)}catch(t){kf(e,e.return,t)}gu&&(gu=!1,Hu(e)),$t=!1;break;case 4:a=hu,hu=pu,r=en(),o=zu,zu=Rm(e.stateNode.containerInfo),Ru(t,e,n),Vu(e),zu=o,$t&&bu&&(xu=!0),$t=r,hu=a;break;case 12:Ru(t,e,n),Vu(e);break;case 31:Ru(t,e,n),Vu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 13:Ru(t,e,n),Vu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(kd=qe()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=pu,l=mu,u=hu;pu=c||o,hu=u||o,mu=l||s,Ru(t,e,n),mu=l,hu=u,pu=c,Vu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||pu||mu||(t=s||mu,n=pu,r=mu,pu=o||pu,mu=t,Ku(e,2),pu=n,mu=r),!o&&hu||Eu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Lu(e,n))));break;case 19:Ru(t,e,n),Vu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 30:a&512&&(mu||r===null||Fl(r,r.return)),a=en(),o=bu,s=(n&335544064)===n,c=e.memoizedProps,bu=s&&Oi(c.default,c.update)!==`none`,Ru(t,e,n),Vu(e),s&&r!==null&&$t&&(e.flags|=4),bu=o,$t=a;break;case 21:break;case 7:a&512&&(mu||r===null||Fl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ru(t,e,n),Vu(e)}}function Vu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ul(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Bl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(zl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Kl(e,Wl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(vn(l,``),n.flags&=-33),Kl(e,Wl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Gl(e,Wl(e),u,s);break;default:throw Error(i(161))}}catch(t){kf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Hu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ph=!0,t.reset(),Ph=!1),e=e.sibling}}function Uu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Wu(t,e),t=t.sibling;else fu(t,!1)}function Wu(e,t){var n=e.alternate;if(n===null)iu(e,!1);else switch(e.tag){case 3:if(Su=yu=!1,Ql(),Uu(t,e),!yu&&!xu){if(e=Zl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Wp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),Su=!0}Zl=null;break;case 5:Uu(t,e);break;case 4:r=yu,yu=!1,Uu(t,e),yu&&(xu=!0),yu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Uu(t,e):iu(e,!1));break;case 30:r=yu,i=Ql(),yu=!1,Uu(t,e),yu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Ei(a,o),o=Ei(n.memoizedProps,o);var s=Oi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,$l=0,t=du(e,n,t,o,s,a,!0),$l!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Jd(e,e.memoizedProps.onUpdate),Zl=i):i!==null&&(i.push.apply(i,Zl),Zl=i),yu=e.flags&32?!0:r;break;default:Uu(t,e)}}function Gu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Tu(e,t.alternate,t),t=t.sibling}function Ku(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:jl(4,n,n.return),Ku(n,r);break;case 1:Fl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Nl(n,n.return,i),Ku(n,r);break;case 27:r&2&&Pm(n.stateNode,n.type,n.memoizedProps);case 5:Fl(n,n.return),n.tag!==5&&n.tag!==27||Rl(n),Ku(n,r);break;case 6:Rl(n);break;case 26:Fl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||mu||i.parentNode.removeChild(i),Ku(n,r);break;case 22:n.memoizedState===null&&Ku(n,r);break;case 30:Fl(n,n.return),Ku(n,r);break;case 7:Fl(n,n.return);default:Ku(n,r)}e=e.sibling}}function qu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:qu(i,a,n),Al(4,a);break;case 1:if(qu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){kf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Mo(l[i],c)}catch(e){kf(r,r.return,e)}}s&&o&64&&Ml(a),Pl(a,a.return);break;case 27:n&2&&ql(a);case 5:a.tag!==5&&a.tag!==27||Ll(a),qu(i,a,n),s&&r===null&&o&4&&Vl(a),Pl(a,a.return);break;case 6:Ll(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||pu||uh(Rm(c.ownerDocument),a.type,c),qu(i,a,n),s&&r===null&&o&4&&Vl(a),Pl(a,a.return);break;case 12:qu(i,a,n);break;case 31:qu(i,a,n),s&&o&4&&Pu(i,a);break;case 13:qu(i,a,n),s&&o&4&&Fu(i,a);break;case 22:a.memoizedState===null&&qu(i,a,n),Pl(a,a.return);break;case 30:qu(i,a,n),Pl(a,a.return);break;case 7:Pl(a,a.return);default:qu(i,a,n)}t=t.sibling}}function Ju(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ha(n))}function Yu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ha(e))}function Xu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Zu(e,t,n,r),t=t.sibling;else i&&uu(t)}function Zu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&lu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Xu(e,t,n,r),a&2048&&Al(9,t);break;case 1:Xu(e,t,n,r);break;case 3:Xu(e,t,n,r),i&&Su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ha(a)));break;case 12:if(a&2048){Xu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){kf(t,t.return,e)}}else Xu(e,t,n,r);break;case 31:Xu(e,t,n,r);break;case 13:Xu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&lu(t),o._visibility&2?Xu(e,t,n,r):(o._visibility|=2,Qu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&lu(s),o._visibility&2?Xu(e,t,n,r):$u(e,t)),a&2048&&Ju(s,t);break;case 24:Xu(e,t,n,r),a&2048&&Yu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(nu(a.child,!0),nu(t.child,!0))),Xu(e,t,n,r);break;default:Xu(e,t,n,r)}}function Qu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Qu(a,o,s,c,i),Al(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Qu(a,o,s,c,i)):u._visibility&2?Qu(a,o,s,c,i):$u(a,o),i&&l&2048&&Ju(o.alternate,o);break;case 24:Qu(a,o,s,c,i),i&&l&2048&&Yu(o.alternate,o);break;default:Qu(a,o,s,c,i)}t=t.sibling}}function $u(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:$u(n,r),i&2048&&Ju(r.alternate,r);break;case 24:$u(n,r),i&2048&&Yu(r.alternate,r);break;default:$u(n,r)}t=t.sibling}}var ed=8192;function td(e,t,n){if(e.subtreeFlags&ed)for(e=e.child;e!==null;)nd(e,t,n),e=e.sibling}function nd(e,t,n){switch(e.tag){case 26:td(e,t,n),e.flags&ed&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&hh(n,e)):gh(n,zu,e.memoizedState,e.memoizedProps));break;case 5:td(e,t,n),e.flags&ed&&(e=e.stateNode,(t&335544128)===t&&hh(n,e));break;case 3:case 4:var r=zu;zu=Rm(e.stateNode.containerInfo),td(e,t,n),zu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ed,ed=16777216,td(e,t,n),ed=r):td(e,t,n));break;case 30:if((e.flags&ed)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Yl===null&&(Yl=new Map),Yl.set(r,i)}td(e,t,n);break;default:td(e,t,n)}}function rd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function id(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];vu=r,sd(r,e)}rd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ad(e),e=e.sibling}function ad(e){switch(e.tag){case 0:case 11:case 15:id(e),e.flags&2048&&jl(9,e,e.return);break;case 3:id(e);break;case 12:id(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,od(e)):id(e);break;default:id(e)}}function od(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];vu=r,sd(r,e)}rd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:jl(8,t,t.return),od(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,od(t));break;default:od(t)}e=e.sibling}}function sd(e,t){for(;vu!==null;){var n=vu;switch(n.tag){case 0:case 11:case 15:jl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ha(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,vu=r;else a:for(n=e;vu!==null;){r=vu;var i=r.sibling,a=r.return;if(ku(r),r===n){vu=null;break a}if(i!==null){i.return=a,vu=i;break a}vu=a}}}var cd={getCacheForType:function(e){var t=Pa(Ba),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pa(Ba).controller.signal}},ld=typeof WeakMap==`function`?WeakMap:Map,ud=0,dd=null,fd=null,pd=0,md=0,hd=null,gd=!1,_d=!1,vd=!1,yd=0,bd=0,xd=0,Sd=0,Cd=0,wd=0,Td=0,Ed=null,Dd=null,Od=!1,kd=0,Ad=0,jd=1/0,Md=null,Nd=null,Pd=0,Fd=null,Id=null,Ld=0,Rd=0,zd=null,Bd=null,Vd=null,Hd=null,Ud=null,Wd=0,Gd=null;function Kd(){return ud&2&&pd!==0?pd&-pd:O.T===null?Et():Xf()}function qd(){if(wd===0){if(!(pd&536870912)||ma){var e=ut;ut<<=1,!(ut&3932160)&&(ut=262144),wd=e}else wd=536870912}return e=zo.current,e!==null&&(e.flags|=32),wd}function Jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Qp(Ei(e.memoizedProps,n))),Hd===null&&(Hd=[]),Hd.push(t.bind(null,r))}}function Yd(e,t,n){(e===dd&&(md===2||md===9)||e.cancelPendingCommit!==null)&&(nf(e,0),$d(e,pd,wd,!1)),yt(e,n),(!(ud&2)||e!==dd)&&(e===dd&&(!(ud&2)&&(Sd|=n),bd===4&&$d(e,pd,wd,!1)),Hf(e))}function Xd(e,t,n){if(ud&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||mt(e,t),a=r?df(e,t):lf(e,t,!0),o=r;do{if(a===0){_d&&!r&&$d(e,t,0,!1);break}if(n=e.current.alternate,o&&!Qd(n))a=lf(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Ed;var l=c.current.memoizedState.isDehydrated;if(l&&(nf(c,s).flags|=256),s=lf(c,s,!1),s!==2&&s!==6){if(vd&&!l){c.errorRecoveryDisabledLanes|=o,Sd|=o,a=4;break a}o=Dd,Dd=a,o!==null&&(Dd===null?Dd=o:Dd.push.apply(Dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){nf(e,0),$d(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:$d(r,t,wd,!gd);break a;case 2:Dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=kd+300-qe(),10<a)){if($d(r,t,wd,!gd),pt(r,0,!0)!==0)break a;Ld=t,r.timeoutHandle=Pp(Zd.bind(null,r,n,Dd,Md,Od,t,wd,Sd,Td,gd,o,`Throttled`,-0,0),a);break a}Zd(r,n,Dd,Md,Od,t,wd,Sd,Td,gd,o,null,-0,0)}break}}while(1);Hf(e)}function Zd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:En},Yl=null,nd(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=bh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?kd-qe():(a&4194048)===a?Ad-qe():0,m=vh(d,m),m!==null)?(Ld=a,e.cancelPendingCommit=m(vf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),$d(e,a,o,!l)):vf(e,t,a,n,r,i,o,s,c,l,u,d)}function Qd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Jr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $d(e,t,n,r){t=ht(e,t),t&=~Cd,t&=~Sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-at(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&xt(e,n,t)}function ef(){return ud&6?!0:(Uf(0,!1),!1)}function tf(){if(fd!==null){if(md===0)var e=fd.return;else e=fd,Da=Ea=null,ps(e),mo=null,ho=0,e=fd;for(;e!==null;)kl(e.alternate,e),e=e.return;fd=null}}function nf(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Fp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ld=0,tf(),dd=e,fd=n=Ui(e.current,null),pd=t,md=0,hd=null,gd=!1,_d=mt(e,t),vd=!1,Td=wd=Cd=Sd=xd=bd=0,Dd=Ed=null,Od=!1,yd=ht(e,t),Ni(),n}function rf(e,t){Zo=null,O.H=Cc,t===ro||t===ao?(t=fo(),md=3):t===io?(t=fo(),md=4):md=t===Bc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,hd=t,fd===null&&(bd=1,Pc(e,Zi(t,e.current)))}function af(){var e=zo.current;return e===null?!0:(pd&4194048)===pd?Bo===null:(pd&62914560)===pd||pd&536870912?e===Bo:!1}function of(){var e=O.H;return O.H=Cc,e===null?Cc:e}function sf(){var e=O.A;return O.A=cd,e}function cf(){bd=4,gd||(pd&4194048)!==pd&&zo.current!==null||(_d=!0),!(xd&134217727)&&!(Sd&134217727)||dd===null||$d(dd,pd,wd,!1)}function lf(e,t,n){var r=ud;ud|=2;var i=of(),a=sf();(dd!==e||pd!==t)&&(Md=null,nf(e,t)),t=!1;var o=bd;a:do try{if(md!==0&&fd!==null){var s=fd,c=hd;switch(md){case 8:tf(),o=6;break a;case 3:case 2:case 9:case 6:zo.current===null&&(t=!0);var l=md;if(md=0,hd=null,hf(e,s,c,l),n&&_d){o=0;break a}break;default:l=md,md=0,hd=null,hf(e,s,c,l)}}uf(),o=bd;break}catch(t){rf(e,t)}while(1);return t&&e.shellSuspendCounter++,Da=Ea=null,ud=r,O.H=i,O.A=a,fd===null&&(dd=null,pd=0,Ni()),o}function uf(){for(;fd!==null;)pf(fd)}function df(e,t){var n=ud;ud|=2;var r=of(),a=sf();dd!==e||pd!==t?(Md=null,jd=qe()+500,nf(e,t)):_d=mt(e,t);a:do try{if(md!==0&&fd!==null){t=fd;var o=hd;b:switch(md){case 1:md=0,hd=null,hf(e,t,o,1);break;case 2:case 9:if(so(o)){md=0,hd=null,mf(t);break}t=function(){md!==2&&md!==9||dd!==e||(md=7),Hf(e)},o.then(t,t);break a;case 3:md=7;break a;case 4:md=5;break a;case 7:so(o)?(md=0,hd=null,mf(t)):(md=0,hd=null,hf(e,t,o,7));break;case 5:var s=null;switch(fd.tag){case 26:s=fd.memoizedState;case 5:case 27:var c=fd;if(s?ph(s):c.stateNode.complete){md=0,hd=null;var l=c.sibling;if(l!==null)fd=l;else{var u=c.return;u===null?fd=null:(fd=u,gf(u))}break b}}md=0,hd=null,hf(e,t,o,5);break;case 6:md=0,hd=null,hf(e,t,o,6);break;case 8:tf(),bd=6;break a;default:throw Error(i(462))}}ff();break}catch(t){rf(e,t)}while(1);return Da=Ea=null,O.H=r,O.A=a,ud=n,fd===null?(dd=null,pd=0,Ni(),bd):0}function ff(){for(;fd!==null&&!Ge();)pf(fd)}function pf(e){var t=bl(e.alternate,e,yd);e.memoizedProps=e.pendingProps,t===null?gf(e):fd=t}function mf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=el(n,t,t.pendingProps,t.type,void 0,pd);break;case 11:t=el(n,t,t.pendingProps,t.type.render,t.ref,pd);break;case 5:ps(t);var r=t;r===fa&&(ma?(ba(r),r.tag===5&&r.stateNode!=null&&(pa=r.stateNode)):(ba(r),ma=!0));default:kl(n,t),t=fd=Wi(t,yd),t=bl(n,t,yd)}e.memoizedProps=e.pendingProps,t===null?gf(e):fd=t}function hf(e,t,n,r){Da=Ea=null,ps(t),mo=null,ho=0;var i=t.return;try{if(zc(e,i,t,n,pd)){bd=1,Pc(e,Zi(n,e.current)),fd=null;return}}catch(t){if(i!==null)throw fd=i,t;bd=1,Pc(e,Zi(n,e.current)),fd=null;return}t.flags&32768?(ma||r===1?e=!0:_d||pd&536870912?e=!1:(gd=e=!0,(r===2||r===9||r===3||r===6)&&(r=zo.current,r!==null&&r.tag===13&&(r.flags|=16384))),_f(t,e)):gf(t)}function gf(e){var t=e;do{if(t.flags&32768){_f(t,gd);return}e=t.return;var n=Dl(t.alternate,t,yd);if(n!==null){fd=n;return}if(t=t.sibling,t!==null){fd=t;return}fd=t=e}while(t!==null);bd===0&&(bd=5)}function _f(e,t){do{var n=Ol(e.alternate,e);if(n!==null){n.flags&=32767,fd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){fd=e;return}fd=e=n}while(e!==null);bd=6,fd=null}function vf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do Ef();while(Pd!==0);if(ud&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===dd&&(fd=dd=null,pd=0),Id=t,Fd=e,Ld=n,zd=a,Bd=r,yf(e,t,n,s,c,l,f)}}function yf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Rd=s,s|=Mi,bt(e,n,s,r,i,a),Hd=null,(n&335544064)===n?(Ud=Ga(e),r=10262):(Ud=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Ff(Ze,function(){return Df(),null})):(e.callbackNode=null,e.callbackPriority=0),Jl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=O.T,O.T=null,i=k.p,k.p=2,a=ud,ud|=4;try{Cu(e,t,n)}finally{ud=a,k.p=i,O.T=r}}Pd=1,Jl?Vd=Xp(o,e.containerInfo,Ud,Sf,Cf,xf,wf,Df,bf,null,null):(Sf(),Cf(),wf())}function bf(e){if(Pd!==0){var t=Fd.onRecoverableError;t(e,{componentStack:null})}}function xf(){Pd===3&&(Pd=0,Wu(Id,Fd),Pd=4)}function Sf(){if(Pd===1){Pd=0;var e=Fd,t=Id,n=Ld,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=O.T,O.T=null;var i=k.p;k.p=2;var a=ud;ud|=4;try{bu=xu=!1,Bu(t,e,n),n=Ep;var o=ei(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&$r(s.ownerDocument.documentElement,s)){if(c!==null&&ti(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Qr(s,h),v=Qr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Ph=!!Tp,Ep=Tp=null}finally{ud=a,k.p=i,O.T=r}}e.current=t,Pd=2}}function Cf(){if(Pd===2){Pd=0;var e=Fd,t=Id,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=ud;ud|=4;try{Tu(e,t.alternate,t)}finally{ud=i,k.p=r,O.T=n}}Pd=3}}function wf(){if(Pd===4||Pd===3){Pd=0;var e=Vd;Vd=null,Ke();var t=Fd,n=Id,r=Ld,i=Bd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Pd=5:(Pd=0,Id=Fd=null,Tf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Nd=null),Tt(r),n=n.stateNode,rt&&typeof rt.onCommitFiberRoot==`function`)try{rt.onCommitFiberRoot(nt,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=O.T,a=k.p,k.p=2,O.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{O.T=n,k.p=a}}if(i=Hd,o=Ud,Ud=null,i!==null&&(Hd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ld&3&&Ef(),Hf(t),a=t.pendingLanes,r&261930&&a&42?t===Gd?Wd++:(Wd=0,Gd=t):(Wd=0,Gd=null),Uf(0,!1)}}function Tf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ha(t)))}function Ef(){return Vd!==null&&(Vd.skipTransition(),Vd=null),Sf(),Cf(),wf(),Df()}function Df(){if(Pd!==5)return!1;var e=Fd,t=Rd;Rd=0;var n=Tt(Ld),r=O.T,a=k.p;try{k.p=32>n?32:n,O.T=null,n=zd,zd=null;var o=Fd,s=Ld;if(Pd=0,Id=Fd=null,Ld=0,ud&6)throw Error(i(331));var c=ud;if(ud|=4,ad(o.current),Zu(o,o.current,s,n),ud=c,Uf(0,!1),rt&&typeof rt.onPostCommitFiberRoot==`function`)try{rt.onPostCommitFiberRoot(nt,o)}catch{}return!0}finally{k.p=a,O.T=r,Tf(e,t)}}function Of(e,t,n){t=Zi(n,t),t=Ic(e.stateNode,t,2),e=Eo(e,t,2),e!==null&&(yt(e,2),Hf(e))}function kf(e,t,n){if(e.tag===3)Of(e,e,n);else for(;t!==null;){if(t.tag===3){Of(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Nd===null||!Nd.has(r))){e=Zi(n,e),n=Lc(2),r=Eo(t,n,2),r!==null&&(Rc(n,r,t,e),yt(r,2),Hf(r));break}}t=t.return}}function Af(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ld;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(vd=!0,i.add(n),e=jf.bind(null,e,t,n),t.then(e,e))}function jf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,dd===e&&(pd&n)===n&&(bd===4||bd===3&&(pd&62914560)===pd&&300>qe()-kd?ud&2?Cd|=n:nf(e,0):Cd|=n,Td===pd&&(Td=0)),Hf(e)}function Mf(e,t){t===0&&(t=_t()),e=Ii(e,t),e!==null&&(yt(e,t),Hf(e))}function Nf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mf(e,n)}function Pf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Mf(e,n)}function Ff(e,t){return Ue(e,t)}var If=null,Lf=null,Rf=!1,zf=!1,Bf=!1,Vf=0;function Hf(e){e!==Lf&&e.next===null&&(Lf===null?If=Lf=e:Lf=Lf.next=e),zf=!0,Rf||(Rf=!0,Yf())}function Uf(e,t){if(!Bf&&zf){Bf=!0;do for(var n=!1,r=If;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-at(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Jf(r,a))}else a=pd,a=pt(r,r===dd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||mt(r,a)||(n=!0,Jf(r,a))}r=r.next}while(n);Bf=!1}}function Wf(){Gf()}function Gf(){zf=Rf=!1;var e=0;Vf!==0&&Np()&&(e=Vf);for(var t=qe(),n=null,r=If;r!==null;){var i=r.next,a=Kf(r,t);a===0?(r.next=null,n===null?If=i:n.next=i,i===null&&(Lf=n)):(n=r,(e!==0||a&3)&&(zf=!0)),r=i}Pd!==0&&Pd!==5||Uf(e,!1),Vf!==0&&(Vf=0)}function Kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-at(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=gt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=dd,n=pd,n=pt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(md===2||md===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&We(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||mt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&We(r),Tt(n)){case 2:case 8:n=Xe;break;case 32:n=Ze;break;case 268435456:n=$e;break;default:n=Ze}return r=qf.bind(null,e),n=Ue(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&We(r),e.callbackPriority=2,e.callbackNode=null,2}function qf(e,t){if(Pd!==0&&Pd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ef()&&e.callbackNode!==n)return null;var r=pd;return r=pt(e,e===dd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Xd(e,r,t),Kf(e,qe()),e.callbackNode!=null&&e.callbackNode===n?qf.bind(null,e):null)}function Jf(e,t){if(Ef())return null;Xd(e,t,!0)}function Yf(){Rp(function(){ud&6?Ue(Ye,Wf):Gf()})}function Xf(){if(Vf===0){var e=Ja;e===0&&(e=lt,lt<<=1,!(lt&261888)&&(lt=256)),Vf=e}return Vf}function Zf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Tn(e)}function Qf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Zf((i[At]||null).action),o=r.submitter;o&&(t=(t=o[At]||null)?Zf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Kn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Vf!==0){var e=new FormData(i,o);lc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),lc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var $f=0;$f<Ci.length;$f++){var ep=Ci[$f];wi(ep.toLowerCase(),`on`+(ep[0].toUpperCase()+ep.slice(1)))}wi(pi,`onAnimationEnd`),wi(hi,`onAnimationIteration`),wi(_i,`onAnimationStart`),wi(`dblclick`,`onDoubleClick`),wi(`focusin`,`onFocus`),wi(`focusout`,`onBlur`),wi(vi,`onTransitionRun`),wi(yi,`onTransitionStart`),wi(bi,`onTransitionCancel`),wi(xi,`onTransitionEnd`),Jt(`onMouseEnter`,[`mouseout`,`mouseover`]),Jt(`onMouseLeave`,[`mouseout`,`mouseover`]),Jt(`onPointerEnter`,[`pointerout`,`pointerover`]),Jt(`onPointerLeave`,[`pointerout`,`pointerover`]),qt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),qt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),qt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),qt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),qt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),qt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var tp=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),np=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(tp));function rp(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ki(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ki(e)}i.currentTarget=null,a=c}}}}function ip(e,t){var n=t[Mt];n===void 0&&(n=t[Mt]=new Set);var r=e+`__bubble`;n.has(r)||(cp(t,e,2,!1),n.add(r))}function ap(e,t,n){var r=0;t&&(r|=4),cp(n,e,r,t)}var op=`_reactListening`+Math.random().toString(36).slice(2);function sp(e){if(!e[op]){e[op]=!0,Gt.forEach(function(t){t!==`selectionchange`&&(np.has(t)||ap(t,!1,e),ap(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[op]||(t[op]=!0,ap(`selectionchange`,!1,t))}}function cp(e,t,n,r){switch(Vh(t)){case 2:var i=Fh;break;case 8:i=Ih;break;default:i=Lh}n=i.bind(null,t,n,e),i=void 0,!In||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function lp(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=zt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Nn(function(){var r=a,i=On(n),s=[];a:{var c=Si.get(e);if(c!==void 0){var l=Kn,u=e;switch(e){case`keypress`:if(Vn(n)===0)break a;case`keydown`:case`keyup`:l=ur;break;case`focusin`:u=`focus`,l=tr;break;case`focusout`:u=`blur`,l=tr;break;case`beforeblur`:case`afterblur`:l=tr;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=$n;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=er;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=pr;break;case pi:case hi:case _i:l=nr;break;case xi:l=mr;break;case`scroll`:case`scrollend`:l=Jn;break;case`wheel`:l=hr;break;case`copy`:case`cut`:case`paste`:l=rr;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=dr;break;case`submit`:l=fr;break;case`toggle`:case`beforetoggle`:l=gr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Pn(m,p),g!=null&&d.push(up(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Dn&&(u=n.relatedTarget||n.fromElement)&&(zt(u)||u[jt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?zt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=$n,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=dr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Vt(c),h=l==null?u:Vt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,zt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,fp):null,c!==null&&pp(s,u,c,d,!1),l!==null&&f!==null&&pp(s,f,l,d,!0)))}a:{if(c=r?Vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ir;else if(Ar(c)){if(Lr)_=Kr;else{_=Wr;var v=Ur}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Sn(r.elementType)&&(_=Ir):_=Gr;if(_&&=_(e,r)){jr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Vt(r):window,e){case`focusin`:(Ar(v)||v.contentEditable===`true`)&&(ri=v,ii=r,ai=null);break;case`focusout`:ai=ii=ri=null;break;case`mousedown`:oi=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:oi=!1,si(s,n,i);break;case`selectionchange`:if(ni)break;case`keydown`:case`keyup`:si(s,n,i)}var y;if(vr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Er?wr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(xr&&n.locale!==`ko`&&(Er||b!==`onCompositionStart`?b===`onCompositionEnd`&&Er&&(y=Bn()):(A=i,Rn=`value`in A?A.value:A.textContent,Er=!0)),v=dp(r,b),0<v.length&&(b=new ir(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=Tr(n),y!==null&&(b.data=y)))),(y=br?Dr(e,n):Or(e,n))&&(b=dp(r,`onBeforeInput`),0<b.length&&(v=new ir(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Qf(s,e,r,n,i)}rp(s,t)})}function up(e,t,n){return{instance:e,listener:t,currentTarget:n}}function dp(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Pn(e,n),i!=null&&r.unshift(up(e,i,a)),i=Pn(e,t),i!=null&&r.push(up(e,i,a))),e.tag===3)return r;e=e.return}return[]}function fp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Pn(n,a),l!=null&&o.unshift(up(n,l,c))):i||(l=Pn(n,a),l!=null&&o.push(up(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var mp=/\r\n?/g,hp=/\u0000|\uFFFD/g;function gp(e){return(typeof e==`string`?e:``+e).replace(mp,`
10
+ `).replace(hp,``)}function _p(e,t){return t=gp(t),gp(e)===t}function vp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||vn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&vn(e,``+r);else return;break;case`className`:nn(e,`class`,r);break;case`tabIndex`:nn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:nn(e,n,r);break;case`style`:xn(e,r,o);return;case`data`:if(t!==`object`){nn(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Tn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&vp(e,t,`name`,a.name,a,null),vp(e,t,`formEncType`,a.formEncType,a,null),vp(e,t,`formMethod`,a.formMethod,a,null),vp(e,t,`formTarget`,a.formTarget,a,null)):(vp(e,t,`encType`,a.encType,a,null),vp(e,t,`method`,a.method,a,null),vp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Tn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=En);return;case`onScroll`:r!=null&&ip(`scroll`,e);return;case`onScrollEnd`:r!=null&&ip(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Tn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:ip(`beforetoggle`,e),ip(`toggle`,e),tn(e,`popover`,r);break;case`xlinkActuate`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:tn(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=Cn.get(n)||n,tn(e,n,r);else return}$t=!0}function yp(e,t,n,r,a,o){switch(n){case`style`:xn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)vn(e,r);else if(typeof r==`number`||typeof r==`bigint`)vn(e,``+r);else return;break;case`onScroll`:r!=null&&ip(`scroll`,e);return;case`onScrollEnd`:r!=null&&ip(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=En);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Kt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[At]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}$t=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):tn(e,n,r)}return}$t=!0}function bp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:ip(`error`,e),ip(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:vp(e,t,o,s,n,null)}}a&&vp(e,t,`srcSet`,n.srcSet,n,null),r&&vp(e,t,`src`,n.src,n,null);return;case`input`:ip(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:vp(e,t,r,d,n,null)}}pn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in ip(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:vp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&hn(e,!!r,n,!0):hn(e,!!r,t,!1);return;case`textarea`:for(s in ip(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:vp(e,t,s,c,n,null)}_n(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:vp(e,t,l,r,n,null)}return;case`dialog`:ip(`beforetoggle`,e),ip(`toggle`,e),ip(`cancel`,e),ip(`close`,e);break;case`iframe`:case`object`:ip(`load`,e);break;case`video`:case`audio`:for(r=0;r<tp.length;r++)ip(tp[r],e);break;case`image`:ip(`error`,e),ip(`load`,e);break;case`details`:ip(`toggle`,e);break;case`embed`:case`source`:case`link`:ip(`error`,e),ip(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:vp(e,t,u,r,n,null)}return;default:if(Sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&yp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&vp(e,t,c,r,n,null))}var xp={};function Sp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||vp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&($t=!0),o=m;break;case`name`:m!==f&&($t=!0),a=m;break;case`checked`:m!==f&&($t=!0),u=m;break;case`defaultChecked`:m!==f&&($t=!0),d=m;break;case`value`:m!==f&&($t=!0),s=m;break;case`defaultValue`:m!==f&&($t=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&vp(e,t,p,m,r,f)}}fn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||vp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&($t=!0),p=o;break;case`defaultValue`:o!==l&&($t=!0),c=o;break;case`multiple`:o!==l&&($t=!0),s=o;default:o!==l&&vp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?hn(e,!!n,n?[]:``,!1):hn(e,!!n,t,!0)):hn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:vp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&($t=!0),p=a;break;case`defaultValue`:a!==o&&($t=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&vp(e,t,s,a,r,o)}gn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:vp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&($t=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:vp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&vp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:vp(e,t,u,p,r,m)}return;default:if(Sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&yp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||yp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&vp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||vp(e,t,f,p,r,m)}function Cp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function wp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Cp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Cp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Tp=null,Ep=null;function Dp(e){return e.nodeType===9?e:e.ownerDocument}function Op(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function kp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ap(e,t,n,r){return n=Dp(n).createElement(e),n[kt]=r,n[At]=t,bp(n,e,t),Ut(n),n}function jp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Mp=null;function Np(){var e=window.event;return e&&e.type===`popstate`?e!==Mp&&(Mp=e,!0):(Mp=null,!1)}var Pp=typeof setTimeout==`function`?setTimeout:void 0,Fp=typeof clearTimeout==`function`?clearTimeout:void 0,Ip=typeof Promise==`function`?Promise:void 0,Lp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Pp,Rp=typeof queueMicrotask==`function`?queueMicrotask:Ip===void 0?Pp:function(e){return Ip.resolve(null).then(e).catch(zp)};function zp(e){setTimeout(function(){throw e})}function Bp(e){return e===`head`}function Vp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),og(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Fm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Fm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[It]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Fm(e.ownerDocument.body)}n=i}while(n);og(t)}function Hp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Up(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Wp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Gp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Kp(e){return Gp(e.getBoundingClientRect(),getComputedStyle(e),e)}function qp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Gp(t,n,e)}function Jp(e){return e.documentElement.clientHeight}function Yp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Xp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Jp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=mh(f),u>_h){s.length=o;break}f=new Promise(Yp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Zp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Qp(e){return{name:e,group:new Zp(`group`,e),imagePair:new Zp(`image-pair`,e),old:new Zp(`old`,e),new:new Zp(`new`,e)}}function $p(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}$p.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(im(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=nm(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,em,e,s,r)}this._eventListeners=a}};function em(e,t,n,r){return v(e).addEventListener(t,n,r),!1}$p.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=im(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=nm(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,tm,e,n,i),r.splice(t,1),a!==null&&a()}};function tm(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function nm(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function rm(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function im(e,t,n,r){if(e.length===0)return-1;r=rm(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&rm(a.optionsOrUseCapture)===r)return i}return-1}$p.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,nm(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,nm(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},$p.prototype.focus=function(e){p(this._fragmentFiber.child,!0,am,e,void 0,void 0)};function am(e,t){return e.tag!==6&&(e=v(e),jm(e,t))}$p.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,om,t,void 0,void 0);for(var n=t.length-1;0<=n&&!am(t[n],e);n--);};function om(e,t){return t.push(e),!1}$p.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=Dp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,sm,e,void 0,void 0))};function sm(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}$p.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,cm,e,void 0,void 0)};function cm(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}$p.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,lm,e,void 0,void 0);for(var n=t=0;n<um.length;n++){var r=um[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):um[t++]=r}um.length=t}};function lm(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var um=[],dm=!1;function fm(e,t,n){um.push({fragmentInstance:e,observer:t,instance:n}),dm||(dm=!0,Mm(function(){dm=!1;var e=um;um=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}$p.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,pm,e,void 0,void 0),e};function pm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}$p.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},$p.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,om,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||mm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function mm(e,t,n,r,i){var a=zt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function hm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}$p.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,om,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),hm(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),hm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function gm(e,t){return e=v(e),_m(e,t),!1}function _m(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function vm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,nm(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<um.length;i++){var a=um[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(um[r++]=a)}um.length=r,n.observe(e)}),_m(e,t))}function ym(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,nm(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?fm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function bm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:bm(n),Rt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function xm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[It])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=Dm(e.nextSibling),e===null)break}return null}function Sm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Dm(e.nextSibling),e===null))return null;return e}function Cm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Dm(e.nextSibling),e===null))return null;return e}function wm(e){return e.data===`$?`||e.data===`$~`}function Tm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function Em(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function Dm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Om=null;function km(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Dm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Am(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function jm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Mm(e){Lp(function(){Lp(function(t){return e(t)})})}function Nm(e,t,n){switch(t=Dp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Pm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&vp(e,t,r,null,xp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===En&&(e.onclick=null),Rt(e)}function Fm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rt(e)}var Im=new Map,Lm=new Set;function Rm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var zm=k.d;k.d={f:Bm,r:Vm,D:Wm,C:Gm,L:Km,m:qm,X:Ym,S:Jm,M:Xm};function Bm(){var e=zm.f(),t=ef();return e||t}function Vm(e){var t=Bt(e);t!==null&&t.tag===5&&t.type===`form`?dc(t):zm.r(e)}var Hm=typeof document>`u`?null:document;function Um(e,t,n){var r=Hm;if(r&&typeof t==`string`&&t){var i=dn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Lm.has(i)||(Lm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),bp(t,`link`,e),Ut(t),r.head.appendChild(t)))}}function Wm(e){zm.D(e),Um(`dns-prefetch`,e,null)}function Gm(e,t){zm.C(e,t),Um(`preconnect`,e,t)}function Km(e,t,n){zm.L(e,t,n);var r=Hm;if(r&&e&&t){var i=`link[rel="preload"][as="`+dn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+dn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+dn(n.imageSizes)+`"]`)):i+=`[href="`+dn(e)+`"]`;var a=i;switch(t){case`style`:a=Qm(e);break;case`script`:a=nh(e)}if(!(Im.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Im.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector($m(a))||t===`script`&&r.querySelector(rh(a))))){var o=r.createElement(`link`);bp(o,`link`,e),t===`style`&&(o[Lt]=!0,o.onload=o.onerror=function(){Wt(o)}),Ut(o),r.head.appendChild(o)}}}function qm(e,t){zm.m(e,t);var n=Hm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+dn(r)+`"][href="`+dn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=nh(e)}if(!Im.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Im.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(rh(a)))return}r=n.createElement(`link`),bp(r,`link`,e),Ut(r),n.head.appendChild(r)}}}function Jm(e,t,n){zm.S(e,t,n);var r=Hm;if(r&&e){var i=Ht(r).hoistableStyles,a=Qm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector($m(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Im.get(a))&&oh(e,n);var c=o=r.createElement(`link`);Ut(c),bp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,ah(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Ym(e,t){zm.X(e,t);var n=Hm;if(n&&e){var r=Ht(n).hoistableScripts,i=nh(e),a=r.get(i);a||(a=n.querySelector(rh(i)),a||(e=T({src:e,async:!0},t),(t=Im.get(i))&&sh(e,t),a=n.createElement(`script`),Ut(a),bp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Xm(e,t){zm.M(e,t);var n=Hm;if(n&&e){var r=Ht(n).hoistableScripts,i=nh(e),a=r.get(i);a||(a=n.querySelector(rh(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Im.get(i))&&sh(e,t),a=n.createElement(`script`),Ut(a),bp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Zm(e,t,n,r){var a=(a=ke.current)?Rm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Qm(n.href),t=Ht(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Qm(n.href);var o=Ht(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector($m(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Im.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Im.set(e,o)),th(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=nh(n),t=Ht(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Qm(e){return`href="`+dn(e)+`"`}function $m(e){return`link[rel="stylesheet"][`+e+`]`}function eh(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function th(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Lt]){r.loading=1;return}}else t=e.createElement(`link`),t[Lt]=!0,t.onload=t.onerror=Wt.bind(null,t),bp(t,`link`,n),Ut(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function nh(e){return`[src="`+dn(e)+`"]`}function rh(e){return`script[async]`+e}function ih(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+dn(n.href)+`"]`);if(r)return t.instance=r,Ut(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ut(r),bp(r,`style`,a),ah(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Qm(n.href);var o=e.querySelector($m(a));if(o)return t.state.loading|=4,t.instance=o,Ut(o),o;r=eh(n),(a=Im.get(a))&&oh(r,a),o=(e.ownerDocument||e).createElement(`link`),Ut(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),bp(o,`link`,r),t.state.loading|=4,ah(o,n.precedence,e),t.instance=o;case`script`:return o=nh(n.src),(a=e.querySelector(rh(o)))?(t.instance=a,Ut(a),a):(r=n,(a=Im.get(o))&&(r=T({},n),sh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ut(a),bp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,ah(r,n.precedence,e));return t.instance}function ah(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function oh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function sh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ch=null;function lh(e,t,n){if(ch===null){var r=new Map,i=ch=new Map;i.set(n,r)}else i=ch,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[It]||a[kt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function uh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function dh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function fh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ph(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function mh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function hh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=mh(t),e.suspenseyImages.push(t)),e=xh.bind(e),t.decode().then(e,e))}function gh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Qm(r.href),a=t.querySelector($m(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=bh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ut(a);return}a=t.ownerDocument||t,r=eh(r),(i=Im.get(i))&&oh(r,i),a=a.createElement(`link`),Ut(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),bp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=bh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var _h=0;function vh(e,t){return e.stylesheets&&e.count===0&&Ch(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Ch(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&_h===0&&(_h=62500*wp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ch(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>_h?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function yh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ch(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function bh(){this.count--,yh(this)}function xh(){this.imgCount--,yh(this)}var Sh=null;function Ch(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Sh=new Map,t.forEach(wh,e),Sh=null,bh.call(e))}function wh(e,t){if(!(t.state.loading&4)){var n=Sh.get(e);if(n)var r=n.get(null);else{n=new Map,Sh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=bh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Th={$$typeof:oe,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function Eh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function Dh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new Eh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Vi(3,null,null,t),e.current=a,a.stateNode=e,t=Va(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Co(a),e}function Oh(e){return e?(e=zi,e):zi}function kh(e,t,n,r,i,a){i=Oh(i),r.context===null?r.context=i:r.pendingContext=i,r=To(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Eo(e,r,t),n!==null&&(Yd(n,e,t),Do(n,e,t))}function Ah(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function jh(e,t){Ah(e,t),(e=e.alternate)&&Ah(e,t)}function Mh(e){if(e.tag===13||e.tag===31){var t=Ii(e,67108864);t!==null&&Yd(t,e,67108864),jh(e,67108864)}}function Nh(e){if(e.tag===13||e.tag===31){var t=Kd();t=wt(t);var n=Ii(e,t);n!==null&&Yd(n,e,t),jh(e,t)}}var Ph=!0;function Fh(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=2,Lh(e,t,n,r)}finally{k.p=a,O.T=i}}function Ih(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=8,Lh(e,t,n,r)}finally{k.p=a,O.T=i}}function Lh(e,t,n,r){if(Ph){var i=Rh(r);if(i===null)lp(e,t,r,zh,n),Xh(e,r);else if(Qh(i,e,t,n,r))r.stopPropagation();else if(Xh(e,r),t&4&&-1<Yh.indexOf(e)){for(;i!==null;){var a=Bt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ft(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-at(o);s.entanglements[1]|=c,o&=~c}Hf(a),!(ud&6)&&(jd=qe()+500,Uf(0,!1))}}break;case 31:case 13:s=Ii(a,2),s!==null&&Yd(s,a,2),ef(),jh(a,2)}if(a=Rh(r),a===null&&lp(e,t,r,zh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else lp(e,t,r,null,n)}}function Rh(e){return e=On(e),Bh(e)}var zh=null;function Bh(e){if(zh=null,e=zt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return zh=e,null}function Vh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Je()){case Ye:return 2;case Xe:return 8;case Ze:case Qe:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Hh=!1,Uh=null,Wh=null,Gh=null,Kh=new Map,qh=new Map,Jh=[],Yh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Xh(e,t){switch(e){case`focusin`:case`focusout`:Uh=null;break;case`dragenter`:case`dragleave`:Wh=null;break;case`mouseover`:case`mouseout`:Gh=null;break;case`pointerover`:case`pointerout`:Kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:qh.delete(t.pointerId)}}function Zh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Bt(t),t!==null&&Mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Qh(e,t,n,r,i){switch(t){case`focusin`:return Uh=Zh(Uh,e,t,n,r,i),!0;case`dragenter`:return Wh=Zh(Wh,e,t,n,r,i),!0;case`mouseover`:return Gh=Zh(Gh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Kh.set(a,Zh(Kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,qh.set(a,Zh(qh.get(a)||null,e,t,n,r,i)),!0}return!1}function $h(e){var t=zt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){Nh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){Nh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function eg(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Rh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Dn=r,n.target.dispatchEvent(r),Dn=null}else return t=Bt(n),t!==null&&Mh(t),e.blockedOn=n,!1;t.shift()}return!0}function tg(e,t,n){eg(e)&&n.delete(t)}function ng(){Hh=!1,Uh!==null&&eg(Uh)&&(Uh=null),Wh!==null&&eg(Wh)&&(Wh=null),Gh!==null&&eg(Gh)&&(Gh=null),Kh.forEach(tg),qh.forEach(tg)}function rg(e,n){e.blockedOn===n&&(e.blockedOn=null,Hh||(Hh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,ng)))}var ig=null;function ag(e){ig!==e&&(ig=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ig===e&&(ig=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Bh(r||n)===null)continue;break}var a=Bt(n);a!==null&&(e.splice(t,3),t-=3,lc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function og(e){function t(t){return rg(t,e)}Uh!==null&&rg(Uh,e),Wh!==null&&rg(Wh,e),Gh!==null&&rg(Gh,e),Kh.forEach(t),qh.forEach(t);for(var n=0;n<Jh.length;n++){var r=Jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Jh.length&&(n=Jh[0],n.blockedOn===null);)$h(n),n.blockedOn===null&&Jh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[At]||null;if(typeof a==`function`)o||ag(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[At]||null)s=o.formAction;else if(Bh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),ag(n)}}}function sg(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function cg(e){this._internalRoot=e}lg.prototype.render=cg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;kh(n,Kd(),e,t,null,null)},lg.prototype.unmount=cg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kh(e.current,2,null,e,null,null),ef(),t[jt]=null}};function lg(e){this._internalRoot=e}lg.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jh.length&&t!==0&&t<Jh[n].priority;n++);Jh.splice(n,0,e),n===0&&$h(e)}};var ug=n.version;if(ug!==`19.3.0`)throw Error(i(527,ug,`19.3.0`));k.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var dg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var fg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fg.isDisabled&&fg.supportsFiber)try{nt=fg.inject(dg),rt=fg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=jc,s=Mc,c=Nc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Dh(e,1,!1,null,null,n,r,null,o,s,c,sg),e[jt]=t.current,sp(e),new cg(t)}})),vi=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_i()}))(),yi=`neko.appearance`,bi=[`sakura`,`light`,`dark`],xi=[`sans`,`serif`,`mono`],Si=[`13`,`14`,`16`,`18`],Ci=[`regular`,`medium`,`semibold`],wi=[`compact`,`normal`,`relaxed`],Ti={theme:`sakura`,font:`sans`,size:`14`,weight:`regular`,leading:`normal`},Ei={theme:`data-theme`,font:`data-chat-font`,size:`data-chat-size`,weight:`data-chat-weight`,leading:`data-chat-leading`},Di={theme:bi,font:xi,size:Si,weight:Ci,leading:wi},Oi=Object.keys(Di);function ki(e,t){return Di[e].includes(t)?t:Ti[e]}function Ai(e){let t;try{t=e?JSON.parse(e):void 0}catch{t=void 0}let n=typeof t==`object`&&t?t:{};return{theme:ki(`theme`,n.theme),font:ki(`font`,n.font),size:ki(`size`,n.size),weight:ki(`weight`,n.weight),leading:ki(`leading`,n.leading)}}function ji(e){return JSON.stringify({v:1,...e})}function Mi(e){return Oi.every(t=>e[t]===Ti[t])}function Ni(e=localStorage){try{return Ai(e.getItem(yi))}catch{return Ti}}function Pi(e,t=localStorage){try{Mi(e)?t.removeItem(yi):t.setItem(yi,ji(e))}catch{}}function Fi(e,t=document){let n=t.documentElement;for(let t of Oi)e[t]===Ti[t]?n.removeAttribute(Ei[t]):n.setAttribute(Ei[t],e[t]);t.querySelector(`meta[name="color-scheme"]`)?.setAttribute(`content`,e.theme===`dark`?`dark`:`light`)}function Ii(e={}){let t=e.storage??localStorage,n=e.doc??document,r=e.target??window,i=Ni(t),a=new Set;function o(e){if(!Oi.every(t=>e[t]===i[t])){i=e,Fi(i,n);for(let e of a)e()}}let s=e=>{let n=e.key;(n===null||n===`neko.appearance`)&&o(Ni(t))};return{get:()=>i,set(e){let n=Ai(ji({...i,...e}));Pi(n,t),o(n)},reset(){Pi(Ti,t),o(Ti)},start(){i=Ni(t),Fi(i,n),r.addEventListener(`storage`,s)},stop(){r.removeEventListener(`storage`,s)},subscribe(e){return a.add(e),()=>a.delete(e)}}}var Li;function Ri(){return Li??=Ii(),Li}function zi(e=Ri()){return(0,f.useSyncExternalStore)(e.subscribe,e.get,()=>Ti)}var Bi=`0.4.9`;function Vi(e){return typeof e==`string`&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(e)&&e.split(`.`).every(e=>Number.isSafeInteger(Number(e)))}function Hi(e,t){if(!Vi(e)||!Vi(t))return!1;let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if(n[e]!==r[e])return n[e]>r[e];return!1}function Ui(e){let{gateway:t,frontend:n,installed:r,web:i}=e;if(t&&t.protocolVersion!==8)return`incompatible`;if(t&&(Hi(t.installedVersion,t.runningVersion)||Hi(r,t.runningVersion)||Hi(n,t.runningVersion))||i&&(Hi(i.installedVersion,i.runningVersion)||Hi(t?.runningVersion,i.runningVersion)||Hi(n,i.runningVersion)))return`restart-service`;if(i){if(Hi(i.runningVersion,n))return`refresh-page`}else if(Hi(r,n)||Hi(t?.runningVersion,n))return`restart-tui`;return t?.checkState===`ok`&&Hi(t.latestVersion,r)?`install`:`none`}var Wi=class extends Error{constructor(){super(`Application protocol incompatible. Update neko, then restart its TUI/Web or serve.`),this.name=`ApplicationProtocolError`}};function Gi(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)}function Ki(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}async function qi(e,t){let n=await t.begin({name:e.name,mimeType:e.mimeType,size:e.bytes.length});try{for(let r=0;r<e.bytes.length;r+=262144)await t.append({id:n,offset:r,data:Gi(e.bytes.subarray(r,r+262144))});return await t.finish(n),n}catch(e){throw await t.release(n).catch(()=>{}),e}}async function Ji(e){let t=[],n=0,r=0,i=``;do{let a=await e(n);if(!Number.isSafeInteger(a.total)||a.total<=0||a.total>20971520||n>0&&(a.total!==r||a.mimeType!==i))throw Error(`Invalid image size or format`);if(r=a.total,i=a.mimeType,a.data.length>349528)throw Error(`Image chunk is too large`);let o=Ki(a.data);if(o.length>262144||n+o.length>r||!o.length&&n<r)throw Error(`Incomplete image`);t.push(o),n+=o.length}while(n<r);let a=new Uint8Array(n),o=0;for(let e of t)a.set(e,o),o+=e.length;return{name:`Image`,mimeType:i,bytes:a}}function Yi(e){let t=/^\/compact(?:\s+([\s\S]*))?$/.exec(e.trim());return t?t[1]?.trim()??``:null}var Xi=(e,t=`New session`)=>e.title||e.firstPromptPreview||t,Zi=e=>e.lastMessageAt??e.createdAt,Qi=(e,t)=>Zi(t)-Zi(e)||Number(t.id)-Number(e.id),$i=(e,t)=>t.lastUsedAt-e.lastUsedAt||Number(t.id)-Number(e.id),ea=(e,t)=>`${e.title} ${e.firstPromptPreview} ${e.id}`.toLocaleLowerCase().includes(t.trim().toLocaleLowerCase());function ta(e,t,n=`en`){let r=Math.floor(Math.max(0,t-e)/6e4);if(r<1)return n===`zh`?`刚刚`:`now`;let i=Math.floor(r/60),a=Math.floor(i/24);if(a>=30)return new Date(e).toLocaleDateString(n===`zh`?`zh-CN`:`en-GB`);let o=a||i||r,s=a?[`天`,`d`]:i?[`小时`,`h`]:[`分钟`,`m`];return n===`zh`?`${o} ${s[0]}前`:`${o}${s[1]}`}var na={assign:0,create:0,clone:0,discard:0,update:0};function ra(e,t,n){return e>=t&&e<=n}function ia(e){return e===8205}function aa(e){return ra(e,55296,56319)}function oa(e){return ra(e,127462,127487)}function sa(e){return ra(e,65024,65039)}function ca(e){return ra(e,768,879)||ra(e,6832,6911)||ra(e,7616,7679)||ra(e,65056,65071)}function la(e){return e>65535?2:1}function ua(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(ca(n)||sa(n))t+=la(n);else break}return t}function da(e,t){let n=e.codePointAt(t),r=t+la(n);for(r=ua(e,r);r<e.length-1&&ia(e.codePointAt(r));){let t=e.codePointAt(r+1);r+=1+la(t),r=ua(e,r)}return oa(n)&&r<e.length&&oa(e.codePointAt(r))&&(r+=la(e.codePointAt(r))),r}function fa(e){return e>=768&&(aa(e)||ca(e)||sa(e)||ia(e))}function pa(e){let t=0,n=0;for(;n<e.length;)n=da(e,n),t++;return t}function ma(e,t){let n=0,r=0;for(;r<e.length;)if(r=da(e,r),++n>=t)return!0;return!1}function ha(e,t){let n=0,r=0;for(;r<e.length;)if(r=da(e,r),++n>t)return!1;return!0}function ga(e,t){if(t===0)return!0;if(e.length<t)return!1;let n=0;for(;;){if(fa(e.charCodeAt(n)))return ma(e,t);if(++n>=t)return!0}}function _a(e,t){if(e.length<=t)return!0;let n=0;for(;;){if(fa(e.charCodeAt(n)))return ha(e,t);if(++n>t)return!1}}var va=s({Counted:()=>Ka,Entries:()=>Xa,EntriesRegExp:()=>Ya,Every:()=>Ha,EveryAll:()=>Ua,GraphemeCount:()=>za,HasPropertyKey:()=>M,IsArray:()=>ya,IsBigInt:()=>ba,IsBoolean:()=>xa,IsClassInstance:()=>La,IsConstructor:()=>Sa,IsDeepEqual:()=>no,IsEqual:()=>j,IsFunction:()=>Ca,IsGreaterEqualThan:()=>Fa,IsGreaterThan:()=>Ma,IsInteger:()=>wa,IsLessEqualThan:()=>Pa,IsLessThan:()=>Na,IsMaxLength:()=>Ba,IsMinLength:()=>Va,IsMultipleOf:()=>Ia,IsNull:()=>Ta,IsNumber:()=>Ea,IsObject:()=>Oa,IsObjectNotArray:()=>Da,IsString:()=>ka,IsSymbol:()=>Aa,IsUndefined:()=>ja,IsUnsafePropertyKey:()=>Ja,IsValueLike:()=>Ra,Keys:()=>Za,ShiftLeft:()=>qa,Some:()=>Wa,SomeAll:()=>Ga,Symbols:()=>Qa,Values:()=>$a});function ya(e){return Array.isArray(e)}function ba(e){return j(typeof e,`bigint`)}function xa(e){return j(typeof e,`boolean`)}function Sa(e){if(ja(e)||!Ca(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Ca(e){return j(typeof e,`function`)}function wa(e){return Number.isInteger(e)}function Ta(e){return j(e,null)}function Ea(e){return Number.isFinite(e)}function Da(e){return Oa(e)&&!ya(e)}function Oa(e){return j(typeof e,`object`)&&!Ta(e)}function ka(e){return j(typeof e,`string`)}function Aa(e){return j(typeof e,`symbol`)}function ja(e){return j(e,void 0)}function j(e,t){return e===t}function Ma(e,t){return e>t}function Na(e,t){return e<t}function Pa(e,t){return e<=t}function Fa(e,t){return e>=t}function Ia(e,t){if(ba(e)||ba(t))return BigInt(e)%BigInt(t)===0n;if(!Ea(e)||wa(e)&&1/t%1==0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t),Math.abs(n+t))<1e-10}function La(e){if(!Oa(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!Ta(t)&&j(typeof t.constructor,`function`)&&!(j(t.constructor,globalThis.Object)||j(t.constructor.name,`Object`))}function Ra(e){return ba(e)||xa(e)||Ta(e)||Ea(e)||ka(e)||ja(e)}function za(e){return pa(e)}function Ba(e,t){return _a(e,t)}function Va(e,t){return ga(e,t)}function Ha(e,t,n){return e.every((e,r)=>r<t||n(e,r))}function Ua(e,t,n){let r=!0;return e.forEach((e,i)=>{i>=t&&!n(e,i)&&(r=!1)}),r}function Wa(e,t){return e.some((e,n)=>t(e,n))}function Ga(e,t){let n=!1;return e.forEach((e,r)=>{t(e,r)&&(n=!0)}),n}function Ka(e,t){return e.reduce((e,n,r)=>t(n,r)?++e:e,0)}function qa(e,t,n){return j(e.length,0)?n():t(e[0],e.slice(1))}function Ja(e){return j(e,`__proto__`)||j(e,`constructor`)||j(e,`prototype`)}function M(e,t){return Ja(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function Ya(e){return Za(e).map(t=>[RegExp(`^${t}$`),e[t]])}function Xa(e){return Object.entries(e)}function Za(e){return Object.getOwnPropertyNames(e)}function Qa(e){return Object.getOwnPropertySymbols(e)}function $a(e){return Object.values(e)}function eo(e,t){if(!Oa(t))return!1;let n=Za(e);return j(n.length,Za(t).length)&&n.every(n=>no(e[n],t[n]))}function to(e,t){return ya(t)&&j(e.length,t.length)&&e.every((n,r)=>no(e[r],t[r]))}function no(e,t){return ya(e)?to(e,t):Oa(e)?eo(e,t):j(e,t)}function ro(e){return e instanceof Boolean}function io(e){return e instanceof Number}function ao(e){return e instanceof String}function oo(e){return globalThis.ArrayBuffer.isView(e)}function so(e){return e instanceof globalThis.RegExp}function co(e){return e instanceof globalThis.Date}function lo(e){return e instanceof globalThis.Set}function uo(e){return e instanceof globalThis.Map}var fo=va,po={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function mo(){return po}function ho(e){return mo().immutableTypes?Object.freeze(e):e}function go(e,t){return na.assign+=1,ho({...e,...t})}function _o(e){return e}function vo(e){return M(e,`~kind`)||M(e,`~unsafe`)}function yo(e){let t={};for(let n of Za(e)){if(Ja(n))continue;let r=Object.getOwnPropertyDescriptor(e,n);r.value=Do(r.value),j(r.enumerable,!0)?t[n]=r.value:Object.defineProperty(t,n,r)}return t}function bo(e){let t={};for(let n of Za(e))Ja(n)||(t[n]=Do(e[n]));for(let n of Qa(e))t[n]=Do(e[n]);return t}function xo(e){return La(e)?_o(e):vo(e)?yo(e):bo(e)}function So(e){return e.map(e=>Do(e))}function Co(e){return e.slice()}function wo(e){return new RegExp(e.source,e.flags)}function To(e){return new Map(Do([...e.entries()]))}function Eo(e){return new Set(Do([...e.values()]))}function Do(e){return oo(e)?Co(e):so(e)?wo(e):uo(e)?To(e):lo(e)?Eo(e):ya(e)?So(e):Oa(e)?xo(e):e}function Oo(e){return na.clone+=1,Do(e)}function ko(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Ao(e,t){return{...e,...t}}function jo(e,t,n={}){na.create+=1;let r=Ao(t,n);return ho(mo().enumerableKind?Ao(r,e):ko(r,e))}function Mo(e,t){na.discard+=1;let n={};for(let r of Za(e)){if(t.includes(r))continue;let i=Object.getOwnPropertyDescriptor(e,r);i.value=Oo(i.value),Object.defineProperty(n,r,i)}return ho(n)}function No(e,t,n){na.update+=1;let r=mo(),i=Oo(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return ho(i)}function Po(e,t){return Oa(e)&&M(e,`~kind`)&&j(e[`~kind`],t)}function Fo(e){return Oa(e)}function Io(e,t,n){return jo({"~kind":`Deferred`},{type:`deferred`,action:e,parameters:t,options:n},{})}function Lo(e){return Po(e,`Deferred`)}function Ro(e){return No(e,{"~readonly":!0},{})}function zo(e,t){return No(Ro(e),{},t)}function Bo(e,t,n,r){return zo(rv(e,t,n),r)}function Vo(e){return No(e,{"~optional":!0},{})}function Ho(e,t){return No(Vo(e),{},t)}function Uo(e,t,n,r){return Ho(rv(e,t,n),r)}function Wo(e,t){return jo({"~kind":`Array`},{type:`array`,items:e},t)}function Go(e){return Po(e,`Array`)}function Ko(e){return Mo(e,[`~kind`,`type`,`items`])}function qo(e,t,n={}){return jo({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function Jo(e){return Po(e,`Constructor`)}function Yo(e){return Mo(e,[`~kind`,`type`,`parameters`,`instanceType`])}function Xo(e,t,n={}){return jo({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function Zo(e){return Po(e,`Function`)}function Qo(e){return Mo(e,[`~kind`,`type`,`parameters`,`returnType`])}function $o(e,t){return jo({"~kind":`Ref`},{$ref:e},t)}function es(e){return Po(e,`Ref`)}function ts(e,t){return jo({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function ns(e){return Po(e,`Generic`)}function rs(e){return jo({"~kind":`Any`},{},e)}function is(e){return Po(e,`Any`)}var as=`(?!)`;function os(e){return jo({"~kind":`Never`},{not:{}},e)}function ss(e){return Po(e,`Never`)}function cs(e,t={}){return Ho(e,t)}function N(e){return cs(e)}function ls(e){return Fo(e)&&M(e,`~optional`)}function us(e){return Za(e).filter(t=>!ls(e[t]))}function ds(e){return Za(e)}function fs(e){return $a(e)}function P(e,t={}){let n=us(e);return jo({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function ps(e){return Po(e,`Object`)}function ms(e){return Mo(e,[`~kind`,`type`,`properties`,`required`])}function hs(e){return jo({"~kind":`Unknown`},{},e)}function gs(e){return Po(e,`Unknown`)}function _s(e,t,n){return jo({"~kind":`Cyclic`},{$defs:Za(e).reduce((t,n)=>({...t,[n]:No(e[n],{},{$id:n})}),{}),$ref:t},n)}function vs(e){return Po(e,`Cyclic`)}function ys(e){return No(e,{"~unsafe":null},{})}function bs(e){return Da(e)&&M(e,`~unsafe`)&&Ta(e[`~unsafe`])}function xs(e,t){return t[e.length]?.(...e)??(()=>{throw Error(`Invalid Arguments`)})()}function Ss(e){return Po(e,`Infer`)}function Cs(e,t,n,r={}){return jo({"~kind":`Dependent`},{if:e,then:t,else:n},r)}function ws(e){return Po(e,`Dependent`)}function Ts(e){return Mo(e,[`~kind`,`if`,`then`,`else`])}function Es(e){return Da(e)}function Ds(e){return Za(e).filter(e=>isNaN(e)).reduce((t,n)=>[...t,e[n]],[])}function Os(e,t){return jo({"~kind":`Enum`},{enum:Es(e)?Ds(e):e},t)}function ks(e){return Po(e,`Enum`)}function As(e,t={}){return jo({"~kind":`Intersect`},{allOf:e},t)}function js(e){return Po(e,`Intersect`)}function Ms(e){return Mo(e,[`~kind`,`allOf`])}function Ns(){throw Error(`Unreachable`)}function Ps(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function Fs(e){return typeof e==`number`}var Is;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(Is||={});var Ls=BigInt(`14695981039346656037`),[Rs,zs]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],Bs=Array.from({length:256}).map((e,t)=>BigInt(t)),Vs=new Float64Array(1),Hs=new DataView(Vs.buffer),Us=new Uint8Array(Vs.buffer);function Ws(e){Ls^=Bs[e],Ls=Ls*Rs%zs}function Gs(e){Ws(Is.Array);for(let t of e)oc(t)}function Ks(e){Ws(Is.BigInt),Hs.setBigInt64(0,e);for(let e of Us)Ws(e)}function qs(e){Ws(Is.Boolean),Ws(+!!e)}function Js(e){Ws(Is.Constructor),oc(e.toString())}function Ys(e){Ws(Is.Date),oc(e.getTime())}function Xs(e){Ws(Is.Function),oc(e.toString())}function Zs(e){Ws(Is.Null)}function Qs(e){Ws(Is.Number),Hs.setFloat64(0,e,!0);for(let e of Us)Ws(e)}function $s(e){Ws(Is.Object);for(let t of Ps(e).sort())oc(t),oc(e[t])}function ec(e){Ws(Is.RegExp),nc(e.toString())}var tc=new TextEncoder;function nc(e){Ws(Is.String);for(let t of tc.encode(e))Ws(t)}function rc(e){Ws(Is.Symbol),oc(e.toString())}function ic(e){Ws(Is.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)Ws(t[e])}function ac(e){return Ws(Is.Undefined)}function oc(e){return oo(e)?ic(e):co(e)?Ys(e):so(e)?ec(e):ro(e)?qs(e.valueOf()):ao(e)?nc(e.valueOf()):io(e)?Qs(e.valueOf()):Fs(e)?Qs(e):ya(e)?Gs(e):xa(e)?qs(e):ba(e)?Ks(e):Sa(e)?Js(e):Ta(e)?Zs(e):Oa(e)?$s(e):ka(e)?nc(e):Aa(e)?rc(e):ja(e)?ac(e):Ca(e)?Xs(e):Ns()}function sc(e){return Ls=BigInt(`14695981039346656037`),oc(e),Ls}function cc(e){return sc(e).toString(16).padStart(16,`0`)}function lc(e){switch(e.keyword){case`additionalProperties`:return`must not have additional properties`;case`anyOf`:return`must match a schema in anyOf`;case`boolean`:return`schema is false`;case`const`:return`must be equal to constant`;case`contains`:return`must contain at least 1 valid item`;case`dependencies`:return`must have properties ${e.params.dependencies.join(`, `)} when property ${e.params.property} is present`;case`dependentRequired`:return`must have properties ${e.params.dependencies.join(`, `)} when property ${e.params.property} is present`;case`enum`:return`must be equal to one of the allowed values`;case`exclusiveMaximum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`exclusiveMinimum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`format`:return`must match format "${e.params.format}"`;case`if`:return`must match "${e.params.failingKeyword}" schema`;case`maxItems`:return`must not have more than ${e.params.limit} items`;case`maxLength`:return`must not have more than ${e.params.limit} characters`;case`maxProperties`:return`must not have more than ${e.params.limit} properties`;case`maximum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`minItems`:return`must not have fewer than ${e.params.limit} items`;case`minLength`:return`must not have fewer than ${e.params.limit} characters`;case`minProperties`:return`must not have fewer than ${e.params.limit} properties`;case`minimum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`multipleOf`:return`must be multiple of ${e.params.multipleOf}`;case`not`:return`must not be valid`;case`oneOf`:return`must match exactly one schema in oneOf`;case`pattern`:return`must match pattern "${e.params.pattern}"`;case`propertyNames`:return`property names ${e.params.propertyNames.join(`, `)} are invalid`;case`required`:return`must have required properties ${e.params.requiredProperties.join(`, `)}`;case`type`:return typeof e.params.type==`string`?`must be ${e.params.type}`:`must be either ${e.params.type.join(` or `)}`;case`unevaluatedItems`:return`must not have unevaluated items`;case`unevaluatedProperties`:return`must not have unevaluated properties`;case`uniqueItems`:return`must not have duplicate items`;case`~refine`:return e.params.message;default:return`an unknown validation error occurred`}}var uc=lc;function dc(){return uc}function fc(e){return cv(e)}function pc(e){return Fo(e)&&M(e,`~immutable`)}function mc(e,t={}){return zo(e,t)}function hc(e){return Fo(e)&&M(e,`~readonly`)}var gc=`-?(?:0|[1-9][0-9]*)n`;function _c(e){return jo({"~kind":`BigInt`},{type:`bigint`},e)}function vc(e){return Po(e,`BigInt`)}function yc(e){return jo({"~kind":`Boolean`},{type:`boolean`},e)}function bc(e){return Po(e,`Boolean`)}var xc=`-?(?:0|[1-9][0-9]*)`;function Sc(e){return jo({"~kind":`Integer`},{type:`integer`},e)}function Cc(e){return Po(e,`Integer`)}var wc=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function Tc(e){return ba(e)?`bigint`:xa(e)?`boolean`:Ea(e)?`number`:ka(e)?`string`:(()=>{throw new wc(e)})()}function F(e,t){return jo({"~kind":`Literal`},{type:Tc(e),const:e},t)}function Ec(e){return ba(e)||xa(e)||Ea(e)||ka(e)}function Dc(e){return kc(e)&&Ea(e.const)}function Oc(e){return kc(e)&&ka(e.const)}function kc(e){return Po(e,`Literal`)}function Ac(e){return jo({"~kind":`Null`},{type:`null`},e)}function jc(e){return Po(e,`Null`)}var Mc=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function Nc(e){return jo({"~kind":`Number`},{type:`number`},e)}function Pc(e){return Po(e,`Number`)}function Fc(e){return jo({"~kind":`Symbol`},{type:`symbol`},e)}function Ic(e){return Po(e,`Symbol`)}function Lc(e){return jo({"~kind":`String`},{type:`string`},e)}function Rc(e){return Po(e,`String`)}function zc(e,t={}){return jo({"~kind":`Union`},{anyOf:e},t)}function Bc(e){return Po(e,`Union`)}function Vc(e){return Mo(e,[`~kind`,`anyOf`])}function Hc(e){let t=vd(e);return j(t.length,2)?t[0]:[]}function Uc(e){return!0}function Wc(e){return qa(e,(e,t)=>Kc(e)?Wc(t):!1,()=>!0)}function Gc(e){return!j(e.length,0)&&Wc(e)}function Kc(e){return Bc(e)?Gc(e.anyOf):kc(e)?Uc(e.const):!1}function qc(e){return Gc(e)}function Jc(e){return jo({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function Yc(e,t,n=[]){return qa(e,(e,r)=>Yc(r,t,[...n,`${e}${t}`]),()=>n)}function Xc(e,t){return j(e.length,0)?[`${t}`]:Yc(e,t)}function Zc(e,t,n=[]){return qa(t,(t,r)=>Zc(e,r,[...n,...Qc(e,t)]),()=>n)}function Qc(e,t){return Bc(t)?Zc(e,t.anyOf):kc(t)?Xc(e,t.const):Ns()}function $c(e,t){return qa(t,(t,n)=>$c(Qc(e,t),n),()=>e)}function el(e){return e.map(e=>F(e))}function tl(e){return zc(el($c([],e)))}function nl(e){return j(e.length,0)?Ns():j(e.length,1)&&kc(e[0])?e[0]:tl(e)}function rl(e){let t=Hc(e);return j(t.length,0)?Lc():qc(t)?nl(t):Jc(e)}function il(e){let t=rl(e);return zd(t)?Lc():t}function al(e,t){return jo({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function ol(e){return al(fu,e)}function sl(e){return P({true:e,false:e})}function cl(e,t={}){let[n,r,i]=[e,e.length,!1];return jo({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function ll(e){return Po(e,`Tuple`)}function ul(e){return Mo(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function dl(e){return Mo(e,[`~readonly`])}function fl(e,t){return No(dl(e),{},t)}function pl(e,t,n,r){return fl(rv(e,t,n),r)}function ml(e,t={}){return fl(e,t)}function hl(e){return Mo(e,[`~optional`])}function gl(e,t){return No(hl(e),{},t)}function _l(e,t,n,r){return gl(rv(e,t,n),r)}function vl(e,t={}){return gl(e,t)}function yl(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function bl(e){return P(yl(e.items))}function xl(e){return ps(e)||ll(e)}function Sl(e,t){return hc(e)?!!hc(t):!1}function Cl(e,t){return ls(e)?!!ls(t):!1}function wl(e,t){let n=Sl(e,t),r=Cl(e,t),i=ml(vl(Hl([e,t])));return n&&r?mc(cs(i)):n&&!r?mc(i):!n&&r?cs(i):i}function Tl(e,t,n){return n in e?n in t?wl(e[n],t[n]):e[n]:n in t?t[n]:os()}function El(e,t){return[...new Set([...Za(e),...Za(t)])].reduce((n,r)=>({...n,[r]:Tl(e,t,r)}),{})}function Dl(e){return ps(e)?e.properties:ll(e)?yl(e.items):{}}function Ol(e,t){return P(El(Dl(e),Dl(t)))}function kl(e,t){let n=Wp(e,t);return j(n,2)?e:j(n,3)||j(n,0)?t:os()}function Al(e,t){let n=xl(e),r=xl(t);return n&&r?Ol(e,t):n&&!r?e:!n&&r?t:kl(e,t)}function jl(e,t){return ss(e)||is(e)?e:gs(e)||ss(t)||is(t)?t:gs(t)?e:Al(e,t)}function Ml(e,t){return Bc(e)||Bc(t)}function Nl(e,t){let n=Gl(e),r=Gl(t);return Ml(n,r)?Hl([n,r]):jl(n,r)}function Pl(e,t,n=[]){return qa(t,(t,r)=>Pl(e,r,[...n,Nl(t,e)]),()=>j(n.length,0)?[e]:n)}function Fl(e,t,n=[]){return qa(e,(e,r)=>Fl(r,t,[...n,...Il([e],t)]),()=>n)}function Il(e,t=[]){return qa(e,(e,n)=>Bc(e)?Il(n,Fl(e.anyOf,t)):Il(n,Pl(e,t)),()=>t)}function Ll(e,t){return Kd(Up({},e,t))?[]:[e]}function Rl(e,t,n=[]){return qa(e,(e,r)=>Rl(r,t,[...n,...Ll(e,t)]),()=>n)}function zl(e,t){let n=Gl(e);return Wl(Rl(Bc(n)?n.anyOf:[n],t))}function Bl(e,t,n){return Wl([Hl([e,t]),zl(n,e)])}function Vl(e,t=[]){return qa(e,(e,n)=>Vl(n,[...t,F(e)]),()=>Wl(t))}function Hl(e){return Wl(Jp(Il(e)))}function Ul(e){return Gl(il(e))}function Wl(e){return Kl(Jp(e))}function Gl(e){return ws(e)?Bl(e.if,e.then,e.else):ks(e)?Vl(e.enum):js(e)?Hl(e.allOf):zd(e)?Ul(e.pattern):Bc(e)?Wl(e.anyOf):e}function Kl(e){return j(e.length,1)?e[0]:j(e.length,0)?os():zc(e)}function ql(e,t){return su(Vl(e),t)}function Jl(e,t){return al(uu,t)}function Yl(e,t){return su(Hl(e),t)}function Xl(e,t){return ka(e)||Ea(e)?P({[e]:t}):j(e,!1)?P({false:t}):j(e,!0)?P({true:t}):P({})}function Zl(e,t){return al(du,t)}function Ql(e,t){return M(e,`pattern`)&&(ka(e.pattern)||e.pattern instanceof RegExp)?al(e.pattern.toString(),t):al(fu,t)}function $l(e,t){return qc(Hc(e))?su(Ul(e),t):al(e,t)}function eu(e){return Bc(e)?tu(e.anyOf):[e]}function tu(e,t=[]){return qa(e,(e,n)=>tu(n,[...t,...eu(e)]),()=>t)}function nu(e){return e.some(e=>Rc(e)||Pc(e)||Cc(e))}function ru(e,t){return j(nu(e),!0)?al(fu,t):void 0}function iu(e,t){return e.reduce((e,n)=>kc(n)&&(ka(n.const)||Ea(n.const))?{...e,[n.const]:t}:e,{})}function au(e,t){return P(iu(e,t))}function ou(e,t){let n=tu(e),r=ru(n,t);return Fo(r)?r:au(n,t)}function su(e,t){return is(e)?ol(t):bc(e)?sl(t):ks(e)?ql(e.enum,t):Cc(e)?Jl(e,t):js(e)?Yl(e.allOf,t):kc(e)?Xl(e.const,t):Pc(e)?Zl(e,t):Bc(e)?ou(e.anyOf,t):Rc(e)?Ql(e,t):zd(e)?$l(e.pattern,t):P({})}function cu(e,t,n){return X_([e])?No(su(e,t),{},n):pu(e,t,n)}function lu(e,t,n,r,i){return cu(rv(e,t,n),rv(e,t,r),i)}var uu=`^${xc}$`,du=`^${Mc}$`,fu=`^.*$`;function pu(e,t,n={}){return Io(`Record`,[e,t],n)}function mu(e,t,n={}){return cu(e,t,n)}function hu(e,t){return al(e,t)}function gu(e){return j(e,fu)?Lc():j(e,uu)?Sc():j(e,du)?Nc():rl(e)}function _u(e){return Za(e.patternProperties)[0]}function vu(e){return gu(_u(e))}function yu(e){return e.patternProperties[_u(e)]}function bu(e){return Po(e,`Record`)}function xu(e){return jo({"~kind":`Rest`},{type:`rest`,items:e},{})}function Su(e){return Po(e,`Rest`)}function Cu(e){return Po(e,`This`)}function wu(e){return jo({"~kind":`Undefined`},{type:`undefined`},e)}function Tu(e){return Po(e,`Undefined`)}function Eu(e){return Po(e,`Void`)}function Du(e){return _c()}function Ou(e){return Lc()}function ku(e){return Nc()}function Au(e){return Sc()}function ju(e){return os()}function Mu(e){return F(e)}function Nu(e){return e}function Pu(e){return zc(e[1])}function Fu(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Iu(e){return[e[0],...e[1]]}function Lu(e){return e}function Ru(e){return e[1]}function zu(e){return j(e.length,2)}function Bu(e,t,n){return zu(e)?t(e[0],e[1]):n()}function Vu(e,t){return j(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Hu(e,t){for(let n=0;n<e.length;n++){let r=Vu(e[n],t);if(zu(r))return r}return[]}function Uu(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var Wu=[...Uu(97,122),...Uu(65,90)],Gu=[`0`,...Uu(49,57)],Ku=`//`,qu=`/*`,Ju=`*/`;function Yu(e){let t=e.indexOf(Ju);return j(t,-1)?``:e.slice(t+2)}function Xu(e){let t=e.indexOf(`
11
+ `);return j(t,-1)?``:e.slice(t)}function Zu(e){return e.replace(/^[ \t\r\f\v]+/,``)}function Qu(e){let t=Zu(e);return t.startsWith(qu)?Qu(Yu(t.slice(2))):t.startsWith(Ku)?Qu(Xu(t.slice(2))):t}function $u(e){let t=e.trimStart();return t.startsWith(qu)?$u(Yu(t.slice(2))):t.startsWith(Ku)?$u(Xu(t.slice(2))):t}[...Gu];function ed(e,t){return Hu([e],t)}function td(e,t){return j(e,``)?[``,t]:e.startsWith(`
12
+ `)?ed(e,Qu(t)):e.startsWith(` `)?ed(e,t):ed(e,$u(t))}[...Wu,...Gu],[...Gu];function nd(e){return j(e,``)?[]:[e.slice(0,1),e.slice(1)]}function rd(e,t){return qa(e,(e,n)=>t.startsWith(e)?!0:rd(n,t),()=>!1)}function id(e,t,n=``){return Bu(nd(t),(r,i)=>rd(e,t)?[n,t]:id(e,i,`${n}${r}`),()=>[])}function ad(e,t){return Bu(id(e,t),(e,t)=>j(e,``)?[]:[e,t],()=>[])}var od=(e,t,n=()=>[])=>e.length===2?t(e):n(),sd=e=>od(td(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[Du(e),t]),cd=e=>od(td(`.*`,e),([e,t])=>[Ou(e),t]),ld=e=>od(td(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[ku(e),t]),ud=e=>od(td(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[Au(e),t]),dd=e=>od(td(`(?!)`,e),([e,t])=>[ju(e),t]),fd=e=>od(ad([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[Mu(e),t]),pd=e=>od(od(sd(e),([e,t])=>[e,t],()=>od(cd(e),([e,t])=>[e,t],()=>od(ld(e),([e,t])=>[e,t],()=>od(ud(e),([e,t])=>[e,t],()=>od(dd(e),([e,t])=>[e,t],()=>od(md(e),([e,t])=>[e,t],()=>od(fd(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[Nu(e),t]),md=e=>od(od(td(`(`,e),([e,t])=>od(_d(t),([t,n])=>od(td(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Pu(e),t]),hd=e=>od(od(od(gd(e),([e,t])=>od(td(`|`,t),([t,n])=>od(hd(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>od(od(gd(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>od([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[Fu(e),t]),gd=e=>od(od(pd(e),([e,t])=>od(_d(t),([t,n])=>[[e,t],n])),([e,t])=>[Iu(e),t]),_d=e=>od(od(hd(e),([e,t])=>[e,t],()=>od(gd(e),([e,t])=>[e,t],()=>[])),([e,t])=>[Lu(e),t]),vd=e=>od(od(td(`^`,e),([e,t])=>od(_d(t),([t,n])=>od(td(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Ru(e),t]);function yd(e){return e.join(`|`)}function bd(e){return e.slice(1,e.length-1)}function xd(e,t,n){return Md(t,`${n}${e}`)}function Sd(e,t){return Md(e,`${t}${gc}`)}function Cd(e,t){return Md(e,`${t}${xc}`)}function wd(e,t){return Md(e,`${t}${Mc}`)}function Td(e,t){return jd(zc([F(`false`),F(`true`)]),e,t)}function Ed(e,t){return Md(e,`${t}.*`)}function Dd(e,t,n){return Md(t,`${n}${bd(e)}`)}function Od(e,t,n){return jd(Fd(e,{}),t,n)}function kd(e,t,n){return jd(Vl(e),t,n)}function Ad(e,t,n,r=[]){return qa(e,(e,i)=>Ad(i,t,n,[...r,jd(e,[],``)]),()=>Md(t,`${n}(${yd(r)})`))}function jd(e,t,n){return ks(e)?kd(e.enum,t,n):Cc(e)?Cd(t,n):kc(e)?xd(e.const,t,n):vc(e)?Sd(t,n):bc(e)?Td(t,n):Pc(e)?wd(t,n):Rc(e)?Ed(t,n):zd(e)?Dd(e.pattern,t,n):Rd(e)?Od(e.parameters[0],t,n):Bc(e)?Ad(e.anyOf,t,n):as}function Md(e,t){return qa(e,(e,n)=>jd(e,n,t),()=>t)}function Nd(e){return`^${Md(e,``)}$`}function Pd(e){return Jc(Nd(e))}function Fd(e,t){return X_(e)?No(Pd(e),{},t):Ld(e,t)}function Id(e,t,n,r){return Fd($_(e,t,n),r)}function Ld(e,t={}){return Io(`TemplateLiteral`,[e],t)}function Rd(e){return Fo(e)&&M(e,`action`)&&j(e.action,`TemplateLiteral`)}function zd(e){return Po(e,`TemplateLiteral`)}function Bd(e){return jo({"~kind":`ExtendsUnion`},{inferred:e})}function Vd(e){return Oa(e)&&M(e,`~kind`)&&M(e,`inferred`)&&j(e[`~kind`],`ExtendsUnion`)&&Oa(e.inferred)}function Hd(e){return jo({"~kind":`ExtendsTrue`},{inferred:e})}function Ud(e){return Oa(e)&&M(e,`~kind`)&&M(e,`inferred`)&&j(e[`~kind`],`ExtendsTrue`)&&Oa(e.inferred)}function Wd(){return jo({"~kind":`ExtendsFalse`},{})}function Gd(e){return Oa(e)&&M(e,`~kind`)&&j(e[`~kind`],`ExtendsFalse`)}function Kd(e){return Vd(e)||Ud(e)}function qd(e,t,n){return Kd(e)?t(e.inferred):n()}function Jd(e,t,n,r){return qd(pp(e,n,r),r=>Hd(go(go(e,r),{[t]:n})),()=>Wd())}function Yd(e,t){return Hd(e)}function Xd(e,t,n,r,i){return qd(pp(e,t,n),e=>qd(pp(e,t,r),e=>Hd(e),()=>Wd()),()=>qd(pp(e,t,i),e=>Hd(e),()=>Wd()))}function Zd(e,t,n){return pp(e,t,Vl(n))}function Qd(e,t,n){return qa(n,(n,r)=>qd(pp(e,t,n),e=>Qd(e,t,r),()=>Wd()),()=>Hd(e))}function $d(e,t,n){return pp(e,t,Ul(n))}function ef(e,t,n){return qa(n,(n,r)=>qd(pp(e,t,n),e=>Hd(e),()=>ef(e,t,r)),()=>Wd())}function tf(e,t,n){return is(n)?Yd(e,t):ws(n)?Xd(e,t,n.if,n.then,n.else):ks(n)?Zd(e,t,n.enum):Ss(n)?Jd(e,n.name,t,n.extends):js(n)?Qd(e,t,n.allOf):zd(n)?$d(e,t,n.pattern):Bc(n)?ef(e,t,n.anyOf):gs(n)?Hd(e):Wd()}function nf(e,t,n){return Ss(n)?tf(e,t,n):is(n)||gs(n)?Hd(e):Bd(e)}function rf(e,t){let n=pc(e),r=pc(t);return n&&r||!n&&r?!0:!(n&&!r)}function af(e,t,n,r){return Go(r)?rf(t,r)?pp(e,n,r.items):Wd():tf(e,t,r)}function of(e,t,n){return vc(n)?Hd(e):tf(e,t,n)}function sf(e,t,n){return bc(n)?Hd(e):tf(e,t,n)}function cf(e,t,n,r,i){let a=Ss(r)?t:r,o=Ss(r)?r:t,s=ls(t),c=ls(r);return!s&&c?Wd():qd(pp(e,a,o),e=>df(e,n,i),()=>Wd())}function lf(e,t,n,r){return qa(r,(r,i)=>cf(e,t,n,r,i),()=>ls(t)?Hd(e):Wd())}function uf(e,t,n){return qa(t,(t,r)=>lf(e,t,r,n),()=>Hd(e))}function df(e,t,n){return uf(e,t,n)}function ff(e,t,n){return Eu(n)?Hd(e):pp(e,t,n)}function pf(e,t,n,r){return is(r)||gs(r)?Hd(e):Jo(r)?qd(df(e,t,r.parameters),e=>ff(e,n,r.instanceType),()=>Wd()):Wd()}function mf(e,t,n,r,i){return qd(pp(e,t,i),()=>pp(e,n,i),()=>pp(e,r,i))}function hf(e,t,n){return pp(e,Vl(t),n)}function gf(e,t,n,r){return is(r)||gs(r)?Hd(e):Zo(r)?qd(df(e,t,r.parameters),e=>ff(e,n,r.returnType),()=>Wd()):Wd()}function _f(e,t,n){return Cc(n)||Pc(n)?Hd(e):tf(e,t,n)}function vf(e,t,n){return pp(e,Hl(t),n)}function yf(e,t,n){return t===n?Hd(e):Wd()}function bf(e,t,n){return kc(n)?yf(e,t,n.const):vc(n)?Hd(e):tf(e,F(t),n)}function xf(e,t,n){return kc(n)?yf(e,t,n.const):bc(n)?Hd(e):tf(e,F(t),n)}function Sf(e,t,n){return kc(n)?yf(e,t,n.const):Pc(n)?Hd(e):tf(e,F(t),n)}function Cf(e,t,n){return kc(n)?yf(e,t,n.const):Rc(n)?Hd(e):tf(e,F(t),n)}function wf(e,t,n){return ba(t.const)?bf(e,t.const,n):xa(t.const)?xf(e,t.const,n):Ea(t.const)?Sf(e,t.const,n):ka(t.const)?Cf(e,t.const,n):Ns()}function Tf(e,t,n){return Ss(n)?tf(e,t,n):Hd(e)}function Ef(e,t,n){return jc(n)?Hd(e):tf(e,t,n)}function Df(e,t,n){return Pc(n)?Hd(e):tf(e,t,n)}function Of(e,t,n){return ls(t)?ls(n)?Hd(e):Wd():Hd(e)}function kf(e,t,n){return Ss(n)&&ss(n.extends)?Wd():qd(pp(e,t,n),e=>Of(e,t,n),()=>Wd())}function Af(e,t){return e.reduce((e,n)=>n in t&&Kd(t[n])?{...e,...t[n].inferred}:Ns(),{})}function jf(e,t,n){let r={};for(let i of Za(n))r[i]=i in t?kf({},t[i],n[i]):ls(n[i])?Ss(n[i])?Hd(go(e,{[n[i].name]:n[i].extends})):Hd(e):Wd();let i=$a(r).every(e=>Kd(e)),a=i?Af(Za(r),r):{};return i?Hd(a):Wd()}function Mf(e,t,n){let r=jf(e,t,n);return Kd(r)?Hd(go(e,r.inferred)):Wd()}function Nf(e,t,n){return Mf(e,t,n)}function Pf(e,t){return Za(t).reduce((n,r)=>({...n,[r]:M(e,r)?Bc(n[r])?zc([...n[r].anyOf,t[r]]):zc([e[r],t[r]]):t[r]}),e)}function Ff(e,t,n,r){return qa(t,(t,i)=>qd(pp({},e[t],n),t=>Ff(e,i,n,Pf(r,t)),()=>Wd()),()=>Hd(r))}function If(e,t,n,r){return Ff(t,Za(t),r,e)}function Lf(e,t,n){return bu(n)?If(e,t,_u(n),yu(n)):ps(n)?Nf(e,t,n.properties):tf(e,P(t),n)}function Rf(e,t){return j(Za(t).length,0)?Hd(e):Wd()}function zf(e,t,n,r,i){return pp(e,n,i)}function Bf(e,t,n,r){return bu(r)?zf(e,gu(t),n,gu(_u(r)),yu(r)):ps(r)?Rf(e,r.properties):is(r)||gs(r)?Hd(e):Wd()}function Vf(e,t,n){return Rc(n)?Hd(e):tf(e,t,n)}function Hf(e,t,n){return Ic(n)?Hd(e):tf(e,t,n)}function Uf(e,t,n){return pp(e,Ul(t),n)}function Wf(e,t){return jo({"~kind":`Inferrable`},{name:e,type:t},{})}function Gf(e){return Oa(e)&&M(e,`~kind`)&&M(e,`name`)&&M(e,`type`)&&j(e[`~kind`],`Inferrable`)&&ka(e.name)&&Oa(e.type)}function Kf(e){return Su(e)?Ss(e.items)?Go(e.items.extends)?Wf(e.items.name,e.items.extends.items):gs(e.items.extends)?Wf(e.items.name,e.items.extends):void 0:Ns():void 0}function qf(e){return Ss(e)?Wf(e.name,e.extends):void 0}function Jf(e,t,n=[]){return qa(e,(e,r)=>qd(pp({},e,t),()=>Jf(r,t,[...n,e]),()=>void 0),()=>n)}function Yf(e,t,n,r){let i=Jf(n,r);return ya(i)?Hd(go(e,{[t]:cl(i)})):Wd()}function Xf(e,t,n,r){let i=Jf(n,r);return ya(i)?Hd(go(e,{[t]:zc(i)})):Wd()}function Zf(e){return[...e].reverse()}function Qf(e,t){return t?Zf(e):e}function $f(e){let t=e.length>0?e[0]:void 0;return Fo(Fo(t)?Kf(t):void 0)}function ep(e,t,n,r,i,a){return qd(pp(e,n,i),e=>rp(e,t,r,a),()=>Wd())}function tp(e,t,n,r,i){let a=Kf(r);return Gf(a)?Yf(e,a.name,Qf(n,t),a.type):qa(n,(n,a)=>ep(e,t,n,a,r,i),()=>Wd())}function np(e,t,n,r){return qa(r,(r,i)=>tp(e,t,n,r,i),()=>j(n.length,0)?Hd(e):Wd())}function rp(e,t,n,r){return np(e,t,n,r)}function ip(e,t,n){let r=Q_(e,Y_([],[]),n),i=$f(r);return rp(e,i,Qf(t,i),Qf(r,i))}function ap(e,t,n){let r=qf(n);return Gf(r)?Xf(e,r.name,t,r.type):qa(t,(t,r)=>qd(pp(e,t,n),e=>ap(e,r,n),()=>Wd()),()=>Hd(e))}function op(e,t,n){let r=Q_(e,Y_([],[]),t);return ll(n)?ip(e,r,n.items):Go(n)?ap(e,r,n.items):tf(e,cl(r),n)}function sp(e,t,n){return Eu(n)||Tu(n)?Hd(e):tf(e,t,n)}function cp(e,t,n){return qa(n,(n,r)=>qd(pp(e,t,n),e=>Hd(e),()=>cp(e,t,r)),()=>Wd())}function lp(e,t,n){return qa(t,(t,r)=>qd(cp(e,t,n),e=>lp(e,r,n),()=>Wd()),()=>Hd(e))}function up(e,t,n){let r=qf(n);return Gf(r)?Xf(e,r.name,t,r.type):Bc(n)?lp(e,t,n.anyOf):lp(e,t,[n])}function dp(e,t,n){return Ss(n)?tf(e,t,n):is(n)||gs(n)?Hd(e):Wd()}function fp(e,t,n){return Eu(n)?Hd(e):tf(e,t,n)}function pp(e,t,n){return is(t)?nf(e,t,n):Go(t)?af(e,t,t.items,n):vc(t)?of(e,t,n):bc(t)?sf(e,t,n):Jo(t)?pf(e,t.parameters,t.instanceType,n):ws(t)?mf(e,t.if,t.then,t.else,n):ks(t)?hf(e,t.enum,n):Zo(t)?gf(e,t.parameters,t.returnType,n):Cc(t)?_f(e,t,n):js(t)?vf(e,t.allOf,n):kc(t)?wf(e,t,n):ss(t)?Tf(e,t,n):jc(t)?Ef(e,t,n):Pc(t)?Df(e,t,n):ps(t)?Lf(e,t.properties,n):bu(t)?Bf(e,_u(t),yu(t),n):Rc(t)?Vf(e,t,n):Ic(t)?Hf(e,t,n):zd(t)?Uf(e,t.pattern,n):ll(t)?op(e,t.items,n):Tu(t)?sp(e,t,n):Bc(t)?up(e,t.anyOf,n):gs(t)?dp(e,t,n):Eu(t)?fp(e,t,n):Wd()}function mp(e,t){return Hl([...e,P(t)])}function hp(e,t,n){return X_(e)?No(mp(e,t),{},n):_p(e,t,n)}function gp(e,t,n,r,i){return hp($_(e,t,n),Z_(e,t,r),i)}function _p(e,t,n={}){return Io(`Interface`,[e,t],n)}function vp(e){return Fo(e)&&M(e,`action`)&&j(e.action,`Interface`)}function yp(e,t,n){return e.includes(n)?!0:Sp([...e,n],t,t[n])}function bp(e,t,n){return xp(e,t,fs(n))}function xp(e,t,n){return qa(n,(n,r)=>Sp(e,t,n)?!0:xp(e,t,r),()=>!1)}function Sp(e,t,n){return es(n)?yp(e,t,n.$ref):Go(n)?Sp(e,t,n.items):Jo(n)?xp(e,t,[...n.parameters,n.instanceType]):Zo(n)?xp(e,t,[...n.parameters,n.returnType]):vp(n)?bp(e,t,n.parameters[1]):js(n)?xp(e,t,n.allOf):ps(n)?bp(e,t,n.properties):Bc(n)?xp(e,t,n.anyOf):ll(n)?xp(e,t,n.items):bu(n)?Sp(e,t,yu(n)):!1}function Cp(e,t,n){return Sp(e,t,n)}function wp(e,t){return t.reduce((t,n)=>Cp([n],e,e[n])?[...t,n]:t,[])}function Tp(e){return wp(e,ds(e))}function Ep(e,t,n){return n.includes(t)?n:t in e?kp(e,e[t],[...n,t]):Ns()}function Dp(e,t,n){return Op(e,fs(t),n)}function Op(e,t,n){return t.reduce((t,n)=>kp(e,n,t),n)}function kp(e,t,n){return es(t)?Ep(e,t.$ref,n):Go(t)?kp(e,t.items,n):Jo(t)?Op(e,[...t.parameters,t.instanceType],n):Zo(t)?Op(e,[...t.parameters,t.returnType],n):vp(t)?Dp(e,t.parameters[1],n):js(t)?Op(e,t.allOf,n):ps(t)?Dp(e,t.properties,n):Bc(t)?Op(e,t.anyOf,n):ll(t)?Op(e,t.items,n):bu(t)?kp(e,yu(t),n):n}function Ap(e,t,n){return kp(e,n,[t])}function jp(e){return rs()}function Mp(e){return Za(e).reduce((t,n)=>({...t,[n]:Pp(e[n])}),{})}function Np(e){return e.reduce((e,t)=>[...e,Pp(t)],[])}function Pp(e){return es(e)?jp(e.$ref):Go(e)?Wo(Pp(e.items),Ko(e)):Jo(e)?qo(Np(e.parameters),Pp(e.instanceType)):Zo(e)?Xo(Np(e.parameters),Pp(e.returnType)):js(e)?As(Np(e.allOf)):ps(e)?P(Mp(e.properties)):bu(e)?mu(vu(e),Pp(yu(e))):Bc(e)?zc(Np(e.anyOf)):ll(e)?cl(Np(e.items)):e}function Fp(e,t){return t in e?Pp(e[t]):hs()}function Ip(e){return Fp(e.$defs,e.$ref)}function Lp(e,t,n){let r=$_(e,Y_([],[]),t),i=Z_({},Y_([],[]),n);return Hl([...r,P(i)])}function Rp(e,t){return Za(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=vp(r)?Lp(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function zp(e,t,n){return _s(Rp(e,Ap(e,t,n)),t)}function Bp(e,t){return t in e?es(e[t])?Bp(e,e[t].$ref):e[t]:os()}function Vp(e,t){return Bp(e,t)}function Hp(e){return vs(e)?Ip(e):bs(e)?hs():e}function Up(e,t,n){return pp(e,Hp(t),Hp(n))}function Wp(e,t){let n=[Up({},e,t),Up({},t,e)];return Kd(n[0])&&Kd(n[1])?0:Kd(n[0])&&Gd(n[1])?2:Gd(n[0])&&Kd(n[1])?3:1}function Gp(e,t,n=[],r=t){return qa(t,(t,i)=>{let a=Wp(e,t);return j(a,2)||j(a,0)?r:j(a,1)?Gp(e,i,[...n,t],r):Gp(e,i,n,r)},()=>[...n,e])}function Kp(e,t,n){let r=Gl(e);return is(r)||gs(r)?[r]:ss(r)?qp(t,n):ps(r)?qp(t,[...n,r]):qp(t,Gp(r,n))}function qp(e,t=[]){return qa(e,(e,n)=>Kp(e,n,t),()=>t)}function Jp(e){return tu(qp(e))}function Yp(e,t){return No(Gl(e),{},t)}function Xp(e,t,n,r){return Yp(rv(e,t,n),r)}function Zp(e,t=[]){return Lo(e)&&j(e.action,`Conditional`)?es(e.parameters[0])?Zp(e.parameters[2],Zp(e.parameters[3],[...t,e.parameters[0].$ref])):Zp(e.parameters[2],Zp(e.parameters[3],t)):Lo(e)&&j(e.action,`Mapped`)&&Lo(e.parameters[1])&&j(e.parameters[1].action,`KeyOf`)&&es(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Qp(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function $p(e,t,n=[]){return qa(e,(e,r)=>qa(t,(t,i)=>$p(r,i,[...n,[t,e]]),()=>n),()=>n)}function em(e){return zd(e)?Ul(e.pattern):ks(e)?Vl(e.enum):e}function tm(e){let t=em(e);return Bc(t)?[...t.anyOf]:[t]}function nm(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function rm(e,t){return t.reduce((t,n)=>[...t,...nm(e,n)],[])}function im(e){return e.reduce((e,t)=>j(t[0],!0)?rm(e,tm(t[1])):rm(e,[t[1]]),[[]])}function am(e,t,n){let r=$p(t,Qp(e,Zp(n)));return Lo(n)&&j(n.action,`Conditional`)||Lo(n)&&j(n.action,`Mapped`)?im(r):[t]}function om(){return[`(not-resolvable)`,os()]}function sm(){return[`(not-generic)`,os()]}function cm(e,t,n){return[e,ts(t,n)]}function lm(e,t,n){return t in e?um(e,t,e[t],n):om()}function um(e,t,n,r){return ns(n)?cm(t,n.parameters,n.expression):es(n)?lm(e,n.$ref,r):sm()}function dm(e,t,n){return um(e,`(anonymous)`,t,n)}function fm(e,t,n){if(Ss(t)||km(t)||Kd(Up({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function pm(e,t,n,r,i){let a=rv(e,t,i);return fm(n,a,r),go(e,{[n]:a})}function mm(e,t,n,r,i){let a=rv(e,t,n.extends),o=rv(e,t,n.equals);return qa(i,(i,o)=>hm(pm(e,t,n.name,a,i),t,r,o),()=>hm(pm(e,t,n.name,a,o),t,r,[]))}function hm(e,t,n,r){return qa(n,(n,i)=>mm(e,t,n,i,r),()=>e)}function gm(e,t,n,r){return hm(e,t,n,r)}var _m=0,vm=0;function ym(){if(!Na(vm,mo().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function bm(){ym(),vm++,_m++}function xm(){_m--,j(_m,0)&&(vm=0)}function Sm(e){return Ma(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function Cm(e,t){return j(Sm(e),t)}function wm(e,t,n,r,i,a){bm();try{let o=gm(e,t,r,a),s=rv(o,Y_([...t.callstack,n.$ref],t.visited),i);return rv(o,Y_([],[]),s)}finally{xm()}}function Tm(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=wm(e,t,n,r,i,o);return[...a,s]},[])}function Em(e,t,n,r,i,a){let o=Tm(e,t,n,r,i,am(r,a,i));return j(o.length,1)?o[0]:Wl(o)}function Dm(e,t,n,r){let i=$_(e,t,r),a=dm(e,n,r),o=a[0],s=a[1];return ns(s)?Cm(t,o)?Om($o(o),i):Em(e,t,$o(o),s.parameters,s.expression,i):Om(n,i)}function Om(e,t){return jo({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function km(e){return Po(e,`Call`)}function Am(e){return Mo(e,[`~immutable`])}function jm(e,t){return No(Am(e),{},t)}function Mm(e,t,n,r){return jm(rv(e,t,n),r)}function Nm(e,t){return e(t)}function Pm(e,t){return ka(t)?F(Nm(e,t)):F(t)}function Fm(e,t){return Lm(e,Ul(t))}function Im(e,t){return zc(t.map(t=>Lm(e,t)))}function Lm(e,t){return kc(t)?Pm(e,t.const):zd(t)?Fm(e,t.pattern):Bc(t)?Im(e,t.anyOf):t}function Rm(e,t={}){return Io(`Capitalize`,[e],t)}function zm(e,t={}){return Io(`Lowercase`,[e],t)}function Bm(e,t={}){return Io(`Uncapitalize`,[e],t)}function Vm(e,t={}){return Io(`Uppercase`,[e],t)}var Hm=e=>e[0].toUpperCase()+e.slice(1),Um=e=>e.toLowerCase(),Wm=e=>e[0].toLowerCase()+e.slice(1),Gm=e=>e.toUpperCase();function Km(e,t){return X_([e])?No(Lm(Hm,e),{},t):Rm(e,t)}function qm(e,t){return X_([e])?No(Lm(Um,e),{},t):zm(e,t)}function Jm(e,t){return X_([e])?No(Lm(Wm,e),{},t):Bm(e,t)}function Ym(e,t){return X_([e])?No(Lm(Gm,e),{},t):Vm(e,t)}function Xm(e,t,n,r){return Km(rv(e,t,n),r)}function Zm(e,t,n,r){return qm(rv(e,t,n),r)}function Qm(e,t,n,r){return Jm(rv(e,t,n),r)}function $m(e,t,n,r){return Ym(rv(e,t,n),r)}function eh(e,t,n,r,i={}){return Io(`Conditional`,[e,t,n,r],i)}function th(e,t,n,r,i,a){let o=Up(e,n,r);return Vd(o)?zc([rv(o.inferred,t,i),rv(e,t,a)]):Ud(o)?rv(o.inferred,t,i):rv(e,t,a)}function nh(e,t,n,r,i,a,o){return X_([n,r])?No(th(e,t,n,r,i,a),{},o):eh(n,r,i,a,o)}function rh(e,t,n,r,i,a,o){return nh(e,t,rv(e,t,n),rv(e,t,r),i,a,o)}function ih(e,t={}){return Io(`ConstructorParameters`,[e],t)}function ah(e){let t=Jo(e)?e.parameters:[];return cl(Q_({},Y_([],[]),t))}function oh(e,t){return X_([e])?No(ah(e),{},t):ih(e,t)}function sh(e,t,n,r){return oh(rv(e,t,n),r)}function ch(e,t,n={}){return Io(`Exclude`,[e,t],n)}function lh(e,t,n){return X_([e,t])?No(zl(e,t),{},n):ch(e,t,n)}function uh(e,t,n,r,i){return lh(rv(e,t,n),rv(e,t,r),i)}function dh(e,t,n={}){return Io(`Extract`,[e,t],n)}function fh(e,t){return Kd(Up({},e,t))?[e]:[]}function ph(e,t,n=[]){return qa(e,(e,r)=>ph(r,t,[...n,...fh(e,t)]),()=>n)}function mh(e,t){let n=Gl(e);return Wl(ph(Bc(n)?n.anyOf:[n],t))}function hh(e,t,n){return X_([e,t])?No(mh(e,t),{},n):dh(e,t,n)}function gh(e,t,n,r,i){return hh(rv(e,t,n),rv(e,t,r),i)}function _h(e,t,n={}){return Io(`Index`,[e,t],n)}function vh(e,t){return Dh(Vp(e,t))}function yh(e,t,n){return Dh(Bl(e,t,n))}function bh(e,t){let n=Za(e).filter(e=>!M(t,e)),r=Za(t).filter(t=>!M(e,t)),i=Za(e).filter(e=>M(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:Hl([e[r],t[r]])}),{});return go(go(a,o),s)}function xh(e){return e.reduce((e,t)=>bh(e,Dh(t)),{})}function Sh(e){return e}function Ch(e){return Dh(bl(cl(e)))}function wh(e,t){return Za(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:Wl([e[r],t[r]])}),{})}function Th(e,t){return qa(e,(e,n)=>Th(n,wh(t,Dh(e))),()=>t)}function Eh(e){return qa(e,(e,t)=>Th(t,Dh(e)),()=>Ns())}function Dh(e){return vs(e)?vh(e.$defs,e.$ref):ws(e)?yh(e.if,e.then,e.else):js(e)?xh(e.allOf):Bc(e)?Eh(e.anyOf):ll(e)?Ch(e.items):ps(e)?Sh(e.properties):{}}function Oh(e){return P(Dh(e))}var kh=RegExp(`^(?:0|[1-9][0-9]*)$`);function Ah(e){let t=`${e}`;return kh.test(t)?parseInt(t):e}function jh(e){return F(Ah(e))}function Mh(e){return e.map(e=>Nh(e))}function Nh(e){return js(e)?As(Mh(e.allOf)):Bc(e)?zc(Mh(e.anyOf)):kc(e)?jh(e.const):e}function Ph(e,t){return Kd(Up({},Nh(t),Nc()))?e:kc(t)&&j(t.const,`length`)?Nc():os()}function Fh(e,t){return Hh(Vp(e,t))}function Ih(e,t,n){return Hh(Bl(e,t,n))}function Lh(e){return Hh(Vl(e))}function Rh(e){return Hh(Hl(e))}function zh(e){return[`${e}`]}function Bh(e){return Hh(Ul(e))}function Vh(e){return e.reduce((e,t)=>[...e,...Hh(t)],[])}function Hh(e){return vs(e)?Fh(e.$defs,e.$ref):ws(e)?Ih(e.if,e.then,e.else):ks(e)?Lh(e.enum):js(e)?Rh(e.allOf):kc(e)?zh(e.const):zd(e)?Bh(e.pattern):Bc(e)?Vh(e.anyOf):[]}function Uh(e){return Hh(e)}function Wh(e,t){return t.map(t=>Gh(e,t))}function Gh(e,t){return Go(t)?Wo(Gh(e,t.items)):Jo(t)?qo(Wh(e,t.parameters),Gh(e,t.instanceType)):Zo(t)?Xo(Wh(e,t.parameters),Gh(e,t.returnType)):ll(t)?cl(Wh(e,t.items)):Bc(t)?zc(Wh(e,t.anyOf)):js(t)?As(Wh(e,t.allOf)):Cu(t)?P(e):t}function Kh(e,t){return Gh(e,t)}function qh(e,t){return Kh(e,t in e?e[t]:os())}function Jh(e,t){return t.reduce((t,n)=>[...t,qh(e,n)],[])}function Yh(e,t){return Wl(Jh(e,Uh(t)))}var Xh=new RegExp(uu);function Zh(e){return e.filter(e=>Xh.test(e))}function Qh(e){return Wl(Jh(e,Zh(ds(e))))}function $h(e,t){return Pc(t)?Qh(e):Yh(e,t)}function eg(e){return F(Ah(e))}function tg(e){return e.map(e=>ng(e))}function ng(e){return js(e)?As(tg(e.allOf)):Bc(e)?zc(tg(e.anyOf)):kc(e)?eg(e.const):e}function rg(e,t){return e.reduceRight((e,n,r)=>Kd(Up({},F(r),t))?[n,...e]:e,[])}function ig(e,t){return Kl(rg(e,ng(t)))}function ag(e){return Kl(e)}function og(e,t){return kc(t)&&j(t.const,`length`)?F(e.length):Pc(t)||Cc(t)?ag(e):ig(e,t)}function sg(e,t){return Go(e)?Ph(e.items,t):ps(e)?$h(e.properties,t):ll(e)?og(e.items,t):os()}function cg(e){return vs(e)||ws(e)||js(e)||Bc(e)?Oh(e):e}function lg(e,t,n){return X_([e,t])?No(sg(cg(e),t),{},n):_h(e,t,n)}function ug(e,t,n,r,i){return lg(rv(e,t,n),rv(e,t,r),i)}function dg(e,t={}){return Io(`InstanceType`,[e],t)}function fg(e){return Jo(e)?e.instanceType:os()}function pg(e,t){return X_([e])?No(fg(e),{},t):dg(e,t)}function mg(e,t,n,r={}){return pg(rv(e,t,n),r)}function hg(e,t={}){return Io(`KeyOf`,[e],t)}function gg(){return zc([Nc(),Lc(),Fc()])}function _g(e){return Nc()}function vg(e){return e.reduce((e,t)=>Ec(t)?[...e,F(Ah(t))]:Ns(),[])}function yg(e){return Kl(vg(Za(e)))}function bg(e){return vu(e)}function xg(e){return Kl(e.map((e,t)=>F(t)))}function Sg(e){return is(e)?gg():Go(e)?_g(e.items):ps(e)?yg(e.properties):bu(e)?bg(e):ll(e)?xg(e.items):os()}function Cg(e){return vs(e)||ws(e)||js(e)||Bc(e)?Oh(e):e}function wg(e,t){return X_([e])?No(Sg(Cg(e)),{},t):hg(e,t)}function Tg(e,t,n,r){return wg(rv(e,t,n),r)}function Eg(e,t,n,r,i={}){return Io(`Mapped`,[e,t,n,r],i)}function Dg(e){return jg(Ul(e))}function Og(e){return e.reduce((e,t)=>[...e,...jg(t)],[])}function kg(e){return jg(Vl(e))}function Ag(e){return Ea(e)?[F(`${e}`)]:[F(e)]}function jg(e){return ks(e)?kg(e.enum):kc(e)?Ag(e.const):zd(e)?Dg(e.pattern):Bc(e)?Og(e.anyOf):[e]}function Mg(e){return jg(e)}function Ng(e){return zd(e)?Ul(e.pattern):e}function Pg(e,t,n,r,i,a){let o=go(e,{[n.name]:r}),s=Ng(rv(o,t,i)),c=rv(o,t,a);return Dc(s)||Oc(s)?{[s.const]:c}:{}}function Fg(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,Pg(e,t,n,o,i,a)],[])}function Ig(e){return e.reduce((e,t)=>[...e,P(t)],[])}function Lg(e,t,n,r,i,a){return Hl(Ig(Fg(e,t,n,Mg(r),i,a)))}function Rg(e,t,n,r,i,a,o){return X_([r])?No(Lg(e,t,n,r,i,a),{},o):Eg(n,r,i,a,o)}function zg(e,t,n,r,i,a,o){return Rg(e,t,n,rv(e,t,r),i,a,o)}function Bg(e,t,n){let r=go(e,t);return Za(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:zp(r,n,t[n])}),{})}function Vg(e,t,n){let r=go(e,t);return Za(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:rv(r,Y_([],[]),t[n])}),{})}function Hg(e,t,n){let r=Tp(t),i=Bg(e,t,r),a=Vg(e,t,r);return No({...i,...a},{},n)}function Ug(e,t,n,r){return Hg(e,n,r)}function Wg(e,t={}){return Io(`NonNullable`,[e],t)}function Gg(e){return lh(e,zc([Ac(),wu()]),{})}function Kg(e,t){return X_([e])?No(Gg(e),{},t):Wg(e,t)}function qg(e,t,n,r){return Kg(rv(e,t,n),r)}function Jg(e,t,n={}){return Io(`Omit`,[e,t],n)}function Yg(e){let t=Oh(e);return ps(t)?t.properties:Ns()}function Xg(e,t){return Za(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function Zg(e,t){return P(Xg(Yg(e),Uh(t)))}function Qg(e,t,n){return X_([e,t])?No(Zg(e,t),{},n):Jg(e,t,n)}function $g(e,t,n,r,i){return Qg(rv(e,t,n),rv(e,t,r),i)}function e_(e,t={}){return Io(`Parameters`,[e],t)}function t_(e){let t=Zo(e)?e.parameters:[];return cl(Q_({},Y_([],[]),t))}function n_(e,t){return X_([e])?No(t_(e),{},t):e_(e,t)}function r_(e,t,n,r){return n_(rv(e,t,n),r)}function i_(e,t={}){return Io(`Partial`,[e],t)}function a_(e,t){let n=u_(Vp(e,t));return _s(go(e,{[t]:n}),t)}function o_(e,t,n){return u_(Bl(e,t,n))}function s_(e){return u_(Hl(e))}function c_(e){return zc(e.map(e=>u_(e)))}function l_(e){return P(Za(e).reduce((t,n)=>({...t,[n]:cs(e[n])}),{}))}function u_(e){return vs(e)?a_(e.$defs,e.$ref):ws(e)?o_(e.if,e.then,e.else):js(e)?s_(e.allOf):Bc(e)?c_(e.anyOf):ps(e)?l_(e.properties):P({})}function d_(e,t){return X_([e])?No(u_(e),{},t):i_(e,t)}function f_(e,t,n,r){return d_(rv(e,t,n),r)}function p_(e,t,n={}){return Io(`Pick`,[e,t],n)}function m_(e,t){return Za(e).reduce((n,r)=>t.includes(r)?go(n,{[r]:e[r]}):n,{})}function h_(e,t){return P(m_(Yg(e),Uh(t)))}function g_(e,t,n){return X_([e,t])?No(h_(e,t),{},n):p_(e,t,n)}function __(e,t,n,r,i){return g_(rv(e,t,n),rv(e,t,r),i)}function v_(e,t={}){return Io(`ReadonlyObject`,[e],t)}function y_(e){return cv(Wo(e))}function b_(e,t){let n=E_(Vp(e,t));return _s(go(e,{[t]:n}),t)}function x_(e,t,n){return E_(Bl(e,t,n))}function S_(e){return E_(Hl(e))}function C_(e){return P(Za(e).reduce((t,n)=>({...t,[n]:mc(e[n])}),{}))}function w_(e){return cv(cl(e))}function T_(e){return zc(e.map(e=>E_(e)))}function E_(e){return Go(e)?y_(e.items):vs(e)?b_(e.$defs,e.$ref):ws(e)?x_(e.if,e.then,e.else):js(e)?S_(e.allOf):ps(e)?C_(e.properties):ll(e)?w_(e.items):Bc(e)?T_(e.anyOf):e}function D_(e,t){return X_([e])?No(E_(e),{},t):v_(e)}function O_(e,t,n,r){return D_(rv(e,t,n),r)}function k_(e,t,n,r){return t.visited.includes(r)?n:r in e?rv(e,Y_(t.callstack,[...t.visited,r]),e[r]):n}function A_(e,t){let n=F_(Vp(e,t));return _s(go(e,{[t]:n}),t)}function j_(e,t,n){return F_(Bl(e,t,n))}function M_(e){return F_(Hl(e))}function N_(e){return zc(e.map(e=>F_(e)))}function P_(e){return P(Za(e).reduce((t,n)=>({...t,[n]:vl(e[n])}),{}))}function F_(e){return vs(e)?A_(e.$defs,e.$ref):ws(e)?j_(e.if,e.then,e.else):js(e)?M_(e.allOf):Bc(e)?N_(e.anyOf):ps(e)?P_(e.properties):P({})}function I_(e,t={}){return Io(`Required`,[e],t)}function L_(e,t){return X_([e])?No(F_(e),{},t):I_(e,t)}function R_(e,t,n,r){return L_(rv(e,t,n),r)}function z_(e,t={}){return Io(`ReturnType`,[e],t)}function B_(e){return Zo(e)?e.returnType:os()}function V_(e,t){return X_([e])?No(B_(e),{},t):z_(e,t)}function H_(e,t,n,r={}){return V_(rv(e,t,n),r)}function U_(e,t){return Io(`With`,[e,t],{})}function W_(e,t){return G_(e,t)}function G_(e,t){return X_([e])?No(e,{},t):U_(e,t)}function K_(e,t,n,r){return G_(rv(e,t,n),r)}function q_(e){return Su(e)?ll(e.items)?J_(e.items.items):Ss(e.items)||es(e.items)?[e]:[os()]:[e]}function J_(e){return e.reduce((e,t)=>[...e,...q_(t)],[])}function Y_(e,t){return{callstack:e,visited:t}}function X_(e){return qa(e,(e,t)=>!es(e)&&X_(t),()=>!0)}function Z_(e,t,n){return Za(n).reduce((r,i)=>({...r,[i]:rv(e,t,n[i])}),{})}function Q_(e,t,n){return J_($_(e,t,n))}function $_(e,t,n){return n.map(n=>rv(e,t,n))}function ev(e,t){let n=ls(e)?Ho(t,{}):t,r=hc(e)?zo(n,{}):n;return pc(e)?ov(r,{}):r}function tv(e,t,n,r,i){return j(n,`AddImmutable`)?sv(e,t,r[0],i):j(n,`RemoveImmutable`)?Mm(e,t,r[0],i):j(n,`AddReadonly`)?Bo(e,t,r[0],i):j(n,`RemoveReadonly`)?pl(e,t,r[0],i):j(n,`AddOptional`)?Uo(e,t,r[0],i):j(n,`RemoveOptional`)?_l(e,t,r[0],i):j(n,`Capitalize`)?Xm(e,t,r[0],i):j(n,`Conditional`)?rh(e,t,r[0],r[1],r[2],r[3],i):j(n,`ConstructorParameters`)?sh(e,t,r[0],i):j(n,`Evaluate`)?Xp(e,t,r[0],i):j(n,`Exclude`)?uh(e,t,r[0],r[1],i):j(n,`Extract`)?gh(e,t,r[0],r[1],i):j(n,`Index`)?ug(e,t,r[0],r[1],i):j(n,`InstanceType`)?mg(e,t,r[0],i):j(n,`Interface`)?gp(e,t,r[0],r[1],i):j(n,`KeyOf`)?Tg(e,t,r[0],i):j(n,`Lowercase`)?Zm(e,t,r[0],i):j(n,`Mapped`)?zg(e,t,r[0],r[1],r[2],r[3],i):j(n,`Module`)?Ug(e,t,r[0],i):j(n,`NonNullable`)?qg(e,t,r[0],i):j(n,`Pick`)?__(e,t,r[0],r[1],i):j(n,`Parameters`)?r_(e,t,r[0],i):j(n,`Partial`)?f_(e,t,r[0],i):j(n,`Omit`)?$g(e,t,r[0],r[1],i):j(n,`ReadonlyObject`)?O_(e,t,r[0],i):j(n,`Record`)?lu(e,t,r[0],r[1],i):j(n,`Required`)?R_(e,t,r[0],i):j(n,`ReturnType`)?H_(e,t,r[0],i):j(n,`TemplateLiteral`)?Id(e,t,r[0],i):j(n,`Uncapitalize`)?Qm(e,t,r[0],i):j(n,`Uppercase`)?$m(e,t,r[0],i):j(n,`With`)?K_(e,t,r[0],r[1]):Io(n,r,i)}function nv(e,t,n){return ev(n,es(n)?k_(e,t,n,n.$ref):Go(n)?Wo(rv(e,t,n.items),Ko(n)):km(n)?Dm(e,t,n.target,n.arguments):Jo(n)?qo($_(e,t,n.parameters),rv(e,t,n.instanceType),Yo(n)):Zo(n)?Xo($_(e,t,n.parameters),rv(e,t,n.returnType),Qo(n)):ws(n)?Cs(rv(e,t,n.if),rv(e,t,n.then),rv(e,t,n.else),Ts(n)):js(n)?As($_(e,t,n.allOf),Ms(n)):ps(n)?P(Z_(e,t,n.properties),ms(n)):bu(n)?hu(_u(n),rv(e,t,yu(n))):Su(n)?xu(rv(e,t,n.items)):ll(n)?cl(Q_(e,t,n.items),ul(n)):Bc(n)?zc($_(e,t,n.anyOf),Vc(n)):n)}function rv(e,t,n){return Lo(n)?tv(e,t,n.action,n.parameters,n.options):nv(e,t,n)}function iv(e,t){return rv(e,Y_([],[]),t)}function av(e){return No(e,{"~immutable":!0},{})}function ov(e,t){return No(av(e),{},t)}function sv(e,t,n,r){return ov(rv(e,t,n),r)}function cv(e,t={}){return ov(e,t)}function lv(e,t={}){return Yp(e,t)}function uv(e,t){let n=Wp(e,t);return j(n,3)?1:+!!j(n,1)}function dv(e,t,n=[]){return qa(t,(r,i)=>j(uv(e,r),1)?dv(e,i,[...n,r]):[...n,e,...t],()=>[...n,e])}function fv(e,t=[]){return qa(e,(e,n)=>fv(n,dv(e,t)),()=>t)}function pv(e){return fv(e)}function mv(e){return M(e,`~refine`)&&ya(e[`~refine`])&&Ha(e[`~refine`],0,e=>Oa(e)&&M(e,`check`)&&M(e,`error`)&&Ca(e.check)&&Ca(e.error))}function hv(e){return Oa(e)&&!ya(e)}function gv(e){return xa(e)}function _v(e){return hv(e)||gv(e)}function vv(e){return M(e,`additionalItems`)&&_v(e.additionalItems)}function yv(e){return M(e,`additionalProperties`)&&_v(e.additionalProperties)}function bv(e){return M(e,`allOf`)&&ya(e.allOf)&&e.allOf.every(e=>_v(e))}function xv(e){return M(e,`$anchor`)&&ka(e.$anchor)}function Sv(e){return M(e,`anyOf`)&&ya(e.anyOf)&&e.anyOf.every(e=>_v(e))}function Cv(e){return M(e,`const`)}function wv(e){return M(e,`contains`)&&_v(e.contains)}function Tv(e){return M(e,`default`)}function Ev(e){return M(e,`dependencies`)&&Oa(e.dependencies)&&Object.values(e.dependencies).every(e=>_v(e)||ya(e)&&e.every(e=>ka(e)))}function Dv(e){return M(e,`dependentRequired`)&&Oa(e.dependentRequired)&&Object.values(e.dependentRequired).every(e=>ya(e)&&e.every(e=>ka(e)))}function Ov(e){return M(e,`dependentSchemas`)&&Oa(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(e=>_v(e))}function kv(e){return M(e,`$dynamicAnchor`)&&ka(e.$dynamicAnchor)}function Av(e){return M(e,`$dynamicRef`)&&ka(e.$dynamicRef)}function jv(e){return M(e,`else`)&&_v(e.else)}function Mv(e){return M(e,`enum`)&&ya(e.enum)}function Nv(e){return M(e,`exclusiveMaximum`)&&(Ea(e.exclusiveMaximum)||ba(e.exclusiveMaximum))}function Pv(e){return M(e,`exclusiveMinimum`)&&(Ea(e.exclusiveMinimum)||ba(e.exclusiveMinimum))}function Fv(e){return M(e,`format`)&&ka(e.format)}function Iv(e){return M(e,`$id`)&&ka(e.$id)}function Lv(e){return M(e,`if`)&&_v(e.if)}function Rv(e){return M(e,`items`)&&(_v(e.items)||ya(e.items)&&e.items.every(e=>_v(e)))}function zv(e){return Rv(e)&&ya(e.items)}function Bv(e){return M(e,`maximum`)&&(Ea(e.maximum)||ba(e.maximum))}function Vv(e){return M(e,`maxContains`)&&Ea(e.maxContains)}function Hv(e){return M(e,`maxItems`)&&Ea(e.maxItems)}function Uv(e){return M(e,`maxLength`)&&Ea(e.maxLength)}function Wv(e){return M(e,`maxProperties`)&&Ea(e.maxProperties)}function Gv(e){return M(e,`minimum`)&&(Ea(e.minimum)||ba(e.minimum))}function Kv(e){return M(e,`minContains`)&&Ea(e.minContains)}function qv(e){return M(e,`minItems`)&&Ea(e.minItems)}function Jv(e){return M(e,`minLength`)&&Ea(e.minLength)}function Yv(e){return M(e,`minProperties`)&&Ea(e.minProperties)}function Xv(e){return M(e,`multipleOf`)&&(Ea(e.multipleOf)||ba(e.multipleOf))}function Zv(e){return M(e,`not`)&&_v(e.not)}function Qv(e){return M(e,`oneOf`)&&ya(e.oneOf)&&e.oneOf.every(e=>_v(e))}function $v(e){return M(e,`pattern`)&&(ka(e.pattern)||e.pattern instanceof RegExp)}function ey(e){return M(e,`patternProperties`)&&Oa(e.patternProperties)&&Object.values(e.patternProperties).every(e=>_v(e))}function ty(e){return M(e,`prefixItems`)&&ya(e.prefixItems)&&e.prefixItems.every(e=>_v(e))}function ny(e){return M(e,`properties`)&&Oa(e.properties)&&Object.values(e.properties).every(e=>_v(e))}function ry(e){return M(e,`propertyNames`)&&(Oa(e.propertyNames)||_v(e.propertyNames))}function iy(e){return M(e,`$recursiveAnchor`)&&xa(e.$recursiveAnchor)}function ay(e){return iy(e)&&j(e.$recursiveAnchor,!0)}function oy(e){return M(e,`$recursiveRef`)&&ka(e.$recursiveRef)}function sy(e){return M(e,`$ref`)&&ka(e.$ref)}function cy(e){return M(e,`required`)&&ya(e.required)&&e.required.every(e=>ka(e))}function ly(e){return M(e,`then`)&&_v(e.then)}function uy(e){return M(e,`type`)&&(ka(e.type)||ya(e.type)&&e.type.every(e=>ka(e)))}function dy(e){return M(e,`uniqueItems`)&&xa(e.uniqueItems)}function fy(e){return M(e,`unevaluatedItems`)&&_v(e.unevaluatedItems)}function py(e){return M(e,`unevaluatedProperties`)&&_v(e.unevaluatedProperties)}var my=class{constructor(){let e=new Set,t=new Set;this.stack=[{indices:e,keys:t}]}Push(){let e=new Set,t=new Set;return this.stack.push({indices:e,keys:t}),!0}Pop(){return this.stack.pop(),!0}AddIndex(e){return this.GetIndices().add(e),!0}AddKey(e){return this.GetKeys().add(e),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(e){for(let t of e)t.GetIndices().forEach(e=>this.GetIndices().add(e)),t.GetKeys().forEach(e=>this.GetKeys().add(e));return!0}},hy=class extends my{constructor(){super(),this.errors=[]}AtCapacity(){return this.errors.length>=mo().maxErrors}AddError(e){return this.AtCapacity()||this.errors.push(e),!1}GetErrors(){return this.errors}};function gy(e,t,n,r){return Ha(n[`~refine`],0,(e,t)=>e.check(r))}function _y(e,t,n,r,i,a){return Ua(i[`~refine`],0,(e,i)=>e.check(a)||t.AddError({keyword:`~refine`,schemaPath:n,instancePath:r,params:{index:i,message:e.error(a)}}))}function vy(e){return Rv(e)&&ya(e.items)}function yy(e,t,n,r){return!vy(n)||Ha(r,0,(r,i)=>Na(i,n.items.length)||sC(e,t,n.additionalItems,r)&&t.AddIndex(i))}function by(e,t,n,r,i,a){return!vy(i)||Ha(a,0,(a,o)=>{let s=`${n}/additionalItems`,c=`${r}/${o}`;return Na(o,i.items.length)||lC(e,t,s,c,i.additionalItems,a)&&t.AddIndex(o)})}function xy(e){return new RegExp(e,`u`)}function Sy(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}$`}function Cy(e){let t=[];return ey(e)&&t.push(...Za(e.patternProperties)),ny(e)&&t.push(...Za(e.properties).map(Sy)),j(t.length,0)?`(?!)`:`(${t.join(`|`)})`}function wy(e,t,n,r){let i=xy(Cy(n));return Ha(Za(r),0,(a,o)=>i.test(a)||sC(e,t,n.additionalProperties,r[a])&&t.AddKey(a))}function Ty(e,t,n,r,i,a){let o=xy(Cy(i)),s=[];return Ua(Za(a),0,(c,l)=>{let u=`${n}/additionalProperties`,d=`${r}/${c}`,f=o.test(c)||lC(e,t,u,d,i.additionalProperties,a[c])&&t.AddKey(c);return f||s.push(c),f})||t.AddError({keyword:`additionalProperties`,schemaPath:n,instancePath:r,params:{additionalProperties:s}})}function Ey(e,t,n,r){let i=n.allOf.reduce((t,n)=>{let i=new my;return cC(e,i,n,r)?[...t,i]:t},[]);return j(i.length,n.allOf.length)&&t.Merge(i)}function Dy(e,t,n,r,i,a){let o=[],s=i.allOf.reduce((t,i,s)=>{let c=`${n}/allOf/${s}`,l=new hy,u=uC(e,l,c,r,i,a);return u||o.push(l),u?[...t,l]:t},[]),c=j(s.length,i.allOf.length)&&t.Merge(s);return c||o.forEach(e=>e.GetErrors().forEach(e=>t.AddError(e))),c}function Oy(e,t,n,r){let i=n.anyOf.reduce((t,n)=>{let i=new my;return cC(e,i,n,r)?[...t,i]:t},[]);return Ma(i.length,0)&&t.Merge(i)}function ky(e,t,n,r,i,a){let o=[],s=i.anyOf.reduce((t,i,s)=>{let c=new hy,l=uC(e,c,`${n}/anyOf/${s}`,r,i,a);return l||o.push(c),l?[...t,c]:t},[]),c=Ma(s.length,0)&&t.Merge(s);return c||o.forEach(e=>e.GetErrors().forEach(e=>t.AddError(e))),c||t.AddError({keyword:`anyOf`,schemaPath:n,instancePath:r,params:{}})}function Ay(e,t,n,r){return n}function jy(e,t,n,r,i,a){return Ay(e,t,i,a)||t.AddError({keyword:`boolean`,schemaPath:n,instancePath:r,params:{}})}function My(e,t,n,r){return Ra(n.const)?j(r,n.const):no(r,n.const)}function Ny(e,t,n,r,i,a){return My(e,t,i,a)||t.AddError({keyword:`const`,schemaPath:n,instancePath:r,params:{allowedValue:i.const}})}function Py(e){return!(Kv(e)&&j(e.minContains,0))}function Fy(e,t,n,r){return!Py(n)||!j(r.length,0)&&Ga(r,(r,i)=>cC(e,t,n.contains,r)&&t.AddIndex(i))}function Iy(e,t,n,r,i,a){return Fy(e,t,i,a)||t.AddError({keyword:`contains`,schemaPath:n,instancePath:r,params:{minContains:1}})}function Ly(e,t,n,r){let i=j(Za(r).length,0),a=Ha(Xa(n.dependencies),0,([n,i])=>!M(r,n)||(ya(i)?i.every(e=>M(r,e)):cC(e,t,i,r)));return i||a}function Ry(e,t,n,r,i,a){let o=j(Za(a).length,0),s=Ua(Xa(i.dependencies),0,([i,o])=>{let s=`${n}/dependencies/${i}`;return!M(a,i)||(ya(o)?o.every(e=>M(a,e)||t.AddError({keyword:`dependencies`,schemaPath:n,instancePath:r,params:{property:i,dependencies:o}})):uC(e,t,s,r,o,a))});return o||s}function zy(e,t,n,r){let i=j(Za(r).length,0),a=Ha(Xa(n.dependentRequired),0,([e,t])=>!M(r,e)||t.every(e=>M(r,e)));return i||a}function By(e,t,n,r,i,a){let o=j(Za(a).length,0),s=Ua(Xa(i.dependentRequired),0,([e,i])=>!M(a,e)||Ua(i,0,o=>M(a,o)||t.AddError({keyword:`dependentRequired`,schemaPath:n,instancePath:r,params:{property:e,dependencies:i}})));return o||s}function Vy(e,t,n,r){let i=j(Za(r).length,0),a=Ha(Xa(n.dependentSchemas),0,([n,i])=>!M(r,n)||cC(e,t,i,r));return i||a}function Hy(e,t,n,r,i,a){let o=j(Za(a).length,0),s=Ua(Xa(i.dependentSchemas),0,([i,o])=>{let s=`${n}/dependentSchemas/${i}`;return!M(a,i)||uC(e,t,s,r,o,a)});return o||s}function Uy(e,t,n,r){let i=e.DynamicRef(n)??!1;return _v(i)&&cC(e,t,i,r)}function Wy(e,t,n,r,i,a){let o=e.DynamicRef(i)??!1;return _v(o)&&uC(e,t,`#`,r,o,a)}function Gy(e,t,n,r){return Wa(n.enum,e=>Ra(e)?j(r,e):no(r,e))}function Ky(e,t,n,r,i,a){return Gy(e,t,i,a)||t.AddError({keyword:`enum`,schemaPath:n,instancePath:r,params:{allowedValues:i.enum}})}function qy(e,t,n,r){return Na(r,n.exclusiveMaximum)}function Jy(e,t,n,r,i,a){return qy(e,t,i,a)||t.AddError({keyword:`exclusiveMaximum`,schemaPath:n,instancePath:r,params:{comparison:`<`,limit:i.exclusiveMaximum}})}function Yy(e,t,n,r){return Ma(r,n.exclusiveMinimum)}function Xy(e,t,n,r,i,a){return Yy(e,t,i,a)||t.AddError({keyword:`exclusiveMinimum`,schemaPath:n,instancePath:r,params:{comparison:`>`,limit:i.exclusiveMinimum}})}var Zy=[0,31,28,31,30,31,30,31,31,30,31,30,31],Qy=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function $y(e){return e%4==0&&(e%100!=0||e%400==0)}function eb(e){let t=Qy.exec(e);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r===2&&$y(n)?29:Zy[r])}var tb=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function nb(e,t=!0){let n=tb.exec(e);if(!n||t&&!n[4]&&!n[5])return!1;let r=+n[1],i=+n[2],a=+n[3];if(r>23||i>59||a>60)return!1;if(n[5]){let e=+n[6],t=+n[7];if(e>23||t>59)return!1}if(a<60)return!0;let o=n[5]===`-`?-1:1,s=+(n[6]||0),c=+(n[7]||0);return((r*60+i-o*(s*60+c))%1440+1440)%1440==1439}function rb(e){let t=e.split(/T/i);return t.length===2&&eb(t[0])&&nb(t[1])}var ib=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function ab(e){return ib.test(e)}var ob=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function sb(e){return ob.test(e)}var cb=/^(?!-).*(?<!-)$/,lb=/^(?!..--)/,ub=/^[a-zA-Z0-9-]*$/,db=/[^\p{ASCII}]/u,fb=/[0-9]/,pb=/[\u{0660}-\u{0669}]/u,mb=/[\u{06f0}-\u{06f9}]/u,hb=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,gb=/[\u{002d}\u{002b}]/u,_b=/\p{Mn}/u,vb=/\p{Mc}/u,yb=/[\p{Mn}\p{Mc}\p{Me}]/u,bb=/\p{L}/u,xb=/\p{Nd}/u,Sb=/\p{Script=Greek}/u,Cb=/\p{Script=Hebrew}/u,wb=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,Tb=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,Eb=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,Db=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,Ob=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,kb=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,Ab=new RegExp([fb,mb].map(e=>e.source).join(`|`),`u`),jb=new RegExp([bb,gb,hb,xb,_b,vb,Ob,kb].map(e=>e.source).join(`|`),`u`);function Mb(e){return cb.test(e)&&lb.test(e)&&ub.test(e)}var Nb=36,Pb=1,Fb=26,Ib=38,Lb=700,Rb=72,zb=128;function Bb(){throw null}function Vb(e){return e.toLowerCase().startsWith(`xn--`)}function Hb(e,t,n){e=n?Math.floor(e/Lb):e>>1,e+=Math.floor(e/t);let r=0;for(;e>455;)e=Math.floor(e/35),r+=Nb;return r+Math.floor(36*e/(e+Ib))}function Ub(e){let t=[],n=zb,r=0,i=Rb,a=e.lastIndexOf(`-`);if(a>0)for(let n=0;n<a;n++){let r=e.charCodeAt(n);r>=128&&Bb(),t.push(r)}let o=a<0?0:a+1;for(;o<e.length;){let a=r,s=1,c=Nb;for(;;){o>=e.length&&Bb();let t=e.charCodeAt(o++),n;t>=97&&t<=122?n=t-97:t>=48&&t<=57?n=t-48+26:Bb(),r+=n*s;let a=c<=i?Pb:c>=i+Fb?Fb:c-i;if(n<a)break;s*=Nb-a,c+=Nb}let l=t.length+1;i=Hb(r-a,l,a===0),n+=Math.floor(r/l),r%=l,t.splice(r,0,n),r++}return String.fromCodePoint(...t)}function Wb(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var Gb=new RegExp(db.source,`gu`);function Kb(e){let t=e.replace(Gb,``),n=t.length,r=n>0?[t,`-`]:[],i=Array.from(e,e=>e.codePointAt(0)),a=zb,o=0,s=Rb,c=n;for(;c<i.length;){let e=1/0;for(let t of i)t>=a&&t<e&&(e=t);o+=(e-a)*(c+1),a=e;for(let e of i)if(e<a&&o++,e===a){let e=o;for(let t=Nb;;t+=Nb){let n=t<=s?Pb:t>=s+Fb?Fb:t-s;if(e<n)break;let i=n+(e-n)%(Nb-n);r.push(Wb(i)),e=Math.floor((e-n)/(Nb-n))}r.push(Wb(e)),s=Hb(o,c+1,c===n),o=0,c++}o++,a++}return r.join(``)}var qb=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,Jb=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,Yb=/^(?:R|AL|AN)$/;function Xb(e){if(Vb(e))try{return Qb(Ub(e.slice(4).toLowerCase()))}catch{return!1}return Qb(e)}function Zb(e){let t=String.fromCodePoint(e);return Ab.test(t)?`EN`:pb.test(t)?`AN`:_b.test(t)?`NSM`:Cb.test(t)?`R`:Tb.test(t)?`AL`:bb.test(t)?`L`:`ON`}function Qb(e){for(let t of e)if(Yb.test(Zb(t.codePointAt(0))))return!0;return!1}function $b(e){let t=!1,n=Jb,r=!1,i=!1,a=!0;for(let o of e){let e=Zb(o.codePointAt(0));if(a){if(e!==`L`&&e!==`R`&&e!==`AL`)return!1;t=e===`R`||e===`AL`,n=t?qb:Jb,a=!1}if(!n.test(e))return!1;e===`EN`?r=!0:e===`AN`&&(i=!0)}return!(t&&r&&i)}function ex(e){return db.test(e)&&Kb(e).length+4>63}function tx(e){return e[0]===`-`||e[e.length-1]===`-`||e.slice(2).join(``).startsWith(`--`)}function nx(e){if(ex(e)||Qb(e)&&!$b(e))return!1;let t=[...e],n=t.map(e=>e.codePointAt(0)),r=n.length;if(tx(t)||yb.test(t[0]))return!1;let i=!1;for(let e=0;e<r;e++){let r=n[e],a=t[e];if(Db.test(a)||!jb.test(a))return!1;wb.test(a)&&(i=!0);let o=n[e-1],s=n[e+1];switch(r){case 183:if(o!==108||s!==108)return!1;break;case 885:if(!s||!Sb.test(t[e+1]))return!1;break;case 1523:case 1524:if(!o||!Cb.test(t[e-1]))return!1;break;case 8204:if(!o||o<128&&!Eb.test(t[e-1]))return!1;break;case 8205:if(!o||!Eb.test(t[e-1]))return!1}}return!(e.includes(`・`)&&!i)}function rx(e){if(!Vb(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf(`-`)===0)return!1;let n=Ub(t);return db.test(n)?nx(n):!1}catch{return!1}}function ix(e){return e.length>0&&e.length<=63}function ax(e){return ix(e)&&(rx(e)||Mb(e))}function ox(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(`.`).every(e=>ax(e))}function sx(e){return e.length>0&&e.length<=63}function cx(e){return sx(e)&&(rx(e)||nx(e))}function lx(e){return e.replace(/[\uff01-\uff5e]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248)).normalize(`NFC`).replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,``).replace(/[\u002E\u3002\uFF0E\uFF61]/g,`.`)}function ux(e){if(e.length===0||e.includes(` `))return!1;let t=lx(e);if(t.length>253)return!1;let n=t.split(`.`),r=n.some(e=>Xb(e));return n.every(e=>cx(e)&&(!r||$b(e)))}function dx(e){return ox(e)}var fx=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function px(e){return fx.test(e.normalize(`NFC`))}function mx(e){return ux(e)}var hx=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function gx(e){return hx.test(e)}var _x=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function vx(e){return _x.test(e)}var yx=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,bx=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function xx(e){return!yx.test(e)&&!bx.test(e)&&URL.canParse(e,`http://example.com`)}var Sx=2048,Cx=/\[[vV][0-9a-fA-F]+\.[^\]]+\]/,wx=/[\x00-\x20<>\^`{|}\\]/,Tx=/%(?![0-9a-fA-F]{2})/;function Ex(e){return e.length<Sx?e.replace(Cx,`[::1]`):e}function Dx(e){return wx.test(e)||Tx.test(e)?!1:URL.canParse(Ex(e))}var Ox=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function kx(e){return Ox.test(e)}var Ax=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function jx(e){return Ax.test(e)}function Mx(e){try{return new RegExp(e,`u`),!0}catch{return!1}}var Nx=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Px(e){return Nx.test(e)}var Fx=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Ix(e){return Fx.test(e)}var Lx=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function Rx(e){return Lx.test(e)}var zx=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Bx(e){return zx.test(e)}function Vx(e){return URL.canParse(e)}var Hx=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Ux(e){return Hx.test(e)}var Wx=new Map;function Gx(){Wx.clear()}function Kx(e,t){return Wx.get(e)?.(t)??!0}function qx(){Gx(),Wx.set(`date-time`,rb),Wx.set(`date`,eb),Wx.set(`duration`,ab),Wx.set(`email`,sb),Wx.set(`hostname`,dx),Wx.set(`idn-email`,px),Wx.set(`idn-hostname`,mx),Wx.set(`ipv4`,gx),Wx.set(`ipv6`,vx),Wx.set(`iri-reference`,xx),Wx.set(`iri`,Dx),Wx.set(`json-pointer-uri-fragment`,kx),Wx.set(`json-pointer`,jx),Wx.set(`regex`,Mx),Wx.set(`relative-json-pointer`,Px),Wx.set(`time`,nb),Wx.set(`uri-reference`,Ix),Wx.set(`uri-template`,Rx),Wx.set(`uri`,Bx),Wx.set(`url`,Vx),Wx.set(`uuid`,Ux)}qx();function Jx(e,t,n,r){return Kx(n.format,r)}function Yx(e,t,n,r,i,a){return Jx(e,t,i,a)||t.AddError({keyword:`format`,schemaPath:n,instancePath:r,params:{format:i.format}})}function Xx(e,t,n,r){let i=!ly(n)||n.then,a=!jv(n)||n.else;return cC(e,t,n.if,r)?cC(e,t,i,r):cC(e,t,a,r)}function Zx(e,t,n,r,i,a){let o=!ly(i)||i.then,s=!jv(i)||i.else,c=new hy,l=uC(e,c,`${n}/if`,r,i.if,a)?uC(e,c,`${n}/then`,r,o,a)||t.AddError({keyword:`if`,schemaPath:n,instancePath:r,params:{failingKeyword:`then`}}):uC(e,t,`${n}/else`,r,s,a)||t.AddError({keyword:`if`,schemaPath:n,instancePath:r,params:{failingKeyword:`else`}});return l&&t.Merge([c]),l}function Qx(e,t,n,r){return Ha(n.items,0,(n,i)=>Pa(r.length,i)||sC(e,t,n,r[i])&&t.AddIndex(i))}function $x(e,t,n,r,i,a){return Ua(i.items,0,(i,o)=>{let s=`${n}/items/${o}`,c=`${r}/${o}`;return Pa(a.length,o)||lC(e,t,s,c,i,a[o])&&t.AddIndex(o)})}function eS(e,t,n,r){return Ha(r,ty(n)?n.prefixItems.length:0,(r,i)=>sC(e,t,n.items,r)&&t.AddIndex(i))}function tS(e,t,n,r,i,a){return Ua(a,ty(i)?i.prefixItems.length:0,(a,o)=>lC(e,t,`${n}/items`,`${r}/${o}`,i.items,a)&&t.AddIndex(o))}function nS(e,t,n,r){return zv(n)?Qx(e,t,n,r):eS(e,t,n,r)}function rS(e,t,n,r,i,a){return zv(i)?$x(e,t,n,r,i,a):tS(e,t,n,r,i,a)}function iS(e){return wv(e)}function aS(e,t,n,r){return!iS(n)||Pa(Ka(r,r=>cC(e,t,n.contains,r)),n.maxContains)}function oS(e,t,n,r,i,a){let o=Kv(i)?i.minContains:1;return aS(e,t,i,a)||t.AddError({keyword:`contains`,schemaPath:n,instancePath:r,params:{minContains:o,maxContains:i.maxContains}})}function sS(e,t,n,r){return Pa(r,n.maximum)}function cS(e,t,n,r,i,a){return sS(e,t,i,a)||t.AddError({keyword:`maximum`,schemaPath:n,instancePath:r,params:{comparison:`<=`,limit:i.maximum}})}function lS(e,t,n,r){return Pa(r.length,n.maxItems)}function uS(e,t,n,r,i,a){return lS(e,t,i,a)||t.AddError({keyword:`maxItems`,schemaPath:n,instancePath:r,params:{limit:i.maxItems}})}function dS(e,t,n,r){return Ba(r,n.maxLength)}function fS(e,t,n,r,i,a){return dS(e,t,i,a)||t.AddError({keyword:`maxLength`,schemaPath:n,instancePath:r,params:{limit:i.maxLength}})}function pS(e,t,n,r){return Pa(Za(r).length,n.maxProperties)}function mS(e,t,n,r,i,a){return pS(e,t,i,a)||t.AddError({keyword:`maxProperties`,schemaPath:n,instancePath:r,params:{limit:i.maxProperties}})}function hS(e){return wv(e)}function gS(e,t,n,r){return!hS(n)||Fa(Ka(r,(r,i)=>cC(e,t,n.contains,r)&&t.AddIndex(i)),n.minContains)}function _S(e,t,n,r,i,a){return gS(e,t,i,a)||t.AddError({keyword:`contains`,schemaPath:n,instancePath:r,params:{minContains:i.minContains}})}function vS(e,t,n,r){return Fa(r,n.minimum)}function yS(e,t,n,r,i,a){return vS(e,t,i,a)||t.AddError({keyword:`minimum`,schemaPath:n,instancePath:r,params:{comparison:`>=`,limit:i.minimum}})}function bS(e,t,n,r){return Fa(r.length,n.minItems)}function xS(e,t,n,r,i,a){return bS(e,t,i,a)||t.AddError({keyword:`minItems`,schemaPath:n,instancePath:r,params:{limit:i.minItems}})}function SS(e,t,n,r){return Va(r,n.minLength)}function CS(e,t,n,r,i,a){return SS(e,t,i,a)||t.AddError({keyword:`minLength`,schemaPath:n,instancePath:r,params:{limit:i.minLength}})}function wS(e,t,n,r){return Fa(Za(r).length,n.minProperties)}function TS(e,t,n,r,i,a){return wS(e,t,i,a)||t.AddError({keyword:`minProperties`,schemaPath:n,instancePath:r,params:{limit:i.minProperties}})}function ES(e,t,n,r){return Ia(r,n.multipleOf)}function DS(e,t,n,r,i,a){return ES(e,t,i,a)||t.AddError({keyword:`multipleOf`,schemaPath:n,instancePath:r,params:{multipleOf:i.multipleOf}})}function OS(e,t,n,r){let i=new my;return!cC(e,i,n.not,r)&&t.Merge([i])}function kS(e,t,n,r,i,a){return OS(e,t,i,a)||t.AddError({keyword:`not`,schemaPath:n,instancePath:r,params:{}})}function AS(e,t,n,r){let i=n.oneOf.reduce((t,n)=>{let i=new my;return cC(e,i,n,r)?[...t,i]:t},[]);return j(i.length,1)&&t.Merge(i)}function jS(e,t,n,r,i,a){let o=[],s=[],c=i.oneOf.reduce((t,i,c)=>{let l=new hy,u=uC(e,l,`${n}/oneOf/${c}`,r,i,a);return u&&s.push(c),u||o.push(l),u?[...t,l]:t},[]),l=j(c.length,1)&&t.Merge(c);return!l&&j(s.length,0)&&o.forEach(e=>e.GetErrors().forEach(e=>t.AddError(e))),l||t.AddError({keyword:`oneOf`,schemaPath:n,instancePath:r,params:{passingSchemas:s}})}function MS(e,t,n,r){return(ka(n.pattern)?xy(n.pattern):n.pattern).test(r)}function NS(e,t,n,r,i,a){return MS(e,t,i,a)||t.AddError({keyword:`pattern`,schemaPath:n,instancePath:r,params:{pattern:i.pattern}})}function PS(e,t,n,r){return Ha(Xa(n.patternProperties),0,([n,i])=>{let a=xy(n);return Ha(Xa(r),0,([n,r])=>!a.test(n)||sC(e,t,i,r)&&t.AddKey(n))})}function FS(e,t,n,r,i,a){return Ua(Xa(i.patternProperties),0,([i,o])=>{let s=`${n}/patternProperties/${i}`,c=xy(i);return Ua(Xa(a),0,([n,i])=>{let a=`${r}/${n}`;return!c.test(n)||lC(e,t,s,a,o,i)&&t.AddKey(n)})})}function IS(e,t,n,r){return j(r.length,0)||Ha(n.prefixItems,0,(n,i)=>Pa(r.length,i)||sC(e,t,n,r[i])&&t.AddIndex(i))}function LS(e,t,n,r,i,a){return j(a.length,0)||Ua(i.prefixItems,0,(i,o)=>{let s=`${n}/prefixItems/${o}`,c=`${r}/${o}`;return Pa(a.length,o)||lC(e,t,s,c,i,a[o])&&t.AddIndex(o)})}function RS(e,t){return e.includes(t)||mo().exactOptionalPropertyTypes}function zS(e,t){return ja(e[t])}function BS(e,t,n,r){let i=cy(n)?n.required:[];return Ha(Xa(n.properties),0,([n,a])=>{let o=!M(r,n)||sC(e,t,a,r[n])&&t.AddKey(n);return RS(i,n)?o:zS(r,n)||o})}function VS(e,t,n,r,i,a){let o=cy(i)?i.required:[];return Ua(Xa(i.properties),0,([i,s])=>{let c=`${n}/properties/${i}`,l=`${r}/${i}`,u=()=>!M(a,i)||lC(e,t,c,l,s,a[i])&&t.AddKey(i);return RS(o,i)?u():zS(a,i)||u()})}function HS(e,t,n,r){return Ha(Za(r),0,(r,i)=>cC(e,t,n.propertyNames,r))}function US(e,t,n,r,i,a){let o=[];return Ua(Za(a),0,(a,s)=>{let c=`${r}/${a}`,l=uC(e,t,`${n}/propertyNames`,c,i.propertyNames,a);return l||o.push(a),l})||t.AddError({keyword:`propertyNames`,schemaPath:n,instancePath:r,params:{propertyNames:o}})}function WS(e,t,n,r){let i=e.RecursiveRef(n)??!1;return _v(i)&&cC(e,t,i,r)}function GS(e,t,n,r,i,a){let o=e.RecursiveRef(i)??!1;return _v(o)&&uC(e,t,`#`,r,o,a)}function KS(e,t,n,r){let i=e.Ref(n)??!1,a=new my,o=_v(i)&&cC(e,a,i,r);return o&&t.Merge([a]),o}function qS(e,t,n,r,i,a){let o=e.Ref(i)??!1,s=new hy,c=_v(o)&&uC(e,s,`#`,r,o,a);return c&&t.Merge([s]),c||s.GetErrors().forEach(e=>t.AddError(e)),c}function JS(e,t,n,r){return Ha(n.required,0,e=>M(r,e))}function YS(e,t,n,r,i,a){let o=[];return Ua(i.required,0,e=>{let t=M(a,e);return t||o.push(e),t})||t.AddError({keyword:`required`,schemaPath:n,instancePath:r,params:{requiredProperties:o}})}function XS(e,t,n,r,i){return j(n,`object`)?Da(i):j(n,`array`)?ya(i):j(n,`boolean`)?xa(i):j(n,`integer`)?wa(i):j(n,`number`)?Ea(i):j(n,`null`)?Ta(i):j(n,`string`)?ka(i):j(n,`bigint`)?ba(i):j(n,`constructor`)?Sa(i):j(n,`function`)?Ca(i):j(n,`symbol`)?Aa(i):j(n,`undefined`)?ja(i):!j(n,`void`)||ja(i)}function ZS(e,t,n,r,i){return Wa(n,n=>XS(e,t,n,r,i))}function QS(e,t,n,r){return ya(n.type)?ZS(e,t,n.type,n,r):XS(e,t,n.type,n,r)}function $S(e,t,n,r,i,a){return(ya(i.type)?ZS(e,t,i.type,i,a):XS(e,t,i.type,i,a))||t.AddError({keyword:`type`,schemaPath:n,instancePath:r,params:{type:i.type}})}function eC(e,t,n,r){let i=t.GetIndices();return Ha(r,0,(r,a)=>(i.has(a)||cC(e,t,n.unevaluatedItems,r))&&t.AddIndex(a))}function tC(e,t,n,r,i,a){let o=t.GetIndices(),s=[];return Ua(a,0,(a,c)=>{let l=new hy,u=(o.has(c)||uC(e,l,n,r,i.unevaluatedItems,a))&&t.AddIndex(c);return u||s.push(c),u})||t.AddError({keyword:`unevaluatedItems`,schemaPath:n,instancePath:r,params:{unevaluatedItems:s}})}function nC(e,t,n,r){let i=t.GetKeys();return Ha(Xa(r),0,([r,a])=>i.has(r)||cC(e,t,n.unevaluatedProperties,a)&&t.AddKey(r))}function rC(e,t,n,r,i,a){let o=t.GetKeys(),s=[];return Ua(Xa(a),0,([a,c])=>{let l=new hy,u=o.has(a)||uC(e,l,n,r,i.unevaluatedProperties,c)&&t.AddKey(a);return u||s.push(a),u})||t.AddError({keyword:`unevaluatedProperties`,schemaPath:n,instancePath:r,params:{unevaluatedProperties:s}})}function iC(e){return!j(e.uniqueItems,!1)}function aC(e,t,n,r){if(!iC(n))return!0;let i=new Set(r.map(cc)).size,a=r.length;return j(i,a)}function oC(e,t,n,r,i,a){if(!iC(i))return!0;let o=new Set,s=a.reduce((e,t,n)=>{let r=cc(t);return o.has(r)?[...e,n]:(o.add(r),e)},[]);return j(s.length,0)||t.AddError({keyword:`uniqueItems`,schemaPath:n,instancePath:r,params:{duplicateItems:s}})}function sC(e,t,n,r){return t.Push()&&cC(e,t,n,r)&&t.Pop()}function cC(e,t,n,r){e.Push(n);let i=gv(n)?Ay(e,t,n,r):(!uy(n)||QS(e,t,n,r))&&(!(Oa(r)&&!ya(r))||(!cy(n)||JS(e,t,n,r))&&(!yv(n)||wy(e,t,n,r))&&(!Ev(n)||Ly(e,t,n,r))&&(!Dv(n)||zy(e,t,n,r))&&(!Ov(n)||Vy(e,t,n,r))&&(!ey(n)||PS(e,t,n,r))&&(!ny(n)||BS(e,t,n,r))&&(!ry(n)||HS(e,t,n,r))&&(!Yv(n)||wS(e,t,n,r))&&(!Wv(n)||pS(e,t,n,r)))&&(!ya(r)||(!vv(n)||yy(e,t,n,r))&&(!wv(n)||Fy(e,t,n,r))&&(!Rv(n)||nS(e,t,n,r))&&(!Vv(n)||aS(e,t,n,r))&&(!Hv(n)||lS(e,t,n,r))&&(!Kv(n)||gS(e,t,n,r))&&(!qv(n)||bS(e,t,n,r))&&(!ty(n)||IS(e,t,n,r))&&(!dy(n)||aC(e,t,n,r)))&&(!ka(r)||(!Uv(n)||dS(e,t,n,r))&&(!Jv(n)||SS(e,t,n,r))&&(!Fv(n)||Jx(e,t,n,r))&&(!$v(n)||MS(e,t,n,r)))&&(!(Ea(r)||ba(r))||(!Nv(n)||qy(e,t,n,r))&&(!Pv(n)||Yy(e,t,n,r))&&(!Bv(n)||sS(e,t,n,r))&&(!Gv(n)||vS(e,t,n,r))&&(!Xv(n)||ES(e,t,n,r)))&&(!sy(n)||KS(e,t,n,r))&&(!oy(n)||WS(e,t,n,r))&&(!Av(n)||Uy(e,t,n,r))&&(!Cv(n)||My(e,t,n,r))&&(!Mv(n)||Gy(e,t,n,r))&&(!Lv(n)||Xx(e,t,n,r))&&(!Zv(n)||OS(e,t,n,r))&&(!bv(n)||Ey(e,t,n,r))&&(!Sv(n)||Oy(e,t,n,r))&&(!Qv(n)||AS(e,t,n,r))&&(!fy(n)||!ya(r)||eC(e,t,n,r))&&(!py(n)||!Oa(r)||nC(e,t,n,r))&&(!mv(n)||gy(e,t,n,r));return e.Pop(n),i}function lC(e,t,n,r,i,a){return t.Push()&&uC(e,t,n,r,i,a)&&t.Pop()}function uC(e,t,n,r,i,a){if(t.AtCapacity())return!1;e.Push(i);let o=gv(i)?jy(e,t,n,r,i,a):!!(+(!uy(i)||$S(e,t,n,r,i,a))&(!(Oa(a)&&!ya(a))||!!(+(!cy(i)||YS(e,t,n,r,i,a))&(!yv(i)||Ty(e,t,n,r,i,a))&(!Ev(i)||Ry(e,t,n,r,i,a))&(!Dv(i)||By(e,t,n,r,i,a))&(!Ov(i)||Hy(e,t,n,r,i,a))&(!ey(i)||FS(e,t,n,r,i,a))&(!ny(i)||VS(e,t,n,r,i,a))&(!ry(i)||US(e,t,n,r,i,a))&(!Yv(i)||TS(e,t,n,r,i,a))&(!Wv(i)||mS(e,t,n,r,i,a))))&(!ya(a)||!!(+(!vv(i)||by(e,t,n,r,i,a))&(!wv(i)||Iy(e,t,n,r,i,a))&(!Rv(i)||rS(e,t,n,r,i,a))&(!Vv(i)||oS(e,t,n,r,i,a))&(!Hv(i)||uS(e,t,n,r,i,a))&(!Kv(i)||_S(e,t,n,r,i,a))&(!qv(i)||xS(e,t,n,r,i,a))&(!ty(i)||LS(e,t,n,r,i,a))&(!dy(i)||oC(e,t,n,r,i,a))))&(!ka(a)||!!(+(!Uv(i)||fS(e,t,n,r,i,a))&(!Jv(i)||CS(e,t,n,r,i,a))&(!Fv(i)||Yx(e,t,n,r,i,a))&(!$v(i)||NS(e,t,n,r,i,a))))&(!(Ea(a)||ba(a))||!!(+(!Nv(i)||Jy(e,t,n,r,i,a))&(!Pv(i)||Xy(e,t,n,r,i,a))&(!Bv(i)||cS(e,t,n,r,i,a))&(!Gv(i)||yS(e,t,n,r,i,a))&(!Xv(i)||DS(e,t,n,r,i,a))))&(!sy(i)||qS(e,t,n,r,i,a))&(!oy(i)||GS(e,t,n,r,i,a))&(!Av(i)||Wy(e,t,n,r,i,a))&(!Cv(i)||Ny(e,t,n,r,i,a))&(!Mv(i)||Ky(e,t,n,r,i,a))&(!Lv(i)||Zx(e,t,n,r,i,a))&(!Zv(i)||kS(e,t,n,r,i,a))&(!bv(i)||Dy(e,t,n,r,i,a))&(!Sv(i)||ky(e,t,n,r,i,a))&(!Qv(i)||jS(e,t,n,r,i,a))&(!fy(i)||!ya(a)||tC(e,t,n,r,i,a))&(!py(i)||!Oa(a)||rC(e,t,n,r,i,a)))&&(!mv(i)||_y(e,t,n,r,i,a));return e.Pop(i),o}function dC(e,t){return Oa(t)&&!Ja(e)?t[e]:void 0}function fC(e,t){return e.reduce((e,t)=>dC(t,e),t)}function pC(e){if(j(e.length,0))return[];let t=e.split(`/`).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`));return t.length>0&&t[0]===``?t.slice(1):t}function mC(e,t){return fC(pC(t),e)}var hC=`https://json-schema.org`;function gC(e,t){if(Oa(e)&&kv(e)&&j(e.$dynamicAnchor,t))return e;if(Oa(e))for(let n of Za(e)){let r=gC(e[n],t);if(r)return r}}function _C(e,t,n){if(j(e,n))return t.href;let r=hv(e)&&Iv(e)?new URL(e.$id,t.href):t;if(ya(e))for(let t of e){let e=_C(t,r,n);if(!ja(e))return e}else if(Oa(e))for(let t of Za(e)){let i=_C(e[t],r,n);if(!ja(i))return i}}function vC(e,t,n){if(j(e.$id,n.hash))return e;let r=new URL(n.href,t.href);if(j(t.pathname,r.pathname))return n.hash.startsWith(`#`)?xC(e,n):e}function yC(e,t,n){let r=new URL(`#${e.$anchor}`,t.href),i=new URL(n.href,t.href);return j(r.href,i.href)?e:void 0}function bC(e,t,n){let r=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(n.href,t.href);return j(r.href,i.href)?e:void 0}function xC(e,t){if(t.href.endsWith(`#`))return e;if(!t.hash.startsWith(`#`))return;let n=decodeURIComponent(t.hash.slice(1));if(n.startsWith(`/`))return mC(e,n)}function SC(e,t,n){if(Iv(e)){let r=vC(e,t,n);if(!ja(r))return r}if(xv(e)){let r=yC(e,t,n);if(!ja(r))return r}if(kv(e)){let r=bC(e,t,n);if(!ja(r))return r}return xC(e,n)}function CC(e,t,n){return e.reduce((e,r)=>{let i=EC(r,t,n);return ja(i)?e:i},void 0)}function wC(e){return j(e,`const`)||j(e,`enum`)}function TC(e,t,n){return Za(e).reduce((r,i)=>{if(wC(i))return r;let a=EC(e[i],t,n);return ja(a)?r:a},void 0)}function EC(e,t,n){let r=hv(e)&&Iv(e)?new URL(e.$id,t.href):t;if(hv(e)){let t=SC(e,r,n);if(!ja(t))return t}if(ya(e))return CC(e,r,n);if(Oa(e))return TC(e,r,n)}function DC(e,t,n){return _C(e,new URL(t||`.`,hC),n)}function OC(e,t,n,r){let i=LC(e,t,n,r,!1);return hv(i)&&Iv(i)?i:void 0}function kC(e){return e.href.split(`#`)[0]}function AC(e,t){return M(e,t)?e[t]:void 0}function jC(e,t,n){return EC(e,t,n)}function MC(e,t,n){let r=kC(n);if(j(r,kC(t))||!M(e,r))return;let i=e[r],a=hv(i)&&Iv(i)?new URL(i.$id,r):new URL(r);return j(n.hash,``)?i:EC(i,a,n)}function NC(e,t,n,r,i){if(!r.$ref.startsWith(`#`)||M(e,`$schema`))return;let a=DC(t,n,i);if(!(ja(a)||j(a,n)))return{target:i,base:a,root:t}}function PC(e,t,n){let r=e[t];if(hv(r))return{target:n,base:t,root:r}}function FC(e,t,n,r,i){let a=i?PC(e.context,r,n):void 0;return ja(a)?NC(e.root,e.lexicalSchema,e.referenceBase,t,n):a}function IC(e,t,n,r,i,a){if(Iv(i))return;let o=OC(e,t,n,r);if(o&&!a.includes(o))return{target:i,resource:o}}function LC(e,t,n,r,i=!0){let a=new URL(n||`.`,hC),o=i&&Iv(t)?new URL(t.$id,a):a,s=new URL(r,o.href);return AC(e,r)??jC(t,o,s)??MC(e,o,s)}function RC(e,t,n,r,i,a){let o=new URL(n||`.`,hC),s=LC(e,i.$dynamicRef.startsWith(`#`)?r:t,n,i.$dynamicRef,!1);if(ja(s)){let e=new URL(i.$dynamicRef,o).hash;if(!e.startsWith(`#/`)&&e.startsWith(`#`)){let n=decodeURIComponent(e.slice(1));return a.find(e=>j(e.$dynamicAnchor,n))??gC(t,n)}}else return!hv(s)||!kv(s)||new URL(i.$dynamicRef,o).hash.startsWith(`#/`)?s:a.find(e=>j(e.$dynamicAnchor,s.$dynamicAnchor))??s}function zC(e,t){let n=e.inRetrievedFrame?e.lexicalSchema:e.root,r=t.$ref.startsWith(`#`)?e.lexicalSchema:n,i=LC(e.context,r,e.referenceBase,t.$ref,!1);if(!i||!hv(i))return{schema:i};let a=new URL(t.$ref,e.referenceBase).href.split(`#`)[0],o=!j(a,e.resourceBase);return{schema:i,retrievedResource:FC(e,t,i,a,o),resolvedResource:o?IC(e.context,e.root,e.referenceBase,a,i,e.ids):void 0}}function BC(e,t){let n=ay(e.lexicalSchema)?e.recursiveAnchors[0]:e.lexicalSchema;return LC(e.context,n,e.lexicalBase,t.$recursiveRef,!1)}function VC(e,t){return RC(e.context,e.root,e.lexicalBase,e.lexicalSchema,t,e.dynamicAnchors)}var HC=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw=class{constructor(e,t){UC.add(this),this.context=e,this.schema=t,this.ids=[],this.resourceIds=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[],this.retrievedResources=new Map,this.retrievedFrames=[],this.resolvedResources=new Map,this.pendingResource=!0}LexicalBaseURL(){return HC(this,UC,`m`,KC).call(this,this.ids)}Push(e){if(!hv(e))return;Iv(e)&&HC(this,UC,`m`,ew).call(this,e),xv(e)&&this.anchors.push(e),ay(e)&&this.recursiveAnchors.push(e),kv(e)&&this.dynamicAnchors.push(e);let t=this.retrievedResources.get(e);t&&this.retrievedFrames.push({schema:t.root,base:t.base,idDepth:this.ids.length,resourceDepth:this.resourceIds.length})}Pop(e){hv(e)&&(Iv(e)&&HC(this,UC,`m`,tw).call(this,e),xv(e)&&this.anchors.pop(),ay(e)&&this.recursiveAnchors.pop(),kv(e)&&this.dynamicAnchors.pop(),this.retrievedResources.has(e)&&this.retrievedFrames.pop(),HC(this,UC,`m`,rw).call(this,e))}Ref(e){let t=zC(HC(this,UC,`m`,WC).call(this),e);return HC(this,UC,`m`,GC).call(this,t),t.schema}RecursiveRef(e){let t=BC(HC(this,UC,`m`,WC).call(this),e);return t&&(this.pendingResource=!0),t}DynamicRef(e){let t=VC(HC(this,UC,`m`,WC).call(this),e);return t&&(this.pendingResource=!0),t}};UC=new WeakSet,WC=function(){return{context:this.context,root:this.schema,ids:this.ids,lexicalSchema:HC(this,UC,`m`,YC).call(this),lexicalBase:this.LexicalBaseURL(),referenceBase:HC(this,UC,`m`,JC).call(this),resourceBase:HC(this,UC,`m`,qC).call(this),recursiveAnchors:this.recursiveAnchors,dynamicAnchors:this.dynamicAnchors,inRetrievedFrame:this.retrievedFrames.length>0}},GC=function(e){ja(e.schema)||(this.pendingResource=!0),ja(e.resolvedResource)||HC(this,UC,`m`,nw).call(this,e.resolvedResource.target,e.resolvedResource.resource),ja(e.retrievedResource)||this.retrievedResources.set(e.retrievedResource.target,{base:e.retrievedResource.base,root:e.retrievedResource.root})},KC=function(e){let t=this.retrievedFrames[this.retrievedFrames.length-1],n=t?new URL(t.base):new URL(hC);return(t?e.slice(t.idDepth):e).reduce((e,t)=>new URL(t.$id,e),n).href},qC=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.resourceIds.slice(e.resourceDepth).reduce((e,t)=>new URL(t.$id,e),new URL(e.base)).href:HC(this,UC,`m`,KC).call(this,this.resourceIds)},JC=function(){if(this.retrievedFrames.length>0)return HC(this,UC,`m`,qC).call(this);let e=this.ids[this.ids.length-1];return e&&!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)?this.LexicalBaseURL():HC(this,UC,`m`,qC).call(this)},YC=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.ids.length>e.idDepth?this.ids[this.ids.length-1]:e.schema:this.ids.length>0?this.ids[this.ids.length-1]:this.schema},XC=function(e){e.forEach(e=>HC(this,UC,`m`,QC).call(this,e,!1))},ZC=function(e){e.forEach(e=>HC(this,UC,`m`,$C).call(this,e,!1))},QC=function e(t,n=!0){if(gv(t))return;if(ya(t))return HC(this,UC,`m`,XC).call(this,t);if(!hv(t))return;let r=t;if(n||!Iv(r)){!n&&kv(r)&&this.dynamicAnchors.push(r);for(let t of Za(r))HC(this,UC,`m`,e).call(this,r[t],!1)}},$C=function e(t,n=!0){if(gv(t))return;if(ya(t))return HC(this,UC,`m`,ZC).call(this,t);if(!hv(t))return;let r=t;if(n||!Iv(r)){!n&&kv(r)&&this.dynamicAnchors.pop();for(let t of Za(r))HC(this,UC,`m`,e).call(this,r[t],!1)}},ew=function(e){this.ids.push(e);let t=this.pendingResource;this.pendingResource=!1,t&&this.resourceIds.push(e),HC(this,UC,`m`,QC).call(this,e,!0)},tw=function(e){this.ids.pop(),this.resourceIds.length>0&&j(this.resourceIds[this.resourceIds.length-1],e)&&this.resourceIds.pop(),HC(this,UC,`m`,$C).call(this,e,!0)},nw=function(e,t){HC(this,UC,`m`,ew).call(this,t),this.resolvedResources.set(e,t)},rw=function(e){if(!this.resolvedResources.has(e))return;let t=this.resolvedResources.get(e);HC(this,UC,`m`,tw).call(this,t),this.resolvedResources.delete(e)};function aw(...e){let[t,n,r]=xs(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]}),i=new iw(t,n),a=new hy,o=uC(i,a,`#`,``,n,r),s=a.GetErrors(),c=dc();return[o,s.map(e=>({...e,message:c(e)}))]}function ow(...e){let[t,n,r]=xs(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return cC(new iw(t,n),new my,n,r)}function sw(...e){let[t,n,r]=xs(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return ow(t,n,r)}function cw(...e){let[t,n,r]=xs(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]}),[i,a]=aw(t,n,r);return a}function lw(e,t,n){return ya(n)?n.map(n=>bw(e,t.items,n)):n}function uw(e,t,n){return bw({...e,...t.$defs},$o(t.$ref),n)}function dw(e,t){let n=M(t,`unevaluatedProperties`)?{additionalProperties:t.unevaluatedProperties}:{},r=lv(iv(e,t));return ps(r)?W_(r,n):r}function fw(e,t,n){return bw(e,dw(e,t),n)}function pw(e){return M(e,`additionalProperties`)?e.additionalProperties:void 0}function mw(e,t,n){if(!Oa(n)||ya(n))return n;let r=pw(t);for(let i of Za(n))M(t.properties,i)?n[i]=bw(e,t.properties[i],n[i]):xa(r)&&j(r,!0)||Fo(r)&&sw(e,r,n[i])?n[i]=bw(e,r,n[i]):delete n[i];return n}function hw(e,t,n){if(!Oa(n))return n;let r=pw(t),[i,a]=[new RegExp(_u(t)),yu(t)];for(let t of Za(n))i.test(t)?n[t]=bw(e,a,n[t]):xa(r)&&j(r,!0)||Fo(r)&&sw(e,r,n[t])?n[t]=bw(e,r,n[t]):delete n[t];return n}function gw(e,t,n){return M(e,t.$ref)?bw(e,e[t.$ref],n):n}function _w(e,t,n){if(!ya(n))return n;let r=Math.min(n.length,t.items.length);for(let i=0;i<r;i++)n[i]=bw(e,t.items[i],n[i]);return Ma(n.length,r)?n.slice(0,r):n}function vw(e){return Oo(e)}function yw(e,t,n){for(let r of t.anyOf){let t=bw(e,r,vw(n));if(sw(e,r,t))return t}return n}function bw(e,t,n){return Go(t)?lw(e,t,n):vs(t)?uw(e,t,n):js(t)?fw(e,t,n):ps(t)?mw(e,t,n):bu(t)?hw(e,t,n):es(t)?gw(e,t,n):ll(t)?_w(e,t,n):Bc(t)?yw(e,t,n):n}function xw(e,t){for(let n of fo.Keys(e))fo.HasPropertyKey(t,n)||(t[n]=e[n]);return t}function Sw(e){let t={};for(let n of fo.Keys(e))t[n]=Tw(e[n]);return t}function Cw(e){return ww(pv(e))}function ww(e){return e.map(e=>Tw(e))}function Tw(e){return xw(e,Go(e)?Wo(Tw(e.items),Ko(e)):js(e)?As(ww(e.allOf)):Bc(e)?zc(Cw(e.anyOf)):ps(e)?P(Sw(e.properties)):bu(e)?mu(vu(e),Tw(yu(e))):ll(e)?cl(ww(e.items)):e)}function Ew(e){return Tw(e)}function Dw(...e){let[t,n,r]=xs(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return bw(t,mo().unionPrioritySort?Ew(n):n,r)}BigInt(2**53-1),BigInt(-(2**53-1));function Ow(e,t,n){if(!ya(n))return n;for(let r=0;r<n.length;r++)n[r]=Lw(e,t.items,n[r]);return n}function kw(e,t,n){return Lw({...e,...t.$defs},$o(t.$ref),n)}function Aw(e,t){return ja(t)?Ca(e.default)?e.default():vw(e.default):t}function jw(e,t,n){return Lw(e,lv(iv(e,t)),n)}function Mw(e,t,n){if(!Oa(n))return n;let r=Za(t.properties);for(let i of r){let r=Lw(e,t.properties[i],n[i]);(!ja(r)||!ls(t.properties[i])&&M(t.properties[i],`default`))&&(n[i]=r)}if(!yv(t)||xa(t.additionalProperties))return n;for(let i of Za(n))r.includes(i)||(n[i]=Lw(e,t.additionalProperties,n[i]));return n}function Nw(e,t,n){if(!Oa(n))return n;let[r,i]=[new RegExp(_u(t)),yu(t)];for(let t of Za(n))r.test(t)&&Tv(i)&&(n[t]=Lw(e,i,n[t]));if(!yv(t))return n;for(let i of Za(n))r.test(i)||(n[i]=Lw(e,t.additionalProperties,n[i]));return n}function Pw(e,t,n){return M(e,t.$ref)?Lw(e,e[t.$ref],n):n}function Fw(e,t,n){if(!ya(n))return n;let[r,i]=[t.items,Math.max(t.items.length,n.length)];for(let t=0;t<i;t++)t<r.length&&(n[t]=Lw(e,r[t],n[t]));return n}function Iw(e,t,n){for(let r of t.anyOf){let t=Lw(e,r,vw(n));if(sw(e,r,t))return t}return n}function Lw(e,t,n){let r=Tv(t)?Aw(t,n):n;return Go(t)?Ow(e,t,r):vs(t)?kw(e,t,r):js(t)?jw(e,t,r):ps(t)?Mw(e,t,r):bu(t)?Nw(e,t,r):es(t)?Pw(e,t,r):ll(t)?Fw(e,t,r):Bc(t)?Iw(e,t,r):r}function Rw(...e){let[t,n,r]=xs(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return Lw(t,n,r)}zc([P({type:F(`insert`),path:Lc(),value:hs()}),Object({type:F(`update`),path:Lc(),value:hs()}),P({type:F(`delete`),path:Lc()})]);var zw=[`aborted`,`contract_mismatch`,`forbidden`,`gone`,`invalid`,`not_in_variant`,`not_ready`,`released`,`superseded`,`unavailable`,`upgrade_conflict`,`upgrade_required`],Bw=new Set([`superseded`,`upgrade_conflict`]),I=class extends Error{code;reason;retryable;details;constructor(e,t,n){super(`${e}${n?.reason?`/${n.reason}`:``}: ${t}`,{cause:n?.cause}),this.name=`ChordError`,this.code=e,this.reason=n?.reason,this.retryable=Bw.has(e),this.details=n?.details}},Vw=(e,t)=>e instanceof I&&(t===void 0||e.code===t),Hw=(e,t,n)=>new I(`invalid`,t,{reason:e,details:n}),Uw=(e,t)=>e instanceof I?e:new I(`unavailable`,`${t}: ${e instanceof Error?e.message:String(e)}`,{cause:e});async function Ww(e,t){let n=[];for(let t of e)try{await t()}catch(e){n.push(e)}if(n.length===1)throw n[0];if(n.length>1)throw AggregateError(n,t)}var Gw=e=>typeof e==`object`&&e?e:e===!1?{not:{}}:{};function Kw(e){return typeof e!=`object`||!e?JSON.stringify(e)??`null`:Array.isArray(e)?`[${e.map(e=>Kw(e)).join(`,`)}]`:`{${Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${JSON.stringify(t)}:${Kw(e[t])}`).join(`,`)}}`}function qw(e){let t=2166136261,n=1523705862;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,1540483477)^n>>>13}return(t>>>0).toString(16).padStart(8,`0`)+(n>>>0).toString(16).padStart(8,`0`)}function Jw(e,t){return e===t||Kw(e)===Kw(t)}function Yw(e,t,n,r){if(sw(n,r))return;let i=[...cw(n,r)].slice(0,3);throw Hw(e,`${t}: ${i.map(e=>`${e.instancePath||`/`} ${e.message}`).join(`; `)}`,i)}function Xw(e,t,n){let r=Dw(e,Rw(e,vw(t??{})));return Yw(`input`,n,e,r),r}function Zw(e,t){return Kw(Qw(Gw(e),t))}function Qw(e,t){if(Array.isArray(t)){let n=e.items;return Array.isArray(n)?t.map((e,t)=>Qw(Gw(n[t]),e)):t.map(e=>Qw(Gw(n),e))}if(typeof t!=`object`||!t)return t;let n=Gw(e.properties),r={};for(let[e,i]of Object.entries(t)){let t=Gw(n[e]);`default`in t&&Jw(t.default,i)||(r[e]=Qw(t,i))}return r}var $w=[`minLength`,`maxLength`,`pattern`,`format`,`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`multipleOf`,`minItems`,`maxItems`,`uniqueItems`,`minProperties`,`maxProperties`],eT=e=>typeof e.type==`string`?[e.type]:Array.isArray(e.type)?e.type:void 0,tT=new Set([...$w,`type`,`properties`,`required`,`additionalProperties`,`patternProperties`,`items`,`additionalItems`,`const`,`enum`,`anyOf`,`parameters`,`returnType`]),nT=new Set([`title`,`description`,`default`,`examples`,`$id`,`$schema`,`$comment`,`readOnly`,`writeOnly`,`deprecated`]),rT=e=>Object.fromEntries(Object.entries(e).filter(([e])=>!nT.has(e)));function iT(e,t){let n=rT(Gw(e)),r=rT(Gw(t));if(Object.keys(r).length===0||Jw(n,r))return!0;if(Object.keys(r).some(e=>!tT.has(e))||r.additionalProperties!==void 0&&typeof r.additionalProperties!=`boolean`)return!1;if(Array.isArray(n.anyOf))return n.anyOf.every(e=>iT(e,r));if(Array.isArray(r.anyOf))return r.anyOf.some(e=>iT(n,e));if(`const`in r)return`const`in n&&Jw(n.const,r.const);if(Array.isArray(r.enum))return(`const`in n?[n.const]:Array.isArray(n.enum)?n.enum:void 0)?.every(e=>r.enum.some(t=>Jw(t,e)))??!1;for(let e of $w)if(e in r&&!Jw(n[e],r[e]))return!1;let i=eT(r),a=eT(n);return i===void 0||a===void 0||!a.every(e=>i.includes(e)||e===`integer`&&i.includes(`number`))?!1:`const`in n||Array.isArray(n.enum)?!0:a.includes(`object`)&&!aT(n,r)||a.includes(`array`)&&!oT(n,r)?!1:!a.includes(`function`)||sT(n,r)}function aT(e,t){let n=Gw(e.properties),r=Gw(t.properties),i=new Set(e.required??[]);for(let e of t.required??[])if(!i.has(e))return!1;for(let[t,i]of Object.entries(r))if(t in n){if(!iT(n[t],i))return!1}else if(typeof e.additionalProperties==`object`&&!iT(e.additionalProperties,i))return!1;if(t.additionalProperties===!1&&(e.additionalProperties!==!1||Object.keys(n).some(e=>!(e in r))))return!1;let a=Gw(t.patternProperties);if(Object.keys(a).length>0){let t=Gw(e.patternProperties);if(e.additionalProperties!==!1&&Object.keys(t).length===0)return!1;for(let[e,i]of Object.entries(a)){let a=new RegExp(e,`u`);for(let[e,t]of Object.entries(n))if(!(e in r)&&a.test(e)&&!iT(t,i))return!1;if(Object.keys(t).length>0&&(!(e in t)||!iT(t[e],i)))return!1}for(let e of Object.keys(t))if(!(e in a))return!1}return!0}function oT(e,t){return Array.isArray(t.items)?!Array.isArray(e.items)||e.items.length!==t.items.length?!1:e.items.every((e,n)=>iT(e,t.items[n])):Array.isArray(e.items)?e.items.every(e=>iT(e,t.items)):iT(e.items,t.items)}function sT(e,t){let n=e.parameters??[],r=t.parameters??[];return n.length>r.length||!n.every((e,t)=>iT(r[t],e))?!1:iT(e.returnType,t.returnType)}var cT=Symbol(`chord.member`);function lT(e,t){return{[cT]:`method`,args:e,result:t}}function uT(e){if(typeof e!=`string`||e===``)throw TypeError(`hostNamed needs a host name`);return{name:e}}function dT(e,t,n){if(`name`in t)return t.name;let r=typeof n==`object`&&n?n[t.key]:void 0;if(typeof r!=`string`||r===``)throw Hw(`placement`,`${e}: input field ${t.key} names no host`);return t.prefix+r}var fT=(e,t)=>`name`in e?e.name===t:t.startsWith(e.prefix)&&t.length>e.prefix.length,pT=e=>`name`in e?e.name:`${e.prefix}<${e.key}>`,mT=ys(P({})),hT=zc([P({kind:F(`method`),args:N(mT),result:N(mT)}),P({kind:F(`state`),schema:mT}),P({kind:F(`opaque`),id:Lc()})]),gT=zc([P({name:Lc({minLength:1})},{additionalProperties:!1}),P({prefix:Lc({minLength:1}),key:Lc({minLength:1})},{additionalProperties:!1})]),_T=P({name:Lc({minLength:1}),scope:zc([F(`remote`),F(`local`)]),version:Sc(),input:mT,host:N(gT),variants:mu(Lc(),mu(Lc(),hT))}),vT=new Set([`variant`,`status`,`ready`,`shape`,`error`,`onShape`,`onStatus`,`release`,`then`,`contract`]);function yT(e,t,n){if(vT.has(e))throw TypeError(`member name is reserved: ${e}`);let r=t[cT];if(r===`method`){let e=t;return{kind:`method`,...e.args===void 0?{}:{args:e.args},...e.result===void 0?{}:{result:e.result}}}if(r===`opaque`){if(n===`remote`)throw TypeError(`remote contracts cannot expose opaque members: ${e}`);return{kind:`opaque`,id:t.id}}return{kind:`state`,schema:t}}function bT(e){return{...e,fingerprint:qw(Kw(e.description))}}function xT(e,t){if(!e)throw TypeError(`contract name is empty`);if(!Number.isInteger(t)||t<1)throw TypeError(`contract version must be a positive integer`)}function ST(e,t){xT(e,t.version);let n=t.host;if(n===void 0||!sw(gT,n))throw TypeError(`remote contract ${e} needs \`host\`: hostNamed(…) or hostFamily(…)`);let r=`name`in n?{name:n.name}:{prefix:n.prefix,key:n.key},i={};if(Object.keys(t.variants).length===0)throw TypeError(`remote contract ${e} has no variants`);for(let[n,r]of Object.entries(t.variants)){let t={};for(let[e,n]of Object.entries(r.state??{}))t[e]=yT(e,n,`remote`);for(let[i,a]of Object.entries(r.methods??{})){if(i in t)throw TypeError(`member ${i} is both state and method in ${e}.${n}`);if(t[i]=yT(i,a,`remote`),t[i].kind!==`method`)throw TypeError(`methods.${i} is not a method()`)}i[n]=t}let a={name:e,scope:`remote`,version:t.version,input:t.input,host:r,variants:i};return bT({scope:`remote`,name:e,version:t.version,input:t.input,def:t,description:a})}function CT(e){let{name:t,scope:n,version:r,input:i,host:a}=e;if(typeof t!=`string`||n!==`remote`&&n!==`local`||!Number.isInteger(r)||n===`remote`!=(a!==void 0))throw new I(`invalid`,`malformed contract token`,{reason:`token`});let o={name:t,version:r,input:i,description:e,fingerprint:qw(Kw(e))};return n===`remote`?{...o,scope:n,def:{version:r,input:i,host:a,variants:{}}}:{...o,scope:n,def:{version:r,input:i}}}function wT(e,t){if(e.name!==t.name||e.scope!==t.scope)return`different type`;if(!TT(e,t))return`host`;if(!iT(t.input,e.input))return`input`;for(let[n,r]of Object.entries(t.variants)){let t=e.variants[n];if(t===void 0)return`variant ${n} missing`;for(let[e,i]of Object.entries(r)){let r=t[e];if(r===void 0||r.kind!==i.kind)return`${n}.${e} missing or of another kind`;if(r.kind===`method`&&i.kind===`method`){if(i.args===void 0!=(r.args===void 0)||i.args!==void 0&&r.args!==void 0&&!iT(i.args,r.args))return`${n}.${e} arguments`;if(i.result!==void 0&&(r.result===void 0||!iT(r.result,i.result)))return`${n}.${e} result`}else if(r.kind===`state`&&i.kind===`state`){if(!iT(r.schema,i.schema))return`${n}.${e} state`}else if(r.kind===`opaque`&&i.kind===`opaque`&&r.id!==i.id)return`${n}.${e} opaque ${r.id} != ${i.id}`}}}var TT=(e,t)=>Kw(e.host??null)===Kw(t.host??null),ET=e=>e.host===void 0?`(local)`:pT(e.host);function DT(e,t,n){if(e.fingerprint===n.fingerprint)return;if(!TT(e.description,n.description))throw new I(`contract_mismatch`,`${e.name} lives on ${ET(e.description)}, the consumer expects ${ET(n.description)}`);if(e.version===n.version){let t=wT(e.description,n.description);if(t===void 0)return;throw new I(`contract_mismatch`,`${e.name}@${e.version} does not cover the consumer's description (${t}); forgotten version bump?`)}let r=t?.[n.version];if(r===void 0)throw new I(`contract_mismatch`,`${e.name}: provider version ${e.version}, consumer version ${n.version}, no accepts adapter`);return r}function OT(e,t){for(let n of Object.values(e.description.variants)){let e=n[t];if(e?.kind===`method`)return e.args===void 0}return!1}var kT=65536,AT=4096,jT=new WeakSet,MT=(e,t)=>{jT.has(e)||(e.length>=AT?jT.add(e):e.push(t))},NT=e=>typeof e==`object`&&!!e,PT=(e,t,n)=>{e.length===0?MT(n,[`r`,t]):MT(n,[`s`,e,t])},FT=(e,t)=>{if(e===t)return!0;if(!NT(e)||!NT(t)||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){let n=t;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!FT(e[t],n[t]))return!1;return!0}let n=t,r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(let t of r)if(!Object.hasOwn(n,t)||!FT(e[t],n[t]))return!1;return!0},IT=(e,t)=>{if(e.length!==t.length)return;let n=new Map;for(let t=0;t<e.length;t++){let r=e[t],i=n.get(r);i===void 0?n.set(r,{indices:[t],used:0}):i.indices.push(t)}let r=Array(t.length);for(let e=0;e<t.length;e++){let i=n.get(t[e]);if(i===void 0||i.used===i.indices.length)return;r[e]=i.indices[i.used++]}return r},LT=(e,t,n,r)=>{if(e===t)return;if(t.length>e.length&&t.slice(0,e.length)===e){MT(r,[`a`,n,t.slice(e.length)]);return}let i=PO(e,t,kT);i===0?MT(r,[`s`,n,t]):(MT(r,[`t`,n,e.length-i]),t.length>i&&MT(r,[`a`,n,t.slice(i)]))},RT=2e5,zT=65536,BT=(e,t)=>e===t||FT(e,t),VT=(e,t,n,r)=>{if(e.length===0||t.length===0)return[];if(e.length*t.length>r)return;let i=t.length+1,a=new Uint32Array((e.length+1)*i);for(let r=e.length-1;r>=0;r--)for(let o=t.length-1;o>=0;o--){let s=r*i+o;a[s]=n(e[r],t[o])?a[(r+1)*i+o+1]+1:Math.max(a[(r+1)*i+o],a[r*i+o+1])}let o=[],s=0,c=0;for(;s<e.length&&c<t.length;)n(e[s],t[c])&&a[s*i+c]===a[(s+1)*i+c+1]+1?o.push([s++,c++]):a[(s+1)*i+c]>=a[s*i+c+1]?s+=1:c+=1;return o},HT=(e,t)=>{if(BT(e,t))return!0;if(!NT(e)||!NT(t)||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.some((e,n)=>NT(e)&&e===t[n]);let n=e,r=t;for(let e of Object.keys(n)){let t=n[e];if(NT(t)&&Object.hasOwn(r,e)&&t===r[e])return!0}return!1},UT=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n},WT=(e,t,n,r,i,a)=>{let o=n-t,s=a-i,c=[];if(s<o){let o=t;for(let t=i;t<a;t++){for(;o<n&&e[o]!==r[t];)o+=1;if(o===n)return;c.push([o++,t])}return c}if(o<s){let o=i;for(let i=t;i<n;i++){for(;o<a&&e[i]!==r[o];)o+=1;if(o===a)return;c.push([i,o++])}return c}},GT=(e,t,n,r)=>{let i=[],a=-1;for(let o=n;o<r;o++){let n=e.get(t[o]);if(n===void 0)continue;let r=n[UT(n,a+1)];r!==void 0&&(i.push([r,o]),a=r)}return i},KT=(e,t,n,r,i,a)=>{let o=new Map;for(let r=t;r<n;r++){let t=e[r],n=o.get(t);n===void 0?o.set(t,[r]):n.push(r)}let s=0;for(let e=i;e<a;e++)if(s+=o.get(r[e])?.length??0,s>RT)return GT(o,r,i,a);if(s===0)return[];let c=[],l=[],u=[];for(let e=i;e<a;e++){let t=o.get(r[e]);if(t!==void 0)for(let n=t.length-1;n>=0;n--){let r=t[n],i=UT(u,r),a=c.length;c.push({before:r,after:e,previous:i===0?-1:l[i-1]}),l[i]=a,u[i]=r}}let d=[],f=l[l.length-1]??-1;for(;f>=0;){let e=c[f];d.push([e.before,e.after]),f=e.previous}return d.reverse(),d},qT=(e,t,n,r,i,a,o,s,c,l)=>{let u=i,d=o,f=c;for(let[i,a]of l){if(jT.has(r))return;JT(e,t,n,r,u,i,d,a,f),f+=a-d,BT(e[i],t[a])||ZT(e[i],t[a],[...n,f],r),f+=1,u=i+1,d=a+1}jT.has(r)||JT(e,t,n,r,u,a,d,s,f)};function JT(e,t,n,r,i,a,o,s,c){if(jT.has(r))return;for(;i<a&&o<s&&BT(e[i],t[o]);)i+=1,o+=1,c+=1;for(;i<a&&o<s&&BT(e[a-1],t[s-1]);)--a,--s;let l=a-i,u=s-o;if(l===0&&u===0)return;if(l===0||u===0){MT(r,[`p`,n,c,l,t.slice(o,s)]);return}if(l===u){let u=[];for(let n=0;n<l;n++)BT(e[i+n],t[o+n])&&u.push([i+n,o+n]);if(u.length>0){qT(e,t,n,r,i,a,o,s,c,u);return}}let d=WT(e,i,a,t,o,s);if(d!==void 0&&d.length>0){qT(e,t,n,r,i,a,o,s,c,d);return}let f=KT(e,i,a,t,o,s);if(f.length>0){qT(e,t,n,r,i,a,o,s,c,f);return}let p=VT(e.slice(i,a),t.slice(o,s),HT,zT);if(p!==void 0&&p.length>0){let l=p.map(([e,t])=>[i+e,o+t]);qT(e,t,n,r,i,a,o,s,c,l)}else l===1&&u===1?ZT(e[i],t[o],[...n,c],r):MT(r,[`p`,n,c,l,t.slice(o,s)])}var YT=(e,t,n,r)=>{if(!(e===t||FT(e,t))){if(e.length===t.length&&e.length>1&&!BT(e[0],t[0])&&!BT(e[e.length-1],t[t.length-1])){let i=IT(e,t);if(i!==void 0){MT(r,[`m`,n,i]);return}}JT(e,t,n,r,0,e.length,0,t.length,0)}},XT=(e,t,n,r)=>{let i=Object.keys(e),a=Object.keys(t);if([...i,...a].some(e=>FO.has(e)))FT(e,t)||PT(n,t,r);else{for(let i of a){if(jT.has(r))return;Object.hasOwn(e,i)?ZT(e[i],t[i],[...n,i],r):PT([...n,i],t[i],r)}for(let e of i){if(jT.has(r))return;Object.hasOwn(t,e)||MT(r,[`d`,[...n,e]])}}},ZT=(e,t,n,r)=>{e===t||jT.has(r)||(typeof e==`string`&&typeof t==`string`&&n.length>0?LT(e,t,n,r):Array.isArray(e)&&Array.isArray(t)?YT(e,t,n,r):NT(e)&&NT(t)&&!Array.isArray(e)&&!Array.isArray(t)?XT(e,t,n,r):PT(n,t,r))},QT=e=>{if(e===null)return 4;if(typeof e==`string`)return e.length+2;if(typeof e==`number`)return String(e).length;if(typeof e==`boolean`)return e?4:5;if(Array.isArray(e)){let t=2;for(let n=0;n<e.length;n++)t+=QT(e[n])+(n===0?0:1);return t}let t=2,n=0;for(let r of Object.keys(e))t+=r.length+3+QT(e[r])+(n++===0?0:1);return t},$T=e=>{let t=2;for(let n=0;n<e.length;n++){let r=e[n];t+=(typeof r==`string`?r.length+2:String(r).length)+(n===0?0:1)}return t},eE=e=>{switch(e[0]){case`r`:return 6+QT(e[1]);case`s`:return 7+$T(e[1])+QT(e[2]);case`d`:return 6+$T(e[1]);case`a`:return 7+$T(e[1])+e[2].length+2;case`t`:return 7+$T(e[1])+String(e[2]).length;case`p`:return 10+$T(e[1])+String(e[2]).length+String(e[3]).length+QT(e[4]);case`m`:return 7+$T(e[1])+QT(e[2])}};function tE(e,t){let n=[];if(ZT(e,t,[],n),jT.has(n))return[[`r`,t]];if(n.length===0||n[0]?.[0]===`r`)return n;let r=2;for(let e of n)r+=eE(e)+1;if(r<65536)return n;let i=QT(t)+6;return r>=i?[[`r`,t]]:n}var nE={value:void 0,writable:!0,enumerable:!0,configurable:!0};function rE(e,t){return iE(e,void 0,t?.omitUndefinedProperties===!0)}function iE(e,t,n){if(e===null||typeof e==`string`||typeof e==`boolean`)return e;if(typeof e==`number`){if(Number.isFinite(e))return e;throw TypeError(`Value contains a non-finite number and is not strict JSON`)}if(typeof e!=`object`)throw TypeError(`Value contains a non-JSON ${typeof e}; expected strict JSON`);let r=t??new Set;if(r.has(e))throw TypeError(`Value contains cycles and is not strict JSON`);r.add(e);try{if(Array.isArray(e)){if(Object.getPrototypeOf(e)!==Array.prototype||Reflect.ownKeys(e).length!==e.length+1)throw TypeError(`Value must contain strict JSON dense plain arrays`);let t=Array(e.length);for(let i=0;i<e.length;i++){let a=Object.getOwnPropertyDescriptor(e,i);if(a===void 0||!a.enumerable||!(`value`in a))throw TypeError(`Value must contain strict JSON enumerable indexed data properties`);aE(t,String(i),iE(a.value,r,n))}return t}let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)throw TypeError(`Value must contain strict JSON plain objects or arrays`);let i=Object.create(t);for(let t of Reflect.ownKeys(e)){if(typeof t==`symbol`)throw TypeError(`Value contains a symbol key and is not strict JSON`);let a=Object.getOwnPropertyDescriptor(e,t);if(!a.enumerable||!(`value`in a))throw TypeError(`Value must contain strict JSON enumerable data properties`);a.value===void 0&&n||aE(i,t,iE(a.value,r,n))}return i}finally{r.delete(e)}}function aE(e,t,n){nE.value=n,Object.defineProperty(e,t,nE),nE.value=void 0}var oE={value:void 0,writable:!0,enumerable:!0,configurable:!0};function sE(e,t){let n=e,r=new WeakSet;for(let e of t){if(e[0]===`r`){n=e[1];continue}if(e[0]===`p`||e[0]===`m`){let t=cE(n,e[1],e[1].length,r);if(n=t.root,!Array.isArray(t.target))throw TypeError(`Trusted array operation target is not an array`);e[0]===`p`?fE(t.target,e[2],e[3],e[4]):pE(t.target,e[2]);continue}let t=e[1],i=cE(n,t,t.length-1,r);n=i.root;let a=t[t.length-1];switch(e[0]){case`s`:dE(i.target,a,e[2]);break;case`d`:if(Array.isArray(i.target)){if(typeof a!=`number`)throw TypeError(`Trusted array deletion key is not numeric`);fE(i.target,a,1,[])}else Reflect.deleteProperty(i.target,a);break;case`a`:{let t=uE(i.target,a);if(typeof t!=`string`)throw TypeError(`Trusted append target is not a string`);dE(i.target,a,`${t}${e[2]}`);break}case`t`:{let t=uE(i.target,a);if(typeof t!=`string`)throw TypeError(`Trusted truncate target is not a string`);dE(i.target,a,t.slice(e[2]));break}}}return n}function cE(e,t,n,r){if(!mE(e))throw TypeError(`Trusted operation root is not a container`);let i=e;r.has(e)||(i=lE(e),r.add(i));let a=i;for(let e=0;e<n;e++){let n=t[e],i=uE(a,n);if(!mE(i))throw TypeError(`Trusted operation path is not a container`);if(r.has(i)){a=i;continue}let o=lE(i);dE(a,n,o),r.add(o),a=o}return{root:i,target:a}}function lE(e){if(Array.isArray(e))return Array.from(e);let t=Object.create(Object.getPrototypeOf(e)===null?null:Object.prototype);for(let n of Object.keys(e))dE(t,n,e[n]);return t}function uE(e,t){return e[t]}function dE(e,t,n){oE.value=n,Object.defineProperty(e,t,oE),oE.value=void 0}function fE(e,t,n,r){let i=e.length,a=r.length-n;a>0?(e.length=i+a,e.copyWithin(t+r.length,t+n,i)):a<0&&(e.copyWithin(t+r.length,t+n,i),e.length=i+a);for(let n=0;n<r.length;n++)dE(e,t+n,r[n])}function pE(e,t){if(e.length!==t.length)throw TypeError(`Trusted permutation length mismatch`);let n=e.slice();for(let r=0;r<t.length;r++)e[r]=n[t[r]]}function mE(e){return typeof e==`object`&&!!e}var hE=Symbol(`chord.delta.overlay.node`),gE=new WeakMap,_E={},vE=new Set([`push`,`pop`,`shift`,`unshift`,`splice`,`reverse`,`sort`,`fill`,`copyWithin`]),yE=4096,bE=128,xE={value:void 0,writable:!0,enumerable:!0,configurable:!0},SE=class{#e;value;base;ops;constructor(e,t,n){this.#e=e,this.value=t,this.base=e.baseValue,this.ops=n,gE.set(this,e)}get baseRevision(){return this.#e.baseRevision}abort(){kO(this.#e)}},CE=class{#e;#t;#n=!1;constructor(e){this.#e=e}get state(){let e=this.#e?.root?.proxy;if(e===void 0)throw TypeError(`Cannot use a settled overlay`);return e}prepare(){if(this.#n)throw Error(`Change has already been settled`);let e=this.#e;VE(e),e.status.value=`prepared`;try{e.replacement||(e.ops=e.dirty.length===0?[]:eO(e));let t=EE(e);return this.#t=e.status,this.#n=!0,t}catch(t){throw e.status.value=`aborted`,jO(e),this.#n=!0,t}finally{this.#e=void 0}}abort(){this.#n?(this.#t?.value===`prepared`&&(this.#t.value=`aborted`),this.#t=void 0):(this.#n=!0,kO(this.#e),this.#e=void 0)}},wE=class{#e={};#t=new Set;#n;#r;#i=0;#a=256;constructor(e){this.#r=e,this.#n=new WeakRef(this)}get value(){return this.#r}get revision(){return this.#i}beginChange(){let e=OE(this.#n,this.#e,this.#i,this.#r,!1,this.#r);return this.#o(e),new CE(e)}prepareReplace(e){let t=OE(this.#n,this.#e,this.#i,e,!0,this.#r);t.status.value=`prepared`,this.#o(t);try{return EE(t)}catch(e){throw t.status.value=`aborted`,jO(t),e}}adopt(e){let t=gE.get(e);if(t?.owner!==this.#e)throw Error(`Prepared change belongs to a different tracker`);if(t.status.value===`consumed`)throw Error(`Prepared change has already been used`);if(t.status.value===`aborted`)throw Error(`Prepared change has been aborted`);if(t.status.value===`stale`)throw Error(`Prepared change is stale`);if(t.status.value!==`prepared`)throw Error(`Prepared change is not ready`);if(t.baseRevision!==this.#i)throw t.status.value=`stale`,jO(t),Error(`Prepared change is stale`);if(this.#r!==e.base)throw t.status.value=`stale`,Error(`Prepared change is stale`);this.#r=e.value,t.status.value=`consumed`,this.#i+=1,this.#c(t)}releaseContext(e){e.registryRef!==void 0&&this.#t.delete(e.registryRef),e.registryRef=void 0}#o(e){let t=new WeakRef(e);e.registryRef=t,this.#t.add(t),--this.#a,this.#a===0&&(this.#s(),this.#a=Math.max(256,this.#t.size))}#s(){for(let e of this.#t)e.deref()===void 0&&this.#t.delete(e)}#c(e){for(let t of this.#t){let n=t.deref();n!==void 0&&n!==e&&((n.status.value===`open`||n.status.value===`prepared`)&&(n.status.value=`stale`),AO(n))}this.#t.clear(),this.#a=256}replacementBase(e){return e.baseRevision===this.#i?this.#r:void 0}};function TE(e){return new wE(e)}function EE(e){let t=DO(e),n=e.baseValue,r=new SE(e,t.length===0?n:e.simpleObjectMaterialization?YD(e.root):DE(n,t),t);return e.nodes.length>4096?AO(e):jO(e),r}function DE(e,t){for(let n of t)if(n[0]===`p`||n[0]===`m`)return GO(e,t);return sE(e,t)}function OE(e,t,n,r,i,a){let o={owner:t,tracker:e,baseRevision:n,status:{value:`open`},root:void 0,bases:[],stored:[],dirty:[],nodes:[],rawNodes:new WeakMap,ops:void 0,replacement:i,replacementNoop:!1,baseValue:a,overlayReleased:!1,simpleObjectMaterialization:!1,registryRef:void 0};return o.root=jE(o,r,void 0),o}var kE={deleteProperty(e,t){return GE(RE(e),t)},defineProperty(e){throw VE(RE(e).context),TypeError(`Defining overlay properties is not supported`)},get(e,t){if(t===`then`){let t=e[hE];if(t===void 0||zE(t.context))return}let n=RE(e);return t===hE?n:HE(n,t)},getOwnPropertyDescriptor(e,t){return JE(RE(e),t)},getPrototypeOf(e){let t=RE(e);return BE(t.context),Object.getPrototypeOf(ME(t))},has(e,t){return KE(RE(e),t)},isExtensible(e){return BE(RE(e).context),!0},ownKeys(e){return qE(RE(e))},preventExtensions(e){throw VE(RE(e).context),TypeError(`Overlays cannot be made non-extensible`)},set(e,t,n){return WE(RE(e),t,n)},setPrototypeOf(e){throw VE(RE(e).context),TypeError(`Changing an overlay prototype is not supported`)}},AE=kE;function jE(e,t,n,r=0,i=``,a=void 0,o=!1){let s=e.rawNodes.get(t);if(s!==void 0)return s;let c=Array.isArray(t)?[]:{},l=e.bases.length,u=n?.baseIndex??-1;e.bases.push(t);let d={context:e,baseIndex:l,parentIndex:u,parentKind:r,parentKey:i,parentPlacement:o,target:c,proxy:c};return a!==void 0&&(d.parentSource=a),c[hE]=d,d.proxy=new Proxy(c,Array.isArray(t)?AE:kE),e.rawNodes.set(t,d),e.nodes.push(d),d}function ME(e){return e.context.bases[e.baseIndex]}function NE(e){return e.parentIndex<0?void 0:e.context.nodes[e.parentIndex]}function PE(e,t){if(!MO(t))return t;let n=e.stored.length;return e.stored.push(t),{index:n}}function FE(e,t){return typeof t==`object`&&t?e.stored[t.index]:t}function IE(e,t,n){return MO(n)?typeof t==`object`&&t?(e.stored[t.index]=n,t):PE(e,n):(typeof t==`object`&&t&&(e.stored[t.index]=_E),n)}function LE(e,t){typeof t==`object`&&t&&(e.stored[t.index]=_E)}function RE(e){let t=e[hE];if(t===void 0)throw TypeError(`Cannot use a settled overlay`);return t}function zE(e){return e.overlayReleased||e.status.value===`consumed`||e.status.value===`aborted`||e.status.value===`stale`}function BE(e){if(zE(e))throw TypeError(`Cannot use a settled overlay`)}function VE(e){if(BE(e),e.status.value!==`open`)throw TypeError(`Prepared overlays are read-only`)}function HE(e,t){if(BE(e.context),Array.isArray(ME(e))){let n=iD(e);if(t===`length`)return xD(n);if(vE.has(t))return RD[t];let r=CD(t);return r===void 0?Reflect.get(Array.prototype,t,e.proxy):UE(e,r)}if(typeof t==`symbol`)return Reflect.get(ME(e),t,e.proxy);let n=String(t);if(!tD(e,n))return QE(e,n)||Object.hasOwn(ME(e),n)?void 0:Reflect.get(ME(e),t,e.proxy);let r=nD(e,n);return MO(r)?jE(e.context,r,e,0,n,void 0,YE(e,n)).proxy:r}function UE(e,t){let n=iD(e);if(t>=xD(n))return;let r=SD(n,t),i=r.start+r.step*n.locatedOffset,a=wD(e,r,i);return MO(a)?jE(e.context,a,e,r.kind===`base`?1:2,i,r.kind===`insert`?r.source:void 0,r.kind===`insert`||TD(n,r,i)).proxy:a}function WE(e,t,n){if(VE(e.context),typeof t==`symbol`)throw TypeError(`Symbol writes are not supported`);if(Array.isArray(ME(e))){if(t===`length`)return ND(e,PD(n)),!0;let r=CD(t);if(r===void 0)throw TypeError(`Only array indices and length can be written`);if(r>xD(iD(e)))throw TypeError(`Overlay arrays cannot contain holes`);return MD(e,r,JD(n)),!0}let r=String(t);if(n===void 0)return GE(e,r);let i=JD(n),a=nD(e,r),o=QE(e,r);return!o&&!MO(i)&&a===i||(XE(e,r,i),o&&Object.hasOwn(ME(e),r)&&(e.readded===void 0&&(e.readded=new Set),e.readded.add(r)),eD(e,r),rD(e)),!0}function GE(e,t){if(VE(e.context),typeof t==`symbol`)throw TypeError(`Symbol writes are not supported`);if(Array.isArray(ME(e)))throw TypeError(`Overlay arrays cannot contain holes`);let n=String(t);return tD(e,n)&&(ZE(e,n),e.readded?.delete(n),$E(e,n),rD(e)),!0}function KE(e,t){if(BE(e.context),Array.isArray(ME(e))){if(t===`length`)return!0;let n=CD(t);return n===void 0?t in Array.prototype:n<xD(iD(e))}return typeof t==`symbol`?t in ME(e):tD(e,String(t))}function qE(e){if(BE(e.context),Array.isArray(ME(e))){let t=xD(iD(e)),n=Array(t+1);for(let e=0;e<t;e++)n[e]=String(e);return n[t]=`length`,n}let t=e.deleteKey===void 0&&e.deletes===void 0&&e.readded===void 0&&(e.writeKey===void 0||Object.hasOwn(ME(e),e.writeKey));if(t&&e.writes!==void 0){for(let n of e.writes.keys())if(!Object.hasOwn(ME(e),n)){t=!1;break}}if(t)return Object.keys(ME(e));let n=Object.keys(ME(e)).filter(t=>!QE(e,t)&&!e.readded?.has(t)),r=new Set(n);if(e.writeKey!==void 0&&!r.has(e.writeKey)&&(n.push(e.writeKey),r.add(e.writeKey)),e.writes!==void 0)for(let t of e.writes.keys())r.has(t)||(n.push(t),r.add(t));let i=[],a=[];for(let e of n){let t=CD(e);t===void 0?a.push(e):i.push(t)}return i.sort((e,t)=>e-t),[...i.map(String),...a]}function JE(e,t){if(BE(e.context),Array.isArray(ME(e))){if(t===`length`){let t=xD(iD(e));return e.target.length=t,Reflect.getOwnPropertyDescriptor(e.target,`length`)}let n=CD(t);if(n===void 0||n>=xD(iD(e)))return}else if(typeof t==`symbol`||!tD(e,String(t)))return;return{configurable:!0,enumerable:!0,writable:e.context.status.value===`open`,value:HE(e,t)}}function YE(e,t){return e.writeKey===t||(e.writes?.has(t)??!1)}function XE(e,t,n){if(e.writes!==void 0){let r=e.writes.get(t);e.writes.set(t,r===void 0?PE(e.context,n):IE(e.context,r,n))}else e.writeKey===void 0||e.writeKey===t?(e.writeKey=t,e.writeValue=e.writeValue===void 0?PE(e.context,n):IE(e.context,e.writeValue,n)):(e.writes=new Map,e.writes.set(e.writeKey,e.writeValue),e.writes.set(t,PE(e.context,n)),e.writeKey=void 0,e.writeValue=void 0)}function ZE(e,t){if(e.writeKey===t)e.writeKey=void 0,LE(e.context,e.writeValue),e.writeValue=void 0;else{let n=e.writes?.get(t);n!==void 0&&LE(e.context,n),e.writes?.delete(t)}}function QE(e,t){return e.deleteKey===t||(e.deletes?.has(t)??!1)}function $E(e,t){e.deletes===void 0?e.deleteKey===void 0||e.deleteKey===t?e.deleteKey=t:(e.deletes=new Set,e.deletes.add(e.deleteKey),e.deletes.add(t),e.deleteKey=void 0):e.deletes.add(t)}function eD(e,t){e.deleteKey===t?e.deleteKey=void 0:e.deletes?.delete(t)}function tD(e,t){return QE(e,t)?!1:YE(e,t)||Object.hasOwn(ME(e),t)}function nD(e,t){if(e.writeKey===t)return FE(e.context,e.writeValue);let n=e.writes?.get(t);return n===void 0?ME(e)[t]:FE(e.context,n)}function rD(e){if(!e.dirty){e.dirty=!0,e.context.dirty.push(e);for(let t=NE(e);t!==void 0;t=NE(t))t.subtreeDirty=!0}}function iD(e){if(e.array!==void 0)return e.array;let t=ME(e),n={root:void 0,pieces:void 0,baseOverrides:void 0,insertOverrides:void 0,structural:!1,generation:0,plan:void 0,seed:2654435769,locatedOffset:0,baseLocations:void 0,insertLocations:void 0};return t.length>0&&(n.root=uD(n,{kind:`base`,start:0,length:t.length,step:1})),e.array=n,n}function aD(e){return e.baseOverrides===void 0&&(e.baseOverrides=new Map),e.baseOverrides}function oD(e){return e.insertOverrides===void 0&&(e.insertOverrides=new Map),e.insertOverrides}function sD(e){let t=e.seed;return t^=t<<13,t^=t>>>17,t^=t<<5,e.seed=t>>>0,e.seed}function cD(e){return e?.elements??0}function lD(e){e.elements=cD(e.left)+e.piece.length+cD(e.right)}function uD(e,t){return{piece:t,left:void 0,right:void 0,priority:sD(e),elements:t.length}}function dD(e,t){return e===void 0?t:t===void 0?e:e.priority>=t.priority?(e.right=dD(e.right,t),lD(e),e):(t.left=dD(e,t.left),lD(t),t)}function fD(e,t,n){if(t===void 0)return[void 0,void 0];let r=cD(t.left);if(n<r){let[r,i]=fD(e,t.left,n);return t.left=i,lD(t),[r,t]}let i=r+t.piece.length;if(n>i){let[r,a]=fD(e,t.right,n-i);return t.right=r,lD(t),[t,a]}if(n===r){let e=t.left;return t.left=void 0,lD(t),[e,t]}if(n===i){let e=t.right;return t.right=void 0,lD(t),[t,e]}let a=n-r,o={...t.piece,length:a},s={...t.piece,start:t.piece.start+t.piece.step*a,length:t.piece.length-a};return[dD(t.left,uD(e,o)),dD(uD(e,s),t.right)]}function pD(e){for(;e.left!==void 0;)e=e.left;return e}function mD(e){for(;e.right!==void 0;)e=e.right;return e}function hD(e,t){return e.kind!==t.kind||e.kind===`insert`&&e.source!==t.source?!1:e.length===1&&t.length===1?Math.abs(t.start-e.start)===1:e.step===t.step&&e.start+e.step*e.length===t.start}function gD(e,t,n){if(t===void 0)return n;if(n===void 0)return t;let r=mD(t).piece,i=pD(n).piece;if(!hD(r,i))return dD(t,n);let[a]=fD(e,t,cD(t)-r.length),[,o]=fD(e,n,i.length),s=r.length===1?i.start-r.start:r.step;return gD(e,gD(e,a,uD(e,r.kind===`base`?{kind:`base`,start:r.start,length:r.length+i.length,step:s}:{kind:`insert`,source:r.source,start:r.start,length:r.length+i.length,step:s})),o)}function _D(e,t){e!==void 0&&(_D(e.left,t),t.push(e.piece),_D(e.right,t))}function vD(e){return e.pieces===void 0&&(e.pieces=[],_D(e.root,e.pieces)),e.pieces}function yD(e,t){kD(t);let n;for(let r of t)n=dD(n,uD(e,r));return n}function bD(e,t){e.root=yD(e,t),e.pieces=void 0,e.baseLocations=void 0,e.insertLocations=void 0}function xD(e){return cD(e.root)}function SD(e,t){let n=e.root;for(;n!==void 0;){let r=cD(n.left);if(t<r)n=n.left;else if(t>=r+n.piece.length)t-=r+n.piece.length,n=n.right;else return e.locatedOffset=t-r,n.piece}throw RangeError(`Array overlay index is out of range`)}function CD(e){if(typeof e!=`string`||e.length===0||e.length>10)return;if(e===`0`)return 0;let t=e.charCodeAt(0);if(t<49||t>57)return;let n=t-48;for(let t=1;t<e.length;t++){let r=e.charCodeAt(t)-48;if(r<0||r>9||(n=n*10+r,n>=4294967295))return}return n}function wD(e,t,n){let r=iD(e);if(t.kind===`base`){let t=r.baseOverrides?.get(n);return t===void 0?ME(e)[n]:FE(e.context,t)}let i=r.insertOverrides?.get(t.source),a=i?.has(n)?i.get(n):t.source.refs[n];return FE(e.context,a)}function TD(e,t,n){return t.kind===`base`?e.baseOverrides?.has(n)??!1:e.insertOverrides?.get(t.source)?.has(n)??!1}function ED(e,t){e.right===void 0?e.piece.length+=t:ED(e.right,t),lD(e)}function DD(e){e.pieces=void 0,e.baseLocations=void 0,e.insertLocations=void 0,e.plan=void 0}function OD(e,t,n,r){if(n===0&&r.length===0)return;let i=iD(e);if(n===0&&t===xD(i)&&r.length===1&&i.root!==void 0){let t=r[0],n=mD(i.root).piece;if(t.kind===`insert`&&n.kind===`insert`&&n.step===1&&n.start+n.length===n.source.refs.length){for(let e=0;e<t.length;e++)n.source.refs.push(t.source.refs[t.start+e]);ED(i.root,t.length),DD(i),i.structural=!0,i.generation+=1,rD(e);return}}let[a,o]=fD(i,i.root,t),[,s]=fD(i,o,n);i.root=gD(i,gD(i,a,yD(i,r)),s),DD(i),i.structural=!0,i.generation+=1,rD(e)}function kD(e){for(let t=1;t<e.length;){let n=e[t-1],r=e[t],i=n.kind===r.kind&&(n.kind===`base`||n.source===r.source);i&&n.length===1&&r.length===1&&Math.abs(r.start-n.start)===1?(n.step=r.start-n.start,n.length=2,e.splice(t,1)):i&&n.step===r.step&&n.start+n.step*n.length===r.start?(n.length+=r.length,e.splice(t,1)):t+=1}}function AD(e,t,n=0){if(t.length===n)return[];let r=[];for(let i=n;i<t.length;i++)r.push(PE(e.context,t[i]));return[{kind:`insert`,source:{refs:r},start:0,length:r.length,step:1}]}function jD(e,t,n=0){if(t.length===n)return[];let r=e.context.stored.length;try{for(let r=n;r<t.length;r++)t[r]=PE(e.context,JD(t[r]))}catch(t){throw e.context.stored.length=r,t}return[{kind:`insert`,source:{refs:t},start:n,length:t.length-n,step:1}]}function MD(e,t,n){let r=iD(e),i=xD(r);if(t===i){OD(e,i,0,AD(e,[n]));return}let a=SD(r,t),o=a.start+a.step*r.locatedOffset,s=wD(e,a,o);if(MO(n)||s!==n){if(a.kind===`base`){let t=r.baseOverrides?.get(o);!MO(n)&&n===ME(e)[o]?(t!==void 0&&LE(e.context,t),r.baseOverrides?.delete(o)):t===void 0?aD(r).set(o,PE(e.context,n)):r.baseOverrides.set(o,IE(e.context,t,n))}else{let t=r.insertOverrides?.get(a.source),i=t?.get(o);!MO(n)&&n===FE(e.context,a.source.refs[o])?(i!==void 0&&LE(e.context,i),t?.delete(o),t?.size===0&&r.insertOverrides?.delete(a.source)):(t===void 0&&(t=new Map,oD(r).set(a.source,t)),i===void 0?t.set(o,PE(e.context,n)):t.set(o,IE(e.context,i,n)))}rD(e)}}function ND(e,t){let n=xD(iD(e));t!==n&&(t<n?OD(e,t,n-t,[]):OD(e,n,0,AD(e,Array.from({length:t-n},()=>null))))}function PD(e){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=4294967296)throw RangeError(`Invalid array length`);return t}function FD(e){let t=Number(e);return Number.isNaN(t)||t===0?0:Number.isFinite(t)?Math.trunc(t):t}function ID(e,t){return e===-1/0?0:e<0?Math.max(t+e,0):Math.min(e,t)}function LD(e){if(!MO(e))return;let t=Reflect.get(e,hE);if(t!==void 0){if(!Array.isArray(ME(t)))throw TypeError(`Array mutator called on incompatible receiver`);return VE(t.context),t}}var RD={push(...e){let t=LD(this);if(t===void 0)return Reflect.apply(Array.prototype.push,this,e);let n=xD(iD(t));return OD(t,n,0,jD(t,e)),n+e.length},pop(){let e=LD(this);if(e===void 0)return Reflect.apply(Array.prototype.pop,this,[]);let t=xD(iD(e));if(t===0)return;let n=UE(e,t-1);return OD(e,t-1,1,[]),n},shift(){let e=LD(this);if(e===void 0)return Reflect.apply(Array.prototype.shift,this,[]);if(xD(iD(e))===0)return;let t=UE(e,0);return OD(e,0,1,[]),t},unshift(...e){let t=LD(this);return t===void 0?Reflect.apply(Array.prototype.unshift,this,e):(OD(t,0,0,jD(t,e)),xD(iD(t)))},splice(...e){let t=LD(this);if(t===void 0)return Reflect.apply(Array.prototype.splice,this,e);let n=xD(iD(t)),r=e.length===0?0:ID(FD(e[0]),n),i=e.length===0?0:e.length===1?n-r:Math.min(Math.max(FD(e[1]),0),n-r),a=Array.from({length:i},(e,n)=>UE(t,r+n)),o=Math.min(2,e.length),s=Math.max(e.length-2,0);return OD(t,r,i,jD(t,e,o)),ND(t,n-i+s),a},reverse(){let e=LD(this);if(e===void 0)return Reflect.apply(Array.prototype.reverse,this,[]);let t=iD(e);if(xD(t)<2)return e.proxy;let n=[...vD(t)].reverse();for(let e of n)e.start+=e.step*(e.length-1),e.step=e.step===1?-1:1;return bD(t,n),t.structural=!0,t.generation+=1,t.plan=void 0,rD(e),e.proxy},sort(e){let t=LD(this);if(t===void 0)return Reflect.apply(Array.prototype.sort,this,[e]);if(e!==void 0&&typeof e!=`function`)throw TypeError(`Comparator must be a function`);let n=iD(t),r=[],i=[],a=[],o=Array(ME(t).length),s=[];for(let e of vD(n))for(let n=0;n<e.length;n++){let c=e.start+e.step*n;if(e.kind===`base`)s.push(c),o[c]=VD(t,c,r,i);else{r.push(e.source),i.push(c);let n=-r.length;s.push(n),a.push(VD(t,n,r,i))}}let c=new Map;for(let[e,r]of n.baseOverrides??[])c.set(e,FE(t.context,r));let l=new Map;for(let[e,r]of n.insertOverrides??[]){let n=new Map;for(let[e,i]of r)n.set(e,FE(t.context,i));l.set(e,n)}let u=n.generation;if(s.sort((t,n)=>{let r=t<0?a[-t-1]:o[t],i=n<0?a[-n-1]:o[n];if(typeof e==`function`)return Number(e(r,i));let s=String(r),c=String(i);return s<c?-1:+(s>c)}),c.size>0||l.size>0||(n.baseOverrides?.size??0)>0||(n.insertOverrides?.size??0)>0)for(let e of s)HD(t,e,r,i,c,l);let d=n.generation!==u,f=xD(n);return f>=s.length&&s.every((e,t)=>UD(n,t,e,r,i))||OD(t,0,Math.min(s.length,f),GD(s,r,i)),d&&WD(t),t.proxy},fill(e,t,n){let r=LD(this);if(r===void 0)return Reflect.apply(Array.prototype.fill,this,[e,t,n]);let i=xD(iD(r)),a=t===void 0?0:ID(FD(t),i),o=n===void 0?i:ID(FD(n),i);if(o<=a)return r.proxy;let s=Array.from({length:o-a},()=>JD(e));return OD(r,a,o-a,AD(r,s)),r.proxy},copyWithin(e,t,n){let r=LD(this);if(r===void 0)return Reflect.apply(Array.prototype.copyWithin,this,[e,t,n]);let i=xD(iD(r)),a=ID(FD(e),i),o=ID(FD(t),i),s=n===void 0?i:ID(FD(n),i),c=Math.min(Math.max(s-o,0),i-a);return OD(r,a,c,AD(r,Array.from({length:c},(e,t)=>JD(UE(r,o+t))))),r.proxy}};function zD(e,t){return e<0?t[-e-1]:void 0}function BD(e,t){return e<0?t[-e-1]:e}function VD(e,t,n,r){let i=iD(e),a=zD(t,n),o=BD(t,r),s=a===void 0?i.baseOverrides?.get(o):i.insertOverrides?.get(a)?.get(o),c=s===void 0?a===void 0?ME(e)[o]:FE(e.context,a.refs[o]):FE(e.context,s);return MO(c)?jE(e.context,c,e,a===void 0?1:2,o,a,a!==void 0||(i.baseOverrides?.has(o)??!1)).proxy:c}function HD(e,t,n,r,i,a){let o=iD(e),s=zD(t,n),c=BD(t,r);if(s===void 0){let t=o.baseOverrides?.get(c),n=i.get(c);n===void 0?(t!==void 0&&LE(e.context,t),o.baseOverrides?.delete(c)):t===void 0?aD(o).set(c,PE(e.context,n)):o.baseOverrides.set(c,IE(e.context,t,n));return}let l=o.insertOverrides?.get(s),u=l?.get(c),d=a.get(s)?.get(c);d===void 0?(u!==void 0&&LE(e.context,u),l?.delete(c),l?.size===0&&o.insertOverrides?.delete(s)):(l===void 0&&(l=new Map,oD(o).set(s,l)),u===void 0?l.set(c,PE(e.context,d)):l.set(c,IE(e.context,u,d)))}function UD(e,t,n,r,i){let a=SD(e,t),o=a.start+a.step*e.locatedOffset,s=zD(n,r);return o===BD(n,i)&&(a.kind===`base`&&s===void 0||a.kind===`insert`&&a.source===s)}function WD(e){let t=iD(e),n=new Set,r=new Map,i=[],a=!1;for(let o of vD(t))for(let t=0;t<o.length;t++){let s=o.start+o.step*t,c;if(o.kind===`base`)c=n.has(s),n.add(s);else{let e=r.get(o.source);e===void 0&&(e=new Set,r.set(o.source,e)),c=e.has(s),e.add(s)}c?(a=!0,KD(i,AD(e,[QD(wD(e,o,s),e.context)])[0])):KD(i,qD(o,s))}a&&(bD(t,i),t.structural=!0,t.generation+=1,t.plan=void 0,rD(e))}function GD(e,t,n){let r=[];for(let i of e){let e=i<0?t[-i-1]:void 0,a=i<0?n[-i-1]:i,o=r.at(-1),s=o!==void 0&&(e===void 0&&o.kind===`base`||e!==void 0&&o.kind===`insert`&&o.source===e);if(o!==void 0&&s){if(o.length===1){let e=a-o.start;if(e===1||e===-1){o.step=e,o.length=2;continue}}else if(o.start+o.step*o.length===a){o.length+=1;continue}}r.push(e===void 0?{kind:`base`,start:a,length:1,step:1}:{kind:`insert`,source:e,start:a,length:1,step:1})}return r}function KD(e,t){let n=e.at(-1),r=n!==void 0&&n.kind===t.kind&&(n.kind===`base`||n.source===t.source);if(n!==void 0&&r&&n.length===1&&t.length===1){let e=t.start-n.start;if(e===1||e===-1){n.step=e,n.length=2;return}}n!==void 0&&r&&n.step===t.step&&n.start+n.step*n.length===t.start?n.length+=t.length:e.push(t)}function qD(e,t){return e.kind===`base`?{kind:`base`,start:t,length:1,step:1}:{kind:`insert`,source:e.source,start:t,length:1,step:1}}function JD(e){let t=MO(e)?Reflect.get(e,hE):void 0;return t===void 0?rE(e):ZD(t)}function YD(e){if(BE(e.context),Array.isArray(ME(e))){let t=iD(e),n=[];for(let r of vD(t))for(let t=0;t<r.length;t++){let i=r.start+r.step*t;n.push(XD(wD(e,r,i),e.context))}return n}let t=Object.create(Object.getPrototypeOf(ME(e)));for(let n of qE(e))$D(t,n,XD(nD(e,n),e.context));return t}function XD(e,t){if(!MO(e))return e;let n=t.rawNodes.get(e);return n===void 0||!n.dirty&&!n.subtreeDirty?e:YD(n)}function ZD(e){if(BE(e.context),Array.isArray(ME(e))){let t=iD(e),n=[];for(let r of vD(t))for(let t=0;t<r.length;t++){let i=r.start+r.step*t;n.push(QD(wD(e,r,i),e.context))}return n}let t=Object.create(Object.getPrototypeOf(ME(e)));for(let n of qE(e))$D(t,n,QD(nD(e,n),e.context));return t}function QD(e,t){if(!MO(e))return rE(e);let n=t.rawNodes.get(e);return n===void 0?rE(e):ZD(n)}function $D(e,t,n){xE.value=n,Object.defineProperty(e,t,xE),xE.value=void 0}function eO(e){let t=tO(e);if(t!==void 0)return t;let n=[],r=new Map,i=new Map,a=new Map;for(let t of e.dirty)if(sO(t,a),Array.isArray(ME(t))){let e=iD(t);if(!e.structural&&(e.baseOverrides?.size??0)>0){let n=a.get(t);n===void 0&&(n={indices:[],bits:void 0,length:ME(t).length},a.set(t,n));for(let t of e.baseOverrides.keys())oO(n,t)}}let o=new Map;for(let[e,t]of a){let n=wO(e);if(n===void 0||n.some(e=>typeof e==`string`&&FO.has(e)))continue;let r=cO(t);r.length>0&&o.set(e,r)}for(let t of e.dirty){let e=wO(t);if(e===void 0||aO(t,e,o))continue;i.set(t,e),!Array.isArray(ME(t))&&uO(t)&&r.set(t,e);let n=e.findIndex(e=>typeof e==`string`&&FO.has(e));if(n>=0){let i=t;for(let t=e.length;t>n;t--)i=NE(i);r.set(i,e.slice(0,n))}}for(let[e,t]of r)i.set(e,t);for(let e of o.keys()){let t=wO(e);t!==void 0&&!aO(e,t,o)&&i.set(e,t)}let s=0;for(let e of i.values())s=Math.max(s,e.length);let c=Array.from({length:s+1},()=>[]);for(let[e,t]of i)c[t.length].push(e);let l=new Set;for(let t of c)for(let a of t){let t=i.get(a);if(!(fO(a)||dO(a,l))){if(r.has(a))CO(n,t,YD(a)),l.add(a);else if(Array.isArray(ME(a))?bO(a,t,n,o.get(a)):mO(a,t,n),n.length>yE)return nO=void 0,[[`r`,YD(e.root)]]}}return nO=void 0,n}function tO(e){let t=[];for(let n of e.dirty){if(Array.isArray(ME(n))||uO(n)||fO(n))return;for(let e=NE(n);e!==void 0;e=NE(e))if(Array.isArray(ME(e)))return;let e=wO(n);if(e!==void 0){for(let t of e)if(typeof t==`string`&&FO.has(t))return;if(t.push(n),t.length>bE)return}}for(let e=1;e<t.length;e++){let n=t[e],r=n.preparedPath.length,i=e;for(;i>0&&t[i-1].preparedPath.length>r;)t[i]=t[i-1],--i;t[i]=n}let n=[],r=!0;for(let i of t)if(mO(i,i.preparedPath,n)&&(r=!1),n.length>yE)return[[`r`,YD(e.root)]];return e.simpleObjectMaterialization=r,n}var nO,rO=0;function iO(e){let t=e;for(let e=NE(t);e!==void 0;e=NE(t)){if(Array.isArray(ME(e))){let n=iD(e);if(t.parentKind!==1||n.structural)return!1;let r=t.parentKey,i=n.baseOverrides?.get(r);return(i===void 0?ME(e)[r]:FE(e.context,i))===ME(t)&&(nO=e,rO=r,!0)}t=e}return!1}function aO(e,t,n){for(let r=NE(e);r!==void 0;r=NE(r)){let e=n.get(r);if(e===void 0)continue;let i=wO(r);if(i===void 0||t.length<=i.length)continue;let a=!0;for(let e=0;e<i.length;e++)if(t[e]!==i[e]){a=!1;break}if(!a)continue;let o=t[i.length];if(typeof o==`number`&&lO(e,o))return!0}return!1}function oO(e,t){if(e.bits!==void 0)e.bits[t]=1;else if(e.indices.push(t),!(e.indices.length<256)){e.bits=new Uint8Array(e.length);for(let t of e.indices)e.bits[t]=1;e.indices.length=0}}function sO(e,t){if(!iO(e))return;let n=t.get(nO);n===void 0&&(n={indices:[],bits:void 0,length:ME(nO).length},t.set(nO,n)),oO(n,rO)}function cO(e){if(e.bits===void 0)return[];let t=[],n=e.bits;for(let e=0;e<n.length;){for(;e<n.length&&n[e]===0;)e+=1;if(e===n.length)break;let r=e,i=e,a=0,o=0;for(;e<n.length;){if(n[e]!==0)a+=1,i=e,o=0;else if(++o>1)break;e+=1}let s=i-r+1;a>=256&&a*2>=s&&t.push({start:r,length:s})}return t}function lO(e,t){for(let n of e)if(t>=n.start&&t<n.start+n.length)return!0;return!1}function uO(e){if(e.writeKey!==void 0&&FO.has(e.writeKey)||e.deleteKey!==void 0&&FO.has(e.deleteKey))return!0;if(e.writes!==void 0){for(let t of e.writes.keys())if(FO.has(t))return!0}if(e.deletes!==void 0){for(let t of e.deletes)if(FO.has(t))return!0}return!1}function dO(e,t){for(let n=NE(e);n!==void 0;n=NE(n))if(t.has(n))return!0;return!1}function fO(e){for(let t=e;t!==void 0;t=NE(t))if(NE(t)!==void 0&&t.parentPlacement)return!0;return!1}function pO(e,t,n,r,i){let a=[...t,r],o=e.readded?.has(r)||!Object.hasOwn(ME(e),r)?void 0:ME(e)[r],s=XD(i,e.context),c=SO(n,a,o,s);return MO(o)&&MO(s)&&!c}function mO(e,t,n){if(e.readded!==void 0)for(let r of e.readded)Object.hasOwn(ME(e),r)&&n.push([`d`,[...t,r]]);let r=!1;if(e.writeKey!==void 0&&(r=pO(e,t,n,e.writeKey,nD(e,e.writeKey))),e.writes!==void 0)for(let[i,a]of e.writes){if(n.length>yE)return r;pO(e,t,n,i,FE(e.context,a))&&(r=!0)}if(e.deleteKey!==void 0&&Object.hasOwn(ME(e),e.deleteKey)&&n.push([`d`,[...t,e.deleteKey]]),e.deletes!==void 0)for(let i of e.deletes){if(n.length>yE)return r;Object.hasOwn(ME(e),i)&&n.push([`d`,[...t,i]])}return r}function hO(e){let t=iD(e);if(t.plan!==void 0)return t.plan;let n=ME(e),r=vD(t);return t.plan=gO(n.length,r)??_O(n.length,r),t.plan}function gO(e,t){let n=[];for(let e of t)if(e.kind===`base`&&e.length!==0){if(e.step!==1&&e.length>1||n.length>0&&e.start<=n[n.length-1])return;n.push(e.start,e.start+e.length-1)}let r=[],i=e;for(let e=n.length-2;e>=-2;e-=2){let t=e>=0?n[e+1]+1:0;i>t&&r.push(t,i-t),e>=0&&(i=n[e])}return{removeRuns:r,permutation:void 0,insertRuns:vO(t)}}function _O(e,t){let n=new Uint8Array(e),r=[];for(let e of t)if(e.kind===`base`)for(let t=0;t<e.length;t++){let i=e.start+e.step*t;n[i]=1,r.push(i)}let i=[];for(let t=e;t>0;){if(n[t-1]!==0){--t;continue}let e=t-1;for(;e>0&&n[e-1]===0;)--e;i.push(e,t-e),t=e}let a=[];for(let e=0;e<n.length;e++)n[e]!==0&&a.push(e);let o;if(r.some((e,t)=>e!==a[t])){let e=new Map(a.map((e,t)=>[e,t]));o=r.map(t=>e.get(t))}return{removeRuns:i,permutation:o,insertRuns:vO(t)}}function vO(e){let t=[],n=0;for(let r=0;r<e.length;){let i=e[r];if(i.kind===`base`){n+=i.length,r+=1;continue}let a=r;for(;r<e.length&&e[r].kind===`insert`;)n+=e[r].length,r+=1;t.push(n-yO(e,a,r),a,r)}return t}function yO(e,t,n){let r=0;for(let i=t;i<n;i++)r+=e[i].length;return r}function bO(e,t,n,r){let i=iD(e),a=ME(e);if(r!==void 0)for(let i of r){if(n.length>yE)return;n.push([`p`,t,i.start,i.length,xO(e,i)])}if(i.structural){let r=hO(e);for(let e=0;e<r.removeRuns.length;e+=2){if(n.length>yE)return;n.push([`p`,t,r.removeRuns[e],r.removeRuns[e+1],[]])}r.permutation!==void 0&&n.push([`m`,t,r.permutation]);let a=vD(i);for(let i=0;i<r.insertRuns.length;i+=3){if(n.length>yE)return;let o=r.insertRuns[i],s=[];for(let t=r.insertRuns[i+1];t<r.insertRuns[i+2];t++){let n=a[t];for(let t=0;t<n.length;t++){let r=n.start+n.step*t;s.push(XD(wD(e,n,r),e.context))}}n.push([`p`,t,o,0,s])}}for(let[o,s]of i.baseOverrides??[]){if(n.length>yE)return;let c=EO(i,1,o,void 0);c===void 0||r!==void 0&&lO(r,c)||SO(n,[...t,c],a[o],XD(FE(e.context,s),e.context))}}function xO(e,t){let n=iD(e),r=[];for(let i=t.start;i<t.start+t.length;i++){let t=SD(n,i),a=t.start+t.step*n.locatedOffset;r.push(XD(wD(e,t,a),e.context))}return r}function SO(e,t,n,r){if(!MO(r)&&n===r||MO(n)&&MO(r)&&OO(n,r))return!1;if(typeof n==`string`&&typeof r==`string`){if(r.length>n.length&&r.slice(0,n.length)===n)return e.push([`a`,t,r.slice(n.length)]),!0;let i=PO(n,r,65536);if(i>0)return e.push([`t`,t,n.length-i]),r.length>i&&e.push([`a`,t,r.slice(i)]),!0}return e.push([`s`,t,r]),!0}function CO(e,t,n){t.length===0?e.push([`r`,n]):e.push([`s`,t,n])}function wO(e){if(e.preparedPath!==void 0)return e.preparedPath;let t=NE(e);if(t===void 0)return e.preparedPath=[],e.preparedPath;let n=wO(t);if(n===void 0)return;if(e.parentKind===0){let r=e.parentKey;return!tD(t,r)||nD(t,r)!==ME(e)?void 0:(e.preparedPath=[...n,r],e.preparedPath)}let r=iD(t),i=EO(r,e.parentKind,e.parentKey,e.parentSource);if(i!==void 0&&wD(t,SD(r,i),e.parentKey)===ME(e))return e.preparedPath=[...n,i],e.preparedPath}function TO(e){if(e.baseLocations!==void 0)return;e.baseLocations=[],e.insertLocations=new Map;let t=0;for(let n of vD(e)){let r=n.start+n.step*(n.length-1),i={piece:n,logicalStart:t,minimum:Math.min(n.start,r),maximum:Math.max(n.start,r)};if(n.kind===`base`)e.baseLocations.push(i);else{let t=e.insertLocations.get(n.source);t===void 0&&(t=[],e.insertLocations.set(n.source,t)),t.push(i)}t+=n.length}let n=(e,t)=>e.minimum-t.minimum;e.baseLocations.sort(n);for(let t of e.insertLocations.values())t.sort(n)}function EO(e,t,n,r){if(t===1&&!e.structural)return n;TO(e);let i=t===1?e.baseLocations:e.insertLocations.get(r);if(i===void 0)return;let a=0,o=i.length;for(;a<o;){let e=a+o>>>1;i[e].minimum<=n?a=e+1:o=e}let s=i[a-1];if(s===void 0||n>s.maximum)return;let c=(n-s.piece.start)/s.piece.step;return c>=0&&c<s.piece.length?s.logicalStart+c:void 0}function DO(e){if(e.ops!==void 0)return e.ops;if(BE(e),e.replacement){let t=e.tracker.deref()?.replacementBase(e);e.replacementNoop=t!==void 0&&OO(t,ME(e.root)),e.ops=e.replacementNoop?[]:[[`r`,ME(e.root)]]}else e.ops=eO(e);return e.ops}function OO(e,t){if(e===t)return!0;if(!MO(e)||!MO(t)||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){let n=t;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!OO(e[t],n[t]))return!1;return!0}let n=t,r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(let t of r)if(!Object.hasOwn(n,t)||!OO(e[t],n[t]))return!1;return!0}function kO(e){e.status.value!==`aborted`&&e.status.value!==`consumed`&&e.status.value!==`stale`&&(e.status.value=`aborted`,jO(e))}function AO(e){e.tracker.deref()?.releaseContext(e),nO?.context===e&&(nO=void 0),e.overlayReleased=!0,e.dirty.length=0,e.nodes.length=0,e.rawNodes=void 0,e.ops=void 0,e.root=void 0,e.bases=void 0,e.stored=void 0,e.baseValue=void 0}function jO(e){e.tracker.deref()?.releaseContext(e),nO?.context===e&&(nO=void 0);for(let t of e.nodes)Array.isArray(t.target)&&(t.target.length=0),Reflect.deleteProperty(t.target,hE),t.writes?.clear(),t.deletes?.clear(),t.readded?.clear(),t.array?.pieces!==void 0&&(t.array.pieces.length=0),t.array!==void 0&&(t.array.root=void 0,t.array.baseLocations=void 0,t.array.insertLocations=void 0),t.array?.baseOverrides?.clear(),t.array?.insertOverrides?.clear(),t.parentSource=void 0,t.target=_E,t.proxy=_E,t.writeKey=void 0,t.writeValue=void 0,t.writes=void 0,t.deleteKey=void 0,t.deletes=void 0,t.readded=void 0,t.array=void 0,t.subtreeDirty=void 0,t.preparedPath=void 0;e.dirty.length=0,e.nodes.length=0,e.rawNodes=void 0,e.ops=void 0,e.root=void 0,e.bases=void 0,e.stored=void 0,e.baseValue=void 0,e.overlayReleased=!0}function MO(e){return typeof e==`object`&&!!e}var NO=e=>typeof e==`object`&&!!e;function PO(e,t,n,r=64,i=8){if(e.length===0||t.length===0||n===0)return 0;let a=e.length>n?e.slice(e.length-n):e;for(let e of[Math.min(r,t.length),1]){let n=t.slice(0,e),r=0;for(let e=a.indexOf(n);e!==-1&&!(++r>i);e=a.indexOf(n,e+1)){let n=a.length-e;if(n<=t.length&&a.slice(e)===t.slice(0,n))return n}if(e===1)break}return 0}var FO=new Set([`__proto__`,`constructor`,`prototype`]),IO=class extends Error{segment;constructor(e){super(`unsafe path segment: ${String(e)}`),this.segment=e,this.name=`UnsafePathError`}};function LO(e){if(!Array.isArray(e)||e.length===0)throw TypeError(`op is not a tuple`);switch(e[0]){case`r`:if(e.length!==2)throw TypeError(`r arity`);return;case`s`:if(e.length!==3)throw TypeError(`s arity`);RO(e[1],!0);return;case`d`:if(e.length!==2)throw TypeError(`d arity`);RO(e[1],!0);return;case`a`:if(e.length!==3||typeof e[2]!=`string`)throw TypeError(`a shape`);RO(e[1],!0);return;case`t`:if(e.length!==3||!Number.isInteger(e[2])||e[2]<0)throw TypeError(`t shape`);RO(e[1],!0);return;case`p`:if(e.length!==5)throw TypeError(`p arity`);if(RO(e[1]),!Number.isInteger(e[2])||e[2]<0)throw TypeError(`p index`);if(!Number.isInteger(e[3])||e[3]<0)throw TypeError(`p remove`);if(!Array.isArray(e[4]))throw TypeError(`p items`);return;case`m`:if(e.length!==3)throw TypeError(`m arity`);RO(e[1]),zO(e[2]);return;default:throw TypeError(`unknown op verb: ${String(e[0])}`)}}function RO(e,t=!1){if(!Array.isArray(e))throw TypeError(`path is not an array`);if(t&&e.length===0)throw TypeError(`path is empty`);VO(e)}function zO(e){if(!Array.isArray(e))throw TypeError(`m permutation is not an array`);let t=new Uint8Array(e.length);for(let n of e){if(!Number.isInteger(n)||n<0||n>=e.length||t[n]!==0)throw TypeError(`m permutation is not a bijection`);t[n]=1}}function BO(e){if(!Array.isArray(e)||e.length===0)throw TypeError(`op is not a tuple`);let[t]=e,n=e=>{if(typeof e==`number`){if(!Number.isInteger(e)||e<0)throw TypeError(`bad path id`)}else{if(!Array.isArray(e))throw TypeError(`path is not an array`);VO(e)}};switch(t){case`r`:if(e.length!==2)throw TypeError(`r arity`);return;case`s`:if(e.length===3)n(e[1]);else if(e.length!==2)throw TypeError(`s arity`);return;case`d`:if(e.length===2)n(e[1]);else if(e.length!==1)throw TypeError(`d arity`);return;case`a`:if(e.length===3){if(n(e[1]),typeof e[2]!=`string`)throw TypeError(`a value`)}else if(e.length===2){if(typeof e[1]!=`string`)throw TypeError(`a value`)}else throw TypeError(`a arity`);return;case`t`:if(e.length===3){if(n(e[1]),!Number.isInteger(e[2])||e[2]<0)throw TypeError(`t count`)}else if(e.length===2){if(!Number.isInteger(e[1])||e[1]<0)throw TypeError(`t count`)}else throw TypeError(`t arity`);return;case`p`:{let[t,r,i]=e.length===5?[e[2],e[3],e[4]]:e.length===4?[e[1],e[2],e[3]]:[];if(i===void 0)throw TypeError(`p arity`);if(e.length===5&&n(e[1]),!Number.isInteger(t)||t<0)throw TypeError(`p index`);if(!Number.isInteger(r)||r<0)throw TypeError(`p remove`);if(!Array.isArray(i))throw TypeError(`p items`);return}case`m`:if(e.length===3)n(e[1]);else if(e.length!==2)throw TypeError(`m arity`);zO(e[e.length-1]);return;case`#`:if(e.length!==3||!Number.isInteger(e[1])||e[1]<0||!Array.isArray(e[2]))throw TypeError(`# shape`);VO(e[2]);return;default:throw TypeError(`unknown op verb: ${String(t)}`)}}function VO(e){for(let t of e)if(typeof t==`string`){if(FO.has(t))throw new IO(t)}else if(!Number.isInteger(t)||t<0)throw new IO(t)}function HO(e,t){if(t>e.length)throw new IO(t)}var UO=class extends Error{path;constructor(e){super(`unresolvable path: ${JSON.stringify(e)}`),this.path=e,this.name=`PathError`}};function WO(e,t){let n=e;for(let e of t){if(LO(e),e[0]===`r`){n=e[1];continue}let t=e[1];if(VO(t),e[0]===`p`){let r=t.length===0?n:XO(n,t);if(!Array.isArray(r))throw new UO(t);r.splice(e[2],e[3]);let i=1e4;for(let t=0;t<e[4].length;t+=i)r.splice(e[2]+t,0,...e[4].slice(t,t+i));continue}if(e[0]===`m`){let r=t.length===0?n:XO(n,t);if(!Array.isArray(r)||r.length!==e[2].length)throw new UO(t);let i=r.slice();for(let t=0;t<e[2].length;t++)r[t]=i[e[2][t]];continue}let r=XO(n,t.slice(0,-1)),i=t[t.length-1];if(Array.isArray(r)){if(typeof i!=`number`)throw new IO(i);HO(r,i)}let a=e=>{Object.defineProperty(r,i,{value:e,writable:!0,enumerable:!0,configurable:!0})},o=()=>Object.hasOwn(r,i)?r[i]:void 0;switch(e[0]){case`s`:a(e[2]);break;case`d`:if(Array.isArray(r)){if(typeof i!=`number`||i>=r.length)throw new UO(t);r.splice(i,1)}else delete r[i];break;case`a`:{let n=o();if(typeof n!=`string`)throw new UO(t);a(`${n}${e[2]}`);break}case`t`:{let n=o();if(typeof n!=`string`)throw new UO(t);a(n.slice(e[2]));break}}}return n}function GO(e,t){return KO(e,[t])}function KO(e,t){let n=e,r=new WeakSet;for(let e of t)for(let t of e)if(LO(t),t[0]===`r`)n=t[1];else{if(t[0]===`p`){let e=qO(n,t,r);if(e!==void 0){n=e;continue}}n=JO(n,t[0]===`p`||t[0]===`m`?t[1]:t[1].slice(0,-1),r),n=WO(n,[t])}return n}function qO(e,t,n){let[,r,i,a,o]=t;if(a!==0)return;let s=e;for(let e of r){if(!(typeof e==`string`?!FO.has(e)&&NO(s)&&!Array.isArray(s):Number.isInteger(e)&&e>=0&&Array.isArray(s))||!Object.hasOwn(s,e))return;s=s[e]}if(!Array.isArray(s)||n.has(s)||i!==s.length)return;let c=s.concat(o);if(n.add(c),r.length===0)return c;let l=r.slice(0,-1),u=JO(e,l,n);return Object.defineProperty(XO(u,l),r[r.length-1],{value:c,writable:!0,enumerable:!0,configurable:!0}),u}function JO(e,t,n){let r=e=>{if(Array.isArray(e))return e.slice();if(!NO(e))throw new UO(t);let n=Object.create(Object.getPrototypeOf(e)===null?null:Object.prototype);for(let t of Object.keys(e))Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0,configurable:!0});return n};if(!NO(e))throw new UO(t);let i;n.has(e)?i=e:(i=r(e),n.add(i));let a=i;for(let e of t){if(!Object.hasOwn(a,e))throw new UO(t);if(Array.isArray(a)&&typeof e!=`number`)throw new IO(e);let i=a[e];if(!NO(i))throw new UO(t);if(n.has(i)){a=i;continue}let o=r(i);Object.defineProperty(a,e,{value:o,writable:!0,enumerable:!0,configurable:!0}),n.add(o),a=o}return i}function YO(e,t){let n=e;for(let e of t){if(!NO(n))throw new UO(t);if(Array.isArray(n)&&typeof e!=`number`)throw new IO(e);if(!Object.hasOwn(n,e))throw new UO(t);n=n[e]}return n}function XO(e,t){let n=YO(e,t);if(!NO(n))throw new UO(t);return n}var ZO=e=>JSON.stringify(e);function QO(){let e=new Set,t=new Map,n=0,r;return{encode(i){r=void 0;let a=[];for(let o of i){if(o[0]===`r`){a.push(o),e.clear(),t.clear(),n=0,r=void 0;continue}let i=o[1],s=ZO(i);if(s===r){switch(o[0]){case`s`:a.push([`s`,o[2]]);break;case`d`:a.push([`d`]);break;case`a`:a.push([`a`,o[2]]);break;case`t`:a.push([`t`,o[2]]);break;case`p`:a.push([`p`,o[2],o[3],o[4]]);break;case`m`:a.push([`m`,o[2]])}continue}let c=i,l=t.get(s);if(l!==void 0)c=l;else if(e.has(s)){let e=n++;t.set(s,e),a.push([`#`,e,i]),c=e}else e.add(s);switch(o[0]){case`s`:a.push([`s`,c,o[2]]);break;case`d`:a.push([`d`,c]);break;case`a`:a.push([`a`,c,o[2]]);break;case`t`:a.push([`t`,c,o[2]]);break;case`p`:a.push([`p`,c,o[2],o[3],o[4]]);break;case`m`:a.push([`m`,c,o[2]])}r=s}return a}}}function $O(){let e=new Map;return{decode(t){let n,r=[];for(let i of t){if(BO(i),i[0]===`#`){VO(i[2]),e.set(i[1],i[2]);continue}if(i[0]===`r`){r.push(i),e.clear(),n=void 0;continue}let t=i[0]===`d`&&i.length===1||i[0]!==`d`&&i[0]!==`p`&&i.length===2||i[0]===`p`&&i.length===4,a;if(t){if(n===void 0)throw new UO([]);a=n}else{let t=i[1];if(typeof t==`number`){let n=e.get(t);if(n===void 0)throw new UO(t);a=n}else a=t;n=a}if(i[0]!==`p`&&i[0]!==`m`&&a.length===0)throw new UO(a);switch(i[0]){case`s`:r.push([`s`,a,t?i[1]:i[2]]);break;case`d`:r.push([`d`,a]);break;case`a`:r.push([`a`,a,t?i[1]:i[2]]);break;case`t`:r.push([`t`,a,t?i[1]:i[2]]);break;case`p`:{let[e,n,o]=t?[i[1],i[2],i[3]]:[i[2],i[3],i[4]];r.push([`p`,a,e,n,o]);break}case`m`:r.push([`m`,a,t?i[1]:i[2]])}}return r}}}var ek=[],tk=0,nk=!1;function rk(e){ek.push(e),ak()}function ik(e){tk++;try{return e()}finally{tk--,ak()}}function ak(){if(!(nk||tk>0)){nk=!0;try{for(let e=ek.shift();e!==void 0;e=ek.shift())e()}finally{nk=!1}}}var ok=0,sk=class{#e=new Set;#t=new Set;#n;constructor(e){this.#n=e}subscribe(e,t){return this.#e.add(e),this.#r(e,t),()=>this.#e.delete(e)}events(e,t){return this.#t.add(e),this.#r(e,{type:`snap`,value:t}),()=>this.#t.delete(e)}emit(e){let t=[...this.#t],n=[...this.#e];rk(()=>{for(let n of t)this.#t.has(n)&&this.#r(n,e);for(let t of n)this.#e.has(t)&&this.#r(t,e.value)})}#r(e,t){try{e(t)}catch(e){this.#n(e)}}},ck=Symbol(`chord.hydration`);function lk(e){if(typeof e==`object`&&e)return e[ck]}var uk=e=>[...e].map(lk).filter(e=>e?.hydrated===!1),dk=class{key;seq=++ok;dependents=new Set;schemas=[];options;fanout;constructor(e,t){this.key=e,this.options=t,this.fanout=new sk(t.report)}subscribe(e){return this.fanout.subscribe(e,this.value)}events(e){return this.fanout.events(e,this.value)}validate(e){if(this.options.dev){for(let t of this.ownSchemas())Yw(`state`,`state ${this.key}`,t,e);for(let t of this.schemas)Yw(`state`,`state ${this.key}`,t,e)}}ownSchemas(){return[]}};function fk(e,t){let n=[];for(let r of e){if(r[0]===`r`||r[1].length===0)return[[`r`,t]];let e=r[1].slice(1);switch(r[0]){case`p`:n.push([`p`,e,r[2],r[3],r[4]]);break;case`m`:n.push([`m`,e,r[2]]);break;default:if(e.length===0)return[[`r`,t]];r[0]===`d`?n.push([`d`,e]):n.push([r[0],e,r[2]])}}return n}var pk=class extends dk{schema;#e;#t;#n;constructor(e,t,n,r,i){super(e,i),n!==void 0&&Yw(`state`,`initial value of state ${e}`,t,n.value),this.schema=t,this.#e=TE({v:n?.value??null}),this.#t=r,this.#n=n!==void 0}initialize(e){if(this.#n)throw Error(`state ${this.key} is already initialized`);Yw(`state`,`initial value of state ${this.key}`,this.schema,e),this.#e=TE({v:e}),this.#n=!0}ownSchemas(){return[this.schema]}get value(){if(!this.#n)throw yk(`state ${this.key} (its init has not run)`);return this.#e.value.v}change(e,t){if(this.#t(e),!this.#n)throw yk(`state ${this.key} (its init has not run)`);let n=this.#e.beginChange(),r;try{let e=n.state,i=t(e.v);if(i instanceof Promise)throw TypeError(`cell.change callbacks must be synchronous`);i!==void 0&&(i!==e.v&&Yw(`state`,`state ${this.key}`,this.schema,i),e.v=i),r=n.prepare()}catch(e){throw n.abort(),e}this.#r(r,`ops`)}replace(e,t,n={}){if(this.#t(e),!this.#n)throw yk(`state ${this.key} (its init has not run)`);let r=this.value,i=n.diff??mk(r,t)?tE(r,t):void 0;this.#r(this.#e.prepareReplace({v:t}),`ops`,!0,i)}reset(e,t){this.schema=t,this.#r(this.#e.prepareReplace({v:e}),`reset`,!1)}#r(e,t,n=!0,r){if(e.ops.length===0&&t===`ops`){this.#e.adopt(e);return}let i=e.value.v,a;try{n&&this.validate(i),a=hk(this,i,n)}catch(t){throw e.abort(),t}ik(()=>{this.#e.adopt(e);let n=r!==void 0&&r.length>0?r:fk(e.ops,i);this.fanout.emit(t===`reset`?{type:t,value:i}:{type:t,ops:n,value:i});for(let[e,t]of a)e.install(t)})}};function mk(e,t){if(e===null||t===null||typeof e!=`object`||typeof t!=`object`||e===t||Array.isArray(e)!==Array.isArray(t))return!1;for(let[n,r]of Object.entries(t))if(typeof r==`object`&&r&&e[n]===r)return!0;return!1}function hk(e,t,n=!0){let r=new Set,i=e=>{for(let t of e.dependents)r.has(t)||(r.add(t),i(t))};i(e);let a=new Map([[e,t]]),o=new Map;for(let e of[...r].sort((e,t)=>e.seq-t.seq)){let t=e.compute(e=>a.has(e)?a.get(e):e.value);n&&e.validate(t),a.set(e,t),o.set(e,t)}return o}var gk=e=>typeof e==`object`&&!!e&&typeof e.subscribe==`function`&&`value`in e,_k=class extends dk{sources;#e;#t;#n=[];constructor(e,t,n,r){super(e,r),this.sources=t.map(t=>{if(!gk(t))throw TypeError(`derive ${e}: sources must be readables`);return t}),this.#e=n,this.#t=void 0}get value(){return this.#t}get[ck](){let e=uk(this.sources);if(e.length!==0)return{hydrated:!1,whenHydrated:()=>Promise.all(e.map(e=>e.whenHydrated())).then(()=>{})}}attach(e){this.#t=e?.has(this)?e.get(this):this.compute(e=>e.value);for(let e of this.sources)e instanceof dk?e.dependents.add(this):this.#n.push(e.subscribe(()=>this.refresh()))}detach(){for(let e of this.sources)e instanceof dk&&e.dependents.delete(this);for(let e of this.#n.splice(0))e()}compute(e){let t=this.#e(...this.sources.map(e));if(t instanceof Promise)throw TypeError(`derive ${this.key}: fn must be synchronous`);return t}refresh(){try{let e=this.compute(e=>e.value),t=hk(this,e);ik(()=>{this.install(e);for(let[e,n]of t)e.install(n)})}catch(e){this.options.report(e)}}install(e){let t=this.#t;this.#t=e;let n=t===void 0||e===void 0?[[`r`,e??null]]:tE(t,e);n.length>0&&this.fanout.emit({type:`ops`,ops:n,value:e})}},vk=e=>e instanceof dk,yk=e=>new I(`not_ready`,`${e} is not ready`),bk=()=>{},xk=(e,t,n,r)=>(Ck(e,n),{contract:e,factory:t,options:n,facet:r}),Sk=e=>e.options.lifetime===`host`;function Ck(e,t){let n=t.lifetime??`referenced`;if(n!==`referenced`&&n!==`host`)throw TypeError(`${e.name}: unknown lifetime ${String(n)}`);if(n===`host`){if(e.scope!==`local`)throw TypeError(`${e.name}: lifetime "host" needs a local type (remote types are referenced)`);if(t.linger!==void 0)throw TypeError(`${e.name}: an object of lifetime "host" does not linger (it lives as long as the host)`);try{Xw(e.input,{},`${e.name} input`)}catch{throw TypeError(`${e.name}: lifetime "host" needs an input that accepts {} (the object's one address)`)}}}var wk=class{resource;constructor(e){this.resource=e}},Tk=class{key;spec;deps;state=`closed`;#e;constructor(e,t,n){this.key=e,this.spec=t,this.deps=n}get value(){if(this.state===`unavailable`)throw new I(`unavailable`,`resource ${this.key} could not be restored`);if(this.state!==`open`)throw yk(`resource ${this.key}`);return this.#e}get exclusive(){return this.spec.exclusive===!0}async open(e,t){if(this.state!==`closed`)return;this.state=`opening`;let n;try{n=await this.spec.open({signal:e})}catch(e){throw this.state=`closed`,e}if(e.aborted)throw this.state=`closed`,await this.spec.close?.(n),new I(`aborted`,`resource ${this.key} opened after abort`);this.#e=n,this.state=`open`,t.push(this)}async close(e){if(this.state!==`open`)return;this.state=`closed`;let t=e.indexOf(this);t!==-1&&e.splice(t,1);let n=this.#e;this.#e=void 0,await this.spec.close?.(n)}markUnavailable(){this.state=`unavailable`,this.#e=void 0}adopt(e){this.spec=e}},Ek=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t,Dk.set(this,e)}get key(){return this.#e.key}get value(){if(this.#t.inFactory>0)throw yk(`resource ${this.key} (inside a factory)`);return this.#e.value}},Dk=new WeakMap,Ok=e=>e instanceof Tk?e:typeof e==`object`&&e?Dk.get(e):void 0,kk=class{cells=new Map;cellSchemas=new Map;cellVersions=new Map;cellMigrations=new Map;refs=new Map;resources=new Map;adopted=new Map;listeners=new Map;tasks=new Map;derives=new Map;registrations=new Map},Ak=e=>typeof e==`object`&&!!e&&typeof e.init==`function`,jk=class e{host;signal;rootId;codeVersion;principal;holder;#e=[];#t;#n=new AbortController;#r=!1;get closed(){return this.#r}check(e){if(this.host!==e)throw Hw(`foreign_ctx`,`ctx belongs to another host`);if(this.#r)throw new I(`aborted`,`ctx expired: its call already settled`,{reason:`expired`});if(this.signal.aborted){let e=this.signal.reason;throw e instanceof I&&e.code===`superseded`?new I(`superseded`,e.message,{cause:e}):new I(`aborted`,`ctx aborted`,{cause:e})}}constructor(e,t){this.host=e;let n=Mk(t.signals);this.signal=n.signal,this.#t=n.release,this.rootId=t.rootId,this.codeVersion=t.codeVersion,this.principal=t.principal,this.holder=t.holder??!1}async get(e,t,n){this.check(this.host);let r=this.host.acquire(e,t,{principal:this.principal,...n},`call`);return this.#e.push(r),await Nk(r,[this.signal,this.#n.signal],this.host.readyTimeout),r.proxy}child(t){return new e(this.host,{signals:[this.signal,t.callAbort.signal],rootId:this.rootId,codeVersion:this.codeVersion,principal:this.host.principal})}close(){this.#r=!0,this.#n.abort(new I(`aborted`,`ctx expired: its call already settled`,{reason:`expired`})),this.#t();for(let e of this.#e.splice(0))e.release()}};function Mk(e){let t=new AbortController,n=[],r=()=>{for(let e of n.splice(0))e()};for(let i of e){if(i.aborted){r(),t.abort(i.reason);break}let e=()=>{r(),t.abort(i.reason)};i.addEventListener(`abort`,e,{once:!0}),n.push(()=>i.removeEventListener(`abort`,e))}return{signal:t.signal,release:r}}async function Nk(e,t,n){let r=new AbortController,i=Number.isFinite(n)?setTimeout(()=>r.abort(new I(`unavailable`,`${e.address} was not ready after ${n} ms`,{reason:`ready_timeout`})),n):void 0;i?.unref?.();let a=Mk([...t,r.signal]);try{await Pk(e.ready,a.signal)}catch(t){e.release();let n=a.signal.reason;throw n instanceof I&&n.reason===`ready_timeout`?n:t}finally{clearTimeout(i),a.release()}}async function Pk(e,t){if(t.aborted)throw new I(`aborted`,`call aborted`,{cause:t.reason});let n=bk,r=new Promise((e,r)=>{n=()=>r(new I(`aborted`,`call aborted`,{cause:t.reason})),t.addEventListener(`abort`,n,{once:!0})});try{return await Promise.race([e,r])}finally{t.removeEventListener(`abort`,n)}}var Fk=new Set([`contract`,`status`,`ready`,`variant`,`shape`,`error`,`onShape`,`onStatus`,`release`]);function Ik(e,t,n,r){if(e.size===0)return;let i=[...e];rk(()=>{for(let e of i)try{e(t,n)}catch(e){r(e)}})}var Lk=new WeakMap,Rk=e=>typeof e==`object`&&e?Lk.get(e):void 0,zk=class{#e;#t;#n=new Set;#r=new Set;#i=new Set;#a;#o=bk;#s;constructor(e,t){this.#e=e,this.#t=t}get value(){let e=this.#e;if(e.status===`released`||e.status===`gone`)throw e.terminalError();if(e.status!==`live`)throw yk(`${e.address}.${this.#t}`);let t=e.currentView();if(t===void 0)throw yk(`${e.address}.${this.#t}`);let n=this.#c();if(n===void 0)throw new I(`not_in_variant`,`${e.address}: ${this.#t} is not a state member of variant ${Vk(t)??`(local)`}`);return n.value}get[ck](){let e=this.#e;return e.status===`live`?lk(this.#c()):{hydrated:!1,whenHydrated:async()=>{await e.ready,await lk(this.#c())?.whenHydrated()}}}subscribe(e){this.#n.add(e);let t=this.#l();return t!==void 0&&(this.#s={value:t.value},this.#d(()=>e(t.value))),this.bind(),()=>this.#u(this.#n,e)}events(e){this.#r.add(e);let t=this.#l();if(t!==void 0){let n=t.value;this.#s={value:n},this.#d(()=>e({type:`snap`,value:n}))}else this.#i.add(e);return this.bind(),()=>{this.#i.delete(e),this.#u(this.#r,e)}}bind(){let e=this.#n.size+this.#r.size>0?this.#c():void 0;if(e===this.#a||(this.#o(),this.#o=bk,this.#a=e,e===void 0))return;let t=!0;this.#o=e.events(e=>{let n=t;if(t=!1,n&&this.#i.size===0&&this.#s!==void 0&&e.value===this.#s.value)return;this.#s={value:e.value};let r=n?{type:`reset`,value:e.value}:e,i=[...this.#r],a=[...this.#n],o=new Set(this.#i);this.#i.clear(),rk(()=>{for(let t of i){if(!this.#r.has(t))continue;let n=o.has(t)?{type:`snap`,value:e.value}:r;this.#d(()=>t(n))}for(let t of a)this.#n.has(t)&&this.#d(()=>t(e.value))})})}stop(){this.#n.clear(),this.#r.clear(),this.#i.clear(),this.bind()}#c(){let e=this.#e.currentView();if(e===void 0||!this.#e.inVariant(e,this.#t))return;let t=e[this.#t];return vk(t)||Wk(t)?t:void 0}#l(){let e=this.#c();return e===void 0||lk(e)?.hydrated===!1?void 0:e}#u(e,t){e.delete(t),this.bind()}#d(e){try{e()}catch(e){this.#e.object.host.report(e)}}},Bk=class{object;contract;owner;address;proxy;ready;status;error;shapeListeners=new Set;goneListeners=new Set;readables=new Map;bindings=new WeakMap;views=new WeakMap;callers=new Map;constructor(e,t,n){this.object=e,this.contract=t,this.owner=n,this.address=e.address,this.status=e.status===`live`?`live`:`loading`,this.ready=e.ready.then(()=>{if(this.status===`gone`)throw this.error;if(this.status===`released`)throw new I(`released`,`reference ${this.address} released`)}),this.ready.catch(bk),this.proxy=new Proxy(this,{get:(e,t)=>{if(Fk.has(t)){let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}if(typeof t==`string`&&t!==`then`)return e.member(t)},has:(e,t)=>Fk.has(t)||e.member(String(t))!==void 0}),Lk.set(this.proxy,this)}get variant(){let e=this.currentView();return e===void 0?void 0:Vk(e)}get shape(){let e=this.status===`live`?this.object.currentInstalled():void 0,t=e===void 0?void 0:this.#n(e);if(e!==void 0&&t!==void 0)return{variant:Vk(t),members:Object.keys(t).filter(e=>e!==`variant`),contract:e.service.contract.fingerprint}}onShape(e){return this.shapeListeners.add(e),()=>this.shapeListeners.delete(e)}onStatus(e){return this.#e.add(e),()=>this.#e.delete(e)}#e=new Set;#t(){Ik(this.#e,this.status,this.error,e=>this.object.host.report(e))}release(){this.status!==`released`&&this.status!==`gone`&&(this.status=`released`,this.#r(),this.#t(),this.object.release(this))}live(){this.status===`loading`&&(this.status=`live`,this.#t(),this.shapeChanged())}gone(e){if(this.status!==`released`&&this.status!==`gone`){this.status=`gone`,this.error=e,this.#r(),this.#t();for(let t of[...this.goneListeners])t(e)}}shapeChanged(){for(let e of this.readables.values())e.bind();let e=this.shape;if(e===void 0)return;let t=[...this.shapeListeners];rk(()=>{for(let n of t)try{n(e)}catch(e){this.object.host.report(e)}})}terminalError(){return this.status===`gone`?this.error:new I(`released`,`reference ${this.address} released`)}viewOf(e){let t=this.bindings.get(e.service);if(this.bindings.has(e.service)||(t=DT(e.service.contract,e.service.options.accepts,this.contract),this.bindings.set(e.service,t)),t===void 0)return e.implementation;let n=this.views.get(e.implementation);return n===void 0&&(n=t(e.implementation),this.views.set(e.implementation,n)),n}currentView(){if(this.status!==`live`)return;let e=this.object.currentInstalled();return e===void 0?void 0:this.#n(e)}#n(e){try{return this.viewOf(e)}catch(e){this.object.host.report(e);return}}describe(e,t){let n=this.contract.description.variants;if(e!==void 0)return n[e]?.[t];for(let e of Object.values(n))if(e[t]!==void 0)return e[t]}inVariant(e,t){return this.contract.scope!==`remote`||this.describe(Vk(e),t)!==void 0}member(e){let t=this.describe(void 0,e),n=this.currentView(),r=n?.[e];if(t?.kind===`method`||t===void 0&&typeof r==`function`)return this.caller(e);if(t?.kind===`state`||t===void 0&&(vk(r)||Wk(r))){let t=this.readables.get(e);return t===void 0&&(t=new zk(this,e),this.readables.set(e,t)),t}if(n!==void 0&&this.inVariant(n,e))return r instanceof wk?r.resource.value:r}caller(e){let t=this.callers.get(e);if(t===void 0){let n=OT(this.contract,e);t=(...t)=>{let[r,i]=n?[void 0,t[0]]:t;if(this.object.host.inFactory>0)throw new I(`not_ready`,`${this.address}.${e} called inside a factory`);if(i!==void 0&&!(i instanceof jk))return Promise.reject(Hw(`foreign_ctx`,`ctx must come from a Chord host`));if(i===void 0||i.holder){try{i?.check(this.object.host)}catch(e){return Promise.reject(e)}return this.object.host.root(t=>this.object.call(this,e,r,t),{signal:i?.signal})}return this.object.call(this,e,r,i)},this.callers.set(e,t)}return t}#r(){for(let e of this.readables.values())e.stop()}},Vk=e=>typeof e.variant==`string`?e.variant:void 0,Hk=(e,t)=>e===t||e!==void 0&&t!==void 0&&String(e)===String(t),Uk=class{host;address;typeName;input;principal;hostLifetime;status=`activating`;ready=Promise.resolve();service;minCodeVersion=0;decls=new kk;pending=new Set;implementations=new Map;refs=new Set;leases=new Map;openOrder=[];callAbort=new AbortController;activationAbort=new AbortController;gate;deferredRuntime=!1;#e=new Map;#t=new Set;#n=new Map;#r=new Set;#i=0;#a;#o;constructor(e,t){this.host=e,this.address=t.address,this.typeName=t.typeName,this.input=t.input,this.principal=t.principal,this.hostLifetime=t.hostLifetime}start(e){this.ready=this.#s(e).then(()=>{for(let e of this.refs)e.live();this.#p()},e=>{this.status===`activating`&&(this.status=`failed`),this.host.forget(this);let t=Uw(e,`activating ${this.address}`);for(let e of this.refs)e.gone(t);throw t}),this.ready.catch(bk)}async#s(e){await e?.catch(bk);let t=this.activationAbort.signal,n=()=>new I(`aborted`,`${this.address} abandoned`);if(t.aborted)throw n();let r=this.host.service(this.typeName);if(r===void 0)throw new I(`unavailable`,`${this.typeName} is not served`,{reason:`unknown_type`});this.service=r;let i=this.run(r,void 0);try{if(await this.open(i.created.resources,i.created.refs,t),t.aborted||(await this.waitHydrated(i),t.aborted)||(await this.initCells(i,t),t.aborted))throw n();this.host.checkRegistrations(this,i.decls),this.decls=i.decls;for(let[e,t]of this.host.retainedCodeVersions())t.get(this.typeName)===r&&this.implementations.set(e,{codeVersion:e,service:r,implementation:i.implementation,decls:i.decls});let e=this.host.pendingCodeVersion();if(!this.implementations.has(this.host.currentCodeVersion())&&(e===void 0||!this.implementations.has(e)))throw new I(`superseded`,`${this.address}: code changed during activation`);for(let e of i.created.derives)e.attach();if(this.refreshSchemas(),this.deferredRuntime=!this.implementations.has(this.host.currentCodeVersion()),this.deferredRuntime||(i.decls.registrations.size>0&&this.host.registriesChanged(this),this.startRuntime()),t.aborted)throw n();this.status=`live`}catch(e){this.callAbort.abort(e),this.stopListeners(),this.stopTasks();let t=this.decls.registrations.size>0&&!this.deferredRuntime;throw this.implementations.clear(),this.decls=new kk,t&&this.host.registriesChanged(),await Promise.allSettled([...this.#t,...this.#r]),await this.unwind(i).catch(e=>this.host.report(e)),e}finally{this.pending.delete(i.decls)}}run(e,t){let n=new qk(this,t),r=e=>{this.pending.delete(e.decls),this.unwind(e).catch(e=>this.host.report(e))};this.pending.add(n.run(void 0).decls),this.host.inFactory++;let i;try{i=e.factory(this.input,this.principal,n)}catch(e){throw this.host.inFactory--,r(n.run(void 0)),e}this.host.inFactory--;let a=n.run(i);try{if(i instanceof Promise)throw Hw(`implementation`,`${this.typeName}: factories must be synchronous`);Kk(e,a.implementation)}catch(e){throw r(a),e}return a}async open(e,t,n){let r=new Map,i=t=>{let a=r.get(t);return a===void 0&&(a=(async()=>{await Promise.all(t.deps.map(t=>t instanceof Tk?e.includes(t)?i(t):void 0:t.ready)),await t.open(n,this.openOrder)})(),r.set(t,a)),a},a=this.withinReadyTimeout(Promise.all(t.map(e=>e.ready)),()=>t.filter(e=>e.status===`loading`).map(e=>e.address)),o=(await Promise.allSettled([...e.map(i),a])).find(e=>e.status===`rejected`);if(o!==void 0)throw o.reason}async waitHydrated(e){let t=Object.entries(e.implementation??{}),n=uk([...e.created.derives,...t.map(([,e])=>e)]);n.length!==0&&await this.withinReadyTimeout(Promise.all(n.map(e=>e.whenHydrated())),()=>[...t.filter(([,e])=>lk(e)?.hydrated===!1).map(([e])=>`${this.address}.${e}`),...e.created.derives.filter(e=>lk(e)!==void 0).map(e=>`derive ${e.key}`)])}async withinReadyTimeout(e,t){let n=this.host.readyTimeout;if(!Number.isFinite(n))return e;let r,i=new Promise((e,i)=>{r=setTimeout(()=>{let e=t();i(new I(`unavailable`,`${this.address} was not ready after ${n} ms${e.length===0?``:`, waiting on ${e.join(`, `)}`} (a reference cycle across hosts?)`,{reason:`ready_timeout`}))},n),r.unref?.()});i.catch(bk);try{return await Promise.race([e,i])}finally{clearTimeout(r)}}async initCells(e,t){if(e.created.inits.length===0)return;let n=(await Promise.allSettled(e.created.inits.map(async([e,n])=>{let r=await this.host.root(e=>n(e),{signal:t});t.aborted||e.initialize(r)}))).find(e=>e.status===`rejected`);if(n!==void 0)throw n.reason}async unwind(e){for(let t of e.created.derives)t.detach();await Ww([...[...e.created.resources].sort((e,t)=>this.openOrder.indexOf(t)-this.openOrder.indexOf(e)).map(e=>()=>e.close(this.openOrder)),...e.created.refs.map(e=>()=>e.release())],`${this.address}: cleanup failed`)}currentInstalled(){return this.implementations.get(this.host.currentCodeVersion())??[...this.implementations.values()].at(-1)}refreshSchemas(){let e=new Map;for(let t of this.implementations.values())for(let[n,r]of Gk(t.service,t.implementation))e.set(n,[...e.get(n)??[],...r]);for(let t of this.allDecls())for(let n of[...t.cells.values(),...t.derives.values()])n.schemas=e.get(n)??[]}allDecls(){let e=new Set([this.decls,...this.pending]);for(let t of this.implementations.values())e.add(t.decls);return e}#c(e){return Ok(e.source)??e.source}#l(e,t){let n=Ok(t.source),r=n===void 0?t.source:n.value,i=t.select===void 0?r:t.select(r);if(typeof i?.subscribe!=`function`)throw Hw(`implementation`,`listener ${e}: source has no subscribe()`);return i}stageListeners(e){let t=new Map,n=new Set;try{for(let[r,i]of e.listeners){let e=this.#c(i),a=this.#e.get(r);if(a!==void 0&&a.origin===e&&Hk(a.select,i.select)){n.add(r);continue}let o=this.#l(r,i),s={origin:e,select:i.select,unsubscribe:bk,buffer:[]};t.set(r,s),vk(o)||Wk(o)?(s.buffer=void 0,s.subscribe=()=>{s.unsubscribe=o.subscribe(e=>this.#d(r,e))}):s.unsubscribe=o.subscribe(e=>{s.buffer===void 0?this.#d(r,e):s.buffer.push(e)})}}catch(e){for(let e of t.values())e.unsubscribe();throw e}return{activate:()=>{for(let[e,t]of this.#e)n.has(e)||(t.unsubscribe(),this.#e.delete(e));for(let[e,n]of t){this.#e.set(e,n),n.subscribe?.();let t=n.buffer??[];n.buffer=void 0;for(let n of t)this.#d(e,n)}},discard:()=>{for(let e of t.values())e.unsubscribe()}}}startRuntime(){this.stageListeners(this.decls).activate(),this.startTasks()}startTasks(){let e=++this.#i,t=()=>{for(let e of this.decls.tasks.keys())this.#u(e,this.host.currentCodeVersion())};if(this.#r.size===0){t();return}let n=this.host.taskStopDeadline,r,i=new Promise(e=>{r=setTimeout(()=>e(!0),n)}),a=Promise.allSettled([...this.#r]).then(()=>!1);Promise.race([a,i]).then(i=>{clearTimeout(r),e===this.#i&&this.status===`live`&&(i&&this.host.report(new I(`aborted`,`${this.address}: aborted tasks still running after ${n} ms; starting their replacements anyway`)),t())})}stopListeners(){for(let e of this.#e.values())e.unsubscribe();this.#e.clear()}#u(e,t){let n=this.decls.tasks.get(e);if(n===void 0)return;let r=new AbortController,i=new jk(this.host,{signals:[r.signal,this.callAbort.signal],rootId:`task:${this.address}:${e}`,codeVersion:t,principal:this.host.principal,holder:!0}),a=(async()=>{try{await n(i)}catch(e){i.signal.aborted||this.host.report(e)}finally{i.close(),this.#n.get(e)?.controller===r&&this.#n.delete(e)}})();this.#n.set(e,{controller:r,done:a})}stopTasks(){this.#i++;for(let e of this.#n.values()){e.controller.abort(new I(`aborted`,`task stopped`));let t=e.done;this.#r.add(t),t.finally(()=>this.#r.delete(t))}this.#n.clear()}#d(e,t){rk(()=>{if(this.gate!==void 0){this.gate.queue.push({key:e,event:t});return}let n=this.decls.listeners.get(e);n===void 0||this.status!==`live`&&this.status!==`activating`||this.host.root(e=>{this.lease(e);let r=e.child(this);return this.#f(async()=>{try{await n.fn(t,r)}finally{r.close()}})}).catch(e=>this.host.report(e))})}openGate(){let e=this.gate;this.gate=void 0;for(let{key:t,event:n}of e?.queue??[])this.#d(t,n)}admit(e){if(this.host.failed!==void 0)throw new I(`unavailable`,`${this.host.name} failed and admits no work`,{reason:`host_failed`});if(!this.host.hasCodeVersion(e.codeVersion))throw new I(`superseded`,`code version ${e.codeVersion} is retired`);if(e.codeVersion<this.minCodeVersion)throw new I(`upgrade_conflict`,`${this.address} was upgraded in code version ${this.minCodeVersion}`);if(this.gate!==void 0&&!this.gate.grandfathered.has(e.rootId))throw new I(`upgrade_conflict`,`${this.address} is being upgraded`)}lease(e){this.leases.has(e.rootId)||(this.leases.set(e.rootId,e.codeVersion),this.host.touch(e.rootId,this))}guard=e=>{if(this.host.inFactory>0)throw Hw(`read_only`,`cells cannot be written while a factory runs`);if(e instanceof jk&&e.check(this.host),e.signal.aborted)throw new I(`aborted`,`write with an aborted ctx`);if(this.status===`disposed`)throw new I(`gone`,`${this.address} is disposed`);e.rootId.startsWith(`task:`)||this.admit(e)};async call(e,t,n,r){if(r.check(this.host),e.status===`released`||e.status===`gone`)throw e.terminalError();if(e.status===`loading`&&await Pk(e.ready,r.signal),e.status!==`live`||this.status!==`live`)throw e.status===`live`?new I(`gone`,`${this.address} is ${this.status}`):e.terminalError();this.admit(r);let i=this.implementations.get(r.codeVersion);if(i===void 0)throw new I(`superseded`,`${this.address} has no implementation for code version ${r.codeVersion}`);let a=e.viewOf(i),o=Vk(a),s=e.describe(e.contract.scope===`remote`?o:``,t),c=a[t];if(typeof c!=`function`||e.contract.scope===`remote`&&s?.kind!==`method`)throw new I(`not_in_variant`,`${this.address}: ${t} is not a method of variant ${o??`(local)`}`);let l=a===i.implementation?i.service.contract.description.variants[o??``]?.[t]:s,u=l?.kind===`method`?l:void 0,d=e.contract.scope===`remote`?u:void 0,f=u===void 0||u.args!==void 0,p=u===void 0||u.result!==void 0,m;if(f){let r=e.contract.scope===`remote`&&s?.kind===`method`?s.args:void 0,i=r===void 0?n:Dw(r,vw(n));m=d?.args?Dw(d.args,vw(i)):i,d?.args&&Yw(`args`,`${this.address}.${t} args`,d.args,m)}this.lease(r);let h=r.child(this),g;try{g=await this.#f(()=>f?c(m,h):c(h))}finally{h.close()}if(p)return d?.result&&Yw(`result`,`${this.address}.${t} result`,d.result,g),g}#f(e){let t=(async()=>e())();this.#t.add(t);let n=()=>{this.#t.delete(t),this.#t.size===0&&this.#p()};return t.then(n,n),t}rootEnded(e){this.leases.delete(e);let t=this.gate;t?.grandfathered.delete(e)&&t.grandfathered.size===0&&t.drained()}addRef(e){this.refs.add(e),this.#a!==void 0&&clearTimeout(this.#a),this.#a=void 0}release(e){this.refs.delete(e)&&this.#p()}#p(){if(this.refs.size>0||this.#t.size>0||this.#a!==void 0)return;if(this.status===`activating`){this.#m(this.dispose(!1));return}if(this.status!==`live`)return;let e=this.service?.options.linger??0;e<=0?this.#m(this.dispose(!1)):(this.#a=setTimeout(()=>{this.#a=void 0,this.refs.size===0&&this.#t.size===0&&this.status===`live`&&this.#m(this.dispose(!1))},e),this.#a.unref?.())}#m(e){e.catch(e=>this.host.report(e))}dispose(e,t){return this.#o??=this.#h(e,t),this.#o}async#h(e,t){let n=this.status===`activating`;this.status=`disposing`,this.host.forget(this),this.#a!==void 0&&clearTimeout(this.#a),this.#a=void 0;let r=t??new I(`gone`,`${this.address} was disposed`);if(e){for(let e of this.refs)e.gone(r);this.callAbort.abort(r)}this.activationAbort.abort(r),n&&await this.ready.catch(bk);for(let e of this.refs)e.gone(r);let i=this.allDecls();this.stopTasks(),this.stopListeners(),await Promise.allSettled([...this.#t]);let a=[...i].some(e=>e.registrations.size>0)&&!this.deferredRuntime;this.implementations.clear(),this.decls=new kk,a&&this.host.registriesChanged();let o=new Set;for(let e of i){for(let t of e.derives.values())t.detach();for(let t of e.refs.values())o.add(t)}try{await Ww([()=>Promise.allSettled([...this.#r]),...[...this.openOrder].reverse().map(e=>()=>e.close(this.openOrder)),...[...o].map(e=>()=>e.release())],`${this.address}: disposal failed`)}finally{this.status=`disposed`,this.host.disposed(this)}}},Wk=e=>typeof e==`object`&&!!e&&typeof e.events==`function`&&typeof e.subscribe==`function`;function Gk(e,t){let n=new Map,r=e.contract;if(r.scope!==`remote`)return n;let i=r.description.variants[Vk(t)??``]??{};for(let[e,r]of Object.entries(i)){let i=t[e];r.kind===`state`&&vk(i)&&n.set(i,[...n.get(i)??[],r.schema])}return n}function Kk(e,t){let n=e.contract,r=e=>{throw Hw(`implementation`,`${n.name}: ${e}`)};(typeof t!=`object`||!t)&&r(`factory must return an object`);let i;if(n.scope===`remote`){let e=t.variant;(typeof e!=`string`||n.description.variants[e]===void 0)&&r(`unknown variant ${String(e)}`),i=n.description.variants[e];for(let n of Object.keys(t))n!==`variant`&&i[n]===void 0&&r(`${n} is not in variant ${String(e)}`)}else i=n.description.variants[``]??{};for(let[e,n]of Object.entries(i)){let i=t[e];n.kind===`method`&&typeof i!=`function`&&r(`${e} must be a method`),n.kind===`state`&&!vk(i)&&!Wk(i)&&r(`${e} must be a cell, a derivation or a held object's state member`),n.kind===`opaque`&&i===void 0&&r(`${e} is missing`)}}var qk=class{#e;#t;#n=new kk;#r={refs:[],resources:[],derives:[],inits:[]};constructor(e,t){this.#e=e,this.#t=t}run(e){return{implementation:e,decls:this.#n,created:this.#r}}#i(e,t,n){if(typeof n!=`string`||n===``)throw TypeError(`${t} needs a name`);if(e.has(n))throw Hw(`duplicate`,`${this.#e.typeName}: duplicate ${t} name ${n}`)}state(e,t,n,r={}){this.#i(this.#n.cells,`state`,e);let i=r.version??1;if(!Number.isInteger(i)||i<1)throw TypeError(`state ${e}: version must be a positive integer`);let a=this.#e.host,o=Ak(n)?n.init:void 0,s=this.#t?.cells.get(e);return s===void 0&&(s=new pk(e,t,o===void 0?{value:n}:void 0,this.#e.guard,{dev:a.dev,report:e=>a.report(e)}),o!==void 0&&this.#r.inits.push([s,o])),this.#n.cells.set(e,s),this.#n.cellSchemas.set(e,t),this.#n.cellVersions.set(e,i),r.migrate!==void 0&&this.#n.cellMigrations.set(e,r.migrate),s}get(e,t,n){let r=this.#e.host,i=this.#t!==void 0,a=r.addressOf(e,t,n?.principal??r.principal,i),o=this.#n.refs.get(a);if(o!==void 0){if(o.contract.fingerprint!==e.fingerprint)throw Hw(`duplicate`,`${this.#e.typeName}: ${e.name} held twice with different contracts`);return o.proxy}let s=this.#t?.refs.get(a);if(s!==void 0&&s.contract.fingerprint===e.fingerprint&&s.status!==`gone`&&s.status!==`released`)return this.#n.refs.set(a,s),s.proxy;let c=r.acquire(e,t,n,`object`,this.#e,i);return this.#n.refs.set(a,c),this.#r.refs.push(c),c.proxy}resource(e,t){if(this.#i(this.#n.resources,`resource`,e),!Number.isInteger(t.version))throw TypeError(`resource ${e}: version must be an integer`);let n=(t.deps??[]).map(t=>{let n=Rk(t)??Ok(t);if(n===void 0)throw TypeError(`resource ${e}: deps must be references or resources of this object`);return n}),r=this.#t?.resources.get(e),i=r!==void 0&&r.spec.version===t.version&&r.exclusive===(t.exclusive===!0)&&r.deps.length===n.length&&r.deps.every((e,t)=>e===n[t]),a=i?r:new Tk(e,t,n);return i?this.#n.adopted.set(r,t):this.#r.resources.push(a),this.#n.resources.set(e,a),new Ek(a,this.#e.host)}on(e,t,...n){this.#i(this.#n.listeners,`listener`,e);let[r,i]=n.length===1?[void 0,n[0]]:[n[0],n[1]];if(typeof i!=`function`)throw TypeError(`listener ${e}: the handler must be a function`);if(r!==void 0&&typeof r!=`function`)throw TypeError(`listener ${e}: select must be a function`);this.#n.listeners.set(e,{source:t,select:r,fn:i})}task(e){if(typeof e!=`function`)throw TypeError(`a task must be a function`);this.#n.tasks.set(`#${this.#n.tasks.size}`,e)}derive(e,t){if(typeof t!=`function`)throw TypeError(`a derivation needs a function`);let n=this.#e.host,r=`#${this.#n.derives.size}`,i=new _k(r,e,t,{dev:n.dev,report:e=>n.report(e)});return this.#r.derives.push(i),this.#n.derives.set(r,i),i}expose(e){let t=Ok(e);if(t===void 0||![...this.#n.resources.values()].includes(t))throw TypeError(`expose takes a resource declared by this object`);return new wk(t)}register(e,t){if(!this.#e.hostLifetime)throw Hw(`not_host_lifetime`,`${this.#e.typeName}: only objects of lifetime "host" may register`);for(let[n,r]of Object.entries(t)){let t=`${e.name}\u0000${n}`;this.#i(this.#n.registrations,`register`,t),this.#n.registrations.set(t,{registry:e,key:n,value:r})}}};function Jk(e){let{run:t,migrated:n,service:r,object:i}=e,a=Gk(r,t.implementation);for(let[e,t]of n)for(let n of a.get(e)??[])Yw(`state`,`${i.address}: migrated state ${e.key}`,n,t);let o=new Map(n),s=[...t.decls.derives].sort(([,e],[,t])=>e.seq-t.seq);for(let[e,t]of s){let n=t.compute(e=>o.has(e)?o.get(e):Yk(e));for(let r of a.get(t)??[])Yw(`state`,`${i.address}: derivation ${e}`,r,n);o.set(t,n)}e.derived=o}function Yk(e){try{return e.value}catch(e){if(Vw(e,`not_ready`)||Vw(e,`not_in_variant`))return;throw e}}function Xk(e){let t=Uw(e,`reload`);return/^reload aborted/.test(t.message.replace(/^[^:]*: /,``))?t:new I(t.code,`reload aborted: ${t.message}`,{cause:t,reason:t.reason,details:t.details})}async function Zk(e,t,n){let r=await Qk(e,t,n);try{return await r.prepare(),r.commit()}finally{$k(e)}}async function Qk(e,t,n,r){if(e.reloading)throw new I(`unavailable`,`a reload is already running`,{reason:`reload_running`});e.reloading=!0;try{return new nA(e,await e.resolve(t),n,r)}catch(t){throw e.reloadEnded(),Xk(t)}}function $k(e){e.reloadEnded()}var eA=1e3;function tA(e,t,n){return t()?Promise.resolve(!0):new Promise(r=>{let i=setTimeout(()=>{a(),r(!1)},n),a=e.watchRetirement(()=>{t()&&(clearTimeout(i),a(),r(!0))})})}var nA=class{host;facets;options;codeVersion;candidates=new Map;abort=new AbortController;closed=[];services=new Map;changed=new Set;removed=new Set;tables=new Map;gated=[];rolledBack=!1;deferred=new Map;facetRuns=new Map;constructor(e,t,n,r){this.host=e,this.facets=t,this.options=n,this.codeVersion=r}async prepare(){try{await this.waitForRetirement(),this.load(),this.checkProviders(),await this.prepareAll(),this.host.gating=this.changed,await this.withDeadline(this.prepareAll(),`activations in flight did not finish`),this.checkRefs(),this.tables=this.host.buildTables(this.entries()),await this.gate(),this.#e(),this.#t()}catch(e){throw await this.rollback(),Xk(e)}}summary(){let e=[...this.candidates.values()].filter(({object:e})=>e.status===`live`);return{codeVersion:this.host.pending?.id??this.host.current.id,previous:this.host.current.id,changed:[...this.changed],removed:[...this.removed],prepared:e.map(({object:e})=>e.address),gated:this.gated.map(({object:e})=>e.address)}}#e(){if(this.rolledBack)throw new I(`aborted`,`reload aborted while preparing`,{reason:`aborted`})}#t(){for(let e of this.candidates.values())e.object.status===`live`&&(e.staged=e.object.stageListeners(e.run.decls));for(let e of this.host.objects.values())e.status===`live`&&e.deferredRuntime&&this.deferred.set(e,e.stageListeners(e.decls))}async waitForRetirement(){let e=this.host,t=e.previous;if(t===void 0)return;let n=this.options.retireDeadline??5e3,r=()=>e.previous!==t;!await tA(e,()=>r()||e.retirable(),n)&&!r()&&(t.abort.abort(new I(`superseded`,`code version ${t.id} was retired`)),await tA(e,()=>r()||t.roots.size===0,Math.min(n,eA))),r()||e.retire()}load(){let e=new Set([...this.facets.map(e=>e.name),...this.options.remove??[]]),t=this.host.current.services;this.services=new Map([...t].filter(([,t])=>!e.has(t.facet)));for(let e of this.facets){let t=new AbortController;this.facetRuns.set(e.name,t),e.setup(this.host.facetApi(((t,n,r={})=>this.host.serveInto(this.services,xk(t,n,r,e.name))),t.signal))}for(let[e,n]of this.services)t.get(e)!==n&&this.changed.add(e);for(let e of t.keys())this.services.has(e)||this.removed.add(e);this.host.pending={id:this.host.nextCodeVersionId(this.codeVersion),services:this.services,tables:new Map,roots:new Map,abort:new AbortController}}async withDeadline(e,t){let n=this.options.gateDeadline??5e3,r,i=new Promise((e,i)=>{r=setTimeout(()=>i(new I(`aborted`,`${t} within ${n} ms`,{reason:`deadline`})),n)});try{return await Promise.race([e,i])}finally{clearTimeout(r)}}checkProviders(){for(let e of this.changed){let t=this.services.get(e).contract,n=this.host.current.services.get(e)?.contract;if(n===void 0||n.version!==t.version)continue;let r=wT(t.description,n.description);if(r!==void 0)throw new I(`contract_mismatch`,`${e}@${t.version} changed incompatibly without a version bump (${r})`)}let e=new Map(this.host.facets);for(let t of this.facets)e.set(t.name,t);for(let t of this.options.remove??[])e.delete(t);for(let t of e.values())for(let e of t.uses??[]){let t=this.services.get(e.name);t!==void 0&&this.changed.has(e.name)&&DT(t.contract,t.options.accepts,e)}}async prepareAll(){for(;;){let e=[...this.host.objects.values()].filter(e=>this.changed.has(e.typeName)&&!this.candidates.has(e)&&e.service!==this.services.get(e.typeName)&&(e.status===`live`||e.status===`activating`));if(e.length===0)return;await Promise.allSettled(e.map(e=>e.ready)),this.#e();for(let t of e)t.status===`live`&&t.service!==this.services.get(t.typeName)&&(await this.prepareObject(t),this.#e())}}async prepareObject(e){let t=this.services.get(e.typeName),n=e.run(t,e.decls),r={object:e,service:t,run:n,reasons:[],atGate:[],replaced:[],migrated:new Map,derived:new Map,staged:void 0};this.candidates.set(e,r);for(let[t,i]of n.decls.cells){if(e.decls.cells.get(t)!==i)continue;let a=e.decls.cellVersions.get(t)??1,o=n.decls.cellVersions.get(t)??1;if(o<a)throw Hw(`state`,`${e.address}: version of state ${t} lowered from ${a} to ${o}`);if(o>a)r.reasons.push(`state ${t} version ${a} -> ${o}`);else if(!Jw(i.schema,n.decls.cellSchemas.get(t)))throw Hw(`state`,`${e.address}: schema of state ${t} changed without a version bump`)}let i=new Set;for(let e of n.created.resources)(e.exclusive||e.deps.some(e=>i.has(e)))&&i.add(e);for(let t of i){r.atGate.push(t);let n=e.decls.resources.get(t.key);t.exclusive&&n?.exclusive&&n.state===`open`&&r.replaced.push(n)}i.size>0&&r.reasons.push(`exclusive resource replaced`),await e.open(n.created.resources.filter(e=>!i.has(e)),n.created.refs,this.abort.signal),await e.waitHydrated(n),r.reasons.length===0&&(await e.initCells(n,this.abort.signal),Jk(r))}checkRefs(){let e=new Set;for(let{object:t,run:n}of this.candidates.values())for(let r of t.decls.refs.values())[...n.decls.refs.values()].includes(r)||e.add(r);for(let t of this.host.objects.values()){let n=this.services.get(t.typeName);if(n!==void 0&&this.changed.has(t.typeName))for(let r of t.refs)r!==this.host.hostObjects.get(t.typeName)&&!e.has(r)&&r.owner!==`client`&&DT(n.contract,n.options.accepts,r.contract)}}entries(){return this.host.liveDecls(!0).filter(([e])=>!this.removed.has(e.typeName)).map(([e,t])=>[e,this.candidates.get(e)?.run.decls??t])}async gate(){this.gated=[...this.candidates.values()].filter(e=>e.reasons.length>0&&e.object.status===`live`);let e=this.gated.map(({object:e})=>{let t=new Set(e.leases.keys());return new Promise(n=>{e.gate={grandfathered:t,queue:[],drained:n},e.stopTasks(),t.size===0&&n()})}),t=this.options.gateDeadline??5e3,n,r=await Promise.race([Promise.all(e).then(()=>!1),new Promise(e=>{n=setTimeout(()=>e(!0),t)})]);if(clearTimeout(n),r){let e=this.gated.flatMap(({object:e})=>[...e.gate?.grandfathered??[]]);throw new I(`aborted`,`gate deadline (${t} ms) missed; blocking roots: ${e.join(`, `)}`,{reason:`gate_deadline`,details:{blocking:e}})}this.#e();for(let e of this.gated){let{object:t}=e;for(let n of e.replaced)this.closed.push([t,n]),await n.close(t.openOrder);await t.open(e.atGate,[],this.abort.signal),this.#e(),await t.initCells(e.run,this.abort.signal),this.#e()}for(let e of this.gated)this.migrate(e)}migrate(e){let{object:t,run:n}=e;for(let[r,i]of n.decls.cells){if(t.decls.cells.get(r)!==i)continue;let a=n.decls.cellSchemas.get(r),o=t.decls.cellVersions.get(r)??1,s=n.decls.cellMigrations.get(r),c;if((n.decls.cellVersions.get(r)??1)>o&&s!==void 0)c=s(structuredClone(i.value),o);else if(!Jw(i.schema,a))c=i.value;else continue;Yw(`state`,`${t.address}: migrated state ${r}`,a,c),e.migrated.set(i,c)}Jk(e)}async rollback(){if(this.rolledBack)return;this.rolledBack=!0,this.abort.abort(new I(`aborted`,`reload aborted`));for(let e of this.facetRuns.values())e.abort(new I(`aborted`,`reload aborted`));let e=e=>this.host.report(e);for(let e of this.candidates.values())e.staged?.discard();for(let e of this.deferred.values())e.discard();for(let{object:t,run:n}of this.candidates.values())t.pending.delete(n.decls),await t.unwind(n).catch(e);for(let[t,n]of this.closed)n.state===`closed`&&await n.open(new AbortController().signal,t.openOrder).catch(r=>{n.markUnavailable(),e(new I(`unavailable`,`${t.address}: resource ${n.key} could not be restored`,{cause:r}))});for(let{object:e}of this.gated)e.gate!==void 0&&(e.openGate(),e.startTasks());let t=new I(`gone`,`reload aborted; type not served`);for(let n of[...this.host.objects.values()])this.host.current.services.has(n.typeName)||await n.dispose(!0,t).catch(e);this.host.pending=void 0,this.host.gating=void 0}commit(e){try{return ik(()=>{let t=this.#r();e?.();for(let e of this.#n.splice(0))e();return t})}catch(e){throw this.host.fail(e),Xk(e)}}#n=[];#r(){let e=this.host,t=e.current,n=e.pending;e.pending=void 0,e.codeVersions.set(n.id,n),e.previous=t,e.current=n;let r=[];for(let i of[...e.objects.values()]){if(this.removed.has(i.typeName))continue;let e=this.candidates.get(i);if(e===void 0){let e=i.implementations.get(t.id);e!==void 0&&i.implementations.set(n.id,{...e,codeVersion:n.id})}else i.status===`live`&&(this.install(e,n.id),r.push(i.address))}for(let{object:t,run:n,staged:r}of this.candidates.values())t.status!==`live`&&(r?.discard(),t.pending.delete(n.decls),t.unwind(n).catch(t=>e.report(t)));for(let[e,t]of this.deferred)e.status===`live`?(e.deferredRuntime=!1,t.activate(),this.#n.push(()=>e.startTasks())):t.discard();e.installTables(n,this.tables,!0);let i=new I(`gone`,`type no longer served`);for(let t of[...e.objects.values()])this.removed.has(t.typeName)&&t.dispose(!0,i).catch(t=>e.report(t));for(let t of this.removed)e.hostObjects.delete(t);for(let t of this.facets)e.facets.set(t.name,t);for(let t of this.options.remove??[])e.facets.delete(t);for(let[t,n]of this.facetRuns)this.#n.push(()=>e.facetRunChanged(t,n));for(let t of this.options.remove??[])this.#n.push(()=>e.facetRunChanged(t,void 0));e.gating=void 0;for(let[t,n]of this.services){Sk(n)&&this.changed.has(t)&&e.hostObjects.get(t)?.object?.status!==`live`&&this.#n.push(()=>e.startHostObject(n));let r=e.hostObjects.get(t);!Sk(n)&&r!==void 0&&(e.hostObjects.delete(t),this.#n.push(()=>r.release()))}return{codeVersion:n.id,previous:t.id,changed:[...this.changed],removed:[...this.removed],prepared:r,gated:this.gated.map(({object:e})=>e.address)}}install(e,t){let{object:n,run:r,service:i}=e,a=e.reasons.length>0;if(n.pending.delete(r.decls),n.stopTasks(),a){let e=new Set(r.decls.derives.values());for(let t of n.decls.derives.values())e.has(t)||t.detach()}n.decls=r.decls,n.service=i;for(let[e,t]of r.decls.adopted)e.adopt(t);if(n.implementations.set(t,{codeVersion:t,service:i,implementation:r.implementation,decls:r.decls}),a){n.minCodeVersion=t;for(let e of[...n.implementations.keys()])e!==t&&this.host.retireImplementation(n,e)}n.refreshSchemas();for(let[t,n]of r.decls.cells){let i=r.decls.cellSchemas.get(t);e.migrated.has(n)?n.reset(e.migrated.get(n),i):n.schema=i}let o=new Set(r.created.derives);for(let t of r.created.derives)t.attach(e.derived);for(let e of r.decls.derives.values())o.has(e)||e.refresh();e.staged?.activate(),this.#n.push(()=>n.startTasks()),n.openGate();let s=this.host.hostObjects.get(n.typeName);if(s?.object===n&&s.contract.fingerprint!==i.contract.fingerprint){let e=new Bk(n,i.contract,`host`);n.addRef(e),this.host.hostObjects.set(n.typeName,e),s.release()}for(let e of[...n.refs]){if(e.owner===`client`)try{DT(i.contract,i.options.accepts,e.contract)}catch(t){e.gone(new I(`upgrade_required`,`${n.typeName} changed; reload the web facets`,{cause:t})),n.release(e);continue}e.shapeChanged()}}},rA=Sc({minimum:1}),iA=Lc({minLength:1}),aA=Sc({minimum:1}),oA=e=>fc(Wo(e)),sA=P({rootId:iA,codeVersion:Sc({minimum:1})}),cA=P({code:Os(zw),message:Lc(),reason:N(Lc())}),lA=P({remove:N(oA(Lc())),gateDeadline:N(Nc()),retireDeadline:N(Nc())}),uA=P({codeVersion:Sc(),previous:Sc(),changed:oA(Lc()),removed:oA(Lc()),prepared:oA(Lc()),gated:oA(Lc())}),dA=zc([P({t:F(`hello`),protocol:N(Sc({minimum:1})),name:iA,kind:zc([F(`host`),F(`client`)]),codeVersion:Sc({minimum:0}),acks:N(yc())}),P({t:F(`ack`),n:Sc({minimum:1})}),P({t:F(`hold`),id:rA,at:iA,token:_T,input:hs(),principal:N(hs()),origin:N(iA),state:N(F(!1)),again:N(F(!0))}),P({t:F(`release`),id:rA}),P({t:F(`shape`),id:rA,variant:N(Lc()),members:oA(Lc()),contract:Lc(),state:oA(iA)}),P({t:F(`gone`),id:rA,error:cA}),P({t:F(`call`),id:rA,hold:rA,member:iA,args:N(hs()),root:N(sA)}),P({t:F(`result`),id:rA,value:N(hs()),error:N(cA)}),P({t:F(`cancel`),id:rA}),P({t:F(`sub`),hold:rA}),P({t:F(`unsub`),hold:rA}),P({t:F(`resync`),hold:rA,m:iA}),P({t:F(`state`),hold:rA,m:iA,as:zc([F(`snap`),F(`reset`),F(`ops`),F(`error`)]),value:N(hs()),ops:N(oA(oA(hs()))),error:N(cA)}),P({t:F(`ping`),n:Sc()}),P({t:F(`pong`),n:Sc()}),P({t:F(`bye`),reason:N(Lc())}),P({t:F(`root_end`),rootId:iA}),P({t:F(`invalidate`),pattern:mu(Lc(),hs())}),P({t:F(`prepare`),reload:aA,codeVersion:Sc({minimum:1}),plugins:oA(Lc()),options:lA}),P({t:F(`vote`),reload:aA,error:N(cA),report:N(uA)}),P({t:F(`commit`),reload:aA}),P({t:F(`retire`),codeVersion:Sc({minimum:1})}),P({t:F(`abort`),reload:aA})]),fA=e=>sw(dA,e);function pA(e){return e instanceof I?e.reason===void 0?{code:e.code,message:e.message}:{code:e.code,message:e.message,reason:e.reason}:{code:`unavailable`,message:e instanceof Error?e.message:String(e)}}var mA=e=>new I(e.code,e.message.replace(/^[a-z_]+(\/[a-z_]+)?: /,``),{reason:e.reason}),hA=0,gA=(e,t)=>{let n;for(let r of Object.entries(e??{}))t?.startsWith(r[0])&&(n===void 0||r[0].length>n[0].length)&&(n=r);return[...n?.[1]??[]]};function _A(e,t,n){let r;return new Promise((i,a)=>{e.votes.set(t,{resolve:i,reject:a}),r=setTimeout(()=>{e.votes.delete(t),a(new I(`aborted`,`votes missing after ${n} ms`,{reason:`vote_deadline`}))},n)}).finally(()=>clearTimeout(r))}async function vA(e,t,n){let r=[...e.connections].filter(e=>e.role===`downstream`&&e.peer.kind===`host`&&e.open&&e.synced),i=e.peekNextCodeVersion(),a=await Qk(e,t,n,i);try{await a.waitForRetirement();let t=r.filter(e=>e.open),o=++hA,s=n.voteDeadline??(n.gateDeadline??5e3)+(n.retireDeadline??5e3)+5e3,c=t.map(e=>{let t=e.name??`child`,r=_A(e,o,s);return e.send({t:`prepare`,reload:o,codeVersion:i,plugins:gA(n.remote,t),options:{remove:gA(n.remoteRemove,t),gateDeadline:n.gateDeadline,retireDeadline:n.retireDeadline}}),r.then(e=>[t,e],e=>{let n=Xk(e);throw new I(n.code,`${t}: ${n.message}`,{cause:n,reason:n.reason})})}),l=!1,u=await Promise.allSettled([a.prepare().then(()=>{l=!0}),...c]),d=u.find(e=>e.status===`rejected`);if(d!==void 0){for(let e of t)e.votes.delete(o),e.send({t:`abort`,reload:o});throw l&&await a.rollback(),d.reason}let f=a.commit(()=>{for(let e of t)e.send({t:`commit`,reload:o}),e.peerCodeVersion=i});e.rememberRemoteModules(n.remote,n.remoteRemove);let p={};for(let e of u.slice(1)){if(e.status!==`fulfilled`)continue;let[t,n]=e.value;n!==void 0&&(p[t]=n)}return{...f,children:p}}finally{$k(e)}}async function yA(e,t){for(;;){if(!t.open)return;if(e.reloading){await e.whenReloadEnded();continue}let n=e.current.id;if(t.peerCodeVersion===n){t.markSynced(n),e.announceRetired(t);return}e.announceRetired(t);let r=++hA,i=_A(t,r,3e4);t.send({t:`prepare`,reload:r,codeVersion:n,plugins:gA(e.remoteModules,t.name),options:{remove:gA(e.remoteRemoved,t.name)}}),await i,e.current.id===n?(t.send({t:`commit`,reload:r}),t.peerCodeVersion=n):t.send({t:`abort`,reload:r})}}var bA=class{#e;#t;constructor(e){this.#e=e}handle(e,t){if(t.t===`prepare`){if(this.#t!==void 0){let n=new I(`unavailable`,`a reload is already running`,{reason:`reload_running`});e.send({t:`vote`,reload:t.reload,error:pA(n)});return}let n={id:t.reload,reload:void 0,state:`loading`,cancelled:!1};this.#t=n,this.#r(n,e,t).catch(e=>this.#e.report(e));return}let n=this.#t;if(n!==void 0&&n.id===t.reload){if(t.t===`abort`)this.#n(n);else if(n.state===`prepared`){this.#t=void 0;try{n.reload?.commit()}finally{$k(this.#e)}}}}parentLost(){this.#t!==void 0&&this.#n(this.#t)}#n(e){e.cancelled=!0,e.state===`prepared`?(this.#t=void 0,e.reload?.rollback().catch(e=>this.#e.report(e)).finally(()=>$k(this.#e))):e.reload?.rollback().catch(e=>this.#e.report(e))}async#r(e,t,n){let r=()=>new I(`aborted`,`reload aborted by the server`,{reason:`aborted`});try{if(e.reload=await Qk(this.#e,n.plugins,n.options,n.codeVersion),e.cancelled||(e.state=`preparing`,await e.reload.prepare(),e.cancelled))throw r();e.state=`prepared`,t.send({t:`vote`,reload:n.reload,report:e.reload.summary()})}catch(r){e.reload!==void 0&&(await e.reload.rollback().catch(e=>this.#e.report(e)),$k(this.#e)),this.#t===e&&(this.#t=void 0),e.cancelled||t.send({t:`vote`,reload:n.reload,error:pA(r)})}}},xA=class{#e;#t=[];#n=new Set;#r=!1;#i;get closed(){return this.#r}send(e){if(!this.#r)return this.transmit(e)}receive(e){this.#e=e;for(let t of this.#t.splice(0))e(t)}onClose(e){this.#r?e(`closed`):this.#n.add(e)}close(e=`closed`){if(!this.#r){try{this.transmit({t:`bye`,reason:e})}catch{}this.ended(e)}}deliver(e){this.#i===void 0?this.#a(e):this.deliverLater(Promise.resolve(e))}deliverLater(e){let t=(this.#i??Promise.resolve()).then(()=>e).then(e=>this.#a(e),()=>this.close(`protocol error`)).finally(()=>{this.#i===t&&(this.#i=void 0)});this.#i=t}#a(e){this.#r||(e.t===`bye`?this.ended(e.reason??`peer closed`):this.#e===void 0?this.#t.push(e):this.#e(e))}ended(e){if(!this.#r){this.#r=!0,this.#t=[];try{this.shutdown()}finally{for(let t of this.#n)t(e);this.#n.clear()}}}},SA=globalThis.process?.getBuiltinModule?.(`node:zlib`),CA=class{bytes;constructor(e){this.bytes=e}};function wA(e){if(!(e instanceof CA))return e;if(SA===void 0)throw TypeError(`packed payload without zlib`);return JSON.parse(SA.inflateRawSync(e.bytes).toString(`utf8`))}var TA=new Set([`args`,`value`]);function EA(e){if(e.t===`call`)return e.args===void 0?void 0:`args`;if(e.t===`result`||e.t===`state`)return e.value===void 0?void 0:`value`}function DA(e,t){let n={...e};return delete n[t],n}function OA(e,t,n){if(e instanceof CA)return e.bytes;if(!(!t||SA===void 0||n===void 0||n.length<=65536))return SA.deflateRawSync(n,{level:1})}function kA(e){if(typeof e!=`object`||!e||!(`z`in e))return e;let{z:t,...n}=e;if(!Array.isArray(t)||!TA.has(t[0])||typeof t[1]!=`string`)throw TypeError(`bad packed payload`);return{...n,[t[0]]:new CA(Buffer.from(t[1],`base64`))}}var AA=new TextEncoder,jA=new TextDecoder;function MA(e,t){let n=EA(e);if(n===void 0)return JSON.stringify(e);let r=e[n],i=r instanceof CA?void 0:JSON.stringify(r),a=OA(r,t,i),o=DA(e,n);if(a===void 0)return`${JSON.stringify(o).slice(0,-1)},${JSON.stringify(n)}:${i}}`;let s=AA.encode(JSON.stringify({...o,z:n})),c=new Uint8Array(4+s.byteLength+a.byteLength);return new DataView(c.buffer).setUint32(0,s.byteLength),c.set(s,4),c.set(a,4+s.byteLength),c}function NA(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(0),n=JSON.parse(jA.decode(e.subarray(4,4+t)));if(typeof n!=`object`||!n)throw TypeError(`bad envelope`);let{z:r,...i}=n;if(typeof r!=`string`||!TA.has(r))throw TypeError(`bad packed payload`);return{envelope:i,field:r,bytes:e.slice(4+t)}}async function PA(e){let t=new Blob([e]).stream().pipeThrough(new DecompressionStream(`deflate-raw`));return JSON.parse(await new Response(t).text())}function FA(e){let t=kA(JSON.parse(e));if(typeof t!=`object`||!t||typeof t.t!=`string`)throw TypeError(`not a frame`);return t}var IA=1,LA=class extends xA{#e;#t;#n=[];constructor(e,t={}){super(),this.#e=e,this.#t=t.compress??!1;let n=t.acceptPacked??!0;`binaryType`in e&&(e.binaryType=`arraybuffer`),e.addEventListener(`open`,()=>{for(let t of this.#n.splice(0))e.send(t)}),e.addEventListener(`message`,e=>{try{let t=e.data;if(typeof t==`string`){this.deliver(FA(t));return}if(!n)throw TypeError(`packed frames are not accepted`);let r=t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):void 0;if(r===void 0)throw TypeError(`unknown message type`);let{envelope:i,field:a,bytes:o}=NA(r);SA===void 0?this.deliverLater(PA(o).then(e=>({...i,[a]:e}))):this.deliver({...i,[a]:new CA(o)})}catch{this.close(`protocol error`)}}),e.addEventListener(`close`,()=>this.ended(`socket closed`))}transmit(e){let t=MA(e,this.#t);return this.#e.readyState===IA?this.#e.send(t):this.#n.push(t),typeof t==`string`?t.length:t.byteLength}shutdown(){this.#n=[],this.#e.readyState<=IA&&this.#e.close(1e3)}},RA=(e,t)=>new LA(e,t),zA=262144,BA=4,VA=e=>new I(`unavailable`,e),HA=class{origin;frame;principal;originTag;generation;down;downId=0;closed=!1;stateWanted;urgent;#e=!1;awaiting=new Set;calls=new Map;#t=new Set;constructor(e,t,n,r){this.origin=e,this.frame=t,this.principal=n,this.originTag=r,this.stateWanted=t.state!==!1,this.generation=e.generation}get originId(){return this.frame.id}get client(){return this.originTag!==void 0}get current(){return!this.closed&&this.origin.open&&this.origin.generation===this.generation}ready(){return this.closed?Promise.reject(new I(`gone`,`relayed hold closed`)):this.down===void 0?new Promise((e,t)=>{this.#t.add({resolve:e,reject:t})}):Promise.resolve(this.down)}open(e){if(this.closed)return;this.down=e,this.downId=e.nextId(),e.relayedRefs.set(this.downId,this);let{at:t,token:n,input:r}=this.frame;e.send({t:`hold`,id:this.downId,at:t,token:n,input:r,principal:this.principal,...this.originTag===void 0?{}:{origin:this.originTag},...this.stateWanted?{}:{state:!1},...this.frame.again===!0?{again:!0}:{}});for(let t of this.#t)t.resolve(e);this.#t.clear()}wantState(e){this.closed||e===this.stateWanted||(this.stateWanted=e,e||(this.origin.dropHoldState(this.originId),this.awaiting.clear()),this.down?.send({t:e?`sub`:`unsub`,hold:this.downId}))}resync(e){this.closed||(this.awaiting.add(e),this.down?.send({t:`resync`,hold:this.downId,m:e}))}shape(e){this.closed||(this.#e||(this.#e=!0,this.frame.again!==!0&&(this.urgent=new Set(e.state))),this.origin.send({...e,id:this.originId}))}state(e){if(this.closed)return;let t=e.m;if(this.awaiting.has(t)){if(e.as===`ops`)return;this.awaiting.delete(t)}let n={...e,hold:this.originId};this.urgent?.delete(t)===!0?this.origin.send(n):this.origin.sendState(n,{resync:()=>this.resync(t)})}close(e,t){if(!this.closed){this.closed=!0;for(let n of[...this.calls.values()])n.cancel(e,t.releaseDown);this.origin.dropHoldState(this.originId),this.origin.served.get(this.originId)?.kind===`relay`&&this.origin.served.delete(this.originId),this.down!==void 0&&(this.down.relayedRefs.delete(this.downId),t.releaseDown&&this.down.send({t:`release`,id:this.downId}));for(let t of this.#t)t.reject(e);this.#t.clear(),t.notify&&this.origin.send({t:`gone`,id:this.originId,error:pA(e)})}}},UA=class{relay;originId;downId;#e;#t=!1;constructor(e,t,n,r){this.relay=e,this.originId=t,this.downId=n,this.#e=r,e.calls.set(t,this),e.down?.relayedCalls.set(n,this)}finish(e,t){this.#t||(this.#t=!0,this.relay.calls.delete(this.originId),this.relay.down?.relayedCalls.delete(this.downId),e===void 0?this.#e.resolve(t):this.#e.reject(e))}cancel(e,t){this.#t||(t&&this.relay.down?.send({t:`cancel`,id:this.downId}),this.finish(e))}},WA=class{host;link;role;peer;originId;principal;restamp;generation=0;peerCodeVersion;synced;fencedCodeVersions=new Set;#e=new Map;#t;#n=new Set;#r=1;#i=Date.now();#a;#o;#s;#c;#l;#u=0;#d=0;#f=[];#p=0;#m=new Map;#h=0;#g=0;#_;#v;#y=!1;remotes=new Map;calls=new Map;served=new Map;incoming=new Map;relayedRefs=new Map;relayedCalls=new Map;votes=new Map;constructor(e,t,n){this.host=e,this.link=t,this.role=n.role,this.peer=n.peer,this.originId=n.originId,this.principal=n.principal,this.restamp=n.restamp,this.synced=this.role!==`downstream`||this.peer.kind!==`host`,this.#s=n.window??zA,this.#c=n.pendingCap??this.#s*BA,this.#o=n.maxCalls??1/0,this.#v=n.onProtocolMismatch,t.onClose(e=>this.#Q(e)),t.receive(e=>this.#A(e)),this.send({t:`hello`,protocol:4,name:e.name,kind:e.kind,codeVersion:e.current.id,acks:!0});let r=n.pingInterval??15e3,i=n.pingTimeout??45e3;if(t.closed)return;let a=0;this.#a=setInterval(()=>{Date.now()-this.#i>i?t.close(`ping timeout`):this.send({t:`ping`,n:++a})},r),this.#a.unref?.()}get open(){return!this.link.closed}get name(){return this.role===`upstream`?this.#t:this.peer.name}send(e){let t=this.link.send(e)??0;this.#l!==!1&&(this.#u++,this.#f.push(t),this.#p+=t)}sendState(e,t){let n=GA(e.hold,e.m),r=this.#m.get(n);if(r===void 0&&!this.#w){this.send(e);return}if(r?.kind===`unit`)return;if(r===void 0&&(r={kind:`state`,hold:e.hold,m:e.m,base:void 0,ops:[],size:0,lazy:!1,overflow:t},this.#m.set(n,r)),e.as!==`ops`){this.#h-=r.size,r.base=e,r.ops=[],r.size=0,r.lazy=!1;return}if(r.lazy)return;let i=JSON.stringify(e.ops).length;if(this.#h+i>this.#c&&this.#b(i,r),!(r.lazy||this.#m.get(n)!==r)){for(let t of e.ops??[])r.ops.push(t);r.size+=i,this.#h+=i}}#b(e,t){for(let n of[...this.#m.values()]){if(this.#h+e<=this.#c)return;n.kind===`state`&&n!==t&&n.size>0&&this.#x(n)}this.#h+e>this.#c&&this.#x(t)}#x(e){this.#h-=e.size,e.base=void 0,e.ops=[],e.size=0,`resend`in e.overflow?e.lazy=!0:(this.#m.delete(GA(e.hold,e.m)),e.overflow.resync())}#S(e,t,n){let r=GA(e,t),i=this.#m.get(r);i?.kind!==`unit`&&(i===void 0?(i={kind:`state`,hold:e,m:t,base:void 0,ops:[],size:0,lazy:!0,overflow:{resend:n}},this.#m.set(r,i)):(this.#h-=i.size,i.base=void 0,i.ops=[],i.size=0,i.lazy=!0),this.#E())}#C(e,t){let n=KA(e);this.#m.has(n)||this.#m.set(n,{kind:`unit`,hold:e,flush:t}),this.#E()}dropState(e,t){let n=this.#m.get(GA(e,t));n?.kind===`state`&&(this.#h-=n.size,this.#m.delete(GA(e,t)))}dropHoldState(e){for(let[t,n]of this.#m)n.hold===e&&(n.kind===`state`&&(this.#h-=n.size),this.#m.delete(t))}get waiting(){return{slots:this.#m.size,bytes:this.#h}}get#w(){return this.#l===!0&&this.#p>=this.#s}#T(e){if(this.#l!==!0||e<this.#d||e>this.#u)this.#k(`ack ${e} outside ${this.#d}..${this.#u}`);else{for(let t of this.#f.splice(0,e-this.#d))this.#p-=t;this.#d=e,this.#E()}}#E(){for(let[e,t]of this.#m){if(this.#w)return;this.#m.delete(e),t.kind===`unit`?t.flush():(this.#h-=t.size,t.lazy?`resend`in t.overflow&&t.overflow.resend():(t.base!==void 0&&this.send(t.base),t.ops.length>0&&this.send({t:`state`,hold:t.hold,m:t.m,as:`ops`,ops:t.ops})))}}#D(){this.#l===!0&&this.#_===void 0&&this.open&&(this.#_=setTimeout(()=>{this.#_=void 0,this.link.send({t:`ack`,n:this.#g})},0),this.#_.unref?.())}nextId(){return this.#r++}whenSynced(){return this.open?this.synced?Promise.resolve():new Promise((e,t)=>this.#n.add({resolve:e,reject:t})):Promise.reject(VA(`link to ${this.name??`peer`} closed`))}markSynced(e){this.peerCodeVersion=e,this.synced=!0;for(let e of this.#n)e.resolve(void 0);this.#n.clear()}revoke(e){this.generation++;let t=new I(`gone`,`principal invalidated`);for(let e of[...this.served.values()])e.kind===`relay`&&e.relay.close(t,{releaseDown:!0,notify:!0});e===void 0?this.link.close(`principal invalidated`):this.principal=e}#O(e,t=!0){if(!this.#y){this.#y=!0;try{this.#v?.({local:4,peer:e})}catch(e){this.host.report(e)}t&&this.link.close(`protocol-version 4`)}}#k(e){this.host.report(new I(`invalid`,`link to ${this.name??`peer`}: ${e}`,{reason:`protocol`})),this.link.close(`protocol error: ${e}`)}hold(e,t){let n=this.nextId();this.remotes.set(n,e),e.bound(this,n);let r=e.principal;return this.send({t:`hold`,id:n,at:e.at,token:e.contract.description,input:e.input,...r===void 0?{}:{principal:r},...e.stateOn?{}:{state:!1},...t?{again:!0}:{}}),n}release(e){this.remotes.delete(e),this.send({t:`release`,id:e})}wantState(e,t){this.remotes.has(e)&&this.send({t:t?`sub`:`unsub`,hold:e})}call(e,t,n,r,i){let a=this.nextId();return new Promise((o,s)=>{if(i.aborted){s(new I(`aborted`,`call aborted`));return}let c=()=>{this.calls.delete(a),this.send({t:`cancel`,id:a}),s(new I(`aborted`,`call aborted`,{cause:i.reason}))};i.addEventListener(`abort`,c,{once:!0});let l=()=>i.removeEventListener(`abort`,c);this.calls.set(a,{resolve:e=>{l(),o(e)},reject:e=>{l(),s(e)}});let u=r!==void 0&&this.host.kind===`host`;u&&this.host.rootSent(r.rootId,this),this.send({t:`call`,id:a,hold:e,member:t,args:n,...u?{root:r}:{}})})}#A(e){if(!this.#y){if(this.#i=Date.now(),!fA(e))this.#k(`malformed frame`);else if(e.t===`ack`)this.#T(e.n);else{this.#g++;try{this.#j(e)}catch(e){this.host.report(e)}this.#D()}}}#j(e){switch(e.t){case`hello`:this.#M(e);return;case`ping`:this.send({t:`pong`,n:e.n});return;case`pong`:case`bye`:case`ack`:return;case`hold`:this.#F(e);return;case`release`:this.#K(e.id,!0);return;case`call`:this.#q(e);return;case`cancel`:this.incoming.get(e.id)?.abort(new I(`aborted`,`cancelled by caller`));return;case`sub`:case`unsub`:this.#W(e.hold,e.t===`sub`);return;case`resync`:this.#G(e.hold,e.m);return;case`shape`:case`gone`:this.#Y(e);return;case`result`:this.#X(e);return;case`state`:this.#Z(e);return;case`root_end`:this.#e.delete(e.rootId),this.host.foreignRootEnded(e.rootId,this);return;case`invalidate`:case`prepare`:case`commit`:case`abort`:case`retire`:if(this.role!==`upstream`){this.#k(`${e.t} from a child`);return}e.t===`invalidate`?this.host.invalidatePrincipal(e.pattern).catch(e=>this.host.report(e)):e.t===`retire`?this.host.allowRetire(e.codeVersion):this.host.onReloadFrame(this,e);return;case`vote`:{if(this.role!==`downstream`||this.peer.kind!==`host`){this.#k(`vote from a non-participant`);return}let t=this.votes.get(e.reload);this.votes.delete(e.reload),e.error===void 0?t?.resolve(e.report):t?.reject(mA(e.error));return}}}#M(e){if((e.protocol??1)!==4)this.#O(e.protocol??1);else if(this.#l===void 0&&(this.#l=e.acks===!0,this.#l||(this.#f=[],this.#p=0)),this.role===`upstream`){if(e.kind!==`host`){this.#k(`parent is not a host`);return}this.#t??=e.name}else e.kind!==this.peer.kind||this.peer.name!==void 0&&e.name!==this.peer.name?this.#k(`hello ${e.kind} ${e.name} does not match the accepted ${this.peer.kind} ${this.peer.name??``}`):this.peer.kind===`host`&&this.host.peerHello(this,e.codeVersion)}#N(e){return this.role===`downstream`?this.principal:e.principal??this.principal}#P(e){return this.role===`downstream`?this.originId:e.origin}#F(e){if(this.served.has(e.id)){this.#k(`duplicate hold id ${e.id}`);return}let t=this.#N(e),n=this.#P(e),r=n!==void 0;if(e.at!==this.host.name){if(this.role===`upstream`){this.send({t:`gone`,id:e.id,error:pA(VA(`${this.host.name} does not relay`))});return}let r=new HA(this,e,t,n);this.served.set(e.id,{kind:`relay`,relay:r}),this.host.relay(r).catch(e=>r.close(e,{releaseDown:!0,notify:!0}));return}let i;try{let n=CT(e.token);if(n.scope!==`remote`)throw Hw(`token`,`${n.name} is local; only remote types cross links`);if(dT(n.name,n.description.host,e.input)!==this.host.name)throw Hw(`placement`,`${n.name} with this input does not live on ${this.host.name}`);let a=this.host.acquire(n,e.input,{principal:t},r?`client`:`connection`);if(!(a instanceof Bk))throw VA(`not a local reference`);i=a}catch(t){this.send({t:`gone`,id:e.id,error:pA(r?YA(t):t)});return}let a={kind:`local`,id:e.id,ref:i,principal:t,origin:n,wantsState:e.state!==!1,again:e.again===!0,unitSent:!1,feeds:new Map};this.served.set(e.id,a),i.onShape(()=>this.#L(a)),i.goneListeners.add(t=>{this.served.get(e.id)===a&&(this.#K(e.id,!1),this.send({t:`gone`,id:e.id,error:pA(t)}))}),i.status===`live`&&this.#L(a)}#I(e,t){return t.members.filter(n=>e.describe(t.variant,n)?.kind===`state`)}#L(e){if(this.served.get(e.id)!==e)return;let t=e.ref.shape;if(t===void 0)return;let n=new Set(e.wantsState?this.#I(e.ref,t):[]);for(let[t,r]of e.feeds)n.has(t)||(r.unsubscribe(),e.feeds.delete(t),this.dropState(e.id,t));e.feeds.size===0&&(!e.again||e.unitSent)?this.#R(e):this.#C(e.id,()=>this.#R(e))}#R(e){if(this.#m.delete(KA(e.id)),this.served.get(e.id)!==e)return;let t=e.ref.shape;if(t===void 0)return;e.unitSent=!0;let n=(e.wantsState?this.#I(e.ref,t):[]).filter(t=>!e.feeds.has(t)),r=[],i=[];for(let t of n){let n=this.#z(e,t);n!==void 0&&(r.push(n.frame),i.push([t,n.feed]))}this.send({t:`shape`,id:e.id,...t.variant===void 0?{}:{variant:t.variant},members:t.members,contract:t.contract,state:r.map(e=>e.m)});for(let e of r)this.send(e);for(let[t,n]of i)this.#B(e,t,n)}#z(e,t,n=`snap`){let r=e.ref.member(t);if(r===void 0||typeof r.events!=`function`)return;let i={unsubscribe:()=>{},encoder:QO(),buffer:[]},a;return i.unsubscribe=r.events(n=>{a===void 0?a=n:i.buffer===void 0?this.#H(e,t,i,n):i.buffer.push(n)}),e.feeds.set(t,i),{frame:this.#V(e,t,n,a?.value),feed:i}}#B(e,t,n){let r=n.buffer??[];n.buffer=void 0;for(let i of r)this.#H(e,t,n,i)}#V(e,t,n,r){try{JA(e.ref,t,r)}catch(n){return{t:`state`,hold:e.id,m:t,as:`error`,error:pA(n)}}return{t:`state`,hold:e.id,m:t,as:n,...r===void 0?{}:{value:r}}}#H(e,t,n,r){if(e.feeds.get(t)!==n)return;let i={resend:()=>this.#U(e,t)};r.type===`ops`?this.sendState({t:`state`,hold:e.id,m:t,as:`ops`,ops:n.encoder.encode(r.ops)},i):(n.encoder=QO(),this.sendState(this.#V(e,t,`reset`,r.value),i))}#U(e,t){let n=e.feeds.get(t);if(n===void 0||this.served.get(e.id)!==e)return;n.unsubscribe(),e.feeds.delete(t);let r=this.#z(e,t,`reset`);r!==void 0&&(this.send(r.frame),this.#B(e,t,r.feed))}#W(e,t){let n=this.served.get(e);if(n!==void 0){if(n.kind===`relay`)n.relay.wantState(t);else if(n.wantsState!==t){if(n.wantsState=t,t)this.#L(n);else{for(let e of n.feeds.values())e.unsubscribe();n.feeds.clear(),this.dropHoldState(e)}}}}#G(e,t){let n=this.served.get(e);n!==void 0&&(n.kind===`relay`?n.relay.resync(t):n.feeds.has(t)&&this.#S(e,t,()=>this.#U(n,t)))}#K(e,t){let n=this.served.get(e);if(n!==void 0){if(this.served.delete(e),n.kind===`relay`)n.relay.close(new I(`released`,`relayed hold released`),{releaseDown:t,notify:!1});else{for(let e of n.feeds.values())e.unsubscribe();n.feeds.clear(),this.dropHoldState(e),t&&n.ref.release()}}}#q(e){if(this.incoming.has(e.id)){this.#k(`duplicate call id ${e.id}`);return}if(this.incoming.size>=this.#o){let t=new I(`unavailable`,`Too many calls in progress on this connection (${this.#o}); wait for earlier ones to finish`,{reason:`too_many_calls`});this.send({t:`result`,id:e.id,error:pA(t)});return}let t=this.served.get(e.hold);if(t===void 0){this.send({t:`result`,id:e.id,error:pA(new I(`gone`,`unknown hold`))});return}let n=new AbortController;this.incoming.set(e.id,n);let r=this.peer.kind===`host`?this.#J(e.root):void 0,i={principal:t.kind===`local`?t.principal:t.relay.principal,signal:n.signal},a=t.kind===`local`?n=>t.ref.object.call(t.ref,e.member,wA(e.args),n):n=>qA(t.relay,e,{rootId:n.rootId,codeVersion:n.codeVersion},n.signal,this.host);(r===void 0?this.host.root(a,i):this.host.joinRoot(r.rootId,r.codeVersion,a,{...i,from:this})).then(t=>this.send({t:`result`,id:e.id,value:t}),t=>this.send({t:`result`,id:e.id,error:pA(t)})).finally(()=>this.incoming.delete(e.id))}#J(e){if(e===void 0||this.role!==`downstream`||!this.fencedCodeVersions.has(e.codeVersion)||this.host.hasCodeVersion(e.codeVersion))return e;let t=this.#e.get(e.rootId);return t===void 0&&(t=this.host.current.id,this.#e.set(e.rootId,t)),{rootId:e.rootId,codeVersion:t}}#Y(e){let t=this.relayedRefs.get(e.id);if(t!==void 0){e.t===`gone`?t.close(mA(e.error),{releaseDown:!1,notify:!0}):t.shape(e);return}let n=this.remotes.get(e.id);n!==void 0&&(e.t===`gone`?(this.remotes.delete(e.id),n.gone(mA(e.error))):n.shaped({variant:e.variant,members:e.members,contract:e.contract},e.state))}#X(e){let t=this.relayedCalls.get(e.id);if(t!==void 0){t.finish(e.error===void 0?void 0:mA(e.error),e.value);return}let n=this.calls.get(e.id);if(this.calls.delete(e.id),e.error!==void 0){n?.reject(mA(e.error));return}let r;try{r=wA(e.value)}catch(e){n?.reject(e);return}n?.resolve(r)}#Z(e){let t=this.relayedRefs.get(e.hold);if(t!==void 0){t.state(e);return}let n=this.remotes.get(e.hold);if(n===void 0)return;if(!(e.value instanceof CA)){n.state(e.m,e);return}let r;try{r=wA(e.value)}catch(t){n.state(e.m,{as:`error`,error:pA(t)});return}n.state(e.m,{...e,value:r})}#Q(e){let t=/^protocol-version (\d+)$/.exec(e);t!==null&&Number(t[1])!==4&&this.#O(Number(t[1]),!1),this.#a!==void 0&&clearInterval(this.#a),this.#_!==void 0&&clearTimeout(this.#_),this.#m.clear(),this.#h=0;let n=VA(`link to ${this.name??`peer`} closed: ${e}`);for(let e of[...this.served.keys()])this.#K(e,!0);for(let e of this.incoming.values())e.abort(n);this.incoming.clear();for(let e of this.calls.values())e.reject(n);this.calls.clear();for(let e of this.votes.values())e.reject(n);this.votes.clear();for(let e of this.#n)e.reject(n);this.#n.clear();for(let e of[...this.relayedRefs.values()])e.close(n,{releaseDown:!1,notify:!0});this.relayedRefs.clear(),this.relayedCalls.clear();let r=[...this.remotes.values()];this.remotes.clear();for(let e of r)this.role===`upstream`?e.detached():e.gone(n);this.host.connectionClosed(this)}},GA=(e,t)=>`s${e}\u0000${t}`,KA=e=>`u${e}`;async function qA(e,t,n,r,i){let a=()=>new I(`aborted`,`call cancelled`,{cause:r.reason});if(r.aborted)throw a();let o=()=>{},s=()=>{},c=new Promise((e,t)=>{o=()=>t(a()),r.addEventListener(`abort`,o,{once:!0})});c.catch(()=>{});try{let o=await Promise.race([e.ready(),c]);if(e.closed)throw new I(`gone`,`relayed hold closed`);return await new Promise((c,l)=>{let u=new UA(e,t.id,o.nextId(),{resolve:c,reject:l});s=()=>u.cancel(a(),!0),r.addEventListener(`abort`,s,{once:!0}),i.rootSent(n.rootId,o),o.send({t:`call`,id:u.downId,hold:e.downId,member:t.member,args:t.args,root:n})})}finally{r.removeEventListener(`abort`,o),r.removeEventListener(`abort`,s)}}function JA(e,t,n){if(n===void 0)return;let r=e.object.currentInstalled();if(r===void 0)return;let i=e.currentView(),a=Vk(i===void 0?r.implementation:i),o=i!==void 0&&i!==r.implementation?e.contract.description.variants[a??``]?.[t]:r.service.contract.description.variants[Vk(r.implementation)??``]?.[t];o?.kind===`state`&&Yw(`state`,`${e.address}.${t}`,o.schema,n)}function YA(e){return e instanceof I&&e.code===`contract_mismatch`?new I(`upgrade_required`,e.message,{cause:e}):e}var XA=()=>{};function ZA(){let e=XA,t=XA,n=new Promise((n,r)=>{e=n,t=r});return n.catch(XA),{promise:n,resolve:e,reject:t}}var QA=class{host;key;contract;at;input;principal;status=`loading`;error;shape;hydrated=!1;hold;stateOn=!1;views=new Set;members=new Map;lingerTimer;#e=new Map;#t;#n=ZA();#r=!1;#i=new Set;constructor(e,t){this.host=e,this.key=t.key,this.contract=t.contract,this.at=t.at,this.input=t.input,this.principal=t.principal}get ended(){return this.status===`ended`}get stateViews(){let e=0;for(let t of this.views)t.wantsState&&e++;return e}get wantsState(){return this.views.size===0?this.stateOn:this.stateViews>0}get applied(){return this.#r}addView(e){this.views.add(e),this.lingerTimer!==void 0&&(clearTimeout(this.lingerTimer),this.lingerTimer=void 0),this.#a(),e.update()}removeView(e){if(this.views.delete(e)){for(let t of this.#e.values())for(let n of t)n.view===e&&t.delete(n);this.views.size===0?this.host.bindingIdle(this):this.#a()}}#a(){if(this.ended||this.views.size===0)return;let e=this.stateViews>0;if(e!==this.stateOn){this.stateOn=e,e||(this.hydrated=!1,this.members.clear(),this.#t!==void 0&&this.#t.missing.clear()),this.hold!==void 0&&this.hold.channel.wantState(this.hold.id,e);for(let e of this.views)e.update()}}listen(e,t){let n=this.#e.get(e);n===void 0&&(n=new Set,this.#e.set(e,n)),n.add(t)}unlisten(e,t){this.#e.get(e)?.delete(t)}inVariant(e){let t=this.shape?.variant;return t!==void 0&&this.contract.description.variants[t]?.[e]?.kind===`state`}read(e){if(this.status===`ended`)throw this.terminalError();if(!this.hydrated)throw new I(`not_ready`,`${this.key}.${e} is not hydrated yet`);if(!this.inVariant(e))throw new I(`not_in_variant`,`${this.key}: ${e} is not a state member of variant ${this.shape?.variant}`);return this.members.get(e)?.value}whenHydrated(){return this.hydrated?Promise.resolve():this.ended?Promise.reject(this.terminalError()):new Promise((e,t)=>this.#i.add({resolve:e,reject:t}))}#o(e){let t=[...this.#i];this.#i.clear();for(let n of t)e===void 0?n.resolve():n.reject(e)}readable(e){return this.status!==`ended`&&this.hydrated&&this.inVariant(e)}terminalError(){return this.error??new I(`released`,`reference ${this.key} released`)}bound(e,t){this.hold={channel:e,id:t},this.stateOn=this.wantsState}shaped(e,t){if(this.ended)return;let n=this.#t,r=new Set(t);if(n!==void 0)for(let e of n.missing)r.add(e);let i=new Set(this.#s(e));for(let e of[...r])(!i.has(e)||!this.stateOn)&&r.delete(e);this.#t={shape:e,missing:r,values:n?.values??new Map},r.size===0&&this.#c()}state(e,t){if(this.ended)return;if(t.as===`error`){let e=mA(t.error);!this.hydrated&&this.stateOn?(this.gone(e),this.close()):this.host.report(e);return}let n=this.#t;if(t.as===`ops`){let r=n?.values.get(e)??this.members.get(e);if(r===void 0)return;let i=r.decoder.decode(t.ops??[]);r.value=GO(r.value,i),r===this.members.get(e)&&this.#l(e,{type:`ops`,ops:i,value:r.value});return}let r={value:t.value,decoder:$O()};n!==void 0&&(n.missing.has(e)||n.values.has(e))?(n.values.set(e,r),n.missing.delete(e),n.missing.size===0&&this.#c()):this.inVariant(e)&&(this.members.set(e,r),this.#l(e,{type:`reset`,value:r.value}))}gone(e){if(!this.ended){this.status=`ended`,this.error=e,this.hold=void 0,this.#t=void 0,this.#n.reject(e),this.#o(e);for(let t of[...this.views])t.end(e);this.#e.clear(),this.host.forgetBinding(this)}}detached(){if(!this.ended){this.hold=void 0,this.#t=void 0,this.status===`live`&&(this.status=`loading`,this.#n=ZA());for(let e of this.views)e.update()}}close(){if(this.lingerTimer!==void 0&&clearTimeout(this.lingerTimer),this.lingerTimer=void 0,this.hold!==void 0&&this.hold.channel.release(this.hold.id),this.hold=void 0,this.status!==`ended`){this.status=`ended`;let e=new I(`released`,`reference ${this.key} released`);this.#n.reject(e),this.#o(e);for(let t of[...this.views])t.end(e)}this.#t=void 0,this.#e.clear(),this.host.forgetBinding(this)}async call(e,t,n){for(;;){if(this.ended)throw this.terminalError();(this.status!==`live`||this.hold===void 0)&&await Pk(this.#n.promise,n.signal);let r=this.hold;if(r===void 0||this.status!==`live`)continue;let i=this.shape?.variant,a=i===void 0?void 0:this.contract.description.variants[i]?.[e];if(a?.kind!==`method`)throw new I(`not_in_variant`,`${this.key}: ${e} is not a method of variant ${i}`);let o=a.args===void 0?void 0:Dw(a.args,vw(t));return r.channel.call(r.id,e,o,{rootId:n.rootId,codeVersion:n.codeVersion},n.signal)}}#s(e){let t=e.variant===void 0?void 0:this.contract.description.variants[e.variant];return t===void 0?[]:e.members.filter(e=>t[e]?.kind===`state`)}#c(){let e=this.#t;if(e===void 0)return;this.#t=void 0,this.shape=e.shape;let t=new Set(this.#s(e.shape));for(let e of[...this.members.keys()])t.has(e)||this.members.delete(e);for(let[n,r]of e.values)t.has(n)&&this.members.set(n,r);this.hydrated=this.stateOn&&[...t].every(e=>this.members.has(e)),this.hydrated&&this.#o(),this.status=`live`,this.#r=!0,this.#n.resolve();for(let e of this.views)e.update();for(let[n,r]of e.values)t.has(n)&&this.#l(n,{type:`reset`,value:r.value});for(let e of[...this.views])e.shapeChanged()}#l(e,t){let n=this.#e.get(e);if(n!==void 0)for(let e of[...n])e.deliver(t)}},$A=class{view;#e;#t=new Set;#n=new Set;#r=new Set;constructor(e,t){this.view=e,this.#e=t}get value(){if(this.view.ended)throw this.view.terminalError();return this.view.binding.read(this.#e)}get[ck](){let e=this.view.binding;if(!e.hydrated)return{hydrated:!1,whenHydrated:()=>e.whenHydrated()}}subscribe(e){return this.#t.add(e),this.#a(),this.#i()&&this.#s(()=>e(this.view.binding.members.get(this.#e)?.value)),()=>this.#o(this.#t,e)}events(e){if(this.#n.add(e),this.#a(),this.#i()){let t=this.view.binding.members.get(this.#e)?.value;this.#s(()=>e({type:`snap`,value:t}))}else this.#r.add(e);return()=>{this.#r.delete(e),this.#o(this.#n,e)}}deliver(e){for(let t of[...this.#n])this.#r.delete(t)?e.type!==`ops`&&this.#s(()=>t({type:`snap`,value:e.value})):this.#s(()=>t(e));for(let t of[...this.#t])this.#s(()=>t(e.value))}stop(){this.#t.clear(),this.#n.clear(),this.#r.clear(),this.view.binding.unlisten(this.#e,this)}#i(){return!this.view.ended&&this.view.binding.readable(this.#e)}#a(){this.view.ended||this.view.binding.listen(this.#e,this)}#o(e,t){e.delete(t),this.#t.size+this.#n.size===0&&this.view.binding.unlisten(this.#e,this)}#s(e){try{e()}catch(e){this.view.binding.host.report(e)}}},ej=class{object=void 0;binding;owner;wantsState;proxy;ready;status=`loading`;error;shapeListeners=new Set;#e=new Set;#t=new Map;#n=new Map;#r;constructor(e,t,n){this.binding=e,this.owner=t,this.wantsState=n;let r=ZA();this.ready=r.promise,this.#r=r,this.proxy=new Proxy(this,{get:(e,t)=>{if(Fk.has(t)){let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}if(typeof t==`string`&&t!==`then`)return e.member(t)}}),Lk.set(this.proxy,this)}get contract(){return this.binding.contract}get address(){return this.binding.key}get ended(){return this.status===`released`||this.status===`gone`}get variant(){return this.binding.shape?.variant}get shape(){return this.binding.shape}onShape(e){return this.shapeListeners.add(e),()=>this.shapeListeners.delete(e)}onStatus(e){return this.#e.add(e),()=>this.#e.delete(e)}terminalError(){return this.status===`gone`?this.error:new I(`released`,`reference ${this.address} released`)}release(){if(!this.ended){this.status=`released`,this.#i(),this.#r?.reject(new I(`released`,`reference ${this.address} released`)),this.#r=void 0;for(let e of this.#t.values())e.stop();this.binding.removeView(this)}}update(){if(this.ended)return;let e=this.binding,t=e.status===`live`&&e.hold!==void 0&&(!this.wantsState||e.hydrated),n=t?`live`:`loading`;n!==this.status&&(this.status=n,this.#i(),t&&(this.#r?.resolve(),this.#r=void 0))}end(e){if(this.ended)return;let t=e instanceof I&&e.code===`released`;this.status=t?`released`:`gone`,t||(this.error=e),this.#i(),this.#r?.reject(e),this.#r=void 0;for(let e of this.#t.values())e.stop()}shapeChanged(){let e=this.binding.shape;if(!(e===void 0||this.ended))for(let t of[...this.shapeListeners])try{t(e)}catch(e){this.binding.host.report(e)}}#i(){Ik(this.#e,this.status,this.error,e=>this.binding.host.report(e))}member(e){let t=Object.values(this.contract.description.variants).map(t=>t[e]).find(e=>e!==void 0);if(t?.kind===`method`)return this.#a(e);if(t?.kind===`state`){let t=this.#t.get(e);return t===void 0&&(t=new $A(this,e),this.#t.set(e,t)),t}}#a(e){let t=this.#n.get(e);if(t===void 0){let n=OT(this.contract,e);t=(...t)=>{let[r,i]=n?[void 0,t[0]]:t,a=this.binding.host;if(a.inFactory>0)throw new I(`not_ready`,`${this.address}.${e} called inside a factory`);if(i!==void 0&&!(i instanceof jk))return Promise.reject(Hw(`foreign_ctx`,`ctx must come from a Chord host`));try{i?.check(a)}catch(e){return Promise.reject(e)}return i===void 0||i.holder?a.root(t=>this.#o(e,r,t),{signal:i?.signal}):this.#o(e,r,i)},this.#n.set(e,t)}return t}#o(e,t,n){return this.ended?Promise.reject(this.terminalError()):this.binding.call(e,t,n)}},tj=e=>typeof e==`object`&&!(e instanceof URL),nj=new Map;function rj(e){return new ij(e)}var ij=class{name;dev;principal;inFactory=0;failed;objects=new Map;codeVersions=new Map;facets=new Map;hostObjects=new Map;kind;connections=new Set;upstream;bindings=new Map;#e=new Map;#t;#n;#r=0;#i=new Map;#a=new bA(this);remoteModules={};remoteRemoved={};#o=0;#s=new Map;#c=new Set;#l=Math.random().toString(36).slice(2,8);#u=new Map;current;previous;pending;gating;reloading=!1;taskStopDeadline;readyTimeout;#d;#f;#p=new Set;#m=new Map;#h=[];#g=new Map;#_;#v;#y=new Map;#b=new Map;#x=new Map;#S=new Map;#C=1;#w=0;constructor(e){if(this.name=e.name??`host`,this.dev=e.dev??!1,!(`self`in e))throw TypeError("createHost needs `self`: the principal of the host's own code");this.principal=e.self,this.#d=e.principalKey??Kw,this.#f=this.#d(e.self),this.#_=e.onError??(e=>console.error(`chord:`,e)),this.#v=e.loader,this.taskStopDeadline=e.taskStopDeadline??5e3,this.readyTimeout=e.readyTimeout??6e4,this.#t=e.linger?.types??{},this.#n=e.linger?.cap??4,this.current={id:this.#C,services:new Map,tables:new Map,roots:new Map,abort:new AbortController},this.codeVersions.set(this.current.id,this.current),this.kind=e.kind??`host`,e.upstream!==void 0&&this.connect(e.upstream.link,e.upstream)}isSelf(e){return e===this.principal||this.#d(e)===this.#f}get codeVersion(){return this.current.id}get previousCodeVersion(){return this.previous?.id}nextCodeVersionId(e){if(e!==void 0&&e<=this.current.id)throw Error(`code version ${e} is not newer than ${this.current.id}`);return this.#C=e??this.#C+1,this.#C}report(e){this.#_(e)}serve=((e,t,n={})=>{if(this.reloading)throw Error(`host.serve during a reload; serve from a facet passed to reload()`);this.serveInto(this.current.services,xk(e,t,n,``)),n.lifetime===`host`&&this.startHostObject(this.current.services.get(e.name))});install(e,t={}){if(this.reloading)throw Error(`host.install during a reload`);if(this.facets.has(e.name))throw Error(`facet ${e.name} is already installed; use reload()`);let n=[],r=new AbortController;try{e.setup(this.facetApi(((t,r,i={})=>{let a=xk(t,r,i,e.name);this.serveInto(this.current.services,a),n.push(a)}),r.signal))}catch(e){throw r.abort(e),e}this.facets.set(e.name,e),this.facetRunChanged(e.name,r);let i=n.filter(Sk).map(e=>this.startHostObject(e));return t.awaitHostObjects===!1?Promise.resolve():this.#T(i)}async load(e,t={}){let n=await this.resolve(e);await Promise.all(n.map(e=>this.install(e,t)))}ready(){return this.#T(this.hostObjects.values())}#T(e){let t=Promise.all([...e].map(e=>e.ready)).then(()=>{});return t.catch(()=>{}),t}async resolve(e){let t=e.filter(e=>!tj(e));if(t.length>0&&this.#v===void 0)throw Error(`loading modules needs createHost({ loader }), e.g. nodeLoader from @earendil-works/chord/node`);let n=t.length>0&&this.#v!==void 0?await this.#v(t):[];return e.map(e=>tj(e)?e:n.shift())}facetApi(e,t){return{serve:e,name:this.name,root:(e,t)=>this.root(e,t),registry:e=>this.registry(e),signal:t}}facetRunChanged(e,t){let n=this.#g.get(e);t===void 0?this.#g.delete(e):this.#g.set(e,t),n!==t&&n?.abort(new I(`gone`,`facet ${e} was replaced or removed`))}serveInto(e,t){if(e.has(t.contract.name))throw Error(`${t.contract.name} is already served`);let n=t.contract.description.host;if(n!==void 0&&!fT(n,this.name))throw TypeError(`${t.contract.name} is declared for ${pT(n)}, but ${this.name} serves it`);e.set(t.contract.name,t)}startHostObject(e){let t=this.acquire(e.contract,{},void 0,`host`);return this.hostObjects.set(e.contract.name,t),t.ready.catch(e=>this.report(e)),t}currentCodeVersion(){return this.current.id}hasCodeVersion(e){return this.codeVersions.has(e)}*retainedCodeVersions(){for(let[e,t]of this.codeVersions)yield[e,t.services];this.pending!==void 0&&(yield[this.pending.id,this.pending.services])}pendingCodeVersion(){return this.pending?.id}service(e){return this.current.services.get(e)??this.pending?.services.get(e)}addressOf(e,t,n,r=!1){let i=this.#E(e,t);if(i!==void 0)return this.#k(e,i.input,n);let a=this.#j(e.name,r);if(a===void 0)throw cj(e.name,this.name);return this.#D(a,t,n).address}#E(e,t){let n=e.description.host;if(e.scope!==`remote`||n===void 0)return;let r=Xw(e.input,t,`${e.name} input`),i=dT(e.name,n,r);return i===this.name?void 0:{at:i,input:r}}#D(e,t,n){let{name:r,input:i}=e.contract,a=Xw(i,t,`${r} input`),o=Zw(i,a);if(Sk(e)){if(o!==Zw(i,Xw(i,{},`${r} input`)))throw Hw(`input`,`${r} has lifetime "host": its one object has the empty input`);n=this.principal}return{address:`${r}\u0000${o}\u0000${this.#O(n)}`,normalized:a,principal:n}}#O(e){return this.isSelf(e)?`host`:`p:${this.#d(e)}`}#k(e,t,n){let r=Zw(e.input,t);return`@${e.name}\u0000${r}\u0000${this.#O(n)}\u0000${e.fingerprint}`}acquire(e,t,n,r,i,a=!1){let o=this.#E(e,t);if(o!==void 0)return this.#P(e,o.at,o.input,n,r);let s=this.#j(e.name,a);if(s===void 0)throw cj(e.name,this.name);DT(s.contract,s.options.accepts,e);let{address:c,normalized:l,principal:u}=this.#D(s,t,n?.principal??this.principal),d=s.contract.description.host;if(d!==void 0&&dT(e.name,d,l)!==this.name)throw Hw(`placement`,`${e.name} with this input lives on ${dT(e.name,d,l)}, not ${this.name}`);let f=this.objects.get(c);if(i!==void 0&&f!==void 0&&(f===i||lj(f,i)))throw Hw(`cycle`,`${i.address} -> ${c} would create a ref cycle`);if(f===void 0){if(this.gating?.has(e.name))throw new I(`upgrade_conflict`,`${e.name} is being upgraded; retry`,{reason:`gate`});let t=this.#y.get(c);t?.status===`disposed`&&this.#y.delete(c),f=new Uk(this,{address:c,typeName:e.name,input:l,principal:u,hostLifetime:Sk(s)}),this.objects.set(c,f),f.start(t?.status===`disposing`?t.dispose(!1):void 0)}let p=new Bk(f,e,r);return f.addRef(p),p}forget(e){this.objects.get(e.address)===e&&this.objects.delete(e.address),e.status===`disposing`&&this.#y.set(e.address,e)}disposed(e){this.#y.get(e.address)===e&&this.#y.delete(e.address)}touch(e,t){let n=this.#b.get(e);n===void 0&&(n=new Set,this.#b.set(e,n)),n.add(t)}async root(e,t={}){let n=`${this.name}#${this.#l}:${++this.#w}`;return this.#c.add(n),this.joinRoot(n,t.codeVersion??this.current.id,e,t)}async joinRoot(e,t,n,r={}){let i=this.codeVersions.get(t);if(i===void 0)throw this.#c.delete(e),new I(`superseded`,`code version ${t} is not retained by ${this.name}`);if(r.from!==void 0&&!this.#c.has(e)){let t=this.#s.get(e);t===void 0&&(t=new Set,this.#s.set(e,t)),t.add(r.from)}i.roots.set(e,(i.roots.get(e)??0)+1);let a=new jk(this,{signals:r.signal===void 0?[i.abort.signal]:[r.signal,i.abort.signal],rootId:e,codeVersion:i.id,principal:r.principal??this.principal});try{return await n(a)}finally{a.close();let t=(i.roots.get(e)??1)-1;t>0?i.roots.set(e,t):(i.roots.delete(e),this.#s.has(e)||this.endRoot(e),this.maybeRetire(),this.#A())}}rootSent(e,t){let n=this.#u.get(e);n===void 0&&(n=new Set,this.#u.set(e,n)),n.add(t)}endRoot(e){this.#c.delete(e),this.#s.delete(e);for(let t of this.#b.get(e)??[])t.rootEnded(e);this.#b.delete(e);for(let t of this.#u.get(e)??[])t.send({t:`root_end`,rootId:e});this.#u.delete(e)}foreignRootEnded(e,t){let n=this.#s.get(e);n===void 0||!n.delete(t)||n.size>0||([...this.codeVersions.values()].some(t=>t.roots.has(e))?this.#s.delete(e):this.endRoot(e))}maybeRetire(){this.retirable()&&this.retire()}retirable(){let e=this.previous;return e===void 0||e.roots.size>0?!1:this.kind===`client`||this.upstream===void 0||e.id<=this.#o}allowRetire(e){this.#o=Math.max(this.#o,e),this.maybeRetire(),this.#A()}watchRetirement(e){return this.#p.add(e),()=>this.#p.delete(e)}#A(){for(let e of[...this.#p])e()}announceRetired(e){let t=(this.previous??this.current).id-1;t>0&&e.send({t:`retire`,codeVersion:t})}retire(){let e=this.previous;if(e!==void 0){this.previous=void 0,this.codeVersions.delete(e.id);for(let t of[...this.objects.values()])this.retireImplementation(t,e.id);for(let t of this.connections)t.role===`downstream`&&t.peer?.kind===`host`&&t.send({t:`retire`,codeVersion:e.id});this.#A()}}retireImplementation(e,t){let n=e.implementations.get(t);if(e.implementations.delete(t),n===void 0||n.decls===e.decls)return;let r=e.allDecls(),i=e=>new Set([...r].flatMap(t=>[...e(t)])),a=i(e=>e.refs.values()),o=i(e=>e.resources.values()),s=i(e=>e.derives.values());for(let e of n.decls.derives.values())s.has(e)||e.detach();let c=[...n.decls.resources.values()].filter(e=>!o.has(e)).sort((t,n)=>e.openOrder.indexOf(n)-e.openOrder.indexOf(t)),l=[...n.decls.refs.values()].filter(e=>!a.has(e));e.refreshSchemas(),Ww([...c.map(t=>()=>t.close(e.openOrder)),...l.map(e=>()=>e.release())],`${e.address}: retiring code version ${t} failed`).catch(e=>this.report(e))}registry(e){let t=t=>{let n=t===void 0?this.current:this.codeVersions.get(t.codeVersion);if(n===void 0)throw new I(`superseded`,`code version ${t?.codeVersion} is retired`);return n.tables.get(e.name)??nj};return{table:t,get:(e,n)=>t(n).get(e),subscribe:n=>{let r=this.#S.get(e.name);r===void 0&&(r=new Set,this.#S.set(e.name,r));let i=n;return r.add(i),i(t(),this.current.id),()=>r.delete(i)}}}buildTables(e){let t=new Map;for(let[n,r]of e)for(let{registry:e,key:i,value:a}of r.registrations.values()){let r=t.get(e.name);r===void 0&&(r=new Map,t.set(e.name,r));let o=r.get(i);if(o!==void 0&&o.object!==n&&e.conflict===`error`)throw Hw(`registry_conflict`,`${e.name}: ${i} registered by ${o.object.address} and ${n.address}`);r.set(i,{value:a,object:n});let s=this.#x.get(e.name);s===void 0&&(s=new Map,this.#x.set(e.name,s)),s.has(i)||s.set(i,s.size)}let n=new Map;for(let[e,r]of t){let t=this.#x.get(e),i=[...r].sort(([e],[n])=>t.get(e)-t.get(n));n.set(e,new Map(i.map(([e,t])=>[e,t.value])))}return n}#j(e,t){return(t?this.pending?.services.get(e):void 0)??this.service(e)}liveDecls(e=!1){return[...this.objects.values()].filter(t=>t.status===`live`&&(e||!t.deferredRuntime)).map(e=>[e,e.decls])}checkRegistrations(e,t){t.registrations.size!==0&&this.buildTables([...this.liveDecls().filter(([t])=>t!==e),[e,t]])}registriesChanged(e){let t=this.liveDecls().filter(([t])=>t!==e);e!==void 0&&t.push([e,e.decls]),this.installTables(this.current,this.buildTables(t))}fail(e){this.failed??=e,this.report(e)}installTables(e,t,n=!1){let r=e.tables;if(e.tables=t,e===this.current)for(let[i,a]of this.#S){let o=t.get(i)??nj;if(!n&&oj(r.get(i)??nj,o))continue;let s=[...a];rk(()=>{for(let t of s)try{t(o,e.id)}catch(e){this.report(e)}})}}async get(e,t,n){let r=this.acquire(e,t,n,`external`);return await Nk(r,n?.signal===void 0?[]:[n.signal],this.readyTimeout),r.proxy}hold(e,t,n){return this.acquire(e,t,n,`external`).proxy}async invalidatePrincipal(e){let t=typeof e==`function`?e:t=>sj(e,t),n=new I(`gone`,`principal invalidated`);for(let e of[...this.connections])e.role===`downstream`&&t(e.principal)&&e.revoke(e.restamp?.(e.principal));if(typeof e!=`function`)for(let t of this.connections)t.role===`downstream`&&t.peer.kind===`host`&&t.send({t:`invalidate`,pattern:e});await aj([...this.objects.values()].filter(e=>!this.isSelf(e.principal)&&t(e.principal)),n,`invalidatePrincipal: disposal failed`)}accept(e,t){let n=t.kind??`client`;if(n===`host`&&t.name===void 0)throw TypeError(`accepting a host link needs its name`);this.#M(e,{...t,role:`downstream`,principal:t.principal,peer:{kind:n,name:n===`host`?t.name:void 0},...n===`client`?{originId:`${this.#l}:${++this.#r}`}:{}})}connect(e,t){if(!(`principal`in t))throw TypeError("connect needs `principal`: what the parent's own requests act as");this.upstream?.open&&this.upstream.link.close(`replaced`);let n=this.#M(e,{...t,role:`upstream`,principal:t.principal,peer:{kind:`host`,name:void 0}});this.upstream=n;for(let e of this.bindings.values())e.hold===void 0&&!e.ended&&n.hold(e,e.applied)}#M(e,t){let n=new WA(this,e,t);return n.open&&this.connections.add(n),n}route(e,t){if(typeof t.principal!=`function`)throw TypeError(`route ${e} needs \`principal\`: what the routed hosts act as when they call back`);this.#i.set(e,t)}peerHello(e,t){t>this.current.id?(this.report(new I(`invalid`,`${e.name} runs code version ${t}, ahead of ${this.current.id}`)),e.link.close(`code version ahead of parent`)):this.reloading?(e.peerCodeVersion=t,t<this.current.id&&e.fencedCodeVersions.add(t),this.#m.set(e,t)):t===this.current.id?(e.markSynced(t),this.announceRetired(e)):(e.peerCodeVersion=t,e.fencedCodeVersions.add(t),yA(this,e).catch(t=>{this.report(t),e.link.close(`reconciliation failed`)}))}reloadEnded(){this.reloading=!1;let e=[...this.#m];this.#m.clear();for(let[t,n]of e)t.open&&this.peerHello(t,n);for(let e of this.#h.splice(0))e();this.maybeRetire()}whenReloadEnded(){return this.reloading?new Promise(e=>this.#h.push(e)):Promise.resolve()}connectionClosed(e){this.connections.delete(e),this.#m.delete(e);for(let[t,n]of[...this.#s])n.has(e)&&this.foreignRootEnded(t,e);for(let t of this.#u.values())t.delete(e);this.upstream===e&&(this.upstream=void 0,this.#a.parentLost())}bindingIdle(e){let t=Object.hasOwn(this.#t,e.contract.name)?this.#t[e.contract.name]:0;if(t<=0||e.ended||!e.applied||this.#n<=0)e.close();else{e.lingerTimer=setTimeout(()=>e.close(),t),e.lingerTimer.unref?.(),this.#e.set(e.key,e);for(let e of this.#e.values()){if(this.#e.size<=this.#n)break;e.close()}}}forgetBinding(e){this.bindings.get(e.key)===e&&this.bindings.delete(e.key),this.#e.get(e.key)===e&&this.#e.delete(e.key)}#N(e){return[...this.connections].find(t=>t.open&&t.role===`downstream`&&t.peer.kind===`host`&&t.peer.name===e)}#P(e,t,n,r,i){let a=r?.principal===void 0||this.isSelf(r.principal)?void 0:r.principal,o=this.#k(e,n,a??this.principal),s=this.bindings.get(o),c=s===void 0||s.ended;(s===void 0||s.ended)&&(s=new QA(this,{key:o,contract:e,at:t,input:n,principal:a}),this.bindings.set(o,s));let l=new ej(s,i,r?.state!==!1);return this.#e.delete(o),s.addView(l),c&&this.#F(s),l}#F(e){let t=t=>{t.then(t=>{!e.ended&&e.hold===void 0&&t.hold(e,!1)},t=>e.gone(t))},n=this.#N(e.at);if(this.upstream!==void 0)this.upstream.hold(e,!1);else if(n!==void 0)t(n.whenSynced().then(()=>n));else{let n=this.#I(e.at);n===void 0?e.gone(new I(`unavailable`,`no route to ${e.at}`)):t(this.#L(n,e.at,e.principal??this.principal))}}#I(e){let t;for(let n of this.#i)e.startsWith(n[0])&&(t===void 0||n[0].length>t[0].length)&&(t=n);return t?.[1]}async#L(e,t,n,r=()=>!0){let i=()=>new I(`forbidden`,`${t} refused for this principal`),a=()=>new I(`gone`,`principal invalidated while resolving`);if(!await e.authorize(n,t))throw i();if(!r())throw a();let o=await e.resolve(t);if(!r())throw a();if(!await e.authorize(n,t))throw i();if(!r())throw a();let s=[...this.connections].find(e=>e.link===o);if(s??=this.#M(o,{role:`downstream`,principal:e.principal(t),peer:{kind:`host`,name:t}}),await s.whenSynced(),!r())throw a();return s}async relay(e){let t=e.frame.at,n=CT(e.frame.token).description.host;if(n===void 0||dT(e.frame.token.name,n,e.frame.input)!==t)throw Hw(`placement`,`${e.frame.token.name} with this input does not live on ${t}`);let r=this.#I(t);if(r===void 0)throw this.#N(t)===void 0?new I(`unavailable`,`no route to ${t}`):new I(`forbidden`,`no route authorizes ${t}`);let i=await this.#L(r,t,e.principal,()=>e.current);e.current&&e.open(i)}reload(e,t={}){return this.kind!==`client`&&this.upstream!==void 0?Promise.reject(new I(`unavailable`,`reloads are coordinated by the server`,{reason:`not_coordinator`})):[...this.connections].some(e=>e.role===`downstream`&&e.peer.kind===`host`)||t.remote!==void 0||t.remoteRemove!==void 0?vA(this,e,t):Zk(this,e,t)}onReloadFrame(e,t){this.#a.handle(e,t)}rememberRemoteModules(e,t){for(let n of new Set([...Object.keys(e??{}),...Object.keys(t??{})])){let r=e?.[n]??[],i=t?.[n]??[];this.remoteModules[n]=[...new Set([...this.remoteModules[n]??[],...r])].filter(e=>!i.includes(e)),this.remoteRemoved[n]=[...new Set([...this.remoteRemoved[n]??[],...i])].filter(e=>!r.includes(e))}}peekNextCodeVersion(){return this.#C+1}async close(){for(let e of[...this.#e.values()])e.close();this.hostObjects.clear();for(let e of[...this.#g.keys()])this.facetRunChanged(e,void 0);let e=new I(`gone`,`host ${this.name} closed`);try{await aj([...this.objects.values()],e,`host close: disposal failed`)}finally{for(let e of[...this.connections])e.link.close(`host closed`)}}};async function aj(e,t,n){let r=new Set(e),i=e=>{let t=new Set;for(let n of e.allDecls())for(let e of n.refs.values())e.object!==void 0&&t.add(e.object);return t},a=new Map(e.map(e=>[e,i(e)])),o=[];for(;r.size>0;){let e=new Set;for(let t of r)for(let n of a.get(t)??[])e.add(n);let n=[...r].filter(t=>!e.has(t));n.length===0&&(n=[...r]);for(let e of n)r.delete(e);let i=await Promise.allSettled(n.map(e=>e.dispose(!0,t)));for(let e of i)e.status===`rejected`&&o.push(e.reason)}if(o.length===1)throw o[0];if(o.length>1)throw AggregateError(o,n)}function oj(e,t){if(e.size!==t.size)return!1;let n=[...e.keys()];return[...t].every(([t,r],i)=>n[i]===t&&e.get(t)===r)}var sj=(e,t)=>typeof t==`object`&&!!t&&Object.entries(e).every(([e,n])=>Jw(t[e],n)),cj=(e,t)=>new I(`unavailable`,`${e} is not served by ${t}`,{reason:`unknown_type`});function lj(e,t){let n=new Set,r=[e];for(;r.length>0;){let e=r.pop();if(e===t)return!0;if(!n.has(e)){n.add(e);for(let t of e.allDecls())for(let e of t.refs.values())e.object!==void 0&&r.push(e.object)}}return!1}var uj={maxItems:100,idChars:64,textChars:256,itemsBytes:65536},dj={questionChars:2e3,maxOptions:12,optionIdChars:64,labelChars:200,descriptionChars:500,textChars:4e3,questionBytes:16384,responseBytes:16384,maxPending:8,previewChars:256,recordBytes:65536},fj={titleChars:120,maxSteps:30,stepChars:500,noteChars:4e3,feedbackChars:2e3},pj=class extends Error{name=`InteractionInputError`},mj=new TextEncoder,hj=e=>mj.encode(JSON.stringify(e)).length,gj=e=>e.trim()===``,_j=e=>typeof e==`object`&&!!e&&!Array.isArray(e),vj=e=>{throw new pj(e)};function yj(e,t,n){for(let r of Object.keys(e))t.includes(r)||vj(`${n} has an unknown field "${r}".`)}function bj(e,t){if(!_j(t))return vj(`Response must be an object.`);if(hj(t)>dj.responseBytes&&vj(`Response is too large (limit ${dj.responseBytes} bytes).`),t.kind===`skip`)return yj(t,[`kind`],`Response`),{kind:`skip`};if(t.kind!==`answer`)return vj(`Response kind must be "answer" or "skip".`);yj(t,[`kind`,`optionIds`,`text`],`Response`);let n=t.optionIds===void 0?[]:t.optionIds;if(!Array.isArray(n))return vj(`optionIds must be an array.`);n.length>dj.maxOptions&&vj(`Too many selected options (limit ${dj.maxOptions}).`);let r=new Set;for(let t of n)(typeof t!=`string`||t===``)&&vj(`optionIds must contain non-empty strings.`),r.has(t)&&vj(`Option "${t}" was selected twice.`),e.options.some(e=>e.id===t)||vj(`Unknown option "${t}".`),r.add(t);!e.options.length&&r.size&&vj(`This question has no options.`),!e.multiple&&r.size>1&&vj(`This question accepts only one option.`);let i=null;if(t.text!==void 0){typeof t.text!=`string`&&vj(`text must be a string.`);let e=t.text;e.length>dj.textChars&&vj(`text is too long (limit ${dj.textChars} characters).`),gj(e)||(i=e)}return!r.size&&i===null&&vj(`Choose an option or enter text.`),{kind:`answer`,optionIds:e.options.filter(e=>r.has(e.id)).map(e=>e.id),text:i}}function xj(e,t){return t.optionIds.map(t=>e.options.find(e=>e.id===t)?.label??t)}var Sj=e=>({completed:e.filter(e=>e.status===`completed`).length,total:e.length}),Cj=()=>({optionIds:[],text:``});function wj(e,t,n){let r=t.optionIds.includes(n);return e.multiple?{...t,optionIds:r?t.optionIds.filter(e=>e!==n):[...t.optionIds,n]}:{...t,optionIds:r?[]:[n]}}function Tj(e){let t=gj(e.text)?void 0:e.text;return!e.optionIds.length&&t===void 0?null:{kind:`answer`,...e.optionIds.length?{optionIds:[...e.optionIds]}:{},...t===void 0?{}:{text:t}}}function Ej(e,t){let n=Tj(t);if(!n)return`Choose an option or enter text.`;try{return bj(e,n),null}catch(e){return e instanceof Error?e.message:`Invalid answer.`}}function Dj(e){if(e.status===`answered`&&e.answer){let t=xj(e,e.answer);return e.answer.text!==null&&t.push(e.answer.text),t.join(`, `)}return e.status===`skipped`?`Skipped`:e.status===`cancelled`?`Cancelled`:`Waiting for your answer`}var Oj=`neko`,kj=(e,t)=>[e,t];function Aj(e,t){let n=Object.fromEntries(Object.entries(t.variants).map(([e,t])=>[e,{...t,methods:Object.fromEntries(Object.entries(t.methods??{}).map(([e,[t,n]])=>[e,lT(t,n)]))}]));return ST(e,{...t,host:uT(Oj),variants:n})}var L=Lc(),jj=Nc(),Mj=yc(),Nj=Ac(),R=Sc({minimum:0,maximum:2**53-1}),Pj=zc([L,Nj]),Fj=Os([`pending`,`running`,`done`]),Ij=Os([`project`,`user`,`builtin`]),Lj=Os([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`]),Rj=P({provider:L,modelId:L}),zj=P({model:N(Rj),thinkingLevel:N(Lj)},{additionalProperties:!1}),Bj=P({input:jj,output:jj,cacheRead:jj,cacheWrite:jj,cost:jj}),Vj=P({name:L,mimeType:L,width:R,height:R,bytes:R,entryId:R,contentIndex:R}),Hj=P({name:L,location:L,body:L,args:L}),Uj=P({callId:L,name:L,summary:L,detail:Pj,phase:Fj,output:Pj,diff:Pj,diffAdded:zc([jj,Nj]),diffRemoved:zc([jj,Nj]),diffTruncated:N(Mj)}),Wj=P({parentId:R,agentId:N(L),round:N(R),runnerId:N(R),inputEntryId:N(R),answerEntryId:N(R),roundUsage:N(zc([Bj,Nj])),taskId:R,callId:L,childId:R,role:Os([`explore`,`plan`,`coder`]),title:L,createdAt:jj,startedAt:zc([jj,Nj]),endedAt:zc([jj,Nj]),status:Os([`queued`,`running`,`completed`,`failed`,`cancelled`]),report:Pj,approvalCount:N(R),historyThrough:N(R),historyUsage:N(Bj)}),Gj=P({agentId:L,parentId:R,childId:R,role:Os([`explore`,`plan`,`coder`]),title:L,status:Os([`idle`,`queued`,`running`]),activeRoundId:zc([R,Nj]),lastRoundId:R,lastReport:N(Pj),roundCount:R,taskTitle:L,approvalCount:R,createdAt:jj,historyThrough:N(R),historyUsage:N(Bj)}),Kj=P({jobId:L,title:L,command:L,cwd:L,status:Os([`running`,`exited`,`failed`,`stopped`,`lost`]),startedAt:jj,endedAt:zc([jj,Nj]),exitCode:zc([jj,Nj]),reason:N(Os([`timeout`,`spawn-error`,`restart`,`aborted`])),timeoutSeconds:N(jj),outputBytes:R}),qj=P({job:Kj,text:L,offset:R,truncated:Mj,dropped:R}),Jj=P({id:R,mode:Os([`steer`,`followUp`]),preview:L,images:R,skill:N(P({name:L,args:L}))}),Yj=P({result:Os([`withdrawn`,`placed`,`settled`,`unknown`]),text:N(L),images:N(R)}),Xj=P({result:Os([`steered`,`withdrawn`,`placed`,`settled`,`unknown`]),id:N(R),text:N(L),images:N(R)}),Zj=P({revision:R,items:Wo(P({id:Lc({minLength:1,maxLength:uj.idChars}),text:Lc({minLength:1,maxLength:uj.textChars}),status:Os([`pending`,`in_progress`,`completed`])},{additionalProperties:!1}),{maxItems:uj.maxItems})}),Qj=P({id:Lc({minLength:1,maxLength:dj.optionIdChars}),label:Lc({minLength:1,maxLength:dj.labelChars}),description:N(Lc({maxLength:dj.descriptionChars})),recommended:N(Mj)},{additionalProperties:!1}),$j=Os([`pending`,`answered`,`skipped`,`cancelled`]),eM=P({id:R,version:L,preview:Lc({maxLength:dj.previewChars}),multiple:Mj,optionCount:R,createdAt:jj}),tM=P({path:L,entries:Wo(P({name:L,path:L,kind:Os([`file`,`directory`,`symlink`]),protected:N(F(!0))},{additionalProperties:!1}),{maxItems:1e3}),limited:Mj,incomplete:Mj}),nM=P({path:L,size:jj,mtimeMs:jj,kind:Os([`text`,`binary`,`protected`]),content:N(L),truncated:Mj}),rM=P({revision:R,files:R,added:R,removed:R}),iM=P({revision:R,files:Wo(P({path:L,outside:N(F(!0)),ops:R,added:R,removed:R,agents:Wo(L,{maxItems:64}),lastSeq:R},{additionalProperties:!1}),{maxItems:500}),truncated:Mj}),aM=P({seq:R,agent:L,tool:Os([`edit`,`write`]),diff:L,added:R,removed:R,truncated:Mj},{additionalProperties:!1}),oM=P({path:L,outside:N(F(!0)),ops:Wo(aM,{maxItems:50}),truncated:Mj}),sM=P({revision:R,pending:Wo(eM,{maxItems:dj.maxPending})}),cM=P({id:R,callId:L,version:L,question:Lc({maxLength:dj.questionChars}),multiple:Mj,options:Wo(Qj,{maxItems:dj.maxOptions}),status:$j,answer:zc([P({optionIds:Wo(Lc(),{maxItems:dj.maxOptions}),text:zc([Lc({maxLength:dj.textChars}),Nj])}),Nj]),createdAt:jj,settledAt:zc([jj,Nj])}),lM=zc([P({kind:F(`answer`),optionIds:N(Wo(Lc(),{maxItems:dj.maxOptions})),text:N(Lc({maxLength:dj.textChars}))},{additionalProperties:!1}),P({kind:F(`skip`)},{additionalProperties:!1})]),uM=P({version:L,title:Lc({maxLength:fj.titleChars}),steps:Wo(Lc({maxLength:fj.stepChars}),{maxItems:fj.maxSteps}),note:Lc({maxLength:fj.noteChars}),status:Os([`awaiting_approval`,`approved`,`revision_requested`,`superseded`,`cancelled`]),feedback:zc([Lc({maxLength:fj.feedbackChars}),Nj]),createdAt:jj,settledAt:zc([jj,Nj])}),dM=P({mode:Os([`normal`,`plan`]),revision:R,current:zc([uM,Nj])}),fM=zc([P({kind:F(`approve`)},{additionalProperties:!1}),P({kind:F(`revise`),feedback:Lc({minLength:1,maxLength:fj.feedbackChars})},{additionalProperties:!1})]),pM=zc([P({kind:F(`ask_user`),id:R,question:L,multiple:Mj,options:Wo(P({id:L,label:L,recommended:N(Mj)})),status:$j,optionIds:N(Wo(L)),labels:N(Wo(L)),text:N(zc([L,Nj]))}),P({kind:F(`todo`),action:Os([`list`,`replace`]),revision:R,completed:R,total:R}),P({kind:F(`submit_plan`),version:L,title:L,steps:Wo(L),note:L})]),mM=P({historyBefore:N(zc([R,Nj])),agents:N(Wo(Gj)),jobs:N(Wo(Kj)),queued:N(Wo(Jj)),todos:N(Zj),questions:N(sM),plan:N(dM),changes:N(rM),rounds:N(Wo(Wj)),subagents:N(Wo(Wj)),taskUsage:N(Bj),model:L,agent:P({model:zc([Rj,Nj]),thinkingLevel:zc([Lj,Nj])}),cwd:L,busy:Mj,status:Pj,usage:Bj,contextUsage:N(P({tokens:zc([jj,Nj]),window:jj,percent:zc([jj,Nj])})),compaction:N(P({failure:N(P({taskId:R,reason:Os([`manual`,`threshold`,`overflow`]),error:L})),active:Wo(P({taskId:R,reason:Os([`manual`,`threshold`,`overflow`]),blocking:Mj,attempt:R,retry:N(P({at:jj,error:L}))})),latest:zc([Nj,P({taskId:R,phase:Os([`summarizing`,`waiting-to-apply`,`applied`,`nothing`,`skipped`,`cancelled`,`failed`]),at:jj})])})),items:Wo(zc([P({type:F(`user`),order:N(jj),key:L,id:R,text:L,images:N(Wo(Vj)),skill:N(Hj),defaultImagePrompt:N(P({version:Sc({minimum:1}),text:L}))}),P({type:F(`assistant`),order:N(jj),key:L,id:R,thinking:L,text:L,stopReason:Pj,errorMessage:Pj,note:Pj}),P({type:F(`tool`),order:N(jj),key:L,images:N(Wo(Vj)),callId:L,name:L,summary:L,detail:Pj,phase:Fj,isError:Mj,output:Pj,result:Pj,durationMs:zc([jj,Nj]),note:Pj,diff:Pj,diffAdded:zc([jj,Nj]),diffRemoved:zc([jj,Nj]),diffTruncated:N(Mj),interaction:N(pM)}),P({type:F(`system`),order:N(jj),key:L,id:R,text:L,jobId:N(L),planDecision:N(P({version:L,kind:Os([`approve`,`revise`])},{additionalProperties:!1}))})])),streaming:zc([Nj,P({thinking:L,text:L,toolCalls:Wo(Uj)})])}),hM=P({workspaceRoot:L,lastUsedAt:jj,title:L,firstPromptPreview:L,createdAt:jj,lastMessageAt:zc([jj,Nj]),model:zc([Rj,Nj]),status:Os([`idle`,`running`,`error`]),awaitingAnswer:N(Mj),awaitingPlan:N(Mj),id:L}),gM=P({revision:R,sessions:Wo(hM)}),_M=P({path:L,createdAt:jj}),vM=P({revision:R,workspaces:Wo(_M)}),yM=P({revision:R,statuses:mu(L,P({savedConfigured:Mj,environmentConfigured:Mj,source:Os([`saved`,`environment`,`runtime`,`keyless`,`none`]),enabled:N(Mj)}))}),bM=P({sessionId:L,attachmentId:L}),xM=P({sessionId:L,attachmentId:L},{additionalProperties:!1}),SM=Aj(`neko.session-directory`,{version:1,input:P({},{additionalProperties:!1}),variants:{ready:{state:{state:gM}}}}),CM=Aj(`neko.session-management`,{version:1,input:P({},{additionalProperties:!1}),variants:{ready:{methods:{create:kj(P({...zj.properties,cwd:N(L)},{additionalProperties:!1}),hM),archive:kj(L,Nj),attach:kj(L,bM),detach:kj(Nj,Nj),fork:kj(L,hM)}}}}),wM=P({maxWidth:N(R),maxHeight:N(R),maxBytes:N(R),jpegQuality:N(R)}),TM=P({maxRequestBytes:N(R),images:N(P({resize:N(wM),maxPerMessage:N(R),maxPerRequest:N(R)}))}),EM=P({provider:L,modelId:L,name:L,available:Mj,contextWindow:jj,input:Wo(L),inputLimits:N(TM),reasoning:Mj,supportedThinkingLevels:Wo(Lj),thinkingLevelAdjustments:P({off:Lj,minimal:Lj,low:Lj,medium:Lj,high:Lj,xhigh:Lj,max:Lj})}),DM=Aj(`neko.models`,{version:1,input:P({},{additionalProperties:!1}),variants:{ready:{methods:{list:kj(Nj,Wo(EM))}}}}),OM=P({data:L,total:R,mimeType:L}),kM=Aj(`neko.subagent`,{version:1,input:P({sessionId:L,attachmentId:L,taskId:N(R),agentId:N(L)}),variants:{ready:{state:{revision:R},methods:{chunk:kj(P({kind:Os([`view`,`history`]),before:N(R),token:N(R),offset:R}),P({token:R,data:L,next:zc([R,Nj])})),getImage:kj(P({entryId:R,contentIndex:R,offset:R}),OM),decideApproval:kj(P({id:R,version:L,decision:Os([`allowed`,`denied`])}),Os([`pending`,`allowed`,`denied`,`cancelled`])),stop:kj(zc([Nj,P({taskId:R})]),Nj)}}}}),AM=Aj(`neko.chat`,{version:1,input:xM,variants:{ready:{state:{view:mM},methods:{submit:kj(P({content:L,images:N(Wo(L,{maxItems:4})),requestId:N(L),whenBusy:N(Os([`steer`,`followUp`]))},{additionalProperties:!1}),Nj),abort:kj(Nj,Nj),withdraw:kj(P({id:R},{additionalProperties:!1}),Yj),steer:kj(P({id:R},{additionalProperties:!1}),Xj),questionGet:kj(P({id:R},{additionalProperties:!1}),zc([cM,Nj])),questionRespond:kj(P({id:R,version:L,response:lM},{additionalProperties:!1}),cM),planGet:kj(P({version:L},{additionalProperties:!1}),zc([uM,Nj])),planRespond:kj(P({version:L,decision:fM},{additionalProperties:!1}),uM),planMode:kj(P({mode:Os([`normal`,`plan`])},{additionalProperties:!1}),dM),usage:kj(Nj,Bj),workspaceDir:kj(P({path:L},{additionalProperties:!1}),tM),workspaceFile:kj(P({path:L},{additionalProperties:!1}),nM),changesList:kj(Nj,iM),changeGet:kj(P({path:L},{additionalProperties:!1}),zc([oM,Nj])),skills:kj(Nj,Wo(P({name:L,description:L,location:L,level:Ij}))),jobOutput:kj(P({jobId:L,since:N(R)},{additionalProperties:!1}),qj),jobStop:kj(P({jobId:L},{additionalProperties:!1}),Kj),configure:kj(zj,Nj),compact:kj(P({instructions:N(L)},{additionalProperties:!1}),Nj),importImage:kj(L,P({id:L,name:L})),draftImage:kj(P({id:L,offset:R},{additionalProperties:!1}),OM),beginImage:kj(P({name:L,mimeType:L,size:Sc({minimum:1,maximum:20971520})},{additionalProperties:!1}),L),appendImage:kj(P({id:L,offset:R,data:Lc({maxLength:35e4})},{additionalProperties:!1}),Nj),finishImage:kj(L,Nj),releaseImage:kj(L,Nj),getImage:kj(P({entryId:R,contentIndex:R,offset:R},{additionalProperties:!1}),OM)}}}}),jM=P({path:L,query:N(L),showHidden:N(Mj),cursor:N(L)},{additionalProperties:!1}),MM=P({path:L,parent:Pj,entries:Wo(P({name:L,path:L,error:N(L)})),next:Pj}),NM=Aj(`neko.workspaces`,{version:1,input:P({},{additionalProperties:!1}),variants:{ready:{state:{state:vM},methods:{add:kj(P({path:L},{additionalProperties:!1}),_M),browse:kj(jM,MM)}}}}),PM=Lc({minLength:1,maxLength:64}),FM=Aj(`neko.credentials`,{version:2,input:P({},{additionalProperties:!1}),variants:{ready:{state:{state:yM},methods:{save:kj(P({provider:PM,key:Lc({minLength:1,maxLength:8192})},{additionalProperties:!1}),Nj),remove:kj(P({provider:PM},{additionalProperties:!1}),Nj),setEnabled:kj(P({provider:PM,enabled:Mj},{additionalProperties:!1}),Nj)}}}}),IM=P({revision:R,selected:Os([`tavily`,`deepseek`])}),LM=Aj(`neko.search-settings`,{version:1,input:P({},{additionalProperties:!1}),variants:{ready:{state:{state:IM},methods:{set:kj(P({provider:Os([`tavily`,`deepseek`])},{additionalProperties:!1}),Nj)}}}}),RM=Os([`default`,`config`,`saved`]),zM=P({revision:R,effective:P({compaction:P({enabled:Mj,triggerPercent:zc([R,Nj]),keepRecentTokens:R}),pruning:P({enabled:Mj,triggerPercent:R,keepRecent:R,minChars:R,minSavePercent:R})}),sources:P({compaction:P({enabled:RM,triggerPercent:RM,keepRecentTokens:RM}),pruning:P({enabled:RM,triggerPercent:RM,keepRecent:RM,minChars:RM,minSavePercent:RM})})}),BM=e=>zc([e,Nj]),VM=P({compaction:N(P({enabled:N(BM(Mj)),triggerPercent:N(BM(R)),keepRecentTokens:N(BM(R))},{additionalProperties:!1})),pruning:N(P({enabled:N(BM(Mj)),triggerPercent:N(BM(R)),keepRecent:N(BM(R)),minChars:N(BM(R)),minSavePercent:N(BM(R))},{additionalProperties:!1}))},{additionalProperties:!1}),HM=Aj(`neko.context-settings`,{version:1,input:P({},{additionalProperties:!1}),variants:{ready:{state:{state:zM},methods:{set:kj(VM,Nj),reset:kj(P({},{additionalProperties:!1}),Nj)}}}}),UM=P({effective:Rj,source:Os([`cli`,`saved`,`config`,`default`])}),WM=Aj(`neko.default-model`,{version:1,input:P({},{additionalProperties:!1}),variants:{ready:{state:{state:UM},methods:{set:kj(Rj,Nj),clear:kj(Nj,Nj)}}}}),GM=P({entries:Wo(P({name:L,path:L,kind:Os([`file`,`directory`])}),{maxItems:100}),limited:Mj,incomplete:Mj}),KM=Aj(`neko.workspace-files`,{version:1,input:P({},{additionalProperties:!1}),variants:{ready:{methods:{search:kj(P({workspaceRoot:L,query:L},{additionalProperties:!1}),GM)}}}}),qM=P({name:L,description:L,category:L,source:L,license:L,version:L,sha256:L,sizeBytes:R,uploadedAt:L,installed:P({project:Mj,user:Mj,builtin:Mj}),activeLevel:zc([Ij,Nj])}),JM=P({body:L,files:Wo(L)}),YM=Os([`user`,`project`]),XM=P({name:L,scope:YM,path:L,shadowedBy:N(YM)}),ZM=Aj(`neko.skill-market`,{version:1,input:P({},{additionalProperties:!1}),variants:{ready:{methods:{list:kj(P({query:N(L),workspaceRoot:N(L)},{additionalProperties:!1}),Wo(qM)),detail:kj(P({name:L,workspaceRoot:N(L)},{additionalProperties:!1}),qM),preview:kj(P({name:L},{additionalProperties:!1}),JM),install:kj(P({name:L,scope:YM,workspaceRoot:N(L),overwrite:N(Mj)},{additionalProperties:!1}),XM),uninstall:kj(P({name:L,scope:YM,workspaceRoot:N(L)},{additionalProperties:!1}),Nj)}}}}),QM=zc([P({status:F(`ready`),path:L,source:Os([`config`,`auto`])}),P({status:F(`missing`),reason:Os([`not_found`,`invalid_config`]),detail:N(L)})]),$M=P({runningVersion:L,installedVersion:Pj,protocolVersion:Sc({minimum:1}),latestVersion:Pj,checkedAt:zc([R,Nj]),checkState:Os([`unknown`,`checking`,`ok`,`failed`,`development`]),serverId:L,shell:N(QM)}),eN=Aj(`neko.application-info`,{version:1,input:P({}),variants:{ready:{state:{info:$M},methods:{check:kj(Nj,$M)}}}}),tN=16777216,nN=e=>e instanceof Uint8Array?e:new Uint8Array(e),rN=e=>typeof e==`string`?new TextEncoder().encode(e).byteLength:e.byteLength;function iN(e,t=tN,n){let r=0,i=0,a=!1,o;return o=RA({get readyState(){return e.readyState},send(n){if(rN(n)+e.bufferedAmount>t)throw e.close(1009,`byte limit`),Error(`Link pending byte limit exceeded`);e.send(n)},close:(t,n)=>e.close(t,n),addEventListener(n,s){if(n===`message`){let n=e=>{let n=rN(e);a||(i+=n),n>t||i>t?o.close(`frame limit exceeded`):s({data:e})};e.on?e.on(`message`,(e,t)=>n(t?nN(e):new TextDecoder().decode(nN(e)))):e.addEventListener(`message`,e=>n(typeof e.data==`string`||e.data instanceof Uint8Array?e.data:String(e.data)))}else e.addEventListener(n,()=>{n===`open`&&(r=0);try{s()}catch{o.close(`socket error`)}})}},n),e.addEventListener(`error`,()=>o.close(`socket error`)),{get closed(){return o.closed},send(n){if(o.closed)return;if(e.readyState>1){o.close(`socket closed`);return}let i=rN(JSON.stringify(n));if(i>t||i+e.bufferedAmount+r>t)throw o.close(`pending byte limit exceeded`),Error(`Link byte limit exceeded`);return e.readyState===0&&(r+=i),o.send(n)},receive(e){a=!0,i=0,o.receive(e)},onClose:e=>o.onClose(e),close:e=>o.close(e)}}function aN(e,t={}){return rj({kind:`client`,self:{kind:`client`},upstream:{link:e,principal:{kind:`server`},...t.onProtocolMismatch?{onProtocolMismatch:t.onProtocolMismatch}:{}},onError:()=>{}})}function oN(e){let t,n,r,i,a=()=>(n||(n=e(),i=n.onStatus((e,n)=>{if(e===`gone`){r=String(n??`Subagent unavailable`);for(let e of s)e(t)}})),n),o=()=>{i?.(),i=void 0,n?.release(),n=void 0},s=new Set,c,l=0,u=0,d=!1;async function f(e,t,n=()=>!0){let r,i=0,o=[];for(;;){if(!n())throw Error(`Transcript subscription closed`);let s=await a().chunk({kind:e,before:t,token:r,offset:i});if(!n())throw Error(`Transcript subscription closed`);if(o.push(s.data),r=s.token,s.next===null)return JSON.parse(o.join(``));i=s.next}}let p=async()=>{if(d||!s.size||!u)return;d=!0;let e=l,n=0;try{do{n=u;try{let n=await f(`view`,void 0,()=>l===e&&s.size>0);if(l!==e)return;r=void 0,t=n;for(let e of s)e(t)}catch(i){if(l!==e)return;if(u===n){r=String(i);for(let e of s)e(t)}}}while(u!==n)}finally{d=!1,l!==e&&s.size&&p()}};return{get error(){return r},view:{get value(){return t},subscribe(e){return s.add(e),e(t),c||=a().revision.subscribe(e=>{u=e??0,p()}),()=>{s.delete(e),s.size||(l++,c?.(),c=void 0,o())}}},history:async e=>{let t=l;try{return await f(`history`,e.before,()=>t===l)}finally{s.size||o()}},getImage:async(e,t)=>{try{return await a().getImage(e,t)}finally{s.size||o()}},decideApproval:async(e,t)=>{try{return await a().decideApproval(e,t)}finally{s.size||o()}},stop:async(e,t)=>{try{return await a().stop(e,t)}finally{s.size||o()}}}}var sN=class{#e=new Map;#t;#n;constructor(e,t){this.#t=e,this.#n=t}get pending(){return[...this.#e.values()].flatMap(({service:e,title:t})=>(e.view.value?.approvals??[]).filter(e=>e.status===`pending`).map(n=>({item:n,title:t,service:e}))).sort((e,t)=>e.item.createdAt-t.item.createdAt||e.item.id-t.item.id)}get error(){return[...this.#e.values()].find(({service:e})=>e.error)?.service.error}update(e){let t=e.filter(e=>e.approvalCount&&e.historyThrough===void 0);for(let[e,n]of this.#e)t.some(t=>(t.agentId??t.taskId)===e)||(this.#e.delete(e),n.stop());for(let e of t){let t=e.agentId??e.taskId;if(this.#e.has(t))continue;let n=this.#t(t),r={service:n,title:e.title,stop:()=>{}};this.#e.set(t,r),r.stop=n.view.subscribe(()=>this.#n())}this.#n()}close(){for(let e of this.#e.values())e.stop();this.#e.clear(),this.#n()}},cN=class extends Error{constructor(){super(`Gateway identity mismatch`),this.name=`GatewayIdentityError`}},lN=`This gateway does not support background jobs. Restart the gateway to enable them.`;function uN(e){let t=()=>e.view.value?.jobs!==void 0,n=()=>{if(!t())throw Error(lN)};return{get supported(){return t()},list:()=>e.view.value?.jobs??[],async output(t,r){return n(),e.jobOutput({jobId:t,...r===void 0?{}:{since:r}})},async stop(t){return n(),e.jobStop({jobId:t})}}}var dN=`This gateway does not support queued message controls. Restart the gateway to enable them.`;function fN(e){let t=()=>e.view.value?.queued!==void 0;return{get supported(){return t()},list:()=>e.view.value?.queued??[],async steer(n){if(!t())throw Error(dN);return e.steer({id:n})},async withdraw(n){if(!t())throw Error(dN);return e.withdraw({id:n})}}}var pN=`This gateway does not support questions. Restart the gateway to enable them.`,mN={revision:0,pending:[]};function hN(e){let t=()=>e.view.value?.questions??mN,n=()=>e.view.value?.questions!==void 0;return{get supported(){return n()},get revision(){return t().revision},pending:()=>t().pending,async get(t){if(!n())throw Error(pN);return e.questionGet({id:t})},async respond(t){if(!n())throw Error(pN);return e.questionRespond(t)}}}var gN=`This gateway does not support plan mode. Restart the gateway to enable it.`;function _N(e){let t=()=>e.view.value?.plan!==void 0;return{get supported(){return t()},view:()=>e.view.value?.plan,async get(n){if(!t())throw Error(gN);return e.planGet({version:n})},async respond(n){if(!t())throw Error(gN);return e.planRespond(n)},async setMode(n){if(!t())throw Error(gN);return e.planMode({mode:n})}}}var vN=`This gateway does not support the workspace browser. Restart the gateway to enable it.`;function yN(e,t){let n=()=>e.view.value?.changes!==void 0,r=()=>{if(!n())throw Error(vN)},i=(e,n)=>e&&t?t.root(e=>n(e),{signal:e}):n();return{get supported(){return n()},summary:()=>e.view.value?.changes,async dir(t,n){return r(),i(n,n=>e.workspaceDir({path:t},n))},async file(t,n){return r(),i(n,n=>e.workspaceFile({path:t},n))},async changes(){return r(),e.changesList(null)},async change(t){return r(),e.changeGet({path:t})}}}function bN(e,t,n={}){let r=n.readyTimeoutMs??xN,i=!1,a=new AbortController,o=``;e.onClose(e=>{o=e,a.abort(Error(`Gateway connection closed: ${e}`))});let s=aN(e,{onProtocolMismatch:()=>{i=!0}}),c=e=>s.hold(e,{}),l=c(eN),u=[l.info.subscribe(()=>{})],d,f=!1;function p(){let e=c(SM),t=c(CM),n=c(DM),r=c(NM),i=c(KM),a=c(FM),o=c(LM),s=c(HM),l=c(WM),d=c(ZM);return u.push(e.state.subscribe(()=>{}),r.state.subscribe(()=>{}),a.state.subscribe(()=>{}),o.state.subscribe(()=>{}),s.state.subscribe(()=>{}),l.state.subscribe(()=>{})),{directory:e,management:t,models:n,workspaces:r,workspaceFiles:i,credentials:a,searchSettings:o,contextSettings:s,defaultModel:l,skillMarket:d}}let m=()=>{if(!f)throw Error(`Gateway protocol not checked`);return d||=p(),d},h=async e=>{await SN(l.ready,e,r);let n=l.info.value;if(n.serverId!==t)throw new cN;if(n.protocolVersion!==8)throw new Wi;f=!0;let{directory:i,management:a,models:o,workspaces:s,credentials:c,searchSettings:u,contextSettings:d,defaultModel:p,workspaceFiles:h,skillMarket:g}=m();await SN(Promise.all([i.ready,a.ready,o.ready,s.ready,c.ready,u.ready,d.ready,p.ready,h.ready,g.ready]),e,r)},g,_,v,y=!1,b,x={application:l,subagent(e){if(!_)throw Error(`No active session`);let t={..._,...typeof e==`string`?{agentId:e}:{taskId:e}};return oN(()=>s.hold(kM,t))},host:s,link:e,get directory(){return m().directory},get management(){return m().management},get models(){return m().models},get workspaces(){return m().workspaces},get workspaceFiles(){return m().workspaceFiles},get credentials(){return m().credentials},get searchSettings(){return m().searchSettings},get contextSettings(){return m().contextSettings},get defaultModel(){return m().defaultModel},get skillMarket(){return m().skillMarket},get attachment(){return _},async ready(e){try{await h(e?AbortSignal.any([e,a.signal]):a.signal)}catch(e){throw i||o.startsWith(`protocol`)?new Wi:e}},async attach(e,t){let n=await x.management.attach(e,t);if(g?.status===`live`&&g.view.value!==void 0&&_?.attachmentId===n.attachmentId)return g;v?.(),g?.release(),_=n;let i=s.hold(AM,n);g=i,v=i.view.subscribe(()=>{});try{if(await SN(i.ready,t?.signal,r),i!==g)throw Error(`Attachment changed`);return i}catch(e){throw i.release(),i===g&&(v?.(),v=void 0,g=void 0,_=void 0),e}},async detach(){v?.(),v=void 0,g?.release(),g=void 0,_=void 0,y||await x.management.detach(null)},async close(){return b||(y=!0,b=(async()=>{v?.(),g?.release();for(let e of u)e();await s.close()})(),b)}};return e.onClose(()=>{x.close().catch(()=>{})}),x}var xN=5e3;function SN(e,t,n){let r,i=()=>{};return Promise.race([e,new Promise((e,a)=>{r=setTimeout(()=>a(Error(`Gateway readiness timed out`)),n),i=()=>a(t?.reason??Error(`Cancelled`)),t?.addEventListener(`abort`,i,{once:!0}),t?.aborted&&i()})]).finally(()=>{clearTimeout(r),t?.removeEventListener(`abort`,i)})}var CN=`neko.language`,wN=[`zh`,`en`],TN={zh:`zh-CN`,en:`en`};function EN(e){return e===`zh`||e===`en`?e:`zh`}function DN(e=AN()){try{return EN(e?.getItem(CN))}catch{return`zh`}}function ON(e,t=AN()){try{e===`zh`?t?.removeItem(CN):t?.setItem(CN,e)}catch{}}function kN(e,t=jN()){t?.documentElement.setAttribute(`lang`,TN[e])}function AN(){try{return typeof localStorage>`u`?void 0:localStorage}catch{return}}function jN(){return typeof document>`u`?void 0:document}function MN(e={}){let t=e.storage??AN(),n=e.doc??jN(),r=e.target??(typeof window>`u`?void 0:window),i=DN(t),a=new Set;function o(e){if(e!==i){i=e,kN(i,n);for(let e of a)e()}}let s=e=>{let n=e.key;(n===null||n===`neko.language`)&&o(DN(t))};return{get:()=>i,set(e){let n=EN(e);ON(n,t),o(n)},reset(){ON(`zh`,t),o(`zh`)},start(){i=DN(t),kN(i,n),r?.addEventListener(`storage`,s)},stop(){r?.removeEventListener(`storage`,s)},subscribe(e){return a.add(e),()=>a.delete(e)}}}var NN;function PN(){return NN??=MN(),NN}function FN(){return PN().get()}function IN(e=PN()){return(0,f.useSyncExternalStore)(e.subscribe,e.get,()=>`zh`)}var LN={zh:{"common.connected":`已连接`,"common.connecting":`连接中…`,"common.loading":`读取中…`,"settings.menuLabel":`设置菜单`,"settings.backToChat":`← 返回聊天`,"settings.title":`设置`,"settings.menu.credentials":`模型服务`,"settings.menu.search":`联网搜索`,"settings.menu.context":`上下文`,"settings.menu.appearance":`外观`,"settings.menu.language":`语言 / Language`,"settings.menu.mobile":`手机配对`,"settings.menu.about":`关于与更新`,"settings.credentials.title":`模型服务`,"settings.credentials.intro":`启用要使用的模型服务并配置 API Key;保存值优先于环境变量,所有工作区共用。DeepSeek 始终启用。`,"settings.credentials.providerLabel":`模型服务商`,"settings.credentials.disabled":`未启用`,"settings.credentials.configured":`已配置`,"settings.credentials.keyMissing":`未配置 Key`,"settings.credentials.enabledCount":`已启用 {enabled} / {total}`,"settings.search.title":`联网搜索`,"settings.search.intro":`选择助手联网搜索使用的服务,并管理 Tavily 与 DeepSeek 的 API Key。`,"settings.search.deepseekNote":`与「模型服务」共用同一个 DeepSeek Key,在任一页面保存或移除都会同步。`,"settings.context.title":`上下文`,"settings.context.intro":`管理长对话如何节省上下文。点选即保存、立即生效,所有工作区共用;不选“默认”则沿用原有行为。`,"settings.mobile.title":`手机配对`,"settings.mobile.intro":`在手机 App 上控制电脑上的 Agent;配对管理仅限电脑本机。`,"settings.appearance.title":`外观`,"settings.appearance.intro":`选择主题与聊天排版。点选即保存、立即生效,只保存在当前浏览器,不影响终端界面与手机端。`,"language.title":`语言 / Language`,"language.intro":`选择界面语言。点选即保存、立即生效,只保存在当前浏览器,不影响终端界面与手机端,也不改变对话内容。`,"language.legend":`界面语言`,"language.option.zh":`中文`,"language.option.en":`English`,"appearance.theme":`主题`,"appearance.theme.sakura":`樱花`,"appearance.theme.sakuraBlurb":`蓝粉白浅色,默认`,"appearance.theme.light":`纸白`,"appearance.theme.lightBlurb":`中性冷灰白,克制`,"appearance.theme.dark":`夜墨`,"appearance.theme.darkBlurb":`深蓝灰深色,夜间友好`,"appearance.previewUser":`你好`,"appearance.previewAssistant":`你好,有什么可以帮你?`,"appearance.typography":`聊天排版`,"appearance.typographyBlurb":`只影响聊天里的消息正文与输入框;代码块、工具卡与侧栏保持不变。`,"appearance.font":`字体`,"appearance.fontHint":`使用本机已安装的系统字体,实际效果取决于你的设备;缺少时自动回退。`,"appearance.font.sans":`无衬线`,"appearance.font.serif":`衬线`,"appearance.font.mono":`等宽`,"appearance.size":`字号`,"appearance.size.13":`小 13px`,"appearance.size.14":`默认 14px`,"appearance.size.16":`大 16px`,"appearance.size.18":`特大 18px`,"appearance.weight":`字重`,"appearance.weight.regular":`常规`,"appearance.weight.medium":`中等`,"appearance.weight.semibold":`偏粗`,"appearance.leading":`行高`,"appearance.leading.compact":`紧凑`,"appearance.leading.normal":`标准`,"appearance.leading.relaxed":`宽松`,"appearance.sample":`示例`,"appearance.sampleBlurb":`随上面的选择即时变化。`,"appearance.sampleUser":`帮我看看这个函数为什么返回了 undefined?`,"appearance.sampleAssistantIntro":"这是一段**示例回答**,用来预览当前排版。行内代码如 `const total = items.length`,下面是代码块:","appearance.sampleItem1":`列表项一`,"appearance.sampleItem2":`列表项二`,"appearance.isDefault":`当前为默认外观`,"appearance.customized":`已自定义`,"appearance.reset":`恢复默认`,"credential.source.saved":`使用已保存密钥`,"credential.source.environment":`使用环境变量`,"credential.source.runtime":`使用运行时配置`,"credential.source.keyless":`keyless(限流)`,"credential.source.none":`尚未配置`,"credential.failed":`操作失败,请检查连接后重试。`,"credential.removed":`已移除保存的密钥`,"credential.saved":`已保存,下次请求生效`,"credential.enableAria":`启用 {name}`,"credential.enabledDone":`已启用`,"credential.disabledDone":`已取消启用`,"credential.alwaysOn":`始终启用`,"credential.enable":`启用`,"credential.envVar":`环境变量:{state}({envVar})`,"credential.envConfigured":`已配置`,"credential.envMissing":`未配置`,"credential.keylessNote":` · 未配置时以 keyless 限流模式运行`,"credential.keyLabel":`{name} API Key`,"credential.placeholderReplace":`输入新密钥以替换`,"credential.placeholderNew":`粘贴你的 API Key`,"credential.working":`处理中…`,"credential.save":`保存密钥`,"credential.remove":`移除已保存密钥`,"credential.getKey":`获取 {name} API Key ↗`,"search.switched":`已切换为{name},下次搜索生效`,"search.saveFailed":`保存失败,请检查连接后重试。`,"search.service":`搜索服务`,"search.current":`当前使用:{name}`,"search.intro":`选择助手联网搜索与读取网页使用的服务;保存后下一次调用生效。`,"search.source.saved":`已保存密钥`,"search.source.environment":`环境变量`,"search.source.runtime":`运行时配置`,"search.source.keyless":`keyless 限流`,"search.source.none":`未配置密钥`,"search.tavilyDescription":`使用 Tavily 搜索与抓取({source}),默认选项`,"search.deepseekDescription":`使用 DeepSeek 搜索与抓取,共用 DeepSeek 密钥({source})`,"search.deepseekWarning":`尚未配置 DeepSeek 密钥,搜索将不可用。请在下方 DeepSeek 卡片配置密钥,或改选 Tavily。`,"providerCombo.placeholder":`选择服务商`,"providerCombo.empty":`没有匹配的服务商。`,"model.context":`{size} 上下文`,"model.images":`支持图片`,"model.textOnly":`仅文本`,"model.reasoning":`支持思考`,"model.noReasoning":`无思考`,"context.row.compactionTrigger.label":`触发时机`,"context.row.compactionTrigger.description":`上下文达到模型窗口的这个比例时自动压缩。默认接近窗口上限。`,"context.row.keepRecentTokens.label":`保留近期`,"context.row.keepRecentTokens.description":`压缩时逐字保留的近期内容,越多越不容易丢细节。`,"context.row.pruningTrigger.label":`触发时机`,"context.row.pruningTrigger.description":`上下文达到模型窗口的这个比例时裁剪旧结果。`,"context.row.keepRecent.label":`保留最近结果`,"context.row.keepRecent.description":`最新的这些工具结果永远保持完整。`,"context.row.minChars.label":`最小结果长度`,"context.row.minChars.description":`短于这个长度的结果不会被裁剪。`,"context.row.minSave.label":`单次最小释放量`,"context.row.minSave.description":`单次裁剪预计释放的上下文达到模型窗口的这个比例才会执行。每次裁剪都会使提示词缓存失效,比例越大,裁剪越少、越集中。`,"context.source.default":`默认`,"context.source.config":`配置文件`,"context.source.saved":`已保存`,"context.value.chars":`{value} 字符`,"context.value.charsK":`{value}k 字符`,"context.value.count":`{value} 个`,"context.chipDefault":`默认`,"context.chipCustom":`{value} · 自定义`,"context.nearLimit":`接近窗口上限`,"context.current":`当前生效 {value} · {source}`,"context.marker.pruning":`裁剪`,"context.marker.compaction":`压缩`,"context.group.compaction.title":`上下文压缩`,"context.group.compaction.blurb":`对话变长时,把较早的内容整理成摘要,腾出空间继续聊。手动 /compact 始终可用。`,"context.group.pruning.title":`工具结果裁剪`,"context.group.pruning.blurb":`把较早的大段工具输出在模型眼中换成一行说明;界面里的完整结果和历史记录不受影响。每次裁剪会让提示词缓存失效,所以按批量进行。`,"context.threshold.aria":`触发位置预览`,"context.threshold.title":`触发位置`,"context.threshold.window":`模型上下文窗口`,"context.threshold.allOff":`自动压缩与裁剪均已关闭。`,"context.fromConfig":`来自配置文件,选择其他档位会覆盖它。`,"context.saveFailed":`保存失败,请检查连接后重试。`,"context.restored":`{label}已恢复默认`,"context.saved":`已保存`,"context.switch.compaction":`自动压缩`,"context.switch.pruning":`裁剪工具结果`,"context.allRestored":`已全部恢复默认`,"context.restoreAll":`全部恢复默认`,"context.saving":`保存中…`,"common.close":`关闭`,"about.intro":`查看 neko 系统版本状态及软件更新。`,"about.checkDone":`检查完成`,"about.checkDevelopment":`开发版本不检查发布更新`,"about.checkFailedRetry":`检查失败,请重试`,"about.checking":`检查中…`,"about.badge.incompatible":`协议不兼容`,"about.badge.install":`发现新版本`,"about.badge.restart":`已就绪 · 待重启`,"about.badge.refresh":`页面待更新`,"about.badge.development":`开发版本`,"about.badge.failed":`检查失败`,"about.badge.latest":`已是最新`,"about.versionStatus":`版本状态`,"about.currentVersion":`当前版本`,"about.latestStable":`最新稳定版`,"about.runUpdate":`可运行 neko update 升级`,"about.installedNew":`已安装新版本`,"about.newVersion":`新版本`,"about.afterRestart":`重启 neko 进程后生效`,"about.staticUpdated":`静态服务已更新`,"about.afterRefresh":`刷新页面后生效`,"about.checkUpdates":`检查更新`,"about.copyUpdate":`复制 neko update`,"about.refreshPage":`刷新页面`,"about.commandShell":`命令 shell`,"about.upgradeTitle":`升级说明`,"about.upgradeBefore":`在终端运行`,"about.upgradeAfter":`,完成后重启 neko 即可生效。`,"about.draftKept":`升级前保留的草稿`,"update.copied":`已复制 neko update,在运行 neko 的电脑上执行`,"update.copyManually":`请复制命令:neko update`,"update.install":`发现新版本 · 运行 neko update`,"update.refreshPage":`页面已更新`,"update.incompatible":`版本不兼容 · 更新并重启 neko`,"update.restart":`已升级 · 请重新启动本地 neko`,"update.copyCommand":`复制命令`,"update.refresh":`刷新`,"update.viewSteps":`查看步骤`,"update.dismiss":`关闭更新提示`,"shell.dismiss":`关闭 shell 提示`,"shell.invalid":`{detail}bash 与后台任务不可用,请修正 neko.config.json 中的 shell.path。`,"shell.invalidDefault":`shell.path 配置无效。`,"shell.missing":`未找到 Git Bash:bash 与后台任务不可用。请安装 Git for Windows,或在 neko.config.json 中设置 shell.path。`,"shell.ready":`已就绪`,"shell.unavailable":`不可用`,"shell.sourceConfig":`{path}(配置 shell.path)`,"shell.sourceAuto":`{path}(自动检测)`,"pairing.qrTitle":`手机配对二维码`,"pairing.getFailed":`GET {path} 失败({status})`,"pairing.requestFailed":`请求失败({status})`,"pairing.disabledNotice":`手机访问已关闭,已受理的任务继续运行。`,"pairing.addressRequired":`请选择要监听的局域网地址。`,"pairing.portInvalid":`端口必须是 1-65535 的整数。`,"pairing.enabledNotice":`手机访问已开启:{address}`,"pairing.qrGenerated":`二维码已生成,120 秒内有效。`,"pairing.certRotated":`证书已重新生成({fingerprint}…),手机需重新扫码配对。`,"pairing.revoked":`已撤销设备授权,该设备已受理的任务继续运行。`,"pairing.revokeMissing":`设备不存在或已撤销。`,"pairing.unsupported":`当前 gateway 版本不支持手机配对。请更新或重启电脑端后刷新本页;聊天功能不受影响。`,"pairing.stateOn":`已开启 · https://{address}{relay}`,"pairing.relayed":`(经 Windows 中继)`,"pairing.stateError":`开启失败`,"pairing.stateOff":`已关闭`,"pairing.intro":`允许手机控制电脑上的 Agent。配对仅限本机管理,请只在可信网络中开启。`,"pairing.wslNote":`当前在 WSL 中运行:这里列出的是 Windows 的局域网地址,开启后由 Windows 侧的转发进程接入手机连接(无需管理员权限,关闭手机访问或退出 neko 时自动停止)。`,"pairing.startFailed":`开启失败:{error}。请检查所选地址与端口是否被占用。`,"pairing.allow":`允许手机控制电脑上的 Agent`,"pairing.address":`地址`,"pairing.noAddressWindows":`未发现 Windows 局域网地址`,"pairing.noAddress":`未发现局域网地址`,"pairing.lastConnected":`{address}(上次连接成功)`,"pairing.port":`端口`,"pairing.noUsableWindows":`未发现可用的 Windows 局域网地址,请确认 Windows 已连接网络且 WSL 互操作可用。`,"pairing.noUsable":`未发现可用的局域网地址,请确认电脑已连接网络(本机回环地址不可用于手机访问)。`,"pairing.qrRemaining":`二维码剩余 {seconds} 秒`,"pairing.copyText":`复制配对文本`,"pairing.refreshQr":`刷新二维码`,"pairing.qrExpired":`二维码已过期,请刷新后重新扫码。`,"pairing.generateQr":`生成二维码`,"pairing.scanHint":`用手机 App 扫码,或点击「复制配对文本」后在 App 中粘贴。请确保手机与电脑在同一网络,防火墙放行所选端口{relay}。`,"pairing.relayFirewall":`(WSL 下需在 Windows 防火墙放行 powershell.exe)`,"pairing.certificate":`证书`,"pairing.certInfo":`{fingerprint}… · 到期 {date}`,"pairing.regenerate":`重新生成证书`,"pairing.certExpiring":`证书即将到期,建议尽快重新生成;重新生成后全部手机需重新扫码。`,"pairing.regenerateWarning":`重新生成会断开全部手机并撤销全部设备授权,电脑上已受理的任务继续运行。`,"pairing.devices":`已配对设备`,"pairing.noDevices":`暂无已配对设备。`,"pairing.online":`在线`,"pairing.offline":`离线`,"pairing.lastSeen":`最后连接 {time}`,"pairing.revoke":`撤销`,"pairing.spawnedBefore":`本页面通过 neko web 启动了 gateway;退出本页面会同时停止 gateway 与手机入口。需要手机长期连接时,请改用`,"pairing.spawnedAfter":`或保持 TUI 运行。`,"pairing.regenerateConfirm":`将生成新的自签名证书:全部手机断开、全部设备授权失效,需要重新扫码配对。电脑上已受理的任务继续运行。`,"pairing.confirmRegenerate":`确认重新生成`,"pairing.revokeTitle":`撤销设备「{name}」`,"pairing.revokeConfirm":`撤销后该手机立即断开且无法重新连接;电脑上已受理的任务继续运行,停止任务需在电脑上单独操作。`,"pairing.confirmRevoke":`确认撤销`,"common.cancel":`取消`,"gw.notConnected":`网关未连接`,"gw.sessionNotReady":`会话未就绪`,"gw.sessionChangedDraft":`会话已切换,草稿已保留`,"gw.sessionChanged":`会话已切换`,"gw.sessionChangedOrNotReady":`会话已切换或未就绪`,"gw.sessionChangedAnswerDraft":`会话已切换或未就绪,答案草稿已保留`,"gw.sessionChangedFeedbackDraft":`会话已切换或未就绪,反馈草稿已保留`,"gw.connectionChanged":`连接已变化,请重试`,"gw.busy":`操作进行中或网关未连接,请稍后重试`,"gw.workspaceMissing":`工作区不存在`,"gw.sessionNotInWorkspace":`会话不属于当前工作区或已归档`,"gw.workspaceNotReady":`工作区未就绪`,"gw.incompatible":`版本不兼容,请运行 neko update 后重新启动本地 neko。`,"gw.infoFailed":`GET /api/info 失败({status})`,"gw.invalidInfo":`无效的网关信息`,"gw.infoLoadFailed":`获取网关信息失败:{error}`,"gw.sessionGone":`原会话不可用,升级草稿保留在关于与更新中`,"gw.notReady":`网关连接未就绪,请稍候或刷新页面。`,"gw.sessionChangedRetry":`会话已变化,请重试`,"gw.notStarted":`网关尚未连接`,"core.status.thinking":`思考中…`,"core.status.running":`运行 {tool}…`,"core.status.retrying":`重试中(第 {attempt} 次)…`,"core.row.compacted":`[上下文已压缩]`,"core.row.newContext":`[新上下文]`,"core.note.notRun":`未运行:响应被中断。`,"core.error.providerDisabled":`PROVIDER_DISABLED: {provider} 未启用。请在 /login 或 Web 设置中启用,或切换模型。`,"core.error.providerKeyRequired":`PROVIDER_KEY_REQUIRED: 请在 /login 或 Web 设置中配置 {provider} 的 API Key。`,"core.error.planBusy":`PLAN_BUSY: 请等待当前运行结束,或先停止它。`,"plan.status.awaiting_approval":`待批准`,"plan.status.approved":`已批准`,"plan.status.revision_requested":`要求修改`,"plan.status.superseded":`已取代`,"plan.status.cancelled":`已取消`,"plan.modeLabel":`规划模式(只读)`,"plan.unsupported":`当前网关不支持规划模式,请重启网关后再试`,"plan.settle.approved":`已批准,开始执行计划`,"plan.settle.revised":`已提交修改要求,仍在规划模式`,"plan.settle.superseded":`该计划已被新的输入取代,没有保存你的决定。`,"plan.settle.cancelled":`该计划已取消(运行已停止或已离开规划模式),没有保存你的决定。`,"plan.settle.pending":`决定尚未保存,请重试。`,"plan.settle.other":`该计划已由其他端先处理,以已保存的结果为准:{status}`,"plan.busy":`会话运行中,请先等待回答结束或停止后再试`,"title.answerPrefix":`({count}) 等待回答 · `,"title.planPrefix":`等待批准 · `,"todo.status.pending":`待办`,"todo.status.in_progress":`进行中`,"todo.status.completed":`已完成`,"question.status.pending":`等待回答`,"question.status.answered":`已回答`,"question.status.skipped":`已跳过`,"question.status.cancelled":`已取消`,"question.settle.answeredWith":`已回答:{answer}`,"question.settle.answered":`已回答`,"question.settle.skipped":`已跳过,未提供答案`,"question.settle.cancelled":`已取消(运行已停止或会话已归档)`,"session.suffix.awaitingAnswer":` · 等待回答`,"session.suffix.awaitingPlan":` · 等待批准`,"session.suffix.running":` · 运行中`,"session.suffix.error":` · 出错`,"composer.input":`消息输入`,"composer.upgrade.sending":`发送中,请稍后刷新`,"composer.upgrade.attachments":`先发送或移除附件,再刷新`,"composer.upgrade.notReady":`连接未就绪,请稍后重试`,"composer.upgrade.otherDrafts":`其他会话有草稿,请先发送或清空`,"composer.upgrade.saveFailed":`草稿保存失败,请先复制文字`,"composer.attach.type":`仅支持 PNG、JPEG、WebP`,"composer.attach.size":`单图不能超过 20 MiB`,"composer.attach.decode":`无法解码图片,请重新选择`,"composer.attach.limit":`每条消息最多 4 张图片,总大小不超过 40 MiB`,"composer.attach.removeUnsupported":`请先移除不支持的附件`,"composer.attach.checking":`检查图片…`,"composer.attach.remove":`移除 {name}`,"composer.skills.newSession":`新建会话后可选择工作区技能`,"composer.skills.waiting":`等待会话连接…`,"composer.skills.loading":`正在加载技能…`,"composer.skills.empty":`当前工作区暂无可用技能`,"composer.skills.failed":`技能加载失败,请关闭菜单后重试`,"composer.image.reading":`正在读取图片…`,"composer.image.readFailed":`图片读取失败,请重试`,"composer.workspaceChanged":`工作区已切换`,"composer.workspaceChangedDraft":`工作区已切换,草稿已保留`,"composer.compaction.retrying":`压缩重试中`,"composer.compaction.waiting":`等待上下文压缩`,"composer.compaction.running":`正在压缩上下文`,"composer.compaction.failure":`压缩失败:{error}`,"composer.compaction.applied":`上下文已压缩`,"composer.compaction.nothing":`当前无需压缩`,"composer.compaction.skipped":`已跳过过期摘要`,"composer.compaction.cancelled":`压缩已取消`,"composer.compaction.failed":`压缩失败,可重试`,"composer.compaction.applying":`等待应用压缩摘要`,"composer.compaction.nothingTitle":`保留近期上下文,暂无可压缩的旧内容;默认保留最近约 20,000 tokens`,"composer.compactFailed":`压缩失败,请重试`,"composer.plan.noArgs":`/plan 不接受参数;先切换到规划模式,再正常描述需求`,"composer.plan.needSession":`请先开始会话,再切换规划模式`,"composer.plan.busy":`会话运行中,请先等待回答结束或停止后再切换规划模式`,"composer.planModeTitle":`只读调研并提交计划;批准后自动退出并开始执行。输入 /plan 可退出`,"composer.sendFailed":`发送失败,请重试`,"composer.queue.steerWithdrawn":`无法改为引导,消息已撤回到输入框`,"composer.queue.gone":`该消息已不在队列中`,"composer.queue.sentNoSteer":`该消息已发送,无法引导`,"composer.queue.steerFailed":`引导失败,请重试`,"composer.queue.imagesNotRestored":`图片未恢复,请重新添加`,"composer.queue.sentNoWithdraw":`该消息已发送,无法撤回`,"composer.queue.withdrawFailed":`撤回失败,请重试`,"composer.questionHint":`助手正在等待你的回答。此处发送的消息仍会排队(含引导),回答或跳过后才进入上下文,不会当作答案。`,"composer.openQuestion":`打开问题`,"composer.dropHint":`松开以添加图片,不会自动发送`,"composer.provider.disabled":`模型服务 {provider} 已取消启用,请重新启用或切换模型。`,"composer.provider.keyMissing":`尚未配置 {provider} Key。`,"composer.provider.goSettings":`前往设置`,"composer.noVision":`当前模型不支持图片,请切换模型或移除附件。`,"composer.noHistoryImages":`当前模型无法查看历史原图,仍可使用已有文字分析。`,"composer.placeholder.waiting":`助手在等你回答,此处消息将排队`,"composer.placeholder.busy":`运行中:消息将在回答结束后排队,可在排队条中引导或撤回`,"composer.placeholder.idle":`输入消息,@ 引用文件,/ 命令`,"composer.addImage":`添加图片`,"composer.addImageTitle":`添加图片(最多 4 张)`,"composer.menu":`输入操作菜单`,"composer.ctx.none":`暂无有效用量;首次回答或压缩后的新回答完成后更新`,"composer.ctx.usage":`最近一次成功回答的上下文用量:{tokens} / {window} tokens;非会话累计用量`,"composer.usage.aria":`任务总用量:输入 {input},输出 {output},缓存读 {cacheRead},成本 {cost}`,"composer.usage.detail":`输入 {input} · 输出 {output} · 缓存读 {cacheRead} · {cost}`,"composer.working":`处理中`,"composer.queue":`排队`,"composer.send":`发送`,"composer.stopTitle":`中止当前会话运行及可中止任务`,"composer.stop":`停止`,"composer.commandTitle":`输入命令`,"composer.noCommands":`没有匹配的命令或技能`,"common.retry":`重试`,"common.loadingEllipsis":`加载中…`,"common.workspace":`工作区`,"common.newSession":`新会话`,"approval.status.pending":`等待审批`,"approval.status.allowed":`已允许本次`,"approval.status.denied":`已拒绝`,"approval.status.cancelled":`已取消`,"approval.section":`Bash 审批`,"approval.timeout":`超时:{value}`,"approval.timeoutDefault":`默认`,"approval.command":`完整命令`,"approval.allow":`允许本次`,"approval.deny":`拒绝`,"approval.inbox":`待审批命令`,"askUser.answer":`回答:{answer}`,"askUser.skipped":`已跳过,未提供答案`,"askUser.cancelled":`问题已取消,没有收到回答`,"askUser.record":`助手提问记录`,"askUser.badge":`助手提问`,"askUser.locate":`定位到问题`,"suggest.hint":`↑↓ 选择 · Enter / Tab 确认 · Esc 关闭`,"suggest.retryFiles":`重试文件查询`,"copy.copied":`已复制`,"copy.failed":`复制失败`,"copy.label":`复制`,"export.busy":`导出中…`,"export.empty":`当前会话还没有内容可导出`,"export.title":`导出会话`,"export.failed":`导出失败:{error}`,"export.button":`导出`,"export.format":`导出格式`,"export.thinking":`包含思考过程`,"export.cancelled":`会话已切换,导出已取消`,"export.done":`已导出 {name}`,"export.doneSkipped":`已导出 {name},{count} 张图片未能内嵌`,"mention.searching":`正在查找文件…`,"mention.incomplete":`文件索引未完整,请输入子目录缩小范围`,"mention.limited":`结果较多,请继续输入路径缩小范围`,"mention.empty":`没有匹配的文件或目录`,"mention.errorWith":`查询失败:{error}`,"mention.error":`查询失败,请重试`,"mention.title":`工作区文件`,"tree.symlinkTitle":`符号链接(不跟随)`,"tree.symlink":`符号链接`,"tree.protectedTitle":`受保护文件,不提供查看`,"tree.protected":`受保护文件`,"tree.emptyDir":`空目录`,"tree.readFailed":`读取失败:{error}`,"tree.incomplete":`列表不完整:{reason}`,"tree.limitedDir":`该目录子项过多,仅显示部分。`,"tree.limitedWorkspace":`工作区文件过多,枚举已被截断。`,"tree.readOnly":`只读浏览`,"tree.refreshAria":`刷新文件树`,"tree.refresh":`刷新`,"tree.aria":`工作区文件树`,"viewer.content":`文件内容`,"viewer.zoom":`代码缩放`,"viewer.zoomOut":`缩小代码`,"viewer.zoomReset":`重置缩放`,"viewer.zoomResetTitle":`重置为 100%`,"viewer.zoomIn":`放大代码`,"viewer.refreshAria":`刷新文件内容`,"viewer.refreshing":`刷新中…`,"viewer.refresh":`刷新`,"viewer.workspaceRoot":`(工作区根目录)`,"viewer.stale":`agent 修改了此文件,当前显示的内容可能已过期。`,"viewer.reload":`刷新内容`,"viewer.missing":`文件不存在`,"viewer.missingDetail":`该文件可能已被删除或移出工作区。`,"viewer.readFailed":`读取失败:{error}`,"viewer.protected":`受保护文件,不提供查看`,"viewer.protectedDetail":`凭据类文件(如 .env、私钥)的内容不会通过浏览器下发,以免经网络泄露。`,"viewer.binary":`二进制文件,不提供预览`,"viewer.binarySize":`大小 {size}`,"viewer.refreshFailed":`刷新失败:{error}`,"viewer.truncated":`已截断,仅显示开头部分,文件共 {size}`,"changes.scopeNote":`仅列出 agent 通过 edit / write 工具造成的改动,不含命令行(如 bash)造成的改动,也不代表磁盘或 git 的实际差异。`,"changes.listFailed":`读取改动列表失败:{error}`,"changes.empty":`本会话还没有 agent 的 edit / write 改动。`,"changes.ops":`{count} 次`,"changes.outside":`工作区外`,"changes.root":`(根目录)`,"changes.listIncomplete":`列表不完整:改动文件过多,已超出上限,仅显示部分。`,"changes.truncated":`已截断`,"changes.backToList":`← 改动列表`,"changes.viewCurrent":`查看当前内容`,"changes.detailFailed":`读取改动详情失败:{error}`,"changes.noRecords":`该文件没有可显示的改动记录。`,"changes.detailIncomplete":`改动记录不完整:该文件的操作过多,已超出上限,仅显示部分。`,"agent.main":`主 agent`,"job.status.running":`运行中`,"job.status.exited":`已退出`,"job.status.failed":`失败`,"job.status.stopped":`已停止`,"job.status.lost":`已丢失`,"job.reason.timeout":`超时`,"job.reason.spawnError":`无法启动`,"job.reason.exitCode":`退出码 {code}`,"job.reason.restart":`网关重启`,"job.stopping":`正在停止…`,"job.stop":`停止任务`,"job.dropped":`… 已省略更早的 {count} 字节输出`,"job.reading":`读取中…`,"job.noOutput":`暂无输出`,"job.toBottom":`回到底部 ↓`,"job.panel":`后台任务`,"job.panelEmpty":`这个会话还没有后台任务。`,"job.reportTitle":`后台任务 {id}`,"job.reportCurrent":`当前:{status}`,"image.loadFailed":`图片加载失败,点击重试`,"image.view":`查看图片 {name}`,"image.loading":`加载图片…`,"image.save":`保存图片`,"task.status.idle":`空闲`,"task.status.queued":`排队中`,"task.status.running":`运行中`,"task.status.completed":`已完成`,"task.status.failed":`失败`,"task.status.cancelled":`已停止`,"message.cat":`neko 小猫`,"message.defaultImagePrompt":`默认图片提示`,"message.copyAnswer":`复制回答`,"message.welcome":`输入消息开始吧 ✦`,"message.round":`任务 {round} · {title} · {status}`,"message.roundUsage":"本轮 ↑{input} ↓{output} · 缓存 {cacheRead}/{cacheWrite} · ${cost}","message.roundUsageMissing":`本轮用量未记录`,"message.approvalsPending":`· 待审批 {count}`,"message.viewProcess":`· 查看完整过程`,"message.approvalLine":`审批 · {status}`,"message.toBottom":`回到底部 ↓`,"picker.aria":`模型与思考强度:{label} {level}`,"picker.badgeImage":`图`,"picker.badgeReasoning":`思`,"picker.providerModels":`{count} 个模型`,"picker.keyMissing":`未配置 Key`,"picker.applyFailed":`配置失败,请重试。`,"picker.defaultFailed":`默认模型保存失败,请重试。`,"picker.title":`模型与思考强度`,"picker.issueDisabled":`当前会话的模型服务 {provider} 已取消启用,请切换到其他模型,或在设置中重新启用。`,"picker.issueKey":`尚未配置 {provider} 的 API Key,请先配置或切换到其他模型。`,"picker.goSettings":`前往设置`,"picker.providerLabel":`模型服务商`,"picker.searchLabel":`搜索模型`,"picker.searchPlaceholder":`搜索模型名称、ID 或服务商`,"picker.models":`模型`,"picker.keyMissingDot":`未配置 Key ·`,"picker.configure":`去配置`,"picker.unsetDefault":`取消默认`,"picker.setDefault":`设为默认`,"picker.unsetDefaultTitle":`取消默认模型(只影响新建会话)`,"picker.setDefaultTitle":`设为默认模型(只影响新建会话)`,"picker.noMatch":`没有匹配的模型。`,"picker.noModels":`没有可选模型,请先在设置中启用模型服务。`,"picker.thinking":`思考强度`,"picker.cliNote":`默认模型当前由 --model 启动参数指定并覆盖保存值;移除该参数后,此处保存的默认才会生效。`,"picker.scopeNote":`仅当前会话,从下一次请求生效;☆ 设为新建会话的默认模型(不影响当前会话)。`,"picker.applying":`应用中…`,"picker.apply":`应用`,"open.explorer":`资源管理器`,"open.fileManager":`文件管理器`,"open.noVscodeExe":`未找到 VS Code(Code.exe)`,"open.noVscodeCommand":`未找到 VS Code(命令 code 不在 PATH 中)`,"open.noExplorer":`未找到 explorer.exe(需启用 Windows 互操作)`,"open.noXdg":`未找到 xdg-open`,"open.title":`打开工作区`,"open.withTarget":`用 {target} 打开`,"open.noTargets":`本机没有可用的打开方式`,"open.pickSession":`请先选择会话`,"open.notReady":`连接未就绪`,"open.failed":`打开失败:{error}`,"open.disabledTitle":`{label}({reason})`,"open.unavailable":`不可用`,"open.choose":`选择打开方式`,"open.forbidden":`没有权限打开,请刷新页面后重试`,"open.invalidPath":`工作区目录不存在或不可访问`,"open.requestFailedStatus":`请求失败({status})`,"open.requestFailed":`请求失败:{error}`,"plan.card.gone":`该计划已不在等待批准:{status}`,"plan.card.goneOther":`该计划已不在等待批准,可能已在其他端处理或已被新的计划取代。`,"plan.card.section":`计划审批`,"plan.card.dismiss":`关闭结果提示`,"plan.card.notSaved":`决定尚未保存,请重试`,"plan.card.submitFailed":`提交失败:{error}`,"plan.card.draftKept":`(反馈草稿已保留,请手动重试)`,"plan.card.exitFailed":`退出失败:{error}`,"plan.card.awaiting":`待批准计划`,"plan.card.badge":`计划`,"plan.card.offline":` · 离线`,"plan.card.feedback":`修改意见`,"plan.card.offlineNote":`离线:批准、修改与退出已停用,重新连接后需要手动操作。`,"plan.card.submitting":`提交中…`,"plan.card.submitFeedback":`提交修改意见`,"plan.card.needFeedback":`请填写修改意见`,"plan.card.approve":`批准并执行`,"plan.card.revise":`要求修改`,"plan.card.processing":`处理中…`,"plan.card.exit":`取消并退出计划模式`,"plan.card.hint":`不决定也可继续输入,新的消息会取代这份计划。`,"plan.row.section":`助手提交的计划`,"question.card.cancelledElsewhere":`该问题已取消(运行已停止或会话已归档),没有保存新的回答。`,"question.card.handledElsewhere":`该问题已由其他端先处理,以已保存的结果为准:{result}`,"question.card.gone":`该问题已不在等待列表中,可能已在其他端处理或已取消。`,"question.card.notFound":`找不到这个问题,它可能已结算。`,"question.card.dock":`待回答问题`,"question.card.dismiss":`关闭结果提示`,"question.card.count":`共 {total} 个待回答问题,当前第 {index} 个`,"question.card.prev":`上一个`,"question.card.next":`下一个`,"question.card.notSaved":`回答尚未保存,请重试`,"question.card.submitFailed":`提交失败:{error}(答案草稿已保留,请手动重试)`,"question.card.section":`助手提问`,"question.card.awaiting":`等待回答`,"question.card.offline":` · 离线`,"question.card.draftKept":`草稿已保留`,"question.card.foldTitle":`折叠提问(不会跳过)`,"question.card.unfoldTitle":`展开提问`,"question.card.fold":`折叠`,"question.card.unfold":`展开`,"question.card.loadFailed":`无法读取完整问题:{message}`,"question.card.loading":`正在读取完整问题…`,"question.card.loadOffline":`离线,暂时无法读取完整问题。`,"question.card.chooseMany":`选择一个或多个选项`,"question.card.chooseOne":`选择一个选项`,"question.card.recommended":`推荐`,"question.card.clear":`清除选择`,"question.card.extra":`补充说明(可选)`,"question.card.yourAnswer":`你的回答`,"question.card.offlineNote":`离线:回答与跳过已停用,草稿已保留;重新连接后需要手动提交,不会自动发送。`,"question.card.submitting":`提交中…`,"question.card.submit":`提交回答`,"question.card.skipTitle":`跳过:不提供答案,助手会自行判断并继续;不会停止运行`,"question.card.skipping":`跳过中…`,"question.card.skip":`跳过`,"question.card.needInput":`选择选项或填写文字后才能提交;选择只保存为草稿。`,"question.card.foldHint":`折叠或关闭不会跳过,运行仍可随时停止。`,"queue.mode.steer":`引导`,"queue.mode.followUp":`排队`,"queue.section":`排队消息`,"queue.image":`图片`,"queue.imageOnly":`(仅图片)`,"queue.images":`{count} 图`,"queue.steerAria":`引导消息:{label}`,"queue.steerTitle":`改为引导:在当前工具轮结束后加入进行中的工作`,"queue.steer":`引导`,"queue.withdrawAria":`撤回{mode}消息:{label}`,"queue.withdraw":`撤回`,"sessions.switchWorkspace":`切换工作区`,"sessions.collapse":`收起侧栏`,"sessions.new":`新建会话`,"sessions.searchAria":`搜索当前工作区会话`,"sessions.searchPlaceholder":`搜索会话…`,"sessions.heading":`会话`,"sessions.actionsFor":`{name}的操作`,"sessions.actions":`会话操作`,"sessions.waitingGateway":`等待网关连接…`,"sessions.noMatch":`没有匹配的会话`,"sessions.empty":`此工作区暂无会话`,"sessions.market":`技能市场`,"sessions.settings":`设置`,"sessions.drawer":`工作区与会话`,"sessions.chooseWorkspace":`选择工作区`,"sessions.archive":`归档会话`,"sessions.currentWorkspace":`当前工作区`,"sessions.addWorkspace":`添加工作区`,"sessions.archiveConfirm":`归档“{name}”?会话将从列表中隐藏,工作区和文件仍会保留。`,"sessions.confirmArchive":`确认归档`,"subagent.title":`子智能体`,"subagent.history":`历史 · `,"subagent.usage":`子智能体累计用量`,"subagent.duration":`当前或最近任务耗时`,"subagent.stop":`停止此任务`,"subagent.queued":`任务排队中…`,"subagent.noContent":`暂无内容`,"subagent.rounds":`{count} 轮`,"todo.aria":`待办 {done}/{total},已完成 {done} 项{offline}`,"todo.ariaOffline":`(离线)`,"todo.progressTitle":`待办进度(只读)`,"todo.label":`待办`,"todo.panel":`待办列表`,"todo.heading":`待办 · 已完成 {done}/{total}`,"todo.offlineNote":`离线 · 显示最后一次加载的内容,可能不是最新状态`,"todo.items":`待办条目`,"tool.status.pending":`待执行`,"tool.status.running":`运行中`,"tool.status.done":`完成`,"tool.status.failed":`失败`,"tool.diff":`代码变更`,"tool.diffTruncated":`代码变更预览已截断,可在下方查看完整写入内容。`,"tool.fullWrite":`完整写入内容`,"tool.output":`输出`,"tool.errorOutput":`错误输出`,"tool.result":`结果`,"common.reconnecting":`重连中…`,"common.connectionFailed":`连接失败`,"topbar.toggleSidebar":`切换侧栏`,"topbar.switching":`切换中…`,"topbar.jobs":`任务{state}`,"topbar.jobsRunning":` · {count} 运行中`,"topbar.jobsCount":` {count}`,"topbar.workspaceAria":`工作区,{count} 个改动文件`,"topbar.workspaceTitle":`工作区:浏览文件与 agent 的改动(只读)`,"wspanel.resize":`调整工作区栏宽度`,"wspanel.close":`关闭工作区栏`,"wspanel.views":`工作区视图`,"wspanel.files":`文件`,"wspanel.changes":`改动 {count}`,"wspanel.backToTree":`← 文件树`,"picker2.hint":`选择 Harness 所在电脑上的文件夹`,"picker2.pathNav":`目录路径`,"picker2.fullPath":`完整目录路径`,"picker2.go":`前往`,"picker2.filter":`筛选文件夹`,"picker2.filterPlaceholder":`筛选文件夹…`,"picker2.hidden":`隐藏目录`,"picker2.list":`文件夹列表`,"picker2.parent":`上级目录`,"picker2.inaccessible":`不可访问`,"picker2.loading":`正在读取目录…`,"picker2.noMatch":`没有匹配的子文件夹,可选择当前目录`,"picker2.more":`加载更多`,"picker2.adding":`正在添加…`,"picker2.choose":`选择文件夹`,"path.thisComputer":`此电脑`,"chat.skip":`跳到主内容`,"chat.dismissNotice":`关闭提示`,"chat.startHere":`在这个工作区开始新的会话`,"chat.subagents":`子智能体 · {count} 个`,"chat.subagentsApproval":` · 待审批 {count}`,"chat.subagentsRunning":` · {count} 运行中`,"command.compact":`压缩上下文(可附加要求)`,"command.plan":`切换规划模式(只读调研并提交计划,批准后执行)`,"command.builtin":`内置`,"thinking.label":`思考过程…`,"skills.category.documents":`文档处理`,"skills.category.development":`开发工作流`,"skills.category.frontend":`前端 / UI`,"skills.category.research":`研究检索`,"skills.category.skills":`技能生态`,"skills.category.automation":`自动化`,"skills.category.database":`数据库`,"skills.category.writing":`写作`,"skills.category.uncategorized":`未分类`,"skills.badge.project":`项目级`,"skills.badge.user":`用户级`,"skills.badge.active":`{level}·生效`,"skills.badge.builtin":`内置`,"skills.scope.user":`用户级`,"skills.scope.project":`项目级`,"skills.processing":`处理中…`,"skills.installedShadowed":`已安装到用户级,但项目级同名技能优先,此安装暂不生效。下次发送消息时生效。`,"skills.installed":`安装完成,下次发送消息时生效。`,"skills.overwriteTitle":`覆盖已安装技能`,"skills.overwriteBody":`{scope}已存在 {name}。以市场版本覆盖?本地改动将丢失。`,"skills.overwriteBodyVersion":`{scope}已存在 {name}。以市场版本 {version} 覆盖?本地改动将丢失。`,"skills.overwrite":`覆盖安装`,"skills.opFailed":`操作失败:{error}`,"skills.shadowTitle":`安装后暂不生效`,"skills.shadowBody":`项目级已存在同名 {name},项目级优先。仍要安装到用户级吗?`,"skills.installAnyway":`仍安装`,"skills.uninstallTitle":`卸载技能`,"skills.uninstallBody":`删除{scope}的 {name}?此操作不可撤销。`,"skills.uninstall":`卸载`,"skills.uninstalled":`已卸载,下次发送消息时生效。`,"skills.closeDetail":`关闭详情`,"skills.detailAria":`技能详情 {name}`,"skills.tab.about":`说明`,"skills.tab.preview":`预览`,"skills.loadFailed":`加载失败:{error}`,"skills.field.category":`分类`,"skills.field.source":`来源`,"skills.field.size":`大小`,"skills.field.uploaded":`上传于`,"skills.field.license":`许可证`,"skills.notInstalled":`尚未安装`,"skills.previewLoading":`下载并解开预览…`,"skills.previewFailed":`预览失败:{error}`,"skills.packageFiles":`包内文件`,"skills.builtinNote":`内置技能随 neko 分发,无需安装,也不支持卸载。`,"skills.uninstallScope":`卸载{scope}`,"skills.installing":`安装中…`,"skills.installScope":`安装到{scope}`,"skills.back":`← 返回聊天`,"skills.title":`技能市场`,"skills.groupCategory":`按分类`,"skills.groupSource":`按来源`,"skills.search":`搜索技能`,"skills.searchPlaceholder":`搜索技能…`,"skills.loadingCatalog":`加载市场目录…`,"skills.waitingGateway":`等待网关连接…`,"skills.catalogFailed":`市场目录加载失败,请检查网络后重试。`,"skills.noMatch":"没有匹配的技能。反复出现的需求可以用 `/skill:skill-creator` 自己造一个。"},en:{"common.connected":`Connected`,"common.connecting":`Connecting…`,"common.loading":`Loading…`,"settings.menuLabel":`Settings menu`,"settings.backToChat":`← Back to chat`,"settings.title":`Settings`,"settings.menu.credentials":`Model services`,"settings.menu.search":`Web search`,"settings.menu.context":`Context`,"settings.menu.appearance":`Appearance`,"settings.menu.language":`语言 / Language`,"settings.menu.mobile":`Mobile pairing`,"settings.menu.about":`About and updates`,"settings.credentials.title":`Model services`,"settings.credentials.intro":`Enable the model services you use and set their API Keys. Saved values take precedence over environment variables and apply to all workspaces. DeepSeek is always enabled`,"settings.credentials.providerLabel":`Model provider`,"settings.credentials.disabled":`Disabled`,"settings.credentials.configured":`Configured`,"settings.credentials.keyMissing":`No Key`,"settings.credentials.enabledCount":`{enabled} / {total} enabled`,"settings.search.title":`Web search`,"settings.search.intro":`Choose the service the assistant uses to search the web, and manage the Tavily and DeepSeek API Keys`,"settings.search.deepseekNote":`Shares the same DeepSeek Key as “Model services”. Saving or removing it on either page syncs both`,"settings.context.title":`Context`,"settings.context.intro":`Manage how long conversations save context. Choices are saved and applied immediately for all workspaces. Leave “Default” selected to keep the original behavior`,"settings.mobile.title":`Mobile pairing`,"settings.mobile.intro":`Control the Agent on your computer from the mobile app. Pairing is managed on this computer only`,"settings.appearance.title":`Appearance`,"settings.appearance.intro":`Choose the theme and chat typography. Choices are saved and applied immediately in this browser only, and do not affect the terminal UI or the mobile app`,"language.title":`语言 / Language`,"language.intro":`Choose the interface language. The choice is saved and applied immediately in this browser only. It does not affect the terminal UI or the mobile app, and conversation content is unchanged`,"language.legend":`Interface language`,"language.option.zh":`中文`,"language.option.en":`English`,"appearance.theme":`Theme`,"appearance.theme.sakura":`Sakura`,"appearance.theme.sakuraBlurb":`Blue-pink-white light theme, default`,"appearance.theme.light":`Paper`,"appearance.theme.lightBlurb":`Neutral cool grey-white, restrained`,"appearance.theme.dark":`Ink`,"appearance.theme.darkBlurb":`Dark blue-grey, easy on the eyes at night`,"appearance.previewUser":`Hi`,"appearance.previewAssistant":`Hi, how can I help?`,"appearance.typography":`Chat typography`,"appearance.typographyBlurb":`Affects message text and the input box in chat only. Code blocks, tool cards and the sidebar stay the same`,"appearance.font":`Font`,"appearance.fontHint":`Uses system fonts installed on this device, so the result depends on your device. Falls back automatically when missing`,"appearance.font.sans":`Sans-serif`,"appearance.font.serif":`Serif`,"appearance.font.mono":`Monospace`,"appearance.size":`Size`,"appearance.size.13":`Small 13px`,"appearance.size.14":`Default 14px`,"appearance.size.16":`Large 16px`,"appearance.size.18":`Extra large 18px`,"appearance.weight":`Weight`,"appearance.weight.regular":`Regular`,"appearance.weight.medium":`Medium`,"appearance.weight.semibold":`Semibold`,"appearance.leading":`Line height`,"appearance.leading.compact":`Compact`,"appearance.leading.normal":`Normal`,"appearance.leading.relaxed":`Relaxed`,"appearance.sample":`Preview`,"appearance.sampleBlurb":`Updates instantly with your choices above`,"appearance.sampleUser":`Why does this function return undefined?`,"appearance.sampleAssistantIntro":"This is a **sample answer** to preview the current typography. Inline code looks like `const total = items.length`, and here is a code block:","appearance.sampleItem1":`First item`,"appearance.sampleItem2":`Second item`,"appearance.isDefault":`Using the default appearance`,"appearance.customized":`Customized`,"appearance.reset":`Restore defaults`,"credential.source.saved":`Using saved key`,"credential.source.environment":`Using environment variable`,"credential.source.runtime":`Using runtime configuration`,"credential.source.keyless":`keyless (rate-limited)`,"credential.source.none":`Not configured`,"credential.failed":`Action failed. Check the connection and try again`,"credential.removed":`Saved key removed`,"credential.saved":`Saved. Takes effect on the next request`,"credential.enableAria":`Enable {name}`,"credential.enabledDone":`Enabled`,"credential.disabledDone":`Disabled`,"credential.alwaysOn":`Always on`,"credential.enable":`Enable`,"credential.envVar":`Environment variable: {state} ({envVar})`,"credential.envConfigured":`configured`,"credential.envMissing":`not configured`,"credential.keylessNote":` · Runs in keyless rate-limited mode when not configured`,"credential.keyLabel":`{name} API Key`,"credential.placeholderReplace":`Enter a new key to replace it`,"credential.placeholderNew":`Paste your API Key`,"credential.working":`Working…`,"credential.save":`Save key`,"credential.remove":`Remove saved key`,"credential.getKey":`Get a {name} API Key ↗`,"search.switched":`Switched to {name}. Takes effect on the next search`,"search.saveFailed":`Save failed. Check the connection and try again`,"search.service":`Search service`,"search.current":`Using: {name}`,"search.intro":`Choose the service the assistant uses to search the web and read pages. Takes effect on the next call after saving`,"search.source.saved":`Saved key`,"search.source.environment":`Environment variable`,"search.source.runtime":`Runtime configuration`,"search.source.keyless":`keyless, rate-limited`,"search.source.none":`No key configured`,"search.tavilyDescription":`Search and fetch with Tavily ({source}), default`,"search.deepseekDescription":`Search and fetch with DeepSeek, shares the DeepSeek key ({source})`,"search.deepseekWarning":`No DeepSeek key is configured, so search is unavailable. Set a key in the DeepSeek card below, or choose Tavily`,"providerCombo.placeholder":`Select a provider`,"providerCombo.empty":`No matching providers`,"model.context":`{size} context`,"model.images":`Image input`,"model.textOnly":`Text only`,"model.reasoning":`Reasoning`,"model.noReasoning":`No reasoning`,"context.row.compactionTrigger.label":`Trigger point`,"context.row.compactionTrigger.description":`Compacts automatically when context reaches this share of the model window. Defaults to near the window limit`,"context.row.keepRecentTokens.label":`Keep recent`,"context.row.keepRecentTokens.description":`Recent content kept verbatim when compacting. More means fewer lost details`,"context.row.pruningTrigger.label":`Trigger point`,"context.row.pruningTrigger.description":`Prunes old results when context reaches this share of the model window`,"context.row.keepRecent.label":`Keep recent results`,"context.row.keepRecent.description":`This many of the newest tool results always stay intact`,"context.row.minChars.label":`Minimum result length`,"context.row.minChars.description":`Results shorter than this are never pruned`,"context.row.minSave.label":`Minimum savings per run`,"context.row.minSave.description":`A prune runs only when it is expected to free at least this share of the model window. Each prune invalidates the prompt cache, so a larger share means fewer, more concentrated prunes`,"context.source.default":`Default`,"context.source.config":`Config file`,"context.source.saved":`Saved`,"context.value.chars":`{value} chars`,"context.value.charsK":`{value}k chars`,"context.value.count":`{value}`,"context.chipDefault":`Default`,"context.chipCustom":`{value} · Custom`,"context.nearLimit":`Near the window limit`,"context.current":`Current {value} · {source}`,"context.marker.pruning":`Prune`,"context.marker.compaction":`Compact`,"context.group.compaction.title":`Context compaction`,"context.group.compaction.blurb":`When a conversation grows long, older content is summarized to free up space. Manual /compact is always available`,"context.group.pruning.title":`Tool result pruning`,"context.group.pruning.blurb":`Replaces older large tool outputs with a one-line note in what the model sees. Full results and history in the UI are unaffected. Each prune invalidates the prompt cache, so pruning runs in batches`,"context.threshold.aria":`Trigger position preview`,"context.threshold.title":`Trigger position`,"context.threshold.window":`Model context window`,"context.threshold.allOff":`Automatic compaction and pruning are both off`,"context.fromConfig":`From the config file. Choosing another option overrides it`,"context.saveFailed":`Save failed. Check the connection and try again`,"context.restored":`{label} restored to default`,"context.saved":`Saved`,"context.switch.compaction":`Auto compaction`,"context.switch.pruning":`Prune tool results`,"context.allRestored":`All restored to defaults`,"context.restoreAll":`Restore all defaults`,"context.saving":`Saving…`,"common.close":`Close`,"about.intro":`View the neko version status and software updates`,"about.checkDone":`Check complete`,"about.checkDevelopment":`Development builds do not check for release updates`,"about.checkFailedRetry":`Check failed. Try again`,"about.checking":`Checking…`,"about.badge.incompatible":`Incompatible protocol`,"about.badge.install":`New version available`,"about.badge.restart":`Ready · restart needed`,"about.badge.refresh":`Page needs refresh`,"about.badge.development":`Development build`,"about.badge.failed":`Check failed`,"about.badge.latest":`Up to date`,"about.versionStatus":`Version status`,"about.currentVersion":`Current version`,"about.latestStable":`Latest stable version`,"about.runUpdate":`Run neko update to upgrade`,"about.installedNew":`New version installed`,"about.newVersion":`New version`,"about.afterRestart":`Takes effect after restarting the neko process`,"about.staticUpdated":`Static server updated`,"about.afterRefresh":`Takes effect after refreshing the page`,"about.checkUpdates":`Check for updates`,"about.copyUpdate":`Copy neko update`,"about.refreshPage":`Refresh page`,"about.commandShell":`Command shell`,"about.upgradeTitle":`Upgrade instructions`,"about.upgradeBefore":`Run`,"about.upgradeAfter":`in a terminal, then restart neko to apply the update`,"about.draftKept":`Draft kept before upgrade`,"update.copied":`Copied neko update. Run it on the computer running neko`,"update.copyManually":`Copy the command: neko update`,"update.install":`New version available · run neko update`,"update.refreshPage":`Page updated`,"update.incompatible":`Version incompatible · update and restart neko`,"update.restart":`Upgraded · restart local neko`,"update.copyCommand":`Copy command`,"update.refresh":`Refresh`,"update.viewSteps":`View steps`,"update.dismiss":`Dismiss update notice`,"shell.dismiss":`Dismiss shell notice`,"shell.invalid":`{detail} bash and background jobs are unavailable. Fix shell.path in neko.config.json`,"shell.invalidDefault":`Invalid shell.path configuration`,"shell.missing":`Git Bash not found: bash and background jobs are unavailable. Install Git for Windows, or set shell.path in neko.config.json`,"shell.ready":`Ready`,"shell.unavailable":`Unavailable`,"shell.sourceConfig":`{path} (shell.path config)`,"shell.sourceAuto":`{path} (auto-detected)`,"pairing.qrTitle":`Mobile pairing QR code`,"pairing.getFailed":`GET {path} failed ({status})`,"pairing.requestFailed":`Request failed ({status})`,"pairing.disabledNotice":`Mobile access turned off. Tasks already accepted keep running`,"pairing.addressRequired":`Select a LAN address to listen on`,"pairing.portInvalid":`The port must be an integer from 1 to 65535`,"pairing.enabledNotice":`Mobile access turned on: {address}`,"pairing.qrGenerated":`QR code generated. Valid for 120 seconds`,"pairing.certRotated":`Certificate regenerated ({fingerprint}…). Phones must scan the code again to pair`,"pairing.revoked":`Device access revoked. Tasks it already submitted keep running`,"pairing.revokeMissing":`Device not found or already revoked`,"pairing.unsupported":`This gateway version does not support mobile pairing. Update or restart the desktop side, then refresh this page. Chat is not affected`,"pairing.stateOn":`On · https://{address}{relay}`,"pairing.relayed":` (via Windows relay)`,"pairing.stateError":`Failed to start`,"pairing.stateOff":`Off`,"pairing.intro":`Allow the phone to control the Agent on this computer. Pairing is managed on this computer only. Turn it on only on trusted networks`,"pairing.wslNote":`Running in WSL: the addresses listed are Windows LAN addresses. When turned on, a relay process on the Windows side accepts phone connections (no administrator rights needed; it stops automatically when you turn off mobile access or exit neko)`,"pairing.startFailed":`Failed to start: {error}. Check whether the selected address and port are in use`,"pairing.allow":`Allow the phone to control the Agent on this computer`,"pairing.address":`Address`,"pairing.noAddressWindows":`No Windows LAN address found`,"pairing.noAddress":`No LAN address found`,"pairing.lastConnected":`{address} (last connected)`,"pairing.port":`Port`,"pairing.noUsableWindows":`No usable Windows LAN address found. Make sure Windows is online and WSL interop is available`,"pairing.noUsable":`No usable LAN address found. Make sure this computer is online (loopback addresses cannot be used for mobile access)`,"pairing.qrRemaining":`QR code expires in {seconds}s`,"pairing.copyText":`Copy pairing text`,"pairing.refreshQr":`Refresh QR code`,"pairing.qrExpired":`The QR code has expired. Refresh it and scan again`,"pairing.generateQr":`Generate QR code`,"pairing.scanHint":`Scan with the mobile app, or choose “Copy pairing text” and paste it in the app. Make sure the phone and computer are on the same network and the firewall allows the selected port{relay}`,"pairing.relayFirewall":` (under WSL, allow powershell.exe in Windows Firewall)`,"pairing.certificate":`Certificate`,"pairing.certInfo":`{fingerprint}… · expires {date}`,"pairing.regenerate":`Regenerate certificate`,"pairing.certExpiring":`The certificate is about to expire. Regenerate it soon. All phones must scan again afterwards`,"pairing.regenerateWarning":`Regenerating disconnects all phones and revokes all device access. Tasks already accepted on the computer keep running`,"pairing.devices":`Paired devices`,"pairing.noDevices":`No paired devices`,"pairing.online":`Online`,"pairing.offline":`Offline`,"pairing.lastSeen":`Last connected {time}`,"pairing.revoke":`Revoke`,"pairing.spawnedBefore":`This page started the gateway through neko web. Closing it also stops the gateway and the mobile entry point. For a long-lived phone connection, use`,"pairing.spawnedAfter":`or keep the TUI running`,"pairing.regenerateConfirm":`A new self-signed certificate will be generated. All phones disconnect, all device access is revoked, and you must scan to pair again. Tasks already accepted on the computer keep running`,"pairing.confirmRegenerate":`Confirm regeneration`,"pairing.revokeTitle":`Revoke device “{name}”`,"pairing.revokeConfirm":`The phone disconnects immediately and cannot reconnect. Tasks already accepted on the computer keep running; stop them separately on the computer`,"pairing.confirmRevoke":`Confirm revoke`,"common.cancel":`Cancel`,"gw.notConnected":`Gateway not connected`,"gw.sessionNotReady":`Session not ready`,"gw.sessionChangedDraft":`Session changed. Draft kept`,"gw.sessionChanged":`Session changed`,"gw.sessionChangedOrNotReady":`Session changed or not ready`,"gw.sessionChangedAnswerDraft":`Session changed or not ready. Answer draft kept`,"gw.sessionChangedFeedbackDraft":`Session changed or not ready. Feedback draft kept`,"gw.connectionChanged":`Connection changed. Try again`,"gw.busy":`An operation is in progress or the gateway is not connected. Try again later`,"gw.workspaceMissing":`Workspace not found`,"gw.sessionNotInWorkspace":`The session is not in this workspace or has been archived`,"gw.workspaceNotReady":`Workspace not ready`,"gw.incompatible":`Version incompatible. Run neko update, then restart local neko`,"gw.infoFailed":`GET /api/info failed ({status})`,"gw.invalidInfo":`Invalid gateway info`,"gw.infoLoadFailed":`Failed to get gateway info: {error}`,"gw.sessionGone":`The original session is unavailable. The draft kept before the upgrade is in About and updates`,"gw.notReady":`Gateway connection not ready. Wait a moment or refresh the page`,"gw.sessionChangedRetry":`Session changed. Try again`,"gw.notStarted":`Gateway not connected yet`,"core.status.thinking":`Thinking…`,"core.status.running":`Running {tool}…`,"core.status.retrying":`Retrying (attempt {attempt})…`,"core.row.compacted":`[context compacted]`,"core.row.newContext":`[new context]`,"core.note.notRun":`Not run: response interrupted`,"core.error.providerDisabled":`PROVIDER_DISABLED: {provider} is not enabled. Enable it in /login or Web settings, or switch model`,"core.error.providerKeyRequired":`PROVIDER_KEY_REQUIRED: Configure a {provider} API Key in /login or Web settings`,"core.error.planBusy":`PLAN_BUSY: Wait for the current run to finish or stop it first`,"plan.status.awaiting_approval":`Awaiting approval`,"plan.status.approved":`Approved`,"plan.status.revision_requested":`Revision requested`,"plan.status.superseded":`Superseded`,"plan.status.cancelled":`Cancelled`,"plan.modeLabel":`Plan mode (read-only)`,"plan.unsupported":`This gateway does not support plan mode. Restart the gateway and try again`,"plan.settle.approved":`Approved. Starting to execute the plan`,"plan.settle.revised":`Revision request sent. Still in plan mode`,"plan.settle.superseded":`This plan was superseded by new input. Your decision was not saved`,"plan.settle.cancelled":`This plan was cancelled (the run stopped or plan mode ended). Your decision was not saved`,"plan.settle.pending":`Your decision has not been saved. Try again`,"plan.settle.other":`Another client already handled this plan. The saved result applies: {status}`,"plan.busy":`A run is in progress. Wait for the answer to finish or stop it, then try again`,"title.answerPrefix":`({count}) Awaiting answer · `,"title.planPrefix":`Awaiting approval · `,"todo.status.pending":`To do`,"todo.status.in_progress":`In progress`,"todo.status.completed":`Done`,"question.status.pending":`Awaiting answer`,"question.status.answered":`Answered`,"question.status.skipped":`Skipped`,"question.status.cancelled":`Cancelled`,"question.settle.answeredWith":`Answered: {answer}`,"question.settle.answered":`Answered`,"question.settle.skipped":`Skipped. No answer provided`,"question.settle.cancelled":`Cancelled (the run stopped or the session was archived)`,"session.suffix.awaitingAnswer":` · Awaiting answer`,"session.suffix.awaitingPlan":` · Awaiting approval`,"session.suffix.running":` · Running`,"session.suffix.error":` · Error`,"composer.input":`Message input`,"composer.upgrade.sending":`Sending. Refresh later`,"composer.upgrade.attachments":`Send or remove attachments, then refresh`,"composer.upgrade.notReady":`Not connected yet. Try again later`,"composer.upgrade.otherDrafts":`Other sessions have drafts. Send or clear them first`,"composer.upgrade.saveFailed":`Could not save the draft. Copy the text first`,"composer.attach.type":`Only PNG, JPEG and WebP are supported`,"composer.attach.size":`Each image must be 20 MiB or smaller`,"composer.attach.decode":`Could not decode the image. Choose another`,"composer.attach.limit":`Up to 4 images per message, 40 MiB in total`,"composer.attach.removeUnsupported":`Remove unsupported attachments first`,"composer.attach.checking":`Checking image…`,"composer.attach.remove":`Remove {name}`,"composer.skills.newSession":`Start a session to choose workspace skills`,"composer.skills.waiting":`Waiting for the session…`,"composer.skills.loading":`Loading skills…`,"composer.skills.empty":`No skills available in this workspace`,"composer.skills.failed":`Failed to load skills. Close the menu and try again`,"composer.image.reading":`Reading image…`,"composer.image.readFailed":`Failed to read the image. Try again`,"composer.workspaceChanged":`Workspace changed`,"composer.workspaceChangedDraft":`Workspace changed. Draft kept`,"composer.compaction.retrying":`Retrying compaction`,"composer.compaction.waiting":`Waiting for context compaction`,"composer.compaction.running":`Compacting context`,"composer.compaction.failure":`Compaction failed: {error}`,"composer.compaction.applied":`Context compacted`,"composer.compaction.nothing":`Nothing to compact`,"composer.compaction.skipped":`Skipped a stale summary`,"composer.compaction.cancelled":`Compaction cancelled`,"composer.compaction.failed":`Compaction failed. You can retry`,"composer.compaction.applying":`Waiting to apply the summary`,"composer.compaction.nothingTitle":`Recent context is kept, so there is no older content to compact. By default about the latest 20,000 tokens are kept`,"composer.compactFailed":`Compaction failed. Try again`,"composer.plan.noArgs":`/plan takes no arguments. Switch to plan mode first, then describe your request as usual`,"composer.plan.needSession":`Start a session before switching plan mode`,"composer.plan.busy":`A run is in progress. Wait for the answer to finish or stop it before switching plan mode`,"composer.planModeTitle":`Read-only research, then submit a plan. After approval it exits plan mode and starts executing. Type /plan to exit`,"composer.sendFailed":`Send failed. Try again`,"composer.queue.steerWithdrawn":`Could not steer the message. It was moved back to the input`,"composer.queue.gone":`The message is no longer queued`,"composer.queue.sentNoSteer":`The message was already sent and cannot be steered`,"composer.queue.steerFailed":`Steer failed. Try again`,"composer.queue.imagesNotRestored":`Images were not restored. Add them again`,"composer.queue.sentNoWithdraw":`The message was already sent and cannot be withdrawn`,"composer.queue.withdrawFailed":`Withdraw failed. Try again`,"composer.questionHint":`The assistant is waiting for your answer. Messages sent here are still queued (including steer) and enter the context only after you answer or skip. They are not treated as the answer`,"composer.openQuestion":`Open question`,"composer.dropHint":`Release to add images. They are not sent automatically`,"composer.provider.disabled":`Model service {provider} is disabled. Enable it again or switch model`,"composer.provider.keyMissing":`No Key configured for {provider}`,"composer.provider.goSettings":`Go to settings`,"composer.noVision":`The current model does not support images. Switch model or remove the attachments`,"composer.noHistoryImages":`The current model cannot view earlier original images. Existing text analysis still applies`,"composer.placeholder.waiting":`The assistant is waiting for your answer. Messages here will be queued`,"composer.placeholder.busy":`Running: messages are queued after the answer ends. Steer or withdraw them in the queue bar`,"composer.placeholder.idle":`Type a message, @ to mention a file, / for commands`,"composer.addImage":`Add image`,"composer.addImageTitle":`Add images (up to 4)`,"composer.menu":`Input actions menu`,"composer.ctx.none":`No valid usage yet. Updates after the first answer or the next answer after compaction`,"composer.ctx.usage":`Context usage of the last successful answer: {tokens} / {window} tokens. Not cumulative session usage`,"composer.usage.aria":`Task total usage: input {input}, output {output}, cache read {cacheRead}, cost {cost}`,"composer.usage.detail":`Input {input} · Output {output} · Cache read {cacheRead} · {cost}`,"composer.working":`Working`,"composer.queue":`Queue`,"composer.send":`Send`,"composer.stopTitle":`Stop the running session and any stoppable tasks`,"composer.stop":`Stop`,"composer.commandTitle":`Commands`,"composer.noCommands":`No matching commands or skills`,"common.retry":`Retry`,"common.loadingEllipsis":`Loading…`,"common.workspace":`Workspace`,"common.newSession":`New session`,"approval.status.pending":`Awaiting approval`,"approval.status.allowed":`Allowed once`,"approval.status.denied":`Denied`,"approval.status.cancelled":`Cancelled`,"approval.section":`Bash approval`,"approval.timeout":`Timeout: {value}`,"approval.timeoutDefault":`default`,"approval.command":`Full command`,"approval.allow":`Allow once`,"approval.deny":`Deny`,"approval.inbox":`Commands awaiting approval`,"askUser.answer":`Answer: {answer}`,"askUser.skipped":`Skipped, no answer provided`,"askUser.cancelled":`Question cancelled, no answer received`,"askUser.record":`Assistant question record`,"askUser.badge":`Assistant question`,"askUser.locate":`Go to question`,"suggest.hint":`↑↓ Select · Enter / Tab Confirm · Esc Close`,"suggest.retryFiles":`Retry file search`,"copy.copied":`Copied`,"copy.failed":`Copy failed`,"copy.label":`Copy`,"export.busy":`Exporting…`,"export.empty":`This session has nothing to export yet`,"export.title":`Export session`,"export.failed":`Export failed: {error}`,"export.button":`Export`,"export.format":`Export format`,"export.thinking":`Include thinking`,"export.cancelled":`Session changed, export cancelled`,"export.done":`Exported {name}`,"export.doneSkipped":`Exported {name}; images not embedded: {count}`,"mention.searching":`Searching files…`,"mention.incomplete":`File index is incomplete, type a subdirectory to narrow down`,"mention.limited":`Too many results, keep typing the path to narrow down`,"mention.empty":`No matching files or directories`,"mention.errorWith":`Search failed: {error}`,"mention.error":`Search failed, try again`,"mention.title":`Workspace files`,"tree.symlinkTitle":`Symbolic link (not followed)`,"tree.symlink":`Symbolic link`,"tree.protectedTitle":`Protected file, viewing is not available`,"tree.protected":`Protected file`,"tree.emptyDir":`Empty directory`,"tree.readFailed":`Read failed: {error}`,"tree.incomplete":`Incomplete list: {reason}`,"tree.limitedDir":`This directory has too many entries, showing part of them`,"tree.limitedWorkspace":`The workspace has too many files, the listing was truncated`,"tree.readOnly":`Read-only browsing`,"tree.refreshAria":`Refresh file tree`,"tree.refresh":`Refresh`,"tree.aria":`Workspace file tree`,"viewer.content":`File content`,"viewer.zoom":`Code zoom`,"viewer.zoomOut":`Zoom out code`,"viewer.zoomReset":`Reset zoom`,"viewer.zoomResetTitle":`Reset to 100%`,"viewer.zoomIn":`Zoom in code`,"viewer.refreshAria":`Refresh file content`,"viewer.refreshing":`Refreshing…`,"viewer.refresh":`Refresh`,"viewer.workspaceRoot":`(workspace root)`,"viewer.stale":`The agent modified this file, the content shown may be outdated`,"viewer.reload":`Reload content`,"viewer.missing":`File not found`,"viewer.missingDetail":`The file may have been deleted or moved out of the workspace`,"viewer.readFailed":`Read failed: {error}`,"viewer.protected":`Protected file, viewing is not available`,"viewer.protectedDetail":`Credential files (such as .env and private keys) are never sent to the browser, to avoid leaking them over the network`,"viewer.binary":`Binary file, preview is not available`,"viewer.binarySize":`Size {size}`,"viewer.refreshFailed":`Refresh failed: {error}`,"viewer.truncated":`Truncated, showing only the beginning of the file ({size} in total)`,"changes.scopeNote":`Lists only changes the agent made with the edit / write tools, not changes made by commands (such as bash), and not the actual disk or git differences`,"changes.listFailed":`Failed to load the change list: {error}`,"changes.empty":`No agent edit / write changes in this session yet`,"changes.ops":`{count}×`,"changes.outside":`Outside workspace`,"changes.root":`(root)`,"changes.listIncomplete":`Incomplete list: too many changed files, over the limit, showing part of them`,"changes.truncated":`Truncated`,"changes.backToList":`← Changes`,"changes.viewCurrent":`View current content`,"changes.detailFailed":`Failed to load change details: {error}`,"changes.noRecords":`No change records to show for this file`,"changes.detailIncomplete":`Incomplete records: too many operations on this file, over the limit, showing part of them`,"agent.main":`Main agent`,"job.status.running":`Running`,"job.status.exited":`Exited`,"job.status.failed":`Failed`,"job.status.stopped":`Stopped`,"job.status.lost":`Lost`,"job.reason.timeout":`timed out`,"job.reason.spawnError":`failed to start`,"job.reason.exitCode":`exit code {code}`,"job.reason.restart":`gateway restarted`,"job.stopping":`Stopping…`,"job.stop":`Stop job`,"job.dropped":`… {count} earlier bytes of output omitted`,"job.reading":`Reading…`,"job.noOutput":`No output yet`,"job.toBottom":`Back to bottom ↓`,"job.panel":`Background jobs`,"job.panelEmpty":`No background jobs in this session yet`,"job.reportTitle":`Background job {id}`,"job.reportCurrent":`Now: {status}`,"image.loadFailed":`Image failed to load, click to retry`,"image.view":`View image {name}`,"image.loading":`Loading image…`,"image.save":`Save image`,"task.status.idle":`Idle`,"task.status.queued":`Queued`,"task.status.running":`Running`,"task.status.completed":`Completed`,"task.status.failed":`Failed`,"task.status.cancelled":`Stopped`,"message.cat":`neko cat`,"message.defaultImagePrompt":`Default image prompt`,"message.copyAnswer":`Copy answer`,"message.welcome":`Type a message to start ✦`,"message.round":`Task {round} · {title} · {status}`,"message.roundUsage":"This round ↑{input} ↓{output} · cache {cacheRead}/{cacheWrite} · ${cost}","message.roundUsageMissing":`Usage for this round was not recorded`,"message.approvalsPending":`· {count} awaiting approval`,"message.viewProcess":`· View full process`,"message.approvalLine":`Approval · {status}`,"message.toBottom":`Back to bottom ↓`,"picker.aria":`Model and thinking level: {label} {level}`,"picker.badgeImage":`Img`,"picker.badgeReasoning":`Think`,"picker.providerModels":`{count} models`,"picker.keyMissing":`No Key`,"picker.applyFailed":`Failed to apply, try again`,"picker.defaultFailed":`Failed to save the default model, try again`,"picker.title":`Model and thinking level`,"picker.issueDisabled":`The model service {provider} of this session is disabled. Switch to another model or enable it again in settings`,"picker.issueKey":`No API Key is set for {provider}. Configure it or switch to another model`,"picker.goSettings":`Go to settings`,"picker.providerLabel":`Model provider`,"picker.searchLabel":`Search models`,"picker.searchPlaceholder":`Search by model name, ID or provider`,"picker.models":`Models`,"picker.keyMissingDot":`No Key ·`,"picker.configure":`Configure`,"picker.unsetDefault":`Unset default`,"picker.setDefault":`Set as default`,"picker.unsetDefaultTitle":`Unset the default model (affects new sessions only)`,"picker.setDefaultTitle":`Set as the default model (affects new sessions only)`,"picker.noMatch":`No matching models`,"picker.noModels":`No models available. Enable a model service in settings first`,"picker.thinking":`Thinking level`,"picker.cliNote":`The default model is currently set by the --model startup option and overrides the saved value. The saved default takes effect once the option is removed`,"picker.scopeNote":`Applies to this session only, from the next request. ☆ sets the default model for new sessions (the current session is unaffected)`,"picker.applying":`Applying…`,"picker.apply":`Apply`,"open.explorer":`File Explorer`,"open.fileManager":`File manager`,"open.noVscodeExe":`VS Code not found (Code.exe)`,"open.noVscodeCommand":`VS Code not found (the code command is not in PATH)`,"open.noExplorer":`explorer.exe not found (Windows interop must be enabled)`,"open.noXdg":`xdg-open not found`,"open.title":`Open workspace`,"open.withTarget":`Open with {target}`,"open.noTargets":`No way to open is available on this computer`,"open.pickSession":`Select a session first`,"open.notReady":`Connection not ready`,"open.failed":`Failed to open: {error}`,"open.disabledTitle":`{label} ({reason})`,"open.unavailable":`unavailable`,"open.choose":`Choose how to open`,"open.forbidden":`Not allowed to open, refresh the page and try again`,"open.invalidPath":`The workspace directory does not exist or is not accessible`,"open.requestFailedStatus":`Request failed ({status})`,"open.requestFailed":`Request failed: {error}`,"plan.card.gone":`This plan is no longer awaiting approval: {status}`,"plan.card.goneOther":`This plan is no longer awaiting approval. It may have been handled elsewhere or replaced by a new plan`,"plan.card.section":`Plan approval`,"plan.card.dismiss":`Dismiss result`,"plan.card.notSaved":`The decision was not saved, try again`,"plan.card.submitFailed":`Submit failed: {error}`,"plan.card.draftKept":` (feedback draft kept, retry manually)`,"plan.card.exitFailed":`Exit failed: {error}`,"plan.card.awaiting":`Plan awaiting approval`,"plan.card.badge":`Plan`,"plan.card.offline":` · offline`,"plan.card.feedback":`Feedback`,"plan.card.offlineNote":`Offline: approve, revise and exit are disabled, act manually after reconnecting`,"plan.card.submitting":`Submitting…`,"plan.card.submitFeedback":`Submit feedback`,"plan.card.needFeedback":`Enter your feedback`,"plan.card.approve":`Approve and run`,"plan.card.revise":`Request changes`,"plan.card.processing":`Working…`,"plan.card.exit":`Cancel and leave plan mode`,"plan.card.hint":`You can keep typing without deciding, a new message replaces this plan`,"plan.row.section":`Plan submitted by the assistant`,"question.card.cancelledElsewhere":`This question was cancelled (the run stopped or the session was archived), the new answer was not saved`,"question.card.handledElsewhere":`This question was handled elsewhere first, the saved result applies: {result}`,"question.card.gone":`This question is no longer waiting. It may have been handled elsewhere or cancelled`,"question.card.notFound":`Question not found, it may already be settled`,"question.card.dock":`Questions awaiting an answer`,"question.card.dismiss":`Dismiss result`,"question.card.count":`{total} questions awaiting an answer, showing {index}`,"question.card.prev":`Previous`,"question.card.next":`Next`,"question.card.notSaved":`The answer was not saved, try again`,"question.card.submitFailed":`Submit failed: {error} (answer draft kept, retry manually)`,"question.card.section":`Assistant question`,"question.card.awaiting":`Awaiting answer`,"question.card.offline":` · offline`,"question.card.draftKept":`Draft kept`,"question.card.foldTitle":`Collapse question (does not skip it)`,"question.card.unfoldTitle":`Expand question`,"question.card.fold":`Collapse`,"question.card.unfold":`Expand`,"question.card.loadFailed":`Cannot load the full question: {message}`,"question.card.loading":`Loading the full question…`,"question.card.loadOffline":`Offline, the full question cannot be loaded for now`,"question.card.chooseMany":`Choose one or more options`,"question.card.chooseOne":`Choose one option`,"question.card.recommended":`Recommended`,"question.card.clear":`Clear selection`,"question.card.extra":`Additional notes (optional)`,"question.card.yourAnswer":`Your answer`,"question.card.offlineNote":`Offline: answering and skipping are disabled and your draft is kept. Submit manually after reconnecting, nothing is sent automatically`,"question.card.submitting":`Submitting…`,"question.card.submit":`Submit answer`,"question.card.skipTitle":`Skip: provide no answer, the assistant decides on its own and continues; the run is not stopped`,"question.card.skipping":`Skipping…`,"question.card.skip":`Skip`,"question.card.needInput":`Choose an option or type text to submit; choices are only kept as a draft`,"question.card.foldHint":`Collapsing or closing does not skip, and the run can still be stopped at any time`,"queue.mode.steer":`Steer`,"queue.mode.followUp":`Queued`,"queue.section":`Queued messages`,"queue.image":`Image`,"queue.imageOnly":`(image only)`,"queue.images":`{count} img`,"queue.steerAria":`Steer message: {label}`,"queue.steerTitle":`Switch to steer: join the work in progress after the current tool round ends`,"queue.steer":`Steer`,"queue.withdrawAria":`Withdraw {mode} message: {label}`,"queue.withdraw":`Withdraw`,"sessions.switchWorkspace":`Switch workspace`,"sessions.collapse":`Collapse sidebar`,"sessions.new":`New session`,"sessions.searchAria":`Search sessions in this workspace`,"sessions.searchPlaceholder":`Search sessions…`,"sessions.heading":`Sessions`,"sessions.actionsFor":`Actions for {name}`,"sessions.actions":`Session actions`,"sessions.waitingGateway":`Waiting for the gateway…`,"sessions.noMatch":`No matching sessions`,"sessions.empty":`No sessions in this workspace yet`,"sessions.market":`Skill market`,"sessions.settings":`Settings`,"sessions.drawer":`Workspaces and sessions`,"sessions.chooseWorkspace":`Choose workspace`,"sessions.archive":`Archive session`,"sessions.currentWorkspace":`Current workspace`,"sessions.addWorkspace":`Add workspace`,"sessions.archiveConfirm":`Archive “{name}”? The session is hidden from the list, the workspace and files are kept`,"sessions.confirmArchive":`Archive`,"subagent.title":`Sub-agents`,"subagent.history":`History · `,"subagent.usage":`Total sub-agent usage`,"subagent.duration":`Duration of the current or latest task`,"subagent.stop":`Stop this task`,"subagent.queued":`Task queued…`,"subagent.noContent":`Nothing yet`,"subagent.rounds":`{count} rounds`,"todo.aria":`Todo {done}/{total}, {done} completed{offline}`,"todo.ariaOffline":` (offline)`,"todo.progressTitle":`Todo progress (read-only)`,"todo.label":`Todo`,"todo.panel":`Todo list`,"todo.heading":`Todo · {done}/{total} completed`,"todo.offlineNote":`Offline · showing the last loaded content, it may be out of date`,"todo.items":`Todo items`,"tool.status.pending":`Pending`,"tool.status.running":`Running`,"tool.status.done":`Done`,"tool.status.failed":`Failed`,"tool.diff":`Code changes`,"tool.diffTruncated":`The code change preview is truncated, see the full content written below`,"tool.fullWrite":`Full content written`,"tool.output":`Output`,"tool.errorOutput":`Error output`,"tool.result":`Result`,"common.reconnecting":`Reconnecting…`,"common.connectionFailed":`Connection failed`,"topbar.toggleSidebar":`Toggle sidebar`,"topbar.switching":`Switching…`,"topbar.jobs":`Jobs{state}`,"topbar.jobsRunning":` · {count} running`,"topbar.jobsCount":` {count}`,"topbar.workspaceAria":`Workspace, {count} changed files`,"topbar.workspaceTitle":`Workspace: browse files and agent changes (read-only)`,"wspanel.resize":`Resize workspace panel`,"wspanel.close":`Close workspace panel`,"wspanel.views":`Workspace views`,"wspanel.files":`Files`,"wspanel.changes":`Changes {count}`,"wspanel.backToTree":`← File tree`,"picker2.hint":`Choose a folder on the computer running Harness`,"picker2.pathNav":`Directory path`,"picker2.fullPath":`Full directory path`,"picker2.go":`Go`,"picker2.filter":`Filter folders`,"picker2.filterPlaceholder":`Filter folders…`,"picker2.hidden":`Hidden folders`,"picker2.list":`Folder list`,"picker2.parent":`Parent directory`,"picker2.inaccessible":`Not accessible`,"picker2.loading":`Reading directory…`,"picker2.noMatch":`No matching subfolders, you can choose the current directory`,"picker2.more":`Load more`,"picker2.adding":`Adding…`,"picker2.choose":`Choose folder`,"path.thisComputer":`This PC`,"chat.skip":`Skip to main content`,"chat.dismissNotice":`Dismiss notice`,"chat.startHere":`Start a new session in this workspace`,"chat.subagents":`Sub-agents · {count}`,"chat.subagentsApproval":` · {count} awaiting approval`,"chat.subagentsRunning":` · {count} running`,"command.compact":`Compact the context (optional instructions)`,"command.plan":`Toggle plan mode (read-only research, submit a plan, run after approval)`,"command.builtin":`Built-in`,"thinking.label":`Thinking…`,"skills.category.documents":`Documents`,"skills.category.development":`Development workflow`,"skills.category.frontend":`Frontend / UI`,"skills.category.research":`Research`,"skills.category.skills":`Skills ecosystem`,"skills.category.automation":`Automation`,"skills.category.database":`Database`,"skills.category.writing":`Writing`,"skills.category.uncategorized":`Uncategorized`,"skills.badge.project":`Project`,"skills.badge.user":`User`,"skills.badge.active":`{level} · active`,"skills.badge.builtin":`Built-in`,"skills.scope.user":`user level`,"skills.scope.project":`project level`,"skills.processing":`Working…`,"skills.installedShadowed":`Installed at user level, but a project-level skill with the same name takes precedence, so this install is not active yet. It applies from your next message`,"skills.installed":`Installed, it applies from your next message`,"skills.overwriteTitle":`Overwrite installed skill`,"skills.overwriteBody":`{name} is already installed at {scope}. Overwrite with the market version? Local changes will be lost`,"skills.overwriteBodyVersion":`{name} is already installed at {scope}. Overwrite with market version {version}? Local changes will be lost`,"skills.overwrite":`Overwrite`,"skills.opFailed":`Operation failed: {error}`,"skills.shadowTitle":`Not active after install`,"skills.shadowBody":`A project-level {name} already exists and takes precedence. Install to user level anyway?`,"skills.installAnyway":`Install anyway`,"skills.uninstallTitle":`Uninstall skill`,"skills.uninstallBody":`Delete {name} from {scope}? This cannot be undone`,"skills.uninstall":`Uninstall`,"skills.uninstalled":`Uninstalled, it applies from your next message`,"skills.closeDetail":`Close details`,"skills.detailAria":`Skill details {name}`,"skills.tab.about":`About`,"skills.tab.preview":`Preview`,"skills.loadFailed":`Failed to load: {error}`,"skills.field.category":`Category`,"skills.field.source":`Source`,"skills.field.size":`Size`,"skills.field.uploaded":`Uploaded`,"skills.field.license":`License`,"skills.notInstalled":`Not installed`,"skills.previewLoading":`Downloading and unpacking preview…`,"skills.previewFailed":`Preview failed: {error}`,"skills.packageFiles":`Files in package`,"skills.builtinNote":`Built-in skills ship with neko, so they need no install and cannot be uninstalled`,"skills.uninstallScope":`Uninstall from {scope}`,"skills.installing":`Installing…`,"skills.installScope":`Install to {scope}`,"skills.back":`← Back to chat`,"skills.title":`Skill market`,"skills.groupCategory":`By category`,"skills.groupSource":`By source`,"skills.search":`Search skills`,"skills.searchPlaceholder":`Search skills…`,"skills.loadingCatalog":`Loading the market catalog…`,"skills.waitingGateway":`Waiting for the gateway…`,"skills.catalogFailed":`Failed to load the market catalog, check your network and try again`,"skills.noMatch":"No matching skills. For a recurring need, create your own with `/skill:skill-creator`"}},RN=/\{(\w+)\}/g;function zN(e,t,n=``){return e.replace(RN,(e,r)=>{let i=t?.[r];if(i===void 0)throw Error(`i18n: missing param "${r}" for "${n}"`);return String(i)})}function BN(e){let t=LN[e];return((e,n)=>zN(t[e],n,e))}function z(){return BN(FN())}function B(){let e=IN();return(0,f.useMemo)(()=>BN(e),[e])}function VN(e,t){return e.filter(e=>e.workspaceRoot===t).sort(Qi)}var HN=class{subagent(e){if(!this.ready||!this.#t)throw Error(z()(`gw.sessionNotReady`));return this.#t.subagent(e)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f=[];#p;#m;#h=[];#g;#_;#v=0;#y=0;#b=0;#x=!1;#S=!1;#C=!1;#w=!1;#T=!1;constructor(e){this.#e=e,this.#p=e.workspaceRoot,this.#m=e.preferredSession}get currentSessionId(){return this.#m}get workspaceRoot(){return this.#p}get ready(){return this.#S&&!this.#w&&this.#d!==void 0}get managementReady(){return this.#S&&!this.#w}async saveCredential(e,t){if(!this.#S||!this.#o)throw Error(z()(`gw.notConnected`));await this.#o.save({provider:e,key:t})}async removeCredential(e){if(!this.#S||!this.#o)throw Error(z()(`gw.notConnected`));await this.#o.remove({provider:e})}async setProviderEnabled(e,t){if(!this.#S||!this.#o)throw Error(z()(`gw.notConnected`));await this.#o.setEnabled({provider:e,enabled:t})}async setSearchProvider(e){if(!this.#S||!this.#s)throw Error(z()(`gw.notConnected`));await this.#s.set({provider:e})}async setContextSettings(e){if(!this.#S||!this.#c)throw Error(z()(`gw.notConnected`));await this.#c.set(e)}async resetContextSettings(){if(!this.#S||!this.#c)throw Error(z()(`gw.notConnected`));await this.#c.reset({})}async setDefaultModel(e){if(!this.#S||!this.#l)throw Error(z()(`gw.notConnected`));await this.#l.set(e)}async clearDefaultModel(){if(!this.#S||!this.#l)throw Error(z()(`gw.notConnected`));await this.#l.clear(null)}async start(){this.#e.events.onPhase(`connecting`),this.#e.events.onWorkspace(this.#p);try{await this.#P()}catch(e){this.#E(e),e instanceof Wi?(this.#C=!0,this.#e.events.onPhase(`error`),await this.#z()):this.#L()}}#E(e){this.#e.events.onError(e instanceof Wi?z()(`gw.incompatible`):e instanceof Error?e.message:String(e))}#D(e){if(this.#x||e!==this.#y)throw Error(z()(`gw.connectionChanged`))}async#O(e){if(!this.managementReady)throw Error(z()(`gw.busy`));this.#w=!0,this.#e.events.onOperation(!0);let t=this.#y;try{await e(t)}finally{this.#w=!1,this.#e.events.onOperation(!1),t===this.#y&&this.#M()}}async selectWorkspace(e){await this.#O(async t=>{if(!this.#r?.state.value.workspaces.some(t=>t.path===e))throw Error(z()(`gw.workspaceMissing`));await this.#k(e,void 0,t)})}async addWorkspace(e){await this.#O(async t=>{let n=await this.#r.add({path:e});this.#D(t),await this.#k(n.path,void 0,t)})}async browse(e){if(!this.#S||!this.#r)throw Error(z()(`gw.notConnected`));return this.#r.browse(e)}async attachTo(e){await this.#O(async t=>{if(!this.#f.find(t=>t.id===e&&t.workspaceRoot===this.#p))throw Error(z()(`gw.sessionNotInWorkspace`));await this.#A(e,t)})}async createSession(){await this.#O(async e=>{let t=await this.#n.create({cwd:this.#p});this.#D(e),await this.#A(t.id,e)})}async archiveSession(e){await this.#O(async t=>{await this.#n.archive(e),this.#D(t),this.#f=this.#f.filter(t=>t.id!==e),this.#m===e&&await this.#k(this.#p,void 0,t)})}async#k(e,t,n){let r=VN(this.#f,e).sort($i),i=r.find(e=>e.id===t)??r[0];try{i?await this.#A(i.id,n):await this.#j(n),this.#D(n),this.#p=e,this.#e.events.onWorkspace(e)}catch(e){throw n===this.#y&&(this.#R(),this.#m=void 0,this.#e.events.onSessionChange(null)),e}}async#A(e,t){if(this.#m===e&&this.#d)return;let n=this.#t;this.#R();let r=this.#b;this.#m=void 0,this.#e.events.onSessionChange(null);let i=await n.attach(e);this.#D(t),this.#d=i,this.#m=e,this.#e.events.onSessionChange(e);let a=e=>{e&&t===this.#y&&r===this.#b&&this.#e.events.onView(e)};i.view.value&&a(i.view.value),this.#g=i.view.subscribe(a)}async#j(e){this.#R(),this.#m=void 0,this.#e.events.onSessionChange(null),await this.#t.detach(),this.#D(e)}#M(){this.managementReady&&this.#m&&!this.#f.some(e=>e.id===this.#m)&&this.#O(e=>this.#k(this.#p,void 0,e)).catch(e=>this.#E(e))}async configure(e){if(!this.ready)throw Error(z()(`gw.sessionNotReady`));await this.#d.configure(e)}async submit(e,t=[],n=crypto.randomUUID(),r){if(r!==void 0&&r!==this.#m)throw Error(z()(`gw.sessionChangedDraft`));if(!this.ready)throw Error(z()(`gw.sessionNotReady`));let i=this.#d,a=[];try{for(let e of t)a.push(await qi(e,{begin:e=>i.beginImage(e),append:e=>i.appendImage(e),finish:e=>i.finishImage(e),release:e=>i.releaseImage(e)}));await i.submit({content:e,requestId:n,images:a})}finally{for(let e of a)await i.releaseImage(e).catch(()=>{})}}async searchFiles(e,t,n){if(!this.managementReady||!this.#i||t!==this.#p)throw Error(z()(`gw.workspaceNotReady`));return this.#t.host.root(n=>this.#i.search({workspaceRoot:t,query:e},n),{signal:n})}async workspaceImage(e,t,n){if(!this.ready||t!==this.#m)throw Error(z()(`gw.sessionChangedDraft`));let r=this.#d;return this.#t.host.root(async t=>{let n=await r.importImage(e,t);try{return{...await Ji(e=>r.draftImage({id:n.id,offset:e},t)),name:n.name}}finally{await r.releaseImage(n.id).catch(()=>{})}},{signal:n})}async compact(e,t){if(t!==void 0&&t!==this.#m)throw Error(z()(`gw.sessionChangedDraft`));if(!this.ready)throw Error(z()(`gw.sessionNotReady`));await this.#d.compact({instructions:e})}#N(e){if(!this.ready||e!==this.#m)throw Error(z()(`gw.sessionChanged`));return uN(this.#d)}async steer(e,t){if(!this.ready||e!==this.#m)throw Error(z()(`gw.sessionChanged`));return fN(this.#d).steer(t)}async withdraw(e,t){if(!this.ready||e!==this.#m)throw Error(z()(`gw.sessionChanged`));return fN(this.#d).withdraw(t)}async questionGet(e,t){if(!this.ready||e!==this.#m)throw Error(z()(`gw.sessionChangedOrNotReady`));return hN(this.#d).get(t)}async questionRespond(e,t){if(!this.ready||e!==this.#m)throw Error(z()(`gw.sessionChangedAnswerDraft`));return hN(this.#d).respond(t)}async planMode(e,t){if(!this.ready||e!==this.#m)throw Error(z()(`gw.sessionChangedOrNotReady`));return _N(this.#d).setMode(t)}async planGet(e,t){if(!this.ready||e!==this.#m)throw Error(z()(`gw.sessionChangedOrNotReady`));return _N(this.#d).get(t)}async planRespond(e,t){if(!this.ready||e!==this.#m)throw Error(z()(`gw.sessionChangedFeedbackDraft`));return _N(this.#d).respond(t)}workspace(e){if(!this.ready||e!==this.#m)throw Error(z()(`gw.sessionChangedOrNotReady`));return yN(this.#d,this.#t.host)}async jobOutput(e,t,n){return this.#N(e).output(t,n)}async jobStop(e,t){return this.#N(e).stop(t)}async image(e,t,n){if(n!==void 0&&n!==this.#m)throw Error(z()(`gw.sessionChangedDraft`));if(!this.ready)throw Error(z()(`gw.sessionNotReady`));let r=this.#d;return Ji(n=>r.getImage({entryId:e,contentIndex:t,offset:n}))}abort(){this.ready&&this.#d.abort(null).catch(e=>this.#E(e))}async listSkills(e,t){if(!this.ready||e!==this.#m)throw Error(z()(`gw.sessionNotReady`));return this.#t.host.root(e=>this.#d.skills(null,e),{signal:t})}async listModels(){return this.#a?.list(null)??[]}marketList(e){return this.#u?this.#u.list({...e?{query:e}:{},workspaceRoot:this.#p}):Promise.reject(Error(z()(`gw.notConnected`)))}marketDetail(e){return this.#u?this.#u.detail({name:e,workspaceRoot:this.#p}):Promise.reject(Error(z()(`gw.notConnected`)))}marketPreview(e){return this.#u?this.#u.preview({name:e}):Promise.reject(Error(z()(`gw.notConnected`)))}marketInstall(e,t,n){return this.#u?this.#u.install({name:e,scope:t,workspaceRoot:this.#p,...n?{overwrite:n}:{}}):Promise.reject(Error(z()(`gw.notConnected`)))}async marketUninstall(e,t){if(!this.#u)return Promise.reject(Error(z()(`gw.notConnected`)));await this.#u.uninstall({name:e,scope:t,workspaceRoot:this.#p})}async#P(){let e=++this.#y,t=this.#e.discover?await this.#e.discover():{gatewayWs:this.#e.url,serverId:this.#e.serverId};this.#D(e);let n=bN(iN(new WebSocket(t.gatewayWs)),t.serverId);this.#t=n,n.link.onClose(()=>{n===this.#t&&this.#L()});try{await n.ready()}catch(e){throw e instanceof Wi&&(this.#C=!0,this.#_&&=(clearTimeout(this.#_),void 0),this.#e.events.onPhase(`error`)),e}this.#D(e),this.#h.push(n.application.info.subscribe(t=>{e===this.#y&&(this.#e.events.onUpdates?.(t),this.#e.events.onShell?.(t.shell??null))})),this.#e.events.onUpdates?.(n.application.info.value),this.#e.events.onShell?.(n.application.info.value.shell??null),this.#n=n.management,this.#r=n.workspaces,this.#i=n.workspaceFiles,this.#a=n.models,this.#o=n.credentials,this.#s=n.searchSettings,this.#c=n.contextSettings,this.#l=n.defaultModel,this.#u=n.skillMarket;let r=this.#o.state.value?.revision;this.#h.push(this.#o.state.subscribe(t=>{e===this.#y&&(this.#e.events.onCredentials?.(t),this.#S&&t.revision!==r&&this.#I(e),r=t.revision)})),this.#e.events.onCredentials?.(this.#o.state.value),this.#h.push(this.#s.state.subscribe(t=>{e===this.#y&&this.#e.events.onSearchSettings?.(t)})),this.#e.events.onSearchSettings?.(this.#s.state.value);let i=this.#c;this.#h.push(i.state.subscribe(t=>{e===this.#y&&this.#e.events.onContextSettings?.(t)})),this.#e.events.onContextSettings?.(i.state.value);let a=this.#l;this.#h.push(a.state.subscribe(t=>{e===this.#y&&this.#e.events.onDefaultModel?.(t)})),this.#e.events.onDefaultModel?.(a.state.value);let o=n.directory,s=t=>{e===this.#y&&(this.#f=t.sessions,this.#e.events.onDirectory(t),this.#M())};this.#h.push(o.state.subscribe(s)),this.#h.push(this.#r.state.subscribe(t=>{e===this.#y&&this.#e.events.onWorkspaces(t)})),this.#T||=(await this.#r.add({path:this.#p}),this.#D(e),!0),s(o.state.value),this.#e.events.onWorkspaces(this.#r.state.value),await this.#k(this.#p,this.#m,e),this.#D(e),this.#S=!0,this.#v=0,this.#e.events.onPhase(`ready`),this.#I(e)}#F=0;#I(e){let t=++this.#F;this.#a?.list(null).then(n=>{e===this.#y&&t===this.#F&&this.#e.events.onModels(n)}).catch(()=>{})}async checkUpdates(){if(!this.#t)throw Error(z()(`gw.notConnected`));return this.#t.application.check(null)}#L(){if(this.#x||this.#C||this.#_)return;++this.#y,this.#S=!1,this.#R(),this.#e.events.onPhase(`reconnecting`),this.#e.events.onUpdates?.(null),this.#e.events.onShell?.(null);let e=Math.min((this.#e.retryBaseMs??800)*++this.#v,this.#e.retryMaxMs??8e3);this.#_=setTimeout(()=>{this.#_=void 0,this.#z().then(()=>{if(!this.#x)return this.#P()}).catch(e=>{this.#E(e),e instanceof Wi?(this.#e.events.onPhase(`error`),this.#z()):this.#L()})},e)}#R(){++this.#b,this.#g?.(),this.#g=void 0,this.#d?.release(),this.#d=void 0,this.#e.events.onView(null)}async#z(){for(let e of this.#h.splice(0))e();this.#R(),this.#n=void 0,this.#r=void 0,this.#i=void 0,this.#o=void 0,this.#e.events.onCredentials?.(null),this.#s=void 0,this.#e.events.onSearchSettings?.(null),this.#c=void 0,this.#e.events.onContextSettings?.(null),this.#l=void 0,this.#e.events.onDefaultModel?.(null),this.#a=void 0;let e=this.#t;this.#t=void 0,await e?.close().catch(()=>{})}dispose(){this.#x=!0,++this.#y,this.#S=!1,clearTimeout(this.#_),this.#z()}},UN=[{pattern:/^Thinking\.\.\.$/,render:e=>e(`core.status.thinking`)},{pattern:/^Running (.+)\.\.\.$/,render:(e,t)=>e(`core.status.running`,{tool:t[1]??``})},{pattern:/^Retrying \(attempt (\d+)\)\.\.\.$/,render:(e,t)=>e(`core.status.retrying`,{attempt:t[1]??``})},{pattern:/^\[context compacted\]$/,render:e=>e(`core.row.compacted`)},{pattern:/^\[new context\]$/,render:e=>e(`core.row.newContext`)},{pattern:/^Not run: response interrupted\.$/,render:e=>e(`core.note.notRun`)}];function WN(e,t=z()){for(let n of UN){let r=n.pattern.exec(e);if(r)return n.render(t,r)}return e}var GN={PROVIDER_DISABLED:{pattern:/^(.+?) is not enabled\./,render:(e,t)=>e(`core.error.providerDisabled`,{provider:t[1]??``})},PROVIDER_KEY_REQUIRED:{pattern:/^Configure an? (.+?) API key\b/,render:(e,t)=>e(`core.error.providerKeyRequired`,{provider:t[1]??``})},PLAN_BUSY:{pattern:/^/,render:e=>e(`core.error.planBusy`)}},KN=/^([A-Z][A-Z_]+): ([\s\S]*)$/;function qN(e,t=z()){let n=KN.exec(e),r=n?.[1]===void 0?void 0:GN[n[1]];if(!n||!r)return e;let i=r.pattern.exec(n[2]??``);return i?r.render(t,i):e}var JN={phase:`connecting`,updates:null,shell:null,webInfo:null,credentials:null,searchSettings:null,contextSettings:null,defaultModel:null,workspaceRoot:``,workspaces:[],operating:!1,sessions:[],models:[],currentSessionId:null,view:null,retained:null,notice:null},YN=new Set;function XN(e){JN=e;for(let e of YN)e()}function ZN(e){return YN.add(e),()=>{YN.delete(e)}}function QN(){return(0,f.useSyncExternalStore)(ZN,()=>JN)}function $N(){return JN}var eP={setUpdates(e){XN({...JN,updates:e})},setShell(e){XN({...JN,shell:e})},setWebInfo(e){XN({...JN,webInfo:e})},setCredentials(e){e&&JN.credentials&&e.revision<JN.credentials.revision||XN({...JN,credentials:e})},setSearchSettings(e){e&&JN.searchSettings&&e.revision<JN.searchSettings.revision||XN({...JN,searchSettings:e})},setContextSettings(e){e&&JN.contextSettings&&e.revision<JN.contextSettings.revision||XN({...JN,contextSettings:e})},setDefaultModel(e){XN({...JN,defaultModel:e})},setWorkspace(e){XN({...JN,workspaceRoot:e})},setWorkspaces(e){XN({...JN,workspaces:e})},setOperation(e){XN({...JN,operating:e})},setPhase(e){XN({...JN,phase:e})},setDirectory(e){XN({...JN,sessions:e})},setModels(e){XN({...JN,models:e})},setSession(e){XN({...JN,currentSessionId:e})},setView(e){let t=JN.currentSessionId,n=e!==null&&t!==null?{sessionId:t,todos:e.todos,questions:e.questions}:JN.retained;XN({...JN,view:e,retained:n})},notice(e){XN({...JN,notice:{...e,text:qN(e.text)}})},clearNotice(){JN.notice!==null&&XN({...JN,notice:null})}},tP=`neko.upgrade-draft.v1`;function nP(e=sessionStorage){try{let t=JSON.parse(e.getItem(tP)??`null`);if(t?.version===1&&typeof t.serverId==`string`&&typeof t.workspace==`string`&&(typeof t.session==`string`||t.session===null)&&typeof t.text==`string`&&typeof t.requestId==`string`)return t}catch{}return null}function rP(e,t=sessionStorage){if(t.setItem(tP,JSON.stringify(e)),t.getItem(tP)!==JSON.stringify(e))throw Error(`Draft not saved`)}function iP(){sessionStorage.removeItem(tP)}var aP=0;async function oP(){let e=++aP,t=await fetch(`/api/info`,{cache:`no-store`,signal:AbortSignal.timeout(5e3)});if(!t.ok)throw Error(z()(`gw.infoFailed`,{status:t.status}));let n=await t.json();if(n.protocolCompatible===!1)throw new Wi;if(typeof n.gatewayWs!=`string`||typeof n.serverId!=`string`||typeof n.webVersion!=`string`||typeof n.workspaceRoot!=`string`||n.installedVersion!==null&&typeof n.installedVersion!=`string`)throw Error(z()(`gw.invalidInfo`));return e===aP&&eP.setWebInfo({serverId:n.serverId,webVersion:n.webVersion,installedVersion:n.installedVersion,gatewaySpawned:n.gatewaySpawned===!0}),n}var sP;function cP(){(async()=>{let e;try{e=await oP()}catch(e){eP.setPhase(`error`),eP.notice({level:`error`,text:e instanceof Wi?z()(`gw.incompatible`):z()(`gw.infoLoadFailed`,{error:e instanceof Error?e.message:String(e)})});return}let t=nP(),n=t?.serverId===e.serverId?t:null;sP=new HN({url:e.gatewayWs,serverId:e.serverId,workspaceRoot:n?.workspace??e.workspaceRoot,preferredSession:n?.session??void 0,discover:oP,events:{onPhase:eP.setPhase,onUpdates:eP.setUpdates,onShell:eP.setShell,onCredentials:eP.setCredentials,onSearchSettings:eP.setSearchSettings,onContextSettings:eP.setContextSettings,onDefaultModel:eP.setDefaultModel,onWorkspaces:e=>eP.setWorkspaces(e.workspaces),onWorkspace:eP.setWorkspace,onOperation:eP.setOperation,onError:e=>eP.notice({level:`error`,text:e}),onDirectory:e=>eP.setDirectory(e.sessions),onModels:eP.setModels,onSessionChange:eP.setSession,onView:eP.setView}}),await sP.start();let r=()=>{document.visibilityState===`visible`&&oP().catch(()=>{})},i=setInterval(r,3e4);document.addEventListener(`visibilitychange`,r),window.addEventListener(`pagehide`,()=>{clearInterval(i),document.removeEventListener(`visibilitychange`,r)},{once:!0}),n?.text&&sP.currentSessionId!==n.session&&eP.notice({level:`info`,text:z()(`gw.sessionGone`)})})()}function lP(){eP.notice({level:`error`,text:z()(`gw.notReady`)})}var uP={subagent(e){return dP().subagent(e)},jobOutput(e,t,n){return dP().jobOutput(e,t,n)},jobStop(e,t){return dP().jobStop(e,t)},workspace(e){return dP().workspace(e)},checkUpdates(){return dP().checkUpdates()},saveCredential(e,t){return dP().saveCredential(e,t)},removeCredential(e){return dP().removeCredential(e)},setProviderEnabled(e,t){return dP().setProviderEnabled(e,t)},setContextSettings(e){return dP().setContextSettings(e)},resetContextSettings(){return dP().resetContextSettings()},setDefaultModel(e){return dP().setDefaultModel(e)},clearDefaultModel(){return dP().clearDefaultModel()},setSearchProvider(e){return dP().setSearchProvider(e)},configure(e,t){let n=dP();return n.currentSessionId!==t||!n.ready?Promise.reject(Error(z()(`gw.sessionChangedRetry`))):n.configure(e)},submit(e,t=[],n,r){return dP().submit(e,t,n,r)},steer(e,t){return dP().steer(e,t)},withdraw(e,t){return dP().withdraw(e,t)},questionGet(e,t){return dP().questionGet(e,t)},questionRespond(e,t){return dP().questionRespond(e,t)},planMode(e,t){return dP().planMode(e,t)},planGet(e,t){return dP().planGet(e,t)},planRespond(e,t){return dP().planRespond(e,t)},searchFiles(e,t,n){return dP().searchFiles(e,t,n)},workspaceImage(e,t,n){return dP().workspaceImage(e,t,n)},compact(e,t){return dP().compact(e,t)},listSkills(e,t){return dP().listSkills(e,t)},marketList(e){return dP().marketList(e)},marketDetail(e){return dP().marketDetail(e)},marketPreview(e){return dP().marketPreview(e)},marketInstall(e,t,n){return dP().marketInstall(e,t,n)},marketUninstall(e,t){return dP().marketUninstall(e,t)},image(e,t,n){return dP().image(e,t,n)},abort(){sP?.ready===!0?sP.abort():lP()},selectSession(e){return dP().attachTo(e)},selectWorkspace(e){return dP().selectWorkspace(e)},addWorkspace(e){return dP().addWorkspace(e)},browse(e){return dP().browse(e)},createSession(){return dP().createSession()},configureModel(e){sP===void 0?lP():sP.configure({model:e}).catch(e=>{eP.notice({level:`error`,text:e instanceof Error?e.message:String(e)})})},archiveSession(e){return dP().archiveSession(e)}};function dP(){if(!sP)throw Error(z()(`gw.notStarted`));return sP}function fP(e){eP.notice({level:`error`,text:e instanceof Error?e.message:String(e)})}function pP(e,t){let n=e.slice(0,t),r=/(?:^|\s|[([{])(@(?:"[^"\n]*"?|[^\s"@]*))$/.exec(n);if(!r?.[1])return null;let i=r[1];return{start:t-i.length,end:t,query:i.slice(1).replace(/^"|"$/g,``)}}function mP(e,t=!1){let n=t&&!e.endsWith(`/`)?`${e}/`:e;return`@${/\s/.test(n)?`"${n}"`:n}`}function hP(e,t,n,r){let i=mP(n,r),a=r?``:` `;return{text:e.slice(0,t.start)+i+a+e.slice(t.end),cursor:t.start+i.length+a.length-(r&&i.endsWith(`"`)?1:0)}}function gP(e){return e.skill===void 0?e.text:e.skill.args===``?`/skill:${e.skill.name}`:`/skill:${e.skill.name} ${e.skill.args}`}function _P(e){return e.phase===`done`?e.isError?`error`:`ok`:e.phase}function vP(e){return(e.phase===`done`?e.result:e.output)??``}function yP(e){let t=e.width>0&&e.height>0?` · ${e.width}×${e.height}`:``;return`${e.name} · ${e.mimeType}${t}`}function bP(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function xP(e){return e.replace(/\s+/g,` `).trim()}function SP(e){let t=[];for(let n of e){if(n.type!==`user`||n.subagentRoundId!==void 0)continue;let e=gP(n).trim();e!==``&&t.at(-1)!==e&&t.push(e)}return t.reverse().slice(0,100)}var CP=e=>/^\/[^\s]*$/.test(e);function wP(e,t,n={}){let r=CP(e)?e:`/`,i=z();return[{key:`compact`,label:`/compact`,description:i(`command.compact`)},...n.plan===!0?[{key:`plan`,label:`/plan`,description:i(`command.plan`)}]:[],...t.map(e=>({key:`skill:${e.name}`,label:`/skill:${e.name}`,description:e.description,...e.level===`builtin`?{badge:i(`command.builtin`)}:{}}))].filter(e=>e.label.startsWith(r))}function TP(e,t=160){e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,t)}px`}function EP(e,t,n,r,i){if(n.shiftKey||n.altKey||n.ctrlKey||n.metaKey||n.key!==`ArrowUp`&&n.key!==`ArrowDown`||i.start!==i.end)return null;let a=e!==null&&e.entries[e.index]===r?e:null;if(n.key===`ArrowUp`){if(i.start!==0)return null;let e=a?.entries??t,n=(a?.index??-1)+1,o=e[n];return o===void 0?null:{browse:{index:n,draft:a?.draft??r,entries:e},text:o,caret:`start`}}if(a===null||i.start!==r.length)return null;let o=a.index-1;return o<0?{browse:null,text:a.draft,caret:`end`}:{browse:{...a,index:o},text:a.entries[o]??``,caret:`end`}}function DP(e){return e.retained!==null&&e.retained.sessionId===e.currentSessionId?e.retained:null}function OP(e){let t=e.view===null?DP(e)?.todos:e.view.todos;return t===void 0?null:{items:t.items,revision:t.revision,...Sj(t.items),offline:e.view===null||e.phase!==`ready`}}function kP(e){let t=e.view===null?DP(e)?.questions:e.view.questions;return t===void 0?null:{pending:t.pending,online:e.phase===`ready`&&!e.operating&&e.view!==null}}var AP={pending:`todo.status.pending`,in_progress:`todo.status.in_progress`,completed:`todo.status.completed`},jP={pending:`question.status.pending`,answered:`question.status.answered`,skipped:`question.status.skipped`,cancelled:`question.status.cancelled`},MP=e=>z()(AP[e]),NP=e=>z()(jP[e]);function PP(e){let t=z();return e.awaitingAnswer===!0?t(`session.suffix.awaitingAnswer`):e.awaitingPlan===!0?t(`session.suffix.awaitingPlan`):e.status===`running`?t(`session.suffix.running`):e.status===`error`?t(`session.suffix.error`):``}function FP(e,t){return t>0?`${z()(`title.answerPrefix`,{count:t})}${e}`:e}function IP(e){return[...e.replace(/\r\n?/g,`
13
+ `)].map(e=>{let t=e.charCodeAt(0);return t<32&&t!==9&&t!==10||t>=127&&t<=159||t>=8234&&t<=8238||t>=8294&&t<=8297?`\\u${t.toString(16).padStart(4,`0`)}`:e}).join(``)}function LP(e){let t=z();if(e.status===`answered`){let n=Dj(e);return n?t(`question.settle.answeredWith`,{answer:n}):t(`question.settle.answered`)}return e.status===`skipped`?t(`question.settle.skipped`):e.status===`cancelled`?t(`question.settle.cancelled`):NP(`pending`)}function RP(e,t){if(t.kind===`skip`)return e.status===`skipped`;if(e.status!==`answered`||e.answer===null)return!1;let n=t.optionIds??[];return e.answer.optionIds.length===n.length&&e.answer.optionIds.every(e=>n.includes(e))&&e.answer.text===(t.text??null)}function zP(e){let t=[...e.labels??e.optionIds??[]];return e.text&&t.push(e.text),t.join(`, `)}var BP={awaiting_approval:`plan.status.awaiting_approval`,approved:`plan.status.approved`,revision_requested:`plan.status.revision_requested`,superseded:`plan.status.superseded`,cancelled:`plan.status.cancelled`},VP=e=>z()(BP[e]),HP=()=>z()(`plan.modeLabel`),UP=()=>z()(`plan.unsupported`);function WP(e){let t=e.view?.plan;return t===void 0?null:{mode:t.mode,current:t.current,awaiting:t.current?.status===`awaiting_approval`?t.current:null,online:e.phase===`ready`&&!e.operating}}function GP(e){let t=/^\/plan(?:\s+([\s\S]*))?$/.exec(e.trim());return t?t[1]?.trim()??``:null}function KP(e,t){let n=z();return t?e.status===`approved`?n(`plan.settle.approved`):n(`plan.settle.revised`):e.status===`superseded`?n(`plan.settle.superseded`):e.status===`cancelled`?n(`plan.settle.cancelled`):e.status===`awaiting_approval`?n(`plan.settle.pending`):n(`plan.settle.other`,{status:VP(e.status)})}function qP(e){return e===`approve`?`approved`:`revision_requested`}function JP(e){return(e instanceof Error?e.message:String(e)).includes(`PLAN_BUSY`)}function YP(e){let t=e instanceof Error?e.message:String(e);return JP(e)?z()(`plan.busy`):t}function XP(e,t,n){if(!n)return FP(e,t);let r=z();return`${t>0?r(`title.answerPrefix`,{count:t}):``}${r(`title.planPrefix`)}${e}`}var ZP=(e,t,n,r)=>({id:e,kind:`model`,name:t,envVar:n,signupUrl:r,keyless:!1}),QP=[ZP(`deepseek`,`DeepSeek`,`DEEPSEEK_API_KEY`,`https://platform.deepseek.com/api_keys`),ZP(`openrouter`,`OpenRouter`,`OPENROUTER_API_KEY`,`https://openrouter.ai/keys`),ZP(`opencode-go`,`OpenCode Go`,`OPENCODE_API_KEY`,`https://opencode.ai/auth`),ZP(`opencode`,`OpenCode Zen`,`OPENCODE_API_KEY`,`https://opencode.ai/auth`),ZP(`openai`,`OpenAI`,`OPENAI_API_KEY`,`https://platform.openai.com/api-keys`),ZP(`google`,`Google`,`GEMINI_API_KEY`,`https://aistudio.google.com/apikey`),ZP(`groq`,`Groq`,`GROQ_API_KEY`,`https://console.groq.com/keys`),ZP(`mistral`,`Mistral`,`MISTRAL_API_KEY`,`https://console.mistral.ai/api-keys`),ZP(`xai`,`xAI`,`XAI_API_KEY`,`https://console.x.ai`),ZP(`together`,`Together`,`TOGETHER_API_KEY`,`https://api.together.ai/settings/api-keys`),ZP(`fireworks`,`Fireworks`,`FIREWORKS_API_KEY`,`https://fireworks.ai/account/api-keys`),ZP(`cerebras`,`Cerebras`,`CEREBRAS_API_KEY`,`https://cloud.cerebras.ai`),ZP(`nvidia`,`NVIDIA`,`NVIDIA_API_KEY`,`https://build.nvidia.com/settings/api-keys`),ZP(`huggingface`,`Hugging Face`,`HF_TOKEN`,`https://huggingface.co/settings/tokens`),ZP(`vercel-ai-gateway`,`Vercel AI Gateway`,`AI_GATEWAY_API_KEY`,`https://vercel.com/ai-gateway`),ZP(`moonshotai`,`Moonshot AI`,`MOONSHOT_API_KEY`,`https://platform.moonshot.ai/console/api-keys`),ZP(`moonshotai-cn`,`Moonshot AI CN`,`MOONSHOT_API_KEY`,`https://platform.moonshot.cn/console/api-keys`),ZP(`minimax`,`MiniMax`,`MINIMAX_API_KEY`,`https://platform.minimax.io`),ZP(`minimax-cn`,`MiniMax CN`,`MINIMAX_CN_API_KEY`,`https://platform.minimaxi.com`),ZP(`zai`,`Z.AI`,`ZAI_API_KEY`,`https://z.ai/manage-apikey/apikey-list`),ZP(`zai-coding-cn`,`Z.AI Coding CN`,`ZAI_CODING_CN_API_KEY`,`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`),ZP(`qwen-token-plan`,`Qwen Token Plan`,`QWEN_TOKEN_PLAN_API_KEY`,`https://modelstudio.console.alibabacloud.com`),ZP(`qwen-token-plan-cn`,`Qwen Token Plan CN`,`QWEN_TOKEN_PLAN_CN_API_KEY`,`https://bailian.console.aliyun.com`),ZP(`qwen-token-plan-individual`,`Qwen Token Plan Individual`,`QWEN_TOKEN_PLAN_API_KEY`,`https://modelstudio.console.alibabacloud.com`),ZP(`xiaomi`,`Xiaomi MiMo`,`XIAOMI_API_KEY`,`https://platform.xiaomimimo.com`),ZP(`xiaomi-token-plan-cn`,`Xiaomi Token Plan CN`,`XIAOMI_TOKEN_PLAN_CN_API_KEY`,`https://platform.xiaomimimo.com`),ZP(`xiaomi-token-plan-ams`,`Xiaomi Token Plan AMS`,`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,`https://platform.xiaomimimo.com`),ZP(`xiaomi-token-plan-sgp`,`Xiaomi Token Plan SGP`,`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,`https://platform.xiaomimimo.com`),ZP(`baseten`,`Baseten`,`BASETEN_API_KEY`,`https://app.baseten.co/settings/api_keys`),ZP(`ant-ling`,`Ant Ling`,`ANT_LING_API_KEY`,`https://ling.tbox.cn`),ZP(`kimi-coding`,`Kimi For Coding`,`KIMI_API_KEY`,`https://www.kimi.com/code/console`),ZP(`meta`,`Meta`,`META_API_KEY`,`https://llama.developer.meta.com`)],$P=[{id:`tavily`,kind:`search`,name:`Tavily`,envVar:`TAVILY_API_KEY`,signupUrl:`https://app.tavily.com`,keyless:!0}];[...QP,...$P];function eF(e){return QP.some(t=>t.id===e)}var tF=new Map(QP.map(e=>[e.id,e.name]));function nF(e){return tF.get(e)??e}function rF(e,t){if(!e||!t||!eF(t))return null;let n=e.statuses[t];return n?n.enabled===!1?`disabled`:n.source===`none`?`missing-key`:null:null}var iF=new Map(QP.map((e,t)=>[e.id,t]));function aF(e,t){return e!==null&&t!=null&&e.effective.provider===t.provider&&e.effective.modelId===t.modelId}function oF(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean),r=new Map;for(let t of e){let e=`${t.name} ${t.modelId} ${t.provider} ${nF(t.provider)}`.toLowerCase();if(!n.every(t=>e.includes(t)))continue;let i=r.get(t.provider);i||(i={provider:t.provider,name:nF(t.provider),available:t.available,models:[]},r.set(t.provider,i)),i.models.push(t)}return[...r.values()].sort((e,t)=>(iF.get(e.provider)??iF.size)-(iF.get(t.provider)??iF.size))}function sF(e,t){return t&&e.some(e=>e.provider===t)?t:(e.find(e=>e.available)??e[0])?.provider??null}function cF(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);return e.filter(e=>{let t=`${e.name} ${e.id} ${e.keywords??``}`.toLowerCase();return n.every(e=>t.includes(e))})}function lF(e){return e>=1e6?`${Number((e/1e6).toFixed(1))}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function uF(e){let t=z();return[t(`model.context`,{size:lF(e.contextWindow)}),e.input.includes(`image`)?t(`model.images`):t(`model.textOnly`),e.reasoning?t(`model.reasoning`):t(`model.noReasoning`)].join(` · `)}var dF=Cj(),fF={drafts:{},fold:{},active:{},focus:null},pF=0,mF=new Set;function hF(e){fF=e;for(let e of mF)e()}var gF=(e,t,n)=>JSON.stringify([e,t,n]);function _F(){return(0,f.useSyncExternalStore)(e=>(mF.add(e),()=>{mF.delete(e)}),()=>fF)}var vF={get state(){return fF},draft(e){return fF.drafts[e]??dF},setDraft(e,t){hF({...fF,drafts:{...fF.drafts,[e]:t}})},clearDraft(e){if(!(e in fF.drafts))return;let{[e]:t,...n}=fF.drafts;hF({...fF,drafts:n})},setFold(e,t){fF.fold[e]!==t&&hF({...fF,fold:{...fF.fold,[e]:t}})},setActive(e,t){fF.active[e]!==t&&hF({...fF,active:{...fF.active,[e]:t}})},open(e,t){let n=gF(e,t.id,t.version);hF({...fF,fold:{...fF.fold,[n]:`open`},active:{...fF.active,[e]:t.id},focus:{key:n,nonce:++pF}})},consumeFocus(e){fF.focus?.nonce===e&&hF({...fF,focus:null})},reset(){hF({drafts:{},fold:{},active:{},focus:null})}};function yF(){return typeof window<`u`}function bF(e){return CF(e)?(e.nodeName||``).toLowerCase():`#document`}function xF(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function SF(e){return((CF(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function CF(e){return yF()?e instanceof Node||e instanceof xF(e).Node:!1}function wF(e){return yF()?e instanceof Element||e instanceof xF(e).Element:!1}function TF(e){return yF()?e instanceof HTMLElement||e instanceof xF(e).HTMLElement:!1}function EF(e){return!yF()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof xF(e).ShadowRoot}function DF(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=RF(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function OF(e){return/^(table|td|th)$/.test(bF(e))}function kF(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var AF=/transform|translate|scale|rotate|perspective|filter/,jF=/paint|layout|strict|content/,MF=e=>!!e&&e!==`none`,NF;function PF(e){let t=wF(e)?RF(e):e;return MF(t.transform)||MF(t.translate)||MF(t.scale)||MF(t.rotate)||MF(t.perspective)||!IF()&&(MF(t.backdropFilter)||MF(t.filter))||AF.test(t.willChange||``)||jF.test(t.contain||``)}function FF(e){let t=BF(e);for(;TF(t)&&!LF(t);){if(PF(t))return t;if(kF(t))return null;t=BF(t)}return null}function IF(){return NF??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),NF}function LF(e){return/^(html|body|#document)$/.test(bF(e))}function RF(e){return xF(e).getComputedStyle(e)}function zF(e){return wF(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function BF(e){if(bF(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||EF(e)&&e.host||SF(e);return EF(t)?t.host:t}function VF(e){let t=BF(e);return LF(t)?(e.ownerDocument||e).body:TF(t)&&DF(t)?t:VF(t)}function HF(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=VF(e),i=r===e.ownerDocument?.body,a=xF(r);if(i){let e=UF(a);return t.concat(a,a.visualViewport||[],DF(r)?r:[],e&&n?HF(e):[])}return t.concat(r,HF(r,[],n))}function UF(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var WF=Math.min,GF=Math.max,KF=Math.round,qF=Math.floor,JF=e=>({x:e,y:e}),YF={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function XF(e,t,n){return GF(e,WF(t,n))}function ZF(e,t){return typeof e==`function`?e(t):e}function QF(e){return e.split(`-`)[0]}function $F(e){return e.split(`-`)[1]}function eI(e){return e===`x`?`y`:`x`}function tI(e){return e===`y`?`height`:`width`}function nI(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function rI(e){return eI(nI(e))}function iI(e,t,n){n===void 0&&(n=!1);let r=$F(e),i=rI(e),a=tI(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pI(o)),[o,pI(o)]}function aI(e){let t=pI(e);return[oI(e),t,oI(t)]}function oI(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var sI=[`left`,`right`],cI=[`right`,`left`],lI=[`top`,`bottom`],uI=[`bottom`,`top`];function dI(e,t,n){switch(e){case`top`:case`bottom`:return n?t?cI:sI:t?sI:cI;case`left`:case`right`:return t?lI:uI;default:return[]}}function fI(e,t,n,r){let i=$F(e),a=dI(QF(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oI)))),a}function pI(e){let t=QF(e);return YF[t]+e.slice(t.length)}function mI(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function hI(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:mI(e)}function gI(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}}var _I=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),vI=typeof Element>`u`,yI=vI?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bI=!vI&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},xI=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):xI(e.parentNode))},SI=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},CI=function(e,t,n){if(xI(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(_I));return t&&yI.call(e,_I)&&r.unshift(e),r=r.filter(n),r},wI=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!xI(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=wI(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{yI.call(a,_I)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!xI(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=wI(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},TI=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},EI=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||SI(e))&&!TI(e)?0:e.tabIndex},DI=function(e,t){var n=EI(e);return n<0&&t&&!TI(e)?0:n},OI=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},kI=function(e){return e.tagName===`INPUT`},AI=function(e){return kI(e)&&e.type===`hidden`},jI=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},MI=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},NI=function(e){if(!e.name)return!0;var t=e.form||bI(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=MI(r,e.form);return!i||i===e},PI=function(e){return kI(e)&&e.type===`radio`},FI=function(e){return PI(e)&&!NI(e)},II=function(e){var t=e&&bI(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=bI(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},LI=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},RI=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=yI.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(yI.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=bI(e);if(s&&!s.shadowRoot&&r(s)===!0)return LI(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(II(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return LI(e);return!1},zI=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return yI.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},BI=function(e,t){return!(t.disabled||AI(t)||RI(t,e)||jI(t)||zI(t))},VI=function(e,t){return!(FI(t)||EI(t)<0||!BI(e,t))},HI=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},UI=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=DI(a,i),s=i?UI(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(OI).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},WI=function(e,t){return t||={},UI(t.getShadowRoot?wI([e],t.includeContainer,{filter:VI.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:HI}):CI(e,t.includeContainer,VI.bind(null,t)))};function GI(){return/apple/i.test(navigator.vendor)}function KI(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function qI(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&EF(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function JI(e){return e?.ownerDocument||document}var YI=typeof document<`u`?f.useLayoutEffect:function(){},XI={...f}.useInsertionEffect||(e=>e());function ZI(e){let t=f.useRef(()=>{});return XI(()=>{t.current=e}),f.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var QI=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function $I(e,t){let n=WI(e,QI()),r=n.length;if(r===0)return;let i=KI(JI(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function eL(e){return $I(JI(e).body,1)||e}function tL(e){return $I(JI(e).body,-1)||e}function nL(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!qI(n,r)}function rL(e){WI(e,QI()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function iL(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var aL=l(gi(),1);function oL(e,t,n){let{reference:r,floating:i}=e,a=nI(t),o=rI(t),s=tI(o),c=QF(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=$F(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function sL(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}=ZF(t,e),p=hI(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=gI(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=gI(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 cL=50,lL=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:sL},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=oL(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<cL&&(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}=oL(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},uL=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}=ZF(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=QF(r),_=nI(o),v=QF(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pI(o)]:aI(o)),x=p!==`none`;!d&&x&&b.push(...fI(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=iI(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`||_===nI(t)||T.every(e=>nI(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=nI(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{}}}},dL=new Set([`left`,`top`]);async function fL(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=QF(n),s=$F(n),c=nI(n)===`y`,l=dL.has(o)?-1:1,u=a&&c?-1:1,d=ZF(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 pL=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 fL(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}}}}},mL=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}=ZF(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=nI(i),p=eI(f),m=u[p],h=u[f],g=(e,t)=>XF(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}}}}}},hL=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}=ZF(e,t),c=await i.detectOverflow(t,s),l=QF(n),u=$F(n),d=nI(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=WF(p-c[m],g),y=WF(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*GF(c.left,c.right):S=p-2*GF(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 gL(e){let t=RF(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=TF(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=KF(n)!==a||KF(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function _L(e){return wF(e)?e:e.contextElement}function vL(e){let t=_L(e);if(!TF(t))return JF(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=gL(t),o=(a?KF(n.width):n.width)/r,s=(a?KF(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var yL=JF(0);function bL(e){let t=xF(e);return!IF()||!t.visualViewport?yL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xL(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===xF(e)}function SL(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=_L(e),o=JF(1);t&&(r?wF(r)&&(o=vL(r)):o=vL(e));let s=xL(a,n,r)?bL(a):JF(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=xF(a),t=wF(r)?xF(r):r,n=e,i=UF(n);for(;i&&t!==n;){let e=vL(i),t=i.getBoundingClientRect(),r=RF(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=xF(i),i=UF(n)}}return gI({width:u,height:d,x:c,y:l})}function CL(e,t){let n=zF(e).scrollLeft;return t?t.left+n:SL(SF(e)).left+n}function wL(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-CL(e,n),y:n.top+t.scrollTop}}function TL(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=SF(r),s=t?kF(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=JF(1),u=JF(0),d=TF(r);if((d||!a)&&((bF(r)!==`body`||DF(o))&&(c=zF(r)),d)){let e=SL(r);l=vL(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?wL(o,c):JF(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 EL(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function DL(e){let t=zF(e),n=e.ownerDocument.body,r=GF(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=GF(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+CL(e),o=-t.scrollTop;return RF(n).direction===`rtl`&&(a+=GF(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var OL=25;function kL(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=xF(e),a=SF(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!IF()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(CL(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<=OL&&(s-=o)}return{width:s,height:c,x:l,y:u}}function AL(e,t){let n=SL(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=vL(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function jL(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=kL(e,n,t);else if(t===`document`)r=DL(SF(e));else if(wF(t))r=AL(t,n);else{let n=bL(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return gI(r)}function ML(e,t){let n=t.get(e);if(n)return n;let r=HF(e,[],!1).filter(e=>wF(e)&&bF(e)!==`body`),i=null,a=RF(e).position===`fixed`,o=a?BF(e):e;for(;wF(o)&&!LF(o);){let e=RF(o),t=PF(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=BF(o)}return t.set(e,r),r}function NL(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?kF(t)?[]:ML(t,this._c):[].concat(n),r],o=jL(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=jL(t,a[e],i);s=GF(n.top,s),c=WF(n.right,c),l=WF(n.bottom,l),u=GF(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function PL(e){let{width:t,height:n}=gL(e);return{width:t,height:n}}function FL(e,t,n){let r=TF(t),i=SF(t),a=n===`fixed`,o=SL(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=JF(0);if((r||!a)&&((bF(t)!==`body`||DF(i))&&(s=zF(t)),r)){let e=SL(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=CL(i));let l=i&&!r&&!a?wL(i,s):JF(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 IL(e){return RF(e).position===`static`}function LL(e,t){if(!TF(e)||RF(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return SF(e)===n&&(n=n.ownerDocument.body),n}function RL(e,t){let n=xF(e);if(kF(e))return n;if(!TF(e)){let t=BF(e);for(;t&&!LF(t);){if(wF(t)&&!IL(t))return t;t=BF(t)}return n}let r=LL(e,t);for(;r&&OF(r)&&IL(r);)r=LL(r,t);return r&&LF(r)&&IL(r)&&!PF(r)?n:r||FF(e)||n}var zL=async function(e){let t=this.getOffsetParent||RL,n=this.getDimensions,r=await n(e.floating);return{reference:FL(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function BL(e){return RF(e).direction===`rtl`}var VL={convertOffsetParentRelativeRectToViewportRelativeRect:TL,getDocumentElement:SF,getClippingRect:NL,getOffsetParent:RL,getElementRects:zL,getClientRects:EL,getDimensions:PL,getScale:vL,isElement:wF,isRTL:BL};function HL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UL(e,t,n){let r=null,i,a=SF(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=qF(d),h=qF(a.clientWidth-(u+f)),g=qF(a.clientHeight-(d+p)),_=qF(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:GF(0,WF(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!HL(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=xF(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function WL(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=_L(e),u=i||a?[...l?HF(l):[],...t?HF(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?UL(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?SL(e):null;c&&g();function g(){let t=SL(e);h&&!HL(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 GL=pL,KL=mL,qL=uL,JL=hL,YL=(e,t,n)=>{let r=new Map,i=n??{},a={...VL,...i.platform,_c:r};return lL(e,t,{...i,platform:a})},XL=typeof document<`u`?f.useLayoutEffect:function(){};function ZL(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(!ZL(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)&&!ZL(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function QL(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $L(e,t){let n=QL(e);return Math.round(t*n)/n}function eR(e){let t=f.useRef(e);return XL(()=>{t.current=e}),t}function tR(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);ZL(p,r)||m(r);let[h,g]=f.useState(null),[_,v]=f.useState(null),y=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=f.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=f.useRef(null),w=f.useRef(null),T=f.useRef(u),ee=c!=null,te=eR(c),ne=eR(i),re=eR(l),E=f.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};ne.current&&(e.platform=ne.current),YL(C.current,w.current,e).then(e=>{let t={...e,isPositioned:re.current!==!1};ie.current&&!ZL(T.current,t)&&(T.current=t,aL.flushSync(()=>{d(t)}))})},[p,t,n,ne,re]);XL(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=f.useRef(!1);XL(()=>(ie.current=!0,()=>{ie.current=!1}),[]),XL(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(te.current)return te.current(x,S,E);E()}},[x,S,E,te,ee]);let ae=f.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),oe=f.useMemo(()=>({reference:x,floating:S}),[x,S]),D=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!oe.floating)return e;let t=$L(oe.floating,u.x),r=$L(oe.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...QL(oe.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,oe.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:E,refs:ae,elements:oe,floatingStyles:D}),[u,E,ae,oe,D])}var nR=(e,t)=>{let n=GL(e);return{name:n.name,fn:n.fn,options:[e,t]}},rR=(e,t)=>{let n=KL(e);return{name:n.name,fn:n.fn,options:[e,t]}},iR=(e,t)=>{let n=qL(e);return{name:n.name,fn:n.fn,options:[e,t]}},aR=(e,t)=>{let n=JL(e);return{name:n.name,fn:n.fn,options:[e,t]}},oR=`ArrowLeft`,sR=`ArrowRight`,cR=`ArrowUp`,lR=`ArrowDown`,uR=[oR,sR],dR=[cR,lR];[...uR,...dR];var fR={...f},pR=!1,mR=0,hR=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+mR++;function gR(){let[e,t]=f.useState(()=>pR?hR():void 0);return YI(()=>{e??t(hR())},[]),f.useEffect(()=>{pR=!0},[]),e}var _R=fR.useId||gR;function vR(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var yR=f.createContext(null),bR=f.createContext(null),xR=()=>f.useContext(yR)?.id||null,SR=()=>f.useContext(bR);function CR(e){return`data-floating-ui-`+e}var wR={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},TR=f.forwardRef(function(e,t){let[n,r]=f.useState();YI(()=>{GI()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[CR(`focus-guard`)]:``,style:wR};return(0,A.jsx)(`span`,{...e,...i})}),ER={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},DR=f.createContext(null),OR=CR(`portal`);function kR(e){e===void 0&&(e={});let{id:t,root:n}=e,r=_R(),i=jR(),[a,o]=f.useState(null),s=f.useRef(null);return YI(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),YI(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(OR,``),e.appendChild(n),s.current=n,o(n)},[t,r]),YI(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!CF(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(OR,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function AR(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=kR({id:n,root:r}),[o,s]=f.useState(null),c=f.useRef(null),l=f.useRef(null),u=f.useRef(null),d=f.useRef(null),p=o?.modal,m=o?.open,h=!!o&&!o.modal&&o.open&&i&&!!(r||a);return f.useEffect(()=>{if(!a||!i||p)return;function e(e){a&&nL(e)&&(e.type===`focusin`?iL:rL)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,p]),f.useEffect(()=>{a&&(m||iL(a))},[m,a]),(0,A.jsxs)(DR.Provider,{value:f.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[h&&a&&(0,A.jsx)(TR,{"data-type":`outside`,ref:c,onFocus:e=>{if(nL(e,a)){var t;(t=u.current)==null||t.focus()}else tL(o?o.domReference:null)?.focus()}}),h&&a&&(0,A.jsx)(`span`,{"aria-owns":a.id,style:ER}),a&&aL.createPortal(t,a),h&&a&&(0,A.jsx)(TR,{"data-type":`outside`,ref:l,onFocus:e=>{if(nL(e,a)){var t;(t=d.current)==null||t.focus()}else eL(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var jR=()=>f.useContext(DR);function MR(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=_R(),a=f.useRef({}),[o]=f.useState(()=>vR()),s=xR()!=null,[c,l]=f.useState(r.reference),u=ZI((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=f.useMemo(()=>({setPositionReference:l}),[]),p=f.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return f.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:p,events:o,floatingId:i,refs:d}),[t,u,p,o,i,d])}function NR(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=MR({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=f.useState(null),[l,u]=f.useState(null),d=o?.domReference||s,p=f.useRef(null),m=SR();YI(()=>{d&&(p.current=d)},[d]);let h=tR({...n,elements:{...o,...l&&{reference:l}}}),g=f.useCallback(e=>{let t=wF(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=f.useCallback(e=>{(wF(e)||e===null)&&(p.current=e,c(e)),(wF(h.refs.reference.current)||h.refs.reference.current===null||e!==null&&!wF(e))&&h.refs.setReference(e)},[h.refs]),v=f.useMemo(()=>({...h.refs,setReference:_,setPositionReference:g,domReference:p}),[h.refs,_,g]),y=f.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=f.useMemo(()=>({...h,...a,refs:v,elements:y,nodeId:r}),[h,v,y,r,a]);return YI(()=>{a.dataRef.current.floatingContext=b;let e=m?.nodesRef.current.find(e=>e.id===r);e&&(e.context=b)}),f.useMemo(()=>({...h,context:b,refs:v,elements:y}),[h,v,y,b])}function PR({anchor:e,id:t,title:n,items:r,selected:i,onSelect:a,onAccept:o,message:s,onRetry:c}){let l=B(),{refs:u,floatingStyles:d,isPositioned:p}=NR({elements:{reference:e.current},placement:`top-start`,whileElementsMounted:WL,middleware:[nR(8),iR(),rR({padding:12}),aR({padding:12,apply({availableHeight:e,availableWidth:t,rects:n,elements:r}){Object.assign(r.floating.style,{maxHeight:`${Math.max(0,Math.min(320,e))}px`,width:`${Math.min(n.reference.width,t)}px`})}})]});return(0,f.useEffect)(()=>{document.getElementById(`${t}-${i}`)?.scrollIntoView({block:`nearest`})},[t,i]),(0,A.jsx)(AR,{children:(0,A.jsxs)(`div`,{ref:u.setFloating,style:{...d,visibility:p?`visible`:`hidden`},className:`z-50 overflow-y-auto rounded-xl border border-sakura-200 bg-base p-1.5 shadow-soft`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-1 px-3 py-2 text-xs text-ink-500`,children:[(0,A.jsx)(`span`,{children:n}),(0,A.jsx)(`span`,{children:l(`suggest.hint`)})]}),(0,A.jsx)(`div`,{id:t,role:`listbox`,tabIndex:-1,"aria-label":n,children:r.map((e,n)=>(0,A.jsxs)(`button`,{type:`button`,role:`option`,id:`${t}-${n}`,"aria-selected":n===i,tabIndex:-1,title:e.description,onMouseDown:e=>e.preventDefault(),onPointerMove:e=>{e.pointerType===`mouse`&&(e.movementX!==0||e.movementY!==0)&&a(n)},onClick:()=>o(n),className:`block w-full rounded-lg px-3 py-2 text-left ${n===i?`bg-sakura-100`:``}`,children:[(0,A.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:`truncate text-sm text-ink-900`,children:e.label}),e.badge&&(0,A.jsx)(`span`,{className:`shrink-0 rounded-md bg-ink-100 px-1.5 py-0.5 text-xs text-ink-600`,children:e.badge})]}),(0,A.jsx)(`span`,{className:`block truncate text-xs text-ink-500`,children:e.description})]},e.key))}),s&&(0,A.jsx)(`output`,{className:`block break-words px-3 py-2 text-sm text-ink-500`,children:s}),c&&(0,A.jsx)(`button`,{type:`button`,className:`px-3 py-2 text-sm text-ink-900 underline`,onMouseDown:e=>e.preventDefault(),onClick:c,children:l(`suggest.retryFiles`)})]})})}function FR(e,t,n,r,i){let[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)({entries:[],limited:!1,incomplete:!1}),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)(0),[m,h]=(0,f.useState)(!1),g=(0,f.useRef)(0),_=(0,f.useId)(),v=()=>{g.current++,o(null),c({entries:[],limited:!1,incomplete:!1}),p(0)},y=()=>{let t=e.current;if(!t||!r)return v();let n=pP(t.value,t.selectionStart);if(!n)return v();a&&n.start===a.start&&n.end===a.end&&n.query===a.query||(g.current++,c({entries:[],limited:!1,incomplete:!1}),u(z()(`mention.searching`)),h(!1),o(n),p(0))};(0,f.useEffect)(()=>{if(!a||!r){o(null);return}let e=new AbortController,t=++g.current,i=setTimeout(()=>{uP.searchFiles(a.query,n,e.signal).then(n=>{if(e.signal.aborted||t!==g.current)return;c(n);let r=z();u(n.incomplete?r(`mention.incomplete`):n.entries.length?n.limited?r(`mention.limited`):``:r(`mention.empty`))}).catch(n=>{if(!e.signal.aborted&&t===g.current){h(!0);let e=z();u(n instanceof Error?e(`mention.errorWith`,{error:n.message}):e(`mention.error`))}})},120);return()=>{clearTimeout(i),e.abort()}},[a,n,r]);let b=e=>{a&&(i(e,a),v())};return{refresh:y,close:v,keyDown:e=>{if(!a||e.nativeEvent.isComposing)return!1;if(e.key===`Escape`||e.key===`Tab`&&(e.shiftKey||!s.entries.length))return v(),e.key===`Escape`&&e.preventDefault(),e.key===`Escape`;if(e.key===`ArrowDown`||e.key===`ArrowUp`)return e.preventDefault(),p(t=>Math.max(0,Math.min(s.entries.length-1,t+(e.key===`ArrowDown`?1:-1)))),!0;if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){e.preventDefault();let t=s.entries[d];return t&&b(t),!0}return!1},panel:a&&r?(0,A.jsx)(PR,{anchor:t,id:_,title:z()(`mention.title`),selected:d,onSelect:p,onAccept:e=>{let t=s.entries[e];t&&b(t)},items:s.entries.map(e=>({key:e.path,label:`${e.kind===`directory`?`▸`:`▤`} ${e.name}${e.kind===`directory`?`/`:``}`,description:e.path})),message:l,onRetry:m?()=>{g.current++,h(!1),u(z()(`mention.searching`)),o(e=>e?{...e}:null)}:void 0}):null,open:!!a,controls:a?_:void 0,active:a&&s.entries[d]?`${_}-${d}`:void 0}}var IR=`(max-width: 768px)`,LR={min:320,max:720,initial:480,step:24},RR=e=>Math.min(LR.max,Math.max(LR.min,Math.round(e)));function zR({name:e,size:t=18,className:n}){return(0,A.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:e===`more`?3:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:n,children:(0,A.jsx)(`path`,{d:{folder:`M3 6h6l2 2h10v11H3z`,plus:`M12 5v14M5 12h14`,chevron:`m8 10 4 4 4-4`,panel:`M3 4h18v16H3zM9 4v16`,"panel-right":`M3 4h18v16H3zM15 4v16`,search:`M20 20l-5-5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0`,more:`M5 12h.01M12 12h.01M19 12h.01`,chat:`M4 4h16v12H9l-5 4z`,close:`m6 6 12 12M6 18 18 6`,settings:`M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1M17 12a5 5 0 1 1-10 0 5 5 0 0 1 10 0`,archive:`M3 4h18v4H3zM5 8v12h14V8M10 12h4`,up:`m5 12 7-7 7 7M12 5v14`,bolt:`M13 2 4 14h6l-1 8 9-12h-6l1-8z`,check:`M5 12.5l4.5 4.5L19 7.5`,clock:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 7v5l3 2`,spinner:`M21 12a9 9 0 1 1-9-9`,store:`M4 9.5 5.6 4.5h12.8L20 9.5M4 9.5V20h16V9.5M4 9.5h16M9.5 20v-5.5h5V20`,info:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 12v4M12 8h.01`,key:`M12.7 11.3 21 3m-4.2 1.8 3 3M8 19a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z`,download:`M12 4v10m0 0-4-4m4 4 4-4M5 20h14`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,trash:`M4.5 7h15M9.5 7V4.5h5V7m-7.5 0 .8 13h8.4l.8-13`,eye:`M2.5 12S6 6 12 6s9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Zm9.5 2.4a2.4 2.4 0 1 0 0-4.8 2.4 2.4 0 0 0 0 4.8Z`,phone:`M8 3h8a1.5 1.5 0 0 1 1.5 1.5v15A1.5 1.5 0 0 1 16 21H8a1.5 1.5 0 0 1-1.5-1.5v-15A1.5 1.5 0 0 1 8 3Zm2.5 14.5h3`,layers:`M12 3 3 8l9 5 9-5-9-5ZM3 12.5l9 5 9-5M3 17l9 5 9-5`,palette:`M12 3a9 9 0 1 0 0 18c1.2 0 1.8-.9 1.4-1.9-.4-1 .2-2.1 1.4-2.1H17a4 4 0 0 0 4-4c0-5-4-10-9-10ZM7.5 11h.01M10 7.5h.01M14.5 7.5h.01`,globe:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM3 12h18M12 3c2.5 2.7 3.8 5.7 3.8 9s-1.3 6.3-3.8 9c-2.5-2.7-3.8-5.7-3.8-9S9.5 5.7 12 3Z`,sparkles:`M12 4l1.8 4.7L18.5 10.5l-4.7 1.8L12 17l-1.8-4.7L5.5 10.5l4.7-1.8zM18.5 3l.8 2 2 .8-2 .8-.8 2-.8-2-2-.8 2-.8zM5 16l.7 1.8 1.8.7-1.8.7L5 21l-.7-1.8-1.8-.7 1.8-.7z`}[e]})})}function BR(){let[e,t]=(0,f.useState)(()=>window.matchMedia(IR).matches);return(0,f.useEffect)(()=>{let e=window.matchMedia(IR),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var VR=0,HR=``;function UR(e){let t=(0,f.useRef)(null),n=(0,f.useId)(),r=B();return(0,f.useEffect)(()=>{let e=document.activeElement,n=t.current;return VR===0&&(HR=document.body.style.overflow),VR+=1,document.body.style.overflow=`hidden`,n.showModal(),()=>{n.close(),--VR,VR===0&&(document.body.style.overflow=HR),e?.isConnected&&e.focus()}},[]),(0,aL.createPortal)((0,A.jsxs)(`dialog`,{ref:t,className:`chrome dialog ${e.drawer?`drawer`:``}`,"aria-labelledby":n,onCancel:t=>{t.preventDefault(),e.locked||e.onClose()},onKeyDown:e=>{if(e.key!==`Tab`)return;let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled), input:not(:disabled), a[href], [tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},children:[(0,A.jsxs)(`div`,{className:`dialog-heading`,children:[(0,A.jsx)(`h2`,{id:n,children:e.title}),(0,A.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":r(`common.close`),title:r(`common.close`),disabled:e.locked,onClick:e.onClose,children:(0,A.jsx)(zR,{name:`close`})})]}),e.children]}),document.body)}function WR(e){let t=(0,f.useRef)(null),n=(0,f.useRef)(e.onClose);n.current=e.onClose;let[r,i]=(0,f.useState)({left:8,top:8});return(0,f.useLayoutEffect)(()=>{let r=t.current,a=()=>{let t=e.anchor.getBoundingClientRect(),n=t.bottom+4+r.offsetHeight>window.innerHeight?Math.max(8,t.top-r.offsetHeight-4):t.bottom+4;i({left:Math.max(8,Math.min(t.left,window.innerWidth-r.offsetWidth-8)),top:n})};a(),r.querySelector(`button:not(:disabled), input, a`)?.focus();let o=t=>{!r.contains(t.target)&&!e.anchor.contains(t.target)&&n.current()};return document.addEventListener(`pointerdown`,o),window.addEventListener(`resize`,a),()=>{document.removeEventListener(`pointerdown`,o),window.removeEventListener(`resize`,a),e.anchor.isConnected&&e.anchor.focus()}},[e.anchor]),(0,aL.createPortal)((0,A.jsx)(`div`,{ref:t,className:`chrome popover`,role:`dialog`,"aria-label":e.label,style:r,onKeyDown:t=>{if(t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.onClose()),t.key===`Tab`){e.onClose();return}if(t.key!==`ArrowDown`&&t.key!==`ArrowUp`)return;t.preventDefault();let n=[...t.currentTarget.querySelectorAll(`button:not(:disabled), a`)];n[(n.indexOf(document.activeElement)+(t.key===`ArrowDown`?1:-1)+n.length)%n.length]?.focus()},children:e.children}),e.anchor.closest(`dialog`)??document.body)}var GR=e=>e.split(/[\\/]/).filter(Boolean).at(-1)??e;function KR(e){return(0,A.jsx)(`button`,{type:`button`,className:`icon-btn focus-neko rounded hover:bg-ink-900/5`,"aria-label":e.label,title:e.label,onClick:e.onClick,children:(0,A.jsx)(zR,{name:`close`,size:14})})}var qR={on:`text-tianyi-800`,warn:`text-sakura-800`,off:`text-ink-400`};function JR(e){let{options:t,value:n}=e,r=B(),i=(0,f.useId)(),[a,o]=(0,f.useState)(!1),[s,c]=(0,f.useState)(null),[l,u]=(0,f.useState)(0),d=t.find(e=>e.id===n),p=a?cF(t,s??``):[],m=a&&p[l]?`${i}-${l}`:void 0,h=`${i}-list`;(0,f.useEffect)(()=>{m&&document.getElementById(m)?.scrollIntoView?.({block:`nearest`})},[m]);function g(e=0){let r=t.findIndex(e=>e.id===n);u(s===null&&r>=0?r:e),o(!0)}function _(){o(!1),c(null)}function v(t){e.onChange(t.id),_()}function y(e){let t=p.length-1;switch(e.key){case`ArrowDown`:case`ArrowUp`:{if(e.preventDefault(),!a)return g();let n=e.key===`ArrowDown`?1:-1;u(t<0?0:(l+n+p.length)%p.length);return}case`Home`:case`End`:if(!a||s!==null)return;e.preventDefault(),u(e.key===`Home`?0:Math.max(t,0));return;case`Enter`:{if(!a)return;e.preventDefault();let t=p[l];t&&v(t);return}case`Escape`:if(!a)return;e.preventDefault(),e.stopPropagation(),_()}}return(0,A.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(`input`,{type:`text`,role:`combobox`,"aria-label":e.label,"aria-expanded":a,"aria-controls":h,"aria-autocomplete":`list`,"aria-activedescendant":m,autoComplete:`off`,spellCheck:!1,disabled:e.disabled,value:s??d?.name??``,placeholder:r(`providerCombo.placeholder`),onChange:e=>{c(e.target.value),u(0),o(!0)},onFocus:e=>e.currentTarget.select(),onClick:e=>{if(a)return _();g(),e.currentTarget.select()},onKeyDown:y,onBlur:_,className:`focus-neko w-full min-w-0 cursor-pointer rounded-xl border border-sakura-200 bg-base py-2 pr-9 pl-3 text-sm font-semibold text-ink-900`}),(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 right-2.5 -translate-y-1/2 text-ink-500 transition-transform ${a?`rotate-180`:``}`,children:(0,A.jsx)(zR,{name:`chevron`,size:16})})]}),(0,A.jsxs)(`div`,{id:h,role:`listbox`,tabIndex:-1,"aria-label":e.label,hidden:!a,onMouseDown:e=>e.preventDefault(),className:`absolute top-full right-0 left-0 z-20 mt-1 max-h-60 overflow-y-auto rounded-xl border border-sakura-200 bg-surface p-1 shadow-soft`,children:[p.map((e,t)=>(0,A.jsxs)(`div`,{id:`${i}-${t}`,role:`option`,tabIndex:-1,"aria-selected":e.id===n,onMouseEnter:()=>u(t),onClick:()=>v(e),className:`flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm ${t===l?`bg-sakura-50`:``} ${e.id===n?`font-semibold text-sakura-800`:`text-ink-700`}`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.detail&&(0,A.jsx)(`span`,{className:`shrink-0 text-xs ${qR[e.tone??`off`]}`,children:e.detail})]},e.id)),a&&p.length===0&&(0,A.jsx)(`p`,{className:`px-2.5 py-2 text-xs text-ink-500`,children:r(`providerCombo.empty`)})]})]})}function YR(e){let t=B(),{models:n,currentSessionId:r,view:i,phase:a,operating:o,defaultModel:s}=QN(),[c,l]=(0,f.useState)(null),u=n.find(t=>t.provider===e.current?.provider&&t.modelId===e.current?.modelId);c&&c.id!==r&&l(null);let d=u?.name??e.fallbackLabel,p=aF(s,e.current);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,disabled:!e.current||a!==`ready`||o,onClick:()=>r&&l({id:r}),className:`focus-neko min-w-0 truncate rounded-full px-2 py-1 text-left text-xs text-ink-500 hover:bg-sakura-50`,"aria-label":t(`picker.aria`,{label:d,level:i?.agent.thinkingLevel??``}),children:[p?`★ `:``,d,` · `,i?.agent.thinkingLevel??`off`,` ▾`]}),c&&c.id===r&&e.current&&(0,A.jsx)(ZR,{session:c.id,currentRef:e.current,current:u??null,level:i?.agent.thinkingLevel??`off`,onClose:()=>l(e=>e===c?null:e)},c.id)]})}function XR(e,t){return[lF(e.contextWindow),e.input.includes(`image`)?t(`picker.badgeImage`):``,e.reasoning?t(`picker.badgeReasoning`):``].filter(Boolean).join(` · `)}function ZR(e){let t=B(),{models:n,credentials:r,defaultModel:i}=QN(),[a,o]=(0,f.useState)(e.current),[s,c]=(0,f.useState)(e.level),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)(e.currentRef.provider),[m,h]=(0,f.useState)(!1),g=(0,f.useRef)(!1),[_,v]=(0,f.useState)(``),y=oF(n,``),b=sF(y,d??void 0),x=y.map(e=>({id:e.provider,name:e.name,detail:e.available?t(`picker.providerModels`,{count:e.models.length}):t(`picker.keyMissing`),tone:e.available?`on`:`warn`})),S=l.trim().length>0,C=S?oF(n,l):y.filter(e=>e.provider===b),w=rF(r,e.currentRef.provider);async function T(){if(!g.current&&a){g.current=!0,h(!0),v(``);try{await uP.configure({model:{provider:a.provider,modelId:a.modelId},thinkingLevel:s},e.session),e.onClose()}catch{v(t(`picker.applyFailed`))}finally{g.current=!1,h(!1)}}}async function ee(e){if(!g.current){g.current=!0,h(!0),v(``);try{aF(i,e)?await uP.clearDefaultModel():await uP.setDefaultModel({provider:e.provider,modelId:e.modelId})}catch{v(t(`picker.defaultFailed`))}finally{g.current=!1,h(!1)}}}return(0,A.jsx)(UR,{title:t(`picker.title`),onClose:e.onClose,children:(0,A.jsxs)(`div`,{className:`space-y-5 p-5`,children:[w&&(0,A.jsxs)(`p`,{role:`alert`,className:`rounded-xl bg-sakura-50 px-3 py-2 text-sm text-sakura-800`,children:[t(w===`disabled`?`picker.issueDisabled`:`picker.issueKey`,{provider:nF(e.currentRef.provider)}),` `,(0,A.jsx)(Hr,{to:`/settings`,hash:`credential-${e.currentRef.provider}`,className:`focus-neko rounded underline`,children:t(`picker.goSettings`)})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,A.jsx)(`div`,{className:`min-w-0 sm:w-64 sm:shrink-0`,children:(0,A.jsx)(JR,{label:t(`picker.providerLabel`),options:x,value:b,onChange:e=>{p(e),u(``)}})}),(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`model-search`,children:t(`picker.searchLabel`)}),(0,A.jsx)(`input`,{id:`model-search`,type:`search`,value:l,onChange:e=>u(e.target.value),placeholder:t(`picker.searchPlaceholder`),autoComplete:`off`,spellCheck:!1,className:`focus-neko w-full min-w-0 rounded-xl border border-sakura-200 bg-base px-3 py-2 text-sm`})]}),(0,A.jsxs)(`fieldset`,{"aria-label":t(`picker.models`),className:`m-0 min-w-0 max-h-[min(40vh,22rem)] space-y-1 overflow-y-auto border-0 p-0 pr-1`,children:[C.map(e=>(0,A.jsxs)(`section`,{id:`models-${e.provider}`,children:[(S||!e.available)&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-1 pt-1 pb-0.5 text-xs`,children:[S&&(0,A.jsx)(`span`,{className:`truncate font-semibold text-ink-700`,children:e.name}),!e.available&&(0,A.jsxs)(`span`,{className:`ml-auto shrink-0 text-sakura-800`,children:[t(`picker.keyMissingDot`),` `,(0,A.jsx)(Hr,{to:`/settings`,hash:`credential-${e.provider}`,className:`focus-neko rounded underline`,children:t(`picker.configure`)})]})]}),(0,A.jsx)(`ul`,{className:`space-y-1`,children:e.models.map(n=>{let r=a?.provider===n.provider&&a.modelId===n.modelId,l=aF(i,n);return(0,A.jsxs)(`li`,{className:`flex items-stretch gap-1`,children:[(0,A.jsxs)(`button`,{type:`button`,disabled:m||!e.available,"aria-pressed":r,title:`${n.modelId} · ${uF(n)}`,onClick:()=>{o(n),c(n.thinkingLevelAdjustments[s])},className:`focus-neko flex min-w-0 flex-1 items-center gap-2 rounded-lg border px-3 py-1.5 text-left text-sm disabled:opacity-50 ${r?`border-sakura-300 bg-sakura-50 text-sakura-800`:`border-sakura-100 bg-surface text-ink-700`}`,children:[(0,A.jsxs)(`span`,{className:`min-w-0 truncate`,children:[l?`★ `:``,n.name,r?` ✓`:``]}),(0,A.jsx)(`span`,{className:`hidden min-w-0 flex-1 truncate text-xs text-ink-400 sm:inline`,children:n.modelId}),(0,A.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-ink-500`,children:XR(n,t)})]}),e.available&&(0,A.jsx)(`button`,{type:`button`,disabled:m,"aria-pressed":l,"aria-label":`${t(l?`picker.unsetDefault`:`picker.setDefault`)} ${n.name}`,title:t(l?`picker.unsetDefaultTitle`:`picker.setDefaultTitle`),onClick:()=>void ee(n),className:`focus-neko shrink-0 rounded-lg border border-sakura-100 px-2 text-sm text-ink-400 hover:bg-sakura-50 disabled:opacity-50`,children:(0,A.jsx)(`span`,{"aria-hidden":`true`,children:l?`★`:`☆`})})]},`${n.provider}/${n.modelId}`)})})]},e.provider)),C.length===0&&(0,A.jsx)(`p`,{className:`px-1 py-3 text-sm text-ink-500`,children:t(S?`picker.noMatch`:`picker.noModels`)})]})]}),a&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`mb-2 text-sm text-ink-600`,children:t(`picker.thinking`)}),(0,A.jsx)(`fieldset`,{className:`flex flex-wrap gap-2`,"aria-label":t(`picker.thinking`),children:a.supportedThinkingLevels.map(e=>(0,A.jsx)(`button`,{type:`button`,disabled:m,"aria-pressed":s===e,onClick:()=>c(e),className:`focus-neko rounded-full border px-4 py-2 text-sm ${e===s?`border-tianyi-300 bg-tianyi-50 text-tianyi-800`:`border-sakura-200`}`,children:e},e))})]}),i?.source===`cli`&&(0,A.jsx)(`p`,{className:`text-xs text-tianyi-800`,children:t(`picker.cliNote`)}),(0,A.jsx)(`p`,{className:`text-xs text-ink-500`,children:t(`picker.scopeNote`)}),_&&(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-sakura-800`,children:_}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:e.onClose,className:`btn-outline rounded-full px-4 py-2 text-sm`,children:t(`common.cancel`)}),(0,A.jsx)(`button`,{type:`button`,disabled:m||!a,onClick:()=>void T(),className:`btn-primary rounded-full px-5 py-2 text-sm`,children:t(m?`picker.applying`:`picker.apply`)})]})]})})}function QR({queued:e,busy:t,onSteer:n,onWithdraw:r}){let i=B();if(!e.length)return null;let a=e=>i(`queue.mode.${e}`);return(0,A.jsx)(`section`,{"aria-label":i(`queue.section`),className:`mb-2 rounded-2xl border border-sakura-200 bg-base/90 px-2 py-1.5`,children:(0,A.jsx)(`ul`,{className:`flex max-h-32 flex-col gap-1 overflow-y-auto`,children:e.map(e=>{let o=e.preview||(e.images?i(`queue.image`):``);return(0,A.jsxs)(`li`,{className:`flex min-w-0 items-center gap-1 text-sm`,children:[(0,A.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-xs ${e.mode===`steer`?`bg-sakura-100 text-sakura-700`:`bg-tianyi-50 text-ink-600`}`,children:a(e.mode)}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-700`,title:e.preview,children:e.preview||(e.images?i(`queue.imageOnly`):``)}),e.images>0&&e.preview&&(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:i(`queue.images`,{count:e.images})}),e.mode===`followUp`&&(0,A.jsx)(`button`,{type:`button`,disabled:t,"aria-label":i(`queue.steerAria`,{label:o}),title:i(`queue.steerTitle`),onClick:()=>n(e),className:`focus-neko h-8 shrink-0 rounded-full px-2 text-xs text-sakura-700 hover:bg-sakura-50 disabled:opacity-50`,children:i(`queue.steer`)}),(0,A.jsx)(`button`,{type:`button`,disabled:t,"aria-label":i(`queue.withdrawAria`,{mode:a(e.mode),label:o}),onClick:()=>r(e),className:`focus-neko h-8 shrink-0 rounded-full px-2 text-xs text-ink-600 hover:bg-sakura-50 disabled:opacity-50`,children:i(`queue.withdraw`)})]},e.id)})})})}var $R=new Map,ez=new Set,tz=new Set;function nz(e){let t=$R.get(e);if(t&&(t.text.trim()!==``||t.files.length>0))return!0;let n=document.activeElement;return n?.tagName===`TEXTAREA`&&n.hasAttribute(`data-composer-input`)}function rz(){let e=z(),t=$N(),n=t.currentSessionId,r=n??`none:${t.workspaceRoot}`,i=$R.get(r);if(tz.size||t.operating)eP.notice({level:`info`,text:e(`composer.upgrade.sending`)});else if([...$R.values()].some(e=>e.files.length))eP.notice({level:`info`,text:e(`composer.upgrade.attachments`)});else if(!t.webInfo)eP.notice({level:`error`,text:e(`composer.upgrade.notReady`)});else if([...$R.entries()].some(([e,t])=>e!==r&&t.text.trim()))eP.notice({level:`info`,text:e(`composer.upgrade.otherDrafts`)});else{try{rP({version:1,serverId:t.webInfo.serverId,workspace:t.workspaceRoot,session:n,text:i?.text??``,requestId:i?.requestId??crypto.randomUUID()})}catch{eP.notice({level:`error`,text:e(`composer.upgrade.saveFailed`)});return}window.location.reload()}}var iz=e=>(ez.add(e),()=>{ez.delete(e)});function az(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function oz(e){return`$${e.toFixed(e>=1?2:4)}`}function sz(e){let{currentSessionId:t,workspaceRoot:n}=QN();return(0,A.jsx)(lz,{sessionId:t??`none:${n}`,...e},t??`none:${n}`)}function cz({file:e}){let[t,n]=(0,f.useState)(``);return(0,f.useEffect)(()=>{let t=URL.createObjectURL(e);return n(t),()=>URL.revokeObjectURL(t)},[e]),(0,A.jsx)(`img`,{src:t||void 0,alt:e.name,className:`h-16 w-20 rounded-lg object-cover`})}function lz(e){let{credentials:t,view:n,models:r,workspaceRoot:i,phase:a,operating:o}=QN(),s=B(),c=n?.compaction?.active??[];$R.has(e.sessionId)||$R.set(e.sessionId,{text:``,files:[],requestId:crypto.randomUUID()}),(0,f.useEffect)(()=>{let t=nP(),n=$N();if(t&&t.serverId===n.webInfo?.serverId&&t.workspace===i&&(t.session??`none:${i}`)===e.sessionId){$R.set(e.sessionId,{text:t.text,files:[],requestId:t.requestId}),iP();for(let e of ez)e()}},[e.sessionId,i]);let l=(0,f.useSyncExternalStore)(iz,()=>$R.get(e.sessionId)),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(null),[y,b]=(0,f.useState)(!1),[x,S]=(0,f.useState)([]),[C,w]=(0,f.useState)(0),[T,ee]=(0,f.useState)(``),te=(0,f.useId)(),[ne,re]=(0,f.useState)(!1),E=(0,f.useRef)(null),ie=(0,f.useRef)(null),ae=(0,f.useRef)(null),oe=(0,f.useRef)(l);oe.current=l;let D=(0,f.useRef)(!1),se=(0,f.useMemo)(()=>SP(n?.items??[]),[n?.items]),ce=(0,f.useRef)(null),le=(0,f.useRef)(null);(0,f.useLayoutEffect)(()=>{let e=E.current;if(!le.current||!e)return;let t=le.current===`start`?0:e.value.length;le.current=null,e.setSelectionRange(t,t)}),(0,f.useLayoutEffect)(()=>{let e=E.current;e&&TP(e)},[l.text,e.sessionId]),(0,f.useEffect)(()=>{let e=E.current;if(!e||typeof ResizeObserver>`u`)return;let t=e.clientWidth,n=new ResizeObserver(()=>{e.clientWidth!==t&&(t=e.clientWidth,TP(e))});return n.observe(e),()=>n.disconnect()},[]);let ue=e=>{let t=e.currentTarget,n=EP(ce.current,se,e,t.value,{start:t.selectionStart,end:t.selectionEnd});return n?(ce.current=n.browse,le.current=n.caret,b(!1),fe({text:n.text}),!0):!1},de=t=>{oe.current=t,$R.set(e.sessionId,t);for(let e of ez)e()},fe=e=>de({...oe.current,...e,requestId:crypto.randomUUID()}),pe=rF(t,n?.agent.model?.provider),me=pe!==null,he=r.find(e=>e.provider===n?.agent.model?.provider&&e.modelId===n?.agent.model?.modelId),ge=l.files.length>0&&he!==void 0&&!he.input.includes(`image`),_e=e=>{let t=e.map(e=>({id:crypto.randomUUID(),file:e,processing:!0,error:[`image/png`,`image/jpeg`,`image/webp`].includes(e.type)?e.size>20971520?`composer.attach.size`:void 0:`composer.attach.type`}));fe({files:[...oe.current.files,...t]});for(let e of t)ve(e)},ve=async t=>{let n=t.error;if(!n)try{(await createImageBitmap(t.file)).close()}catch{n=`composer.attach.decode`}let r=$R.get(e.sessionId);if(!r?.files.some(e=>e.id===t.id))return;let i={...r,files:r.files.map(e=>e.id===t.id?{...e,error:n,processing:!1}:e)};de(i)},ye=(0,f.useRef)(null),be=(0,f.useRef)(!1);(0,f.useEffect)(()=>()=>{be.current||ye.current?.abort()},[]),(0,f.useEffect)(()=>{if(S([]),w(0),!y)return;if(e.sessionId.startsWith(`none:`)){ee(`composer.skills.newSession`);return}if(a!==`ready`||o){ee(`composer.skills.waiting`);return}let t=new AbortController;return ee(`composer.skills.loading`),uP.listSkills(e.sessionId,t.signal).then(e=>{t.signal.aborted||(S(e),ee(e.length?``:`composer.skills.empty`))}).catch(()=>{t.signal.aborted||ee(`composer.skills.failed`)}),()=>t.abort()},[e.sessionId,a,o,y]);let O=FR(E,ie,i,a===`ready`&&!o,(t,n)=>{let r=oe.current;if(t.kind===`file`&&/\.(png|jpe?g|webp)$/i.test(t.path)){if(ye.current)return;let a=new AbortController;ye.current=a,m(s(`composer.image.reading`)),(async()=>{let o=e.sessionId;if(o.startsWith(`none:`)){be.current=!0,await uP.createSession();let e=$N();if(e.workspaceRoot!==i||!e.currentSessionId)throw Error(s(`composer.workspaceChanged`));o=e.currentSessionId,$R.set(o,r);for(let e of ez)e()}let c=await uP.workspaceImage(t.path,o,a.signal);if(a.signal.aborted||$N().currentSessionId!==o||$N().workspaceRoot!==i)return;let l=$R.get(o)??r,u={id:crypto.randomUUID(),file:new File([new Uint8Array(c.bytes)],c.name,{type:c.mimeType})},d=l.text===r.text?r.text.slice(0,n.start)+r.text.slice(n.end):l.text;$R.set(o,{...l,text:d,files:[...l.files,u],requestId:crypto.randomUUID()});for(let e of ez)e();m(``)})().catch(e=>{if(!a.signal.aborted){let t=e instanceof Error?e.message:s(`composer.image.readFailed`);m(t),be.current&&eP.notice({level:`error`,text:t})}}).finally(()=>{ye.current===a&&(ye.current=null)});return}let a=hP(r.text,n,t.path,t.kind===`directory`),o=E.current;if(o){o.focus(),o.setSelectionRange(n.start,n.end);let e=a.text.slice(n.start,a.text.length-(r.text.length-n.end));document.execCommand(`insertText`,!1,e)?fe({text:o.value}):fe({text:a.text}),requestAnimationFrame(()=>{o.setSelectionRange(a.cursor,a.cursor),t.kind===`directory`&&O.refresh()})}}),k=n?.contextUsage,xe=n?.compaction?.latest,Se=xe&&![`summarizing`,`waiting-to-apply`].includes(xe.phase)?xe.at+(xe.phase===`failed`?1e4:5e3):null,[Ce,we]=(0,f.useState)(Se!==null&&Se<=Date.now());(0,f.useEffect)(()=>{if(we(Se!==null&&Se<=Date.now()),Se===null||Se<=Date.now())return;let e=setTimeout(()=>we(!0),Se-Date.now());return()=>clearTimeout(e)},[Se]);let Te=c.length?c.some(e=>e.retry)?s(`composer.compaction.retrying`):c.some(e=>e.blocking)?s(`composer.compaction.waiting`):s(`composer.compaction.running`):n?.compaction?.failure?s(`composer.compaction.failure`,{error:n.compaction.failure.error}):xe&&!Ce?s({applied:`composer.compaction.applied`,nothing:`composer.compaction.nothing`,skipped:`composer.compaction.skipped`,cancelled:`composer.compaction.cancelled`,failed:`composer.compaction.failed`,summarizing:`composer.compaction.running`,"waiting-to-apply":`composer.compaction.applying`}[xe.phase]):null,Ee=!c.length&&(!!n?.compaction?.failure||xe?.phase===`failed`),De=n?.taskUsage??n?.usage??null,Oe=async t=>{if(D.current||e.disabled)return;D.current=!0,d(!0),tz.add(e.sessionId),m(``);let n=oe.current;$R.set(e.sessionId,n);try{await uP.compact(t,e.sessionId),oe.current===n&&$R.get(e.sessionId)===n&&Yi(n.text)!==null&&de({...n,text:``,requestId:crypto.randomUUID()}),b(!1)}catch(e){m(e instanceof Error?qN(e.message):s(`composer.compactFailed`))}finally{D.current=!1,d(!1),tz.delete(e.sessionId)}},ke=WP({view:n,phase:a,operating:o}),Ae=async t=>{if(D.current||e.disabled)return;if(m(``),g(``),t!==``){g(s(`composer.plan.noArgs`));return}if(e.sessionId.startsWith(`none:`)){g(s(`composer.plan.needSession`));return}if(ke===null){g(UP());return}if(e.busy){g(s(`composer.plan.busy`));return}D.current=!0,d(!0);let n=oe.current;try{await uP.planMode(e.sessionId,ke.mode===`plan`?`normal`:`plan`),oe.current===n&&$R.get(e.sessionId)===n&&GP(n.text)!==null&&de({...n,text:``,requestId:crypto.randomUUID()}),b(!1)}catch(e){let t=YP(e);(JP(e)?g:m)(t)}finally{D.current=!1,d(!1)}},je=async()=>{let t=Yi(oe.current.text);if(t!==null){await Oe(t);return}let n=GP(oe.current.text);if(n!==null){await Ae(n);return}let r=oe.current;if($R.set(e.sessionId,r),!(D.current||e.disabled||me||ge||!r.text.trim()&&!r.files.length)){if(r.files.length>4||r.files.reduce((e,t)=>e+t.file.size,0)>41943040)m(s(`composer.attach.limit`));else if(!r.files.some(e=>e.processing)){if(r.files.some(e=>e.error))m(s(`composer.attach.removeUnsupported`));else{D.current=!0,d(!0),tz.add(e.sessionId),m(``),g(``);try{let t=[];for(let e of r.files)t.push({name:e.file.name,mimeType:e.file.type,bytes:new Uint8Array(await e.file.arrayBuffer())});let n=e.sessionId;if(n.startsWith(`none:`)){await uP.createSession();let e=$N();if(e.workspaceRoot!==i||!e.currentSessionId)throw Error(s(`composer.workspaceChangedDraft`));n=e.currentSessionId,$R.set(n,r);for(let e of ez)e()}if(await uP.submit(r.text.trim(),t,r.requestId,n),n!==e.sessionId){$R.set(n,{text:``,files:[],requestId:crypto.randomUUID()});for(let e of ez)e()}let a=$R.get(e.sessionId);a&&de({text:a.text===r.text?``:a.text,files:a.files.filter(e=>!r.files.some(t=>t.id===e.id)),requestId:crypto.randomUUID()})}catch(t){let n=t instanceof Error?qN(t.message):s(`composer.sendFailed`);m(n),$N().currentSessionId!==e.sessionId&&eP.notice({level:`error`,text:n})}finally{D.current=!1,d(!1),tz.delete(e.sessionId)}}}}},Me=wP(l.text,x,{plan:ke!==null}),Ne=Math.min(C,Math.max(0,Me.length-1)),Pe=(e=Ne)=>{let t=Me[e];t&&(fe({text:`${t.label} `}),b(!1),E.current?.focus())},Fe=n?.queued??[],Ie=n?.questions?.pending??[],Le=()=>{let t=vF.state.active[e.sessionId],n=Ie.find(e=>e.id===t)??Ie[0];n&&vF.open(e.sessionId,n)},Re=async t=>{if(_===null){v(t.id),m(``),g(``);try{let n=await uP.steer(e.sessionId,t.id);if(n.result===`withdrawn`){let e=oe.current.text,r=n.text??t.preview;fe({text:e.trim()?`${e}\n${r}`:r}),g(s(`composer.queue.steerWithdrawn`))}else n.result===`unknown`?g(s(`composer.queue.gone`)):n.result!==`steered`&&g(s(`composer.queue.sentNoSteer`))}catch(e){m(e instanceof Error?qN(e.message):s(`composer.queue.steerFailed`))}finally{v(null)}}},ze=async t=>{if(_===null){v(t.id),m(``),g(``);try{let n=await uP.withdraw(e.sessionId,t.id);if(n.result===`withdrawn`){let e=oe.current.text,r=n.text??t.preview;fe({text:e.trim()?`${e}\n${r}`:r}),n.images&&g(s(`composer.queue.imagesNotRestored`)),E.current?.focus()}else n.result===`unknown`?g(s(`composer.queue.gone`)):g(s(`composer.queue.sentNoWithdraw`))}catch(e){m(e instanceof Error?qN(e.message):s(`composer.queue.withdrawFailed`))}finally{v(null)}}},Be=e.busy||c.some(e=>e.reason===`manual`||e.blocking);return(0,A.jsx)(`section`,{"aria-label":s(`composer.input`),className:`relative shrink-0 px-3 pt-1 pb-3 sm:px-4 sm:pb-4`,onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),re(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||re(!1)},onDrop:e=>{e.preventDefault(),re(!1),_e(Array.from(e.dataTransfer.files))},children:(0,A.jsxs)(`div`,{className:`chat-column`,children:[(0,A.jsx)(QR,{queued:Fe,busy:_!==null,onSteer:e=>void Re(e),onWithdraw:e=>void ze(e)}),(0,A.jsxs)(`div`,{ref:ie,className:`composer-card ${Be?`is-busy`:``} ${ne?`ring-2 ring-sakura-300`:``}`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pt-2.5 empty:pt-0`,children:[Ie.length>0&&(0,A.jsxs)(`output`,{"data-question-hint":!0,className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs leading-snug text-tianyi-900 sm:text-sm`,children:[(0,A.jsx)(`span`,{className:`min-w-0 break-words`,children:s(`composer.questionHint`)}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 rounded-full border border-tianyi-300 bg-tianyi-50 px-2.5 py-0.5 text-xs text-tianyi-900 hover:bg-tianyi-100`,onClick:Le,children:s(`composer.openQuestion`)})]}),ne&&(0,A.jsx)(`p`,{className:`text-sm text-sakura-700`,children:s(`composer.dropHint`)}),pe&&(0,A.jsxs)(`p`,{className:`text-sm text-sakura-700`,children:[s(pe===`disabled`?`composer.provider.disabled`:`composer.provider.keyMissing`,{provider:nF(n?.agent.model?.provider??``)}),(0,A.jsx)(Hr,{to:`/settings`,hash:`credential-${n?.agent.model?.provider??``}`,className:`focus-neko ml-1 underline`,children:s(`composer.provider.goSettings`)})]}),ge&&(0,A.jsx)(`p`,{className:`text-sm text-sakura-700`,children:s(`composer.noVision`)}),!he?.input.includes(`image`)&&n?.items.some(e=>e.type===`user`&&e.images?.length)&&(0,A.jsx)(`p`,{className:`text-xs text-ink-500`,children:s(`composer.noHistoryImages`)}),h&&(0,A.jsx)(`output`,{className:`block break-words text-sm text-ink-600`,children:h}),p&&(0,A.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-sakura-700`,children:p})]}),!!l.files.length&&(0,A.jsx)(`ul`,{className:`flex max-h-40 flex-wrap gap-2 overflow-y-auto px-4 pt-2.5`,children:l.files.map(e=>(0,A.jsxs)(`li`,{className:`relative w-28 rounded-xl border border-sakura-200 bg-base p-2`,children:[(0,A.jsx)(cz,{file:e.file}),(0,A.jsx)(`span`,{className:`block truncate text-xs`,title:e.file.name,children:e.file.name}),e.processing&&(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:s(`composer.attach.checking`)}),e.error&&(0,A.jsx)(`span`,{className:`text-xs text-sakura-700`,children:s(e.error)}),(0,A.jsx)(`button`,{type:`button`,"aria-label":s(`composer.attach.remove`,{name:e.file.name}),className:`focus-neko absolute right-0 top-0 rounded-full bg-base px-1`,onClick:()=>fe({files:oe.current.files.filter(t=>t.id!==e.id)}),children:`×`})]},e.id))}),(0,A.jsx)(`textarea`,{ref:E,disabled:e.disabled,value:l.text,rows:1,placeholder:Ie.length>0?s(`composer.placeholder.waiting`):e.busy?s(`composer.placeholder.busy`):s(`composer.placeholder.idle`),"aria-label":s(`composer.input`),"data-composer-input":!0,"aria-autocomplete":`list`,"aria-controls":O.controls??(y?te:void 0),"aria-activedescendant":O.active??(y&&Me.length?`${te}-${Ne}`:void 0),onClick:e=>{O.refresh(),b(CP(e.currentTarget.value))},onBlur:()=>{O.close(),b(!1)},onCompositionStart:()=>{O.close(),b(!1)},onCompositionEnd:e=>{O.refresh(),b(CP(e.currentTarget.value))},className:`composer-input max-h-40 min-h-10 min-w-0 w-full resize-none bg-transparent px-4 py-2 text-ink-900 focus:outline-none`,onChange:e=>{ce.current=null,fe({text:e.target.value}),w(0),b(!e.nativeEvent.isComposing&&CP(e.target.value)),e.nativeEvent.isComposing||O.refresh()},onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length&&(e.preventDefault(),_e(t))},onKeyDown:e=>{e.nativeEvent.isComposing||O.keyDown(e)||(e.key===`Escape`&&y?(e.preventDefault(),b(!1)):y&&(e.key===`ArrowDown`||e.key===`ArrowUp`)?(e.preventDefault(),w(Math.max(0,Math.min(Me.length-1,Ne+(e.key===`ArrowDown`?1:-1))))):y&&e.key===`Tab`?!e.shiftKey&&Me.length?(e.preventDefault(),Pe()):b(!1):(e.key===`ArrowUp`||e.key===`ArrowDown`)&&!y&&ue(e)?e.preventDefault():e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y&&Me.length?Pe():(b(!1),je())))}}),(0,A.jsxs)(`div`,{className:`composer-toolbar flex flex-wrap items-center gap-x-1 gap-y-1 border-t border-sakura-100 px-2 py-1.5`,children:[(0,A.jsx)(`input`,{ref:ae,type:`file`,accept:`image/png,image/jpeg,image/webp`,multiple:!0,hidden:!0,onChange:e=>{_e(Array.from(e.target.files??[])),e.target.value=``}}),(0,A.jsx)(`button`,{type:`button`,"aria-label":s(`composer.addImage`),title:s(`composer.addImageTitle`),disabled:e.disabled,onClick:()=>ae.current?.click(),className:`focus-neko inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-ink-600 hover:bg-sakura-50`,children:(0,A.jsx)(zR,{name:`plus`})}),(0,A.jsx)(`button`,{type:`button`,"aria-label":s(`composer.menu`),"aria-expanded":y,className:`focus-neko inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-ink-500 hover:bg-sakura-50`,onClick:()=>{O.close(),b(!y),E.current?.focus()},children:(0,A.jsx)(zR,{name:`more`})}),(0,A.jsx)(`div`,{className:`min-w-0 max-w-64 [&>button]:max-w-full`,children:(0,A.jsx)(YR,{current:n?.agent.model??null,fallbackLabel:n?.model??`…`})}),k&&k.window>0&&(0,A.jsxs)(`span`,{className:`shrink-0 rounded-full bg-tianyi-50 px-2 py-1 font-mono text-xs ${k.percent!==null&&k.percent>90?`text-sakura-700 font-semibold`:`text-ink-600`}`,title:k.tokens===null?s(`composer.ctx.none`):s(`composer.ctx.usage`,{tokens:k.tokens,window:k.window}),children:[`Ctx `,k.percent===null?`?`:`${k.percent.toFixed(1)}%`,`/`,az(k.window)]}),(0,A.jsxs)(`output`,{"aria-live":`polite`,"aria-atomic":`true`,className:`contents`,children:[Te&&(0,A.jsx)(`span`,{className:`max-w-full whitespace-nowrap rounded-full border px-2 py-1 text-xs ${Ee?`border-sakura-300 bg-sakura-50 text-sakura-700`:`border-tianyi-200 bg-tianyi-50 text-ink-600`}`,title:xe?.phase===`nothing`&&!c.length?s(`composer.compaction.nothingTitle`):void 0,children:Te}),ke?.mode===`plan`&&(0,A.jsx)(`span`,{"data-plan-mode":!0,className:`max-w-full whitespace-nowrap rounded-full border border-sakura-300 bg-sakura-50 px-2 py-1 text-xs font-medium text-sakura-800`,title:s(`composer.planModeTitle`),children:HP()})]}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[e.busy&&e.status!==null&&(0,A.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-64 items-center gap-1.5 text-xs font-medium text-sakura-700`,title:WN(e.status,s),children:[(0,A.jsxs)(`span`,{className:`dots shrink-0`,"aria-hidden":!0,children:[(0,A.jsx)(`span`,{}),(0,A.jsx)(`span`,{}),(0,A.jsx)(`span`,{})]}),(0,A.jsx)(`span`,{className:`truncate`,children:WN(e.status,s).replace(/(\.\.\.|…)$/,``)})]}),De!==null&&(0,A.jsxs)(`button`,{type:`button`,className:`telemetry focus-neko shrink-0 rounded-full px-1.5 py-1 font-mono text-xs text-ink-500`,"aria-label":s(`composer.usage.aria`,{input:De.input,output:De.output,cacheRead:De.cacheRead,cost:oz(De.cost)}),children:[`↑`,az(De.input),` ↓`,az(De.output),(0,A.jsx)(`span`,{className:`telemetry-detail`,"aria-hidden":!0,children:s(`composer.usage.detail`,{input:De.input,output:De.output,cacheRead:De.cacheRead,cost:oz(De.cost)})})]}),(0,A.jsx)(`button`,{type:`button`,disabled:u||e.disabled||!l.text.trim()&&!l.files.length||Yi(l.text)===null&&GP(l.text)===null&&(me||ge||l.files.some(e=>!!e.error||e.processing)),onClick:()=>void je(),className:`btn-primary focus-neko h-10 shrink-0 rounded-full px-3 text-sm disabled:opacity-50`,children:u?s(`composer.working`):e.busy?s(`composer.queue`):s(`composer.send`)}),Be&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>uP.abort(),className:`btn-stop focus-neko h-10 rounded-full px-2 text-sm`,title:s(`composer.stopTitle`),children:s(`composer.stop`)})]})]})]}),O.panel,y&&!O.open&&(0,A.jsx)(PR,{anchor:ie,id:te,title:s(`composer.commandTitle`),items:Me,selected:Ne,onSelect:w,message:T?s(T):Me.length?void 0:s(`composer.noCommands`),onAccept:Pe})]})})}var uz=[{key:`credentials`,label:`settings.menu.credentials`,icon:`key`,to:`/settings`},{key:`search`,label:`settings.menu.search`,icon:`search`,to:`/settings/search`},{key:`context`,label:`settings.menu.context`,icon:`layers`,to:`/settings/context`},{key:`appearance`,label:`settings.menu.appearance`,icon:`palette`,to:`/settings/appearance`},{key:`language`,label:`settings.menu.language`,icon:`globe`,to:`/settings/language`},{key:`mobile`,label:`settings.menu.mobile`,icon:`phone`,to:`/settings/mobile`},{key:`about`,label:`settings.menu.about`,icon:`info`,to:`/about`}];function dz({active:e,children:t}){let n=B();return(0,A.jsxs)(`div`,{className:`flex min-h-dvh flex-col bg-base sm:flex-row`,children:[(0,A.jsxs)(`nav`,{"aria-label":n(`settings.menuLabel`),className:`flex shrink-0 items-center gap-1 overflow-x-auto border-b border-sakura-100 px-4 py-2.5 sm:w-48 sm:flex-col sm:items-stretch sm:gap-1 sm:border-r sm:border-b-0 sm:px-3 sm:py-5`,children:[(0,A.jsx)(Hr,{to:`/`,className:`focus-neko mr-2 inline-flex shrink-0 items-center rounded-lg px-2 py-1.5 text-sm text-sakura-700 sm:mr-0 sm:mb-3`,children:n(`settings.backToChat`)}),(0,A.jsx)(`span`,{className:`hidden px-2 pb-1 text-xs font-medium text-ink-400 sm:block`,children:n(`settings.title`)}),uz.map(t=>(0,A.jsxs)(Hr,{to:t.to,activeOptions:{exact:!0},"aria-current":e===t.key?`page`:void 0,className:`focus-neko inline-flex shrink-0 items-center gap-2 rounded-xl px-3 py-2 text-sm ${e===t.key?`bg-sakura-100 font-semibold text-sakura-800`:`text-ink-600 hover:bg-ink-100`}`,children:[(0,A.jsx)(zR,{name:t.icon,size:15}),n(t.label)]},t.key))]}),(0,A.jsx)(`div`,{className:`min-w-0 flex-1`,children:t})]})}async function fz(){let e=z(),t;try{await navigator.clipboard.writeText(`neko update`),t=e(`update.copied`)}catch{t=e(`update.copyManually`)}return eP.notice({level:`info`,text:t}),t}function pz(){let{updates:e,webInfo:t}=QN();return Ui({gateway:e,frontend:Bi,installed:t?.installedVersion??null,web:t?{runningVersion:t.webVersion,installedVersion:t.installedVersion}:void 0})}function mz(){let e=pz(),t=B(),[n,r]=(0,f.useState)(null);if(e===`none`||n===e)return null;let i=t(e===`install`?`update.install`:e===`refresh-page`?`update.refreshPage`:e===`incompatible`?`update.incompatible`:`update.restart`);return(0,A.jsxs)(`output`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-x-3 gap-y-1 border-b border-sakura-100 bg-sakura-50 px-4 py-1.5 text-xs text-ink-700`,children:[(0,A.jsx)(`span`,{children:i}),e===`install`?(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,onClick:()=>void fz(),children:t(`update.copyCommand`)}):e===`refresh-page`?(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,onClick:rz,children:t(`update.refresh`)}):(0,A.jsx)(Hr,{to:`/about`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,children:t(`update.viewSteps`)}),(0,A.jsx)(KR,{label:t(`update.dismiss`),onClick:()=>r(e)})]})}function hz(e){if(e?.status!==`missing`)return;let t=z();return e.reason===`invalid_config`?t(`shell.invalid`,{detail:e.detail??t(`shell.invalidDefault`)}):t(`shell.missing`)}function gz(e){if(e===null)return null;let t=z();return e.status===`ready`?{label:t(`shell.ready`),tone:`ok`,detail:t(e.source===`config`?`shell.sourceConfig`:`shell.sourceAuto`,{path:e.path})}:{label:t(`shell.unavailable`),tone:`warn`,detail:hz(e)??``}}function _z(){let{updates:e,webInfo:t,phase:n,shell:r}=QN(),i=B(),a=gz(r),o=pz(),[s,c]=(0,f.useState)(!1),[l,u]=(0,f.useState)(``),d=nP();async function p(){if(!s){c(!0),u(``);try{let e=await uP.checkUpdates();u(e.checkState===`ok`?i(`about.checkDone`):e.checkState===`development`?i(`about.checkDevelopment`):i(`about.checkFailedRetry`))}catch{u(i(`about.checkFailedRetry`))}finally{c(!1)}}}return(0,A.jsxs)(dz,{active:`about`,children:[(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:i(`settings.menu.about`)}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:i(n===`ready`?`common.connected`:`common.connecting`)})]}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:i(`about.intro`)})]}),(0,A.jsxs)(`main`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-5 px-5 pb-8`,children:[(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsx)(`h2`,{className:`mb-4 text-base font-bold text-ink-900`,children:i(`about.versionStatus`)}),(0,A.jsxs)(`div`,{className:`flex flex-col divide-y divide-sakura-100`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-sm font-medium text-ink-800`,children:i(`about.currentVersion`)}),(0,A.jsx)(`span`,{className:`ml-3 font-mono text-sm text-ink-600`,children:Bi})]}),(0,A.jsx)(`div`,{children:s?(0,A.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2.5 py-0.5 text-xs text-ink-600`,children:i(`about.checking`)}):o===`incompatible`?(0,A.jsx)(`span`,{className:`rounded-full bg-sakura-100 px-2.5 py-0.5 text-xs font-semibold text-sakura-800`,children:i(`about.badge.incompatible`)}):o===`install`?(0,A.jsx)(`span`,{className:`rounded-full bg-sakura-100 px-2.5 py-0.5 text-xs font-semibold text-sakura-800`,children:i(`about.badge.install`)}):o===`restart-service`?(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-100 px-2.5 py-0.5 text-xs font-semibold text-tianyi-800`,children:i(`about.badge.restart`)}):o===`refresh-page`?(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-100 px-2.5 py-0.5 text-xs font-semibold text-tianyi-800`,children:i(`about.badge.refresh`)}):e?.checkState===`development`?(0,A.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2.5 py-0.5 text-xs text-ink-600`,children:i(`about.badge.development`)}):e?.checkState===`failed`?(0,A.jsx)(`span`,{className:`rounded-full bg-sakura-100 px-2.5 py-0.5 text-xs text-sakura-800`,children:i(`about.badge.failed`)}):(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-2.5 py-0.5 text-xs font-medium text-tianyi-800`,children:i(`about.badge.latest`)})})]}),o===`install`&&e?.latestVersion&&(0,A.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-sakura-50/60 px-3 py-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-sakura-800`,children:i(`about.latestStable`)}),(0,A.jsx)(`span`,{className:`ml-3 font-mono text-sm text-sakura-900`,children:e.latestVersion})]}),(0,A.jsx)(`span`,{className:`text-xs text-sakura-700`,children:i(`about.runUpdate`)})]}),o===`restart-service`&&(0,A.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-tianyi-50/60 px-3 py-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-tianyi-800`,children:i(`about.installedNew`)}),(0,A.jsx)(`span`,{className:`ml-3 font-mono text-sm text-tianyi-900`,children:e?.installedVersion??t?.installedVersion??i(`about.newVersion`)})]}),(0,A.jsx)(`span`,{className:`text-xs text-tianyi-700`,children:i(`about.afterRestart`)})]}),o===`refresh-page`&&(0,A.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-tianyi-50/60 px-3 py-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-tianyi-800`,children:i(`about.staticUpdated`)}),(0,A.jsx)(`span`,{className:`ml-3 font-mono text-sm text-tianyi-900`,children:t?.webVersion??i(`about.newVersion`)})]}),(0,A.jsx)(`span`,{className:`text-xs text-tianyi-700`,children:i(`about.afterRefresh`)})]})]}),(0,A.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,disabled:s,onClick:()=>void p(),children:i(s?`about.checking`:`about.checkUpdates`)}),o===`install`?(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,onClick:()=>void fz().then(u),children:i(`about.copyUpdate`)}):(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full border border-sakura-200 bg-surface px-4 py-1.5 text-sm text-ink-600 hover:bg-sakura-50`,onClick:()=>void fz().then(u),children:i(`about.copyUpdate`)}),o===`refresh-page`&&(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-tianyi-100 px-4 py-1.5 text-sm font-semibold text-tianyi-800`,onClick:rz,children:i(`about.refreshPage`)})]}),l&&(0,A.jsx)(`output`,{className:`mt-3 block text-xs text-tianyi-800`,children:l})]}),a&&(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"data-shell-status":!0,children:[(0,A.jsx)(`h2`,{className:`mb-3 text-base font-bold text-ink-900`,children:i(`about.commandShell`)}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`rounded-full px-2.5 py-0.5 text-xs font-semibold ${a.tone===`ok`?`bg-tianyi-50 text-tianyi-800`:`bg-sakura-100 text-sakura-800`}`,children:a.label}),(0,A.jsx)(`span`,{className:`min-w-0 break-all text-sm text-ink-600`,children:a.detail})]})]}),(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsx)(`h2`,{className:`mb-2 text-base font-bold text-ink-900`,children:i(`about.upgradeTitle`)}),(0,A.jsxs)(`p`,{className:`text-sm text-ink-600`,children:[i(`about.upgradeBefore`),` `,(0,A.jsx)(`code`,{className:`select-all rounded bg-ink-100 px-1.5 py-0.5 font-mono text-xs text-ink-800`,children:`neko update`}),i(`about.upgradeAfter`)]}),d?.text&&(0,A.jsxs)(`details`,{className:`mt-4 border-t border-sakura-100 pt-3 text-sm`,children:[(0,A.jsx)(`summary`,{className:`focus-neko cursor-pointer font-medium text-ink-700`,children:i(`about.draftKept`)}),(0,A.jsx)(`p`,{className:`mt-2 max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-xl bg-ink-50 p-3 font-mono text-xs text-ink-600 select-text`,children:d.text})]})]})]})]})}var vz=e=>[...e].map(e=>{let t=e.charCodeAt(0);return t<32&&t!==9&&t!==10||t>=127&&t<=159||t>=8234&&t<=8238||t>=8294&&t<=8297?`\\u${t.toString(16).padStart(4,`0`)}`:e}).join(``);function yz({item:e,title:t,decide:n}){let r=B(),[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(``),c=(0,f.useRef)(!1),l=async t=>{if(!(c.current||e.status!==`pending`)){c.current=!0,a(!0),s(``);try{await n(t)}catch(e){s(String(e))}finally{c.current=!1,a(!1)}}};return(0,A.jsxs)(`section`,{"aria-label":r(`approval.section`),className:`min-w-0 rounded-xl border border-sakura-200 bg-surface p-3 text-sm`,children:[(0,A.jsxs)(`output`,{className:`block font-medium text-sakura-800`,children:[t,` · Bash · `,r(`approval.status.${e.status}`)]}),(0,A.jsxs)(`p`,{className:`break-all text-xs text-ink-500`,children:[vz(e.cwd),` · `,r(`approval.timeout`,{value:e.timeout??r(`approval.timeoutDefault`)})]}),(0,A.jsx)(`textarea`,{readOnly:!0,rows:Math.min(6,Math.max(1,e.command.split(`
14
+ `).length)),"aria-label":r(`approval.command`),value:vz(e.command),className:`focus-neko my-2 w-full resize-y whitespace-pre-wrap break-all rounded-lg bg-base p-2 font-mono text-xs`}),e.status===`pending`&&(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:i,className:`focus-neko rounded-lg bg-tianyi-100 px-3 py-1 text-tianyi-800 disabled:opacity-50`,onClick:()=>void l(`allowed`),children:r(`approval.allow`)}),(0,A.jsx)(`button`,{type:`button`,disabled:i,className:`focus-neko rounded-lg border border-sakura-300 px-3 py-1 disabled:opacity-50`,onClick:()=>void l(`denied`),children:r(`approval.deny`)})]}),o&&(0,A.jsx)(`p`,{role:`alert`,className:`break-all text-xs text-sakura-800`,children:o})]})}function bz(){let e=B(),{phase:t,operating:n,currentSessionId:r,view:i}=QN(),[,a]=(0,f.useState)(0),o=(0,f.useRef)(null),[s,c]=(0,f.useState)(null),l=t===`ready`&&!n&&i!==null;if((0,f.useEffect)(()=>{if(!l||!r)return;let e=!0,t=new sN(e=>uP.subagent(e),()=>{e&&a(e=>e+1)});return o.current=t,c(t),()=>{e=!1,o.current=null,t.close(),c(null)}},[l,r]),(0,f.useEffect)(()=>{l&&s===o.current&&s?.update(i?.subagents??[])},[s,l,i?.subagents]),!l||!s)return null;let u=s.pending;return!u.length&&!s.error?null:(0,A.jsxs)(`section`,{"aria-label":e(`approval.inbox`),className:`max-h-[40dvh] shrink-0 space-y-2 overflow-auto px-3 py-2`,children:[u.map(({item:e,title:t,service:n})=>(0,A.jsx)(yz,{item:e,title:t,decide:t=>n.decideApproval({id:e.id,version:e.version,decision:t})},`${e.id}:${e.version}`)),s.error&&(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-sakura-800`,children:s.error})]})}function xz(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);if(t<3600)return`${n}m ${t%60}s`;let r=Math.floor(t/3600);return t<86400?`${r}h ${n%60}m`:`${Math.floor(t/86400)}d ${r%24}h`}var Sz=e=>e.split(`
15
+ `).map(e=>e.trim()).find(Boolean)??``;function Cz(e){return e.title.trim()||Sz(e.command)||`(empty command)`}function wz(e,t){return e.status===`running`?xz(t-e.startedAt):e.reason===`timeout`?`timeout`:e.exitCode===null?e.reason===`restart`?`restart`:xz((e.endedAt??t)-e.startedAt):`exit ${e.exitCode}`}var Tz=e=>Number.parseInt(e.replace(/^\D+/,``),10)||0;function Ez(e,t){let n=[...e].sort((e,t)=>t.startedAt-e.startedAt||Tz(t.jobId)-Tz(e.jobId)).map(e=>{let n=e.status===`running`;return{job:e,label:Cz(e),running:n,statusText:e.status,meta:wz(e,t),durationMs:Math.max(0,(e.endedAt??t)-e.startedAt)}});return{rows:n,running:n.filter(e=>e.running).length}}function Dz(e){let t=e.split(`
16
+ `),n=t[0]??``,r=t[1]?.startsWith(`Command: `)?t[1].slice(9):void 0,i=t.findIndex((e,t)=>t>0&&e.startsWith(`Last output (`)),a=i<0?void 0:t.slice(i+1).join(`
17
+ `);return{head:n,command:r,output:a===``?void 0:a}}var Oz=262144,kz=class{#e=``;#t=0;#n;#r;constructor(e=Oz){this.#r=e}get text(){return this.#e}get dropped(){return this.#t}get offset(){return this.#n}apply(e,t=e=>e){if(this.#n===void 0?this.#t=e.dropped:e.truncated&&(this.#t+=e.dropped),this.#n=e.offset,this.#e+=t(e.text),this.#e.length>this.#r){let e=this.#e.length-this.#r;this.#e=this.#e.slice(e),this.#t+=e}}},Az={running:`job.status.running`,exited:`job.status.exited`,failed:`job.status.failed`,stopped:`job.status.stopped`,lost:`job.status.lost`};function jz(e,t){let n=z(),r=n(Az[e.status]);return e.status===`running`?`${r} · ${xz(t-e.startedAt)}`:e.reason===`timeout`?`${r} · ${n(`job.reason.timeout`)}`:e.reason===`spawn-error`?`${r} · ${n(`job.reason.spawnError`)}`:e.exitCode===null?e.reason===`restart`?`${r} · ${n(`job.reason.restart`)}`:`${r} · ${xz((e.endedAt??t)-e.startedAt)}`:`${r} · ${n(`job.reason.exitCode`,{code:e.exitCode})}`}var Mz=/\u001b(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007\u001b]*(?:\u0007|\u001b\\)|[@-Z\\-_])/g,Nz=/[\u0000-\u0008\u000b-\u001f\u007f]/g;function Pz(e){return e.replace(Mz,``).replace(/\r\n?/g,`
18
+ `).replace(Nz,``)}function Fz(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}var Iz=1e3,Lz=e=>e instanceof Error?e.message:String(e);function Rz({sessionId:e,job:t}){let n=B(),r=t.jobId,i=(0,f.useRef)(new kz),[,a]=(0,f.useState)(0),[o,s]=(0,f.useState)(``),[c,l]=(0,f.useState)(!0),[u,d]=(0,f.useState)(!1),p=(0,f.useRef)(!0),m=(0,f.useRef)(null),h=t.status===`running`,g=(0,f.useRef)(h);g.current=h;let[_,v]=(0,f.useState)(Date.now);(0,f.useEffect)(()=>{if(!h)return;let e=setInterval(()=>v(Date.now()),Iz);return()=>clearInterval(e)},[h]),(0,f.useEffect)(()=>{let t=!1,n,o=async()=>{let c=g.current;try{let l=await uP.jobOutput(e,r,i.current.offset);if(t)return;i.current.apply(l,Pz),s(``),a(e=>e+1),c&&(n=setTimeout(()=>void o(),Iz))}catch(e){t||s(Lz(e))}};return o(),()=>{t=!0,clearTimeout(n)}},[e,r]),(0,f.useLayoutEffect)(()=>{let e=m.current;e&&p.current&&(e.scrollTop=e.scrollHeight)});let y=(0,f.useCallback)(()=>{let e=m.current;e&&(p.current=!0,l(!0),e.scrollTop=e.scrollHeight)},[]),b=()=>{u||(d(!0),uP.jobStop(e,r).catch(e=>s(Lz(e))).finally(()=>d(!1)))},x=i.current.text;return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sakura-100 p-3 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`font-medium text-ink-800`,children:jz(t,_)}),h&&(0,A.jsx)(`button`,{type:`button`,disabled:u,className:`focus-neko rounded-lg border border-sakura-300 px-2 py-0.5 disabled:opacity-50`,onClick:b,children:n(u?`job.stopping`:`job.stop`)})]}),(0,A.jsx)(`code`,{className:`max-h-20 overflow-auto whitespace-pre-wrap break-all text-ink-700`,children:t.command}),(0,A.jsx)(`span`,{className:`break-all text-ink-500`,children:t.cwd})]}),o&&(0,A.jsx)(`p`,{role:`alert`,className:`shrink-0 p-3 text-sm text-sakura-800`,children:o}),(0,A.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,A.jsxs)(`div`,{ref:m,"data-testid":`job-output`,className:`h-full overflow-y-auto overflow-x-hidden p-3`,onScroll:e=>{let t=Fz(e.currentTarget);p.current=t,l(t)},children:[i.current.dropped>0&&(0,A.jsx)(`p`,{className:`mb-2 text-xs text-sakura-800`,children:n(`job.dropped`,{count:i.current.dropped})}),x===``?(0,A.jsx)(`p`,{className:`text-xs text-ink-500`,children:i.current.offset===void 0?n(`job.reading`):n(`job.noOutput`)}):(0,A.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs text-ink-800`,children:x})]}),!c&&(0,A.jsx)(`button`,{type:`button`,onClick:y,className:`focus-neko discrete-in absolute right-3 bottom-3 rounded-full border border-sakura-300 bg-surface px-3.5 py-1 text-xs font-medium text-sakura-800 hover:bg-sakura-50`,children:n(`job.toBottom`)})]})]})}function zz({sessionId:e,jobs:t,open:n,onClose:r}){let i=B(),[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)(Date.now),l=(0,f.useRef)(null),u=(0,f.useRef)(null),[d,p]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>p(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let m=Ez(t,s);(0,f.useEffect)(()=>{if(!n||m.running===0)return;let e=setInterval(()=>c(Date.now()),Iz);return()=>clearInterval(e)},[n,m.running]),(0,f.useEffect)(()=>{if(!n)return;let e=document.activeElement,t=d&&u.current?.parentElement?[...u.current.parentElement.children].filter(e=>e instanceof HTMLElement&&e!==u.current):[],r=t.map(e=>e.inert);return t.forEach(e=>{e.inert=!0}),l.current?.focus(),()=>{t.forEach((e,t)=>{e.inert=r[t]}),e?.isConnected&&e.focus()}},[n,d]);let h=m.rows.find(e=>e.job.jobId===a)??m.rows[0];return(0,A.jsxs)(`aside`,{ref:u,role:d?`dialog`:`complementary`,"aria-modal":d&&n?!0:void 0,"aria-label":i(`job.panel`),className:`${n?`flex`:`hidden`} fixed inset-0 z-30 min-w-0 flex-col border-l border-sakura-200 bg-base lg:static lg:z-auto lg:w-[min(42vw,40rem)] lg:shrink-0`,onKeyDown:e=>{if(e.currentTarget.contains(e.target)){if(e.key===`Tab`&&window.innerWidth<1024){let t=[...e.currentTarget.querySelectorAll(`button:not([disabled]),a[href],summary,[tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}e.key===`Escape`&&(e.stopPropagation(),r())}},children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,A.jsx)(`strong`,{className:`text-sm text-ink-800`,children:i(`job.panel`)}),(0,A.jsx)(`button`,{ref:l,type:`button`,className:`focus-neko rounded-lg px-2 py-1 text-sm text-ink-600 hover:bg-sakura-50`,onClick:r,children:i(`common.close`)})]}),m.rows.length===0?(0,A.jsx)(`p`,{className:`p-4 text-sm text-ink-500`,children:i(`job.panelEmpty`)}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`max-h-44 shrink-0 overflow-auto border-b border-sakura-100 p-2`,children:m.rows.map(e=>(0,A.jsxs)(`button`,{type:`button`,"aria-pressed":h?.job.jobId===e.job.jobId,className:`focus-neko flex w-full min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm ${h?.job.jobId===e.job.jobId?`bg-tianyi-100`:`hover:bg-sakura-50`}`,onClick:()=>o(e.job.jobId),children:[(0,A.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,A.jsx)(`span`,{className:`text-tianyi-700`,children:e.job.jobId}),` · `,e.label]}),(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:jz(e.job,s)})]},e.job.jobId))}),n&&h&&(0,A.jsx)(Rz,{sessionId:e,job:h.job},`${e}:${h.job.jobId}`)]})]})}function Bz(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Vz=Bz();function Hz(e){Vz=e}var Uz={exec:()=>null};function Wz(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 Gz(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(qz.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Kz=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),qz={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,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,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,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:Wz(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Wz(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Wz(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Wz(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Wz(e=>RegExp(`^ {0,${e}}(?:</?(?:${cB})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:Wz(e=>RegExp(`^ {0,${e}}>`))},Jz=/^(?:[ \t]*(?:\n|$))+/,Yz=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Xz=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zz=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qz=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$z=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,eB=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,tB=Gz(eB).replace(/bull/g,$z).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),nB=Gz(eB).replace(/bull/g,$z).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),rB=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,iB=/^[^\n]+/,aB=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,oB=Gz(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,aB).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sB=Gz(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,$z).getRegex(),cB=`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`,lB=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,uB=Gz(`^ {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][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,lB).replace(`tag`,cB).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dB=e=>Gz(rB).replace(`hr`,Zz).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,cB).getRegex(),fB=dB(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),pB=dB(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),mB={blockquote:Gz(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,pB).getRegex(),code:Yz,def:oB,fences:Xz,heading:Qz,hr:Zz,html:uB,lheading:tB,list:sB,newline:Jz,paragraph:fB,table:Uz,text:iB},hB=Gz(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Zz).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,cB).getRegex(),gB={...mB,lheading:nB,table:hB,paragraph:Gz(rB).replace(`hr`,Zz).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,hB).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,cB).getRegex()},_B={...mB,html:Gz(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,lB).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:Uz,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Gz(rB).replace(`hr`,Zz).replace(`heading`,` *#{1,6} *[^
19
+ ]`).replace(`lheading`,tB).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},vB=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,yB=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bB=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,xB=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,SB=/[\p{P}\p{S}]/u,CB=/[\s\p{P}\p{S}]/u,wB=/[^\s\p{P}\p{S}]/u,TB=Gz(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,CB).getRegex(),EB=/[\p{Pi}\p{Ps}"']/u,DB=/(?!~)[\p{P}\p{S}]/u,OB=/(?!~)[\s\p{P}\p{S}]/u,kB=/(?:[^\s\p{P}\p{S}]|~)/u,AB=Gz(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Kz?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),jB=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,MB=Gz(jB,`u`).replace(/punct/g,SB).getRegex(),NB=Gz(jB,`u`).replace(/punct/g,DB).getRegex(),PB=Gz(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,EB).replace(/punct/g,SB).getRegex(),FB=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,IB=Gz(FB,`gu`).replace(/notPunctSpace/g,wB).replace(/punctSpace/g,CB).replace(/punct/g,SB).getRegex(),LB=Gz(FB,`gu`).replace(/notPunctSpace/g,kB).replace(/punctSpace/g,OB).replace(/punct/g,DB).getRegex(),RB=Gz(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,wB).replace(/punctSpace/g,CB).replace(/punct/g,SB).getRegex(),zB=Gz(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,wB).replace(/punctSpace/g,CB).replace(/punct/g,SB).getRegex(),BB=Gz(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,wB).replace(/punctSpace/g,CB).replace(/punct/g,SB).getRegex(),VB=Gz(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,SB).getRegex(),HB=Gz(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,wB).replace(/punctSpace/g,CB).replace(/punct/g,SB).getRegex(),UB=Gz(/\\(punct)/,`gu`).replace(/punct/g,SB).getRegex(),WB=Gz(/^<(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(),GB=Gz(lB).replace(`(?:-->|$)`,`-->`).getRegex(),KB=Gz(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,GB).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qB=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,JB=Gz(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,qB).getRegex(),YB=Gz(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,JB).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),XB=Gz(/^!?\[(label)\]\[(ref)\]/).replace(`label`,JB).replace(`ref`,aB).getRegex(),ZB=Gz(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,aB).getRegex(),QB=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,$B=Gz(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,qB).getRegex(),eV=Gz(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Gz(/^!?\[(label)\]\[(ref)\]/).replace(`label`,$B).replace(`ref`,QB).getRegex()).replace(`nolink`,Gz(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,QB).getRegex()).getRegex(),tV=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,nV=Gz(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),rV={_backpedal:Uz,anyPunctuation:UB,autolink:WB,blockSkip:AB,br:bB,code:yB,del:Uz,delLDelim:Uz,delRDelim:Uz,emStrongLDelim:MB,emStrongRDelimAst:IB,emStrongRDelimUnd:zB,escape:vB,link:YB,nolink:ZB,punctuation:TB,reflink:XB,reflinkSearch:eV,tag:KB,text:xB,url:Uz},iV={...rV,emStrongLDelim:PB,emStrongRDelimAst:RB,emStrongRDelimUnd:BB,link:Gz(/^!?\[(label)\]\((.*?)\)/).replace(`label`,JB).getRegex(),reflink:Gz(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,JB).getRegex()},aV={...rV,emStrongRDelimAst:LB,emStrongLDelim:NB,delLDelim:VB,delRDelim:HB,url:Gz(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,nV).replace(`protocol`,tV).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Gz(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,tV).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},oV={...aV,br:Gz(bB).replace(`{2,}`,`*`).getRegex(),text:Gz(aV.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},sV={normal:mB,gfm:gB,pedantic:_B},cV={normal:rV,gfm:aV,breaks:oV,pedantic:iV},lV={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},uV=e=>lV[e];function dV(e,t){if(t){if(qz.escapeTest.test(e))return e.replace(qz.escapeReplace,uV)}else if(qz.escapeTestNoEncode.test(e))return e.replace(qz.escapeReplaceNoEncode,uV);return e}function fV(e){return e.replace(qz.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function pV(e){try{e=encodeURI(e).replace(qz.percentDecode,`%`)}catch{return null}return e}function mV(e,t){let n=e.replace(qz.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(qz.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(qz.slashPipe,`|`);return n}function hV(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 gV(e){let t=e.split(`
20
+ `),n=t.length-1;for(;n>=0&&qz.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
21
+ `)}function _V(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function vV(e,t){if(e.indexOf(t[0])===-1&&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 yV(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 bV(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function xV(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
22
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
23
+ `)}function SV(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var CV=class{options;rules;lexer;constructor(e){this.options=e||Vz}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]:gV(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=xV(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=hV(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:hV(t[0],`
24
+ `),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:hV(t[0],`
25
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=hV(t[0],`
26
+ `).split(`
27
+ `),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(`
28
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
29
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
30
+ ${s}`:s,r=r?`${r}
31
+ ${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=e.join(`
32
+ `),o=t.raw+`
33
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
34
+ `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
35
+ ${d.join(`
36
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
37
+ `+e.join(`
38
+ `),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(`
39
+ `)}}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=t[2].split(`
40
+ `,1)[0],l=t[1].length,u=this.options.pedantic?yV(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>yV(e,l)),d=e.split(`
41
+ `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
42
+ `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
43
+ `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
44
+ `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
45
+ `+d}f=!d.trim(),r+=l+`
46
+ `,e=e.substring(l.length+1),u=m.slice(p)}}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)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!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))}for(let e of i.items){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)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=gV(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){if(!this.rules.other.startAngleBracket.test(t[2])&&vV(t[2],`()`)!==-1)return;let e=_V(t[1]).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:hV(t[0],`
47
+ `),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=mV(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
48
+ `):[],a={type:`table`,raw:hV(t[0],`
49
+ `),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(mV(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:hV(t[0],`
50
+ `),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)===`
51
+ `?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){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&SV(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=hV(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=vV(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 i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),bV(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.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 r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&SV(e,n[1],r,this.rules))return;let i=t[_V((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return bV(n,i,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 i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,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,autolink:!0,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,autolink:!0,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:e?t[0]:fV(t[0]),escaped:e}}}},wV=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Vz,this.options.tokenizer=this.options.tokenizer||new CV,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:qz,block:sV.normal,inline:cV.normal};this.options.pedantic?(t.block=sV.pedantic,t.inline=cV.pedantic):this.options.gfm&&(t.block=sV.gfm,t.inline=this.options.breaks?cV.breaks:cV.gfm),this.tokenizer.rules=t}static get rules(){return{block:sV,inline:cV}}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(qz.carriageReturn,`
52
+ `),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(qz.tabCharGlobal,` `).replace(qz.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+=`
53
+ `: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(`
54
+ `)?``:`
55
+ `)+i.raw,n.text+=`
56
+ `+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(`
57
+ `)?``:`
58
+ `)+i.raw,n.text+=`
59
+ `+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(`
60
+ `)?``:`
61
+ `)+i.raw,r.text+=`
62
+ `+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(`
63
+ `)?``:`
64
+ `)+i.raw,n.text+=`
65
+ `+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}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,_V(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,_V(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=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&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}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)}},TV=class{options;parser;constructor(e){this.options=e||Vz}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(qz.notSpaceStart)?.[0],i=e?e.replace(qz.endingNewline,``)+`
66
+ `:``;return r?`<pre><code class="language-`+dV(r)+`">`+(n?i:dV(i,!0))+`</code></pre>
67
+ `:`<pre><code>`+(n?i:dV(i,!0))+`</code></pre>
68
+ `}blockquote({tokens:e}){return`<blockquote>
69
+ ${this.parser.parse(e)}</blockquote>
70
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
71
+ `}hr(e){return`<hr>
72
+ `}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+`>
73
+ `+r+`</`+i+`>
74
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
75
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
76
+ `}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>
77
+ <thead>
78
+ `+t+`</thead>
79
+ `+r+`</table>
80
+ `}tablerow({text:e}){return`<tr>
81
+ ${e}</tr>
82
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
83
+ `}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>${dV(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?dV(n,!0):this.parser.parseInline(r),o=pV(e);if(o===null)return a;e=dV(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+dV(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=pV(e);if(i===null)return dV(n);e=i;let a=`<img src="${dV(e)}" alt="${dV(n)}"`;return t&&(a+=` title="${dV(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:dV(e.text)}},EV=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}},DV=class e{options;renderer;textRenderer;constructor(e){this.options=e||Vz,this.options.renderer=this.options.renderer||new TV,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new EV}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`,`checkbox`,`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`,`checkbox`,`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}},OV=class{options;block;constructor(e){this.options=e||Vz}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?wV.lex:wV.lexInline}provideParser(e=this.block){return e?DV.parse:DV.parseInline}},kV=class{defaults=Bz();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=DV;Renderer=TV;TextRenderer=EV;Lexer=wV;Tokenizer=CV;Hooks=OV;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 TV(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 CV(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 OV;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]=OV.passThroughHooks.has(n)?e=>{if(this.defaults.async&&OV.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 wV.lex(e,t??this.defaults)}parser(e,t){return DV.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?wV.lex:wV.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?DV.parse:DV.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?wV.lex:wV.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?DV.parse:DV.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+=`
84
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+dV(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},AV=new kV;function jV(e,t){return AV.parse(e,t)}jV.options=jV.setOptions=function(e){return AV.setOptions(e),jV.defaults=AV.defaults,Hz(jV.defaults),jV},jV.getDefaults=Bz,jV.defaults=Vz;function MV(...e){return AV.use(...e),jV.defaults=AV.defaults,Hz(jV.defaults),jV}jV.use=MV,jV.walkTokens=function(e,t){return AV.walkTokens(e,t)},jV.parseInline=AV.parseInline,jV.Parser=DV,jV.parser=DV.parse,jV.Renderer=TV,jV.TextRenderer=EV,jV.Lexer=wV,jV.lexer=wV.lex,jV.Tokenizer=CV,jV.Hooks=OV,jV.parse=jV,jV.options,jV.setOptions,jV.walkTokens,jV.parseInline,DV.parse,wV.lex;var NV=/^image\/(png|jpeg|webp|gif)$/i,PV=/^(https?:|mailto:)/i,FV=49152,IV=`default-src 'none'; img-src data:; style-src 'unsafe-inline'`,LV=`
85
+ :root{color-scheme:light dark;--bg:#fff;--fg:#1f2328;--muted:#656d76;--border:#d0d7de;--user:#eef4ff;--code:#f6f8fa}
86
+ @media(prefers-color-scheme:dark){:root{--bg:#0d1117;--fg:#e6edf3;--muted:#8b949e;--border:#30363d;--user:#16243a;--code:#161b22}}
87
+ body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
88
+ main{max-width:860px;margin:0 auto;padding:24px 16px 64px}
89
+ h1{font-size:1.5rem;margin:0 0 4px}
90
+ .meta{color:var(--muted);font-size:.85rem;margin:0 0 24px}
91
+ .msg{margin:16px 0;padding:12px 16px;border:1px solid var(--border);border-radius:12px}
92
+ .msg.user{background:var(--user)}
93
+ .role{font-size:.75rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
94
+ .text{white-space:pre-wrap;overflow-wrap:anywhere}
95
+ .system{text-align:center;color:var(--muted);font-size:.85rem;margin:16px 0}
96
+ .md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}
97
+ .md pre,pre{background:var(--code);border-radius:8px;padding:10px 12px;overflow:auto;font-size:.85rem;white-space:pre-wrap;overflow-wrap:anywhere}
98
+ .md code{background:var(--code);border-radius:4px;padding:1px 4px}.md pre code{background:none;padding:0}
99
+ .md table{border-collapse:collapse}.md th,.md td{border:1px solid var(--border);padding:4px 8px}
100
+ .md blockquote{margin:0;padding-left:12px;border-left:3px solid var(--border);color:var(--muted)}
101
+ details{margin:8px 0}summary{cursor:pointer;color:var(--muted)}
102
+ details.tool{border:1px solid var(--border);border-radius:8px;padding:6px 12px;margin:12px 0}
103
+ details.tool.error>summary .status{color:#cf222e}
104
+ .label{font-size:.75rem;color:var(--muted);margin-top:8px}
105
+ .note{color:var(--muted);font-style:italic;margin-top:6px}
106
+ figure{margin:8px 0}img{max-width:100%;height:auto;border-radius:8px}figcaption,.placeholder{color:var(--muted);font-size:.8rem}
107
+ `,RV=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`).replaceAll(`'`,`&#39;`),zV=new kV({gfm:!0,breaks:!0,renderer:{html:({text:e})=>RV(e),link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n);if(!PV.test(e.trim()))return r;let i=t?` title="${RV(t)}"`:``;return`<a href="${RV(e)}"${i} rel="noopener noreferrer" target="_blank">${r}</a>`},image({href:e,text:t}){let n=`[image: ${RV(t||e)}]`;return PV.test(e.trim())?`<a href="${RV(e)}" rel="noopener noreferrer" target="_blank">${n}</a>`:n}}});async function BV(e,t){let n=new Map,r=0,i=0;for(let a of e)if(a.type===`user`||a.type===`tool`)for(let e of a.images??[]){let a=null;if(t===void 0)a=`not embedded`;else if(r+e.bytes>33554432)a=`over the embedding size limit`;else try{let i=await t(e);if(!NV.test(i.mimeType))a=`unsupported image type`;else if(r+i.bytes.length>33554432)a=`over the embedding size limit`;else{r+=i.bytes.length;let t=[];for(let e=0;e<i.bytes.length;e+=FV)t.push(Gi(i.bytes.subarray(e,e+FV)));n.set(`${e.entryId}:${e.contentIndex}`,{src:`data:${i.mimeType.toLowerCase()};base64,${t.join(``)}`})}}catch{a=`image unavailable`}a!==null&&(n.set(`${e.entryId}:${e.contentIndex}`,{reason:a}),i++)}return{embedded:n,skipped:i}}function VV(e,t){return(e??[]).map(e=>{let n=t.get(`${e.entryId}:${e.contentIndex}`),r=RV(yP(e));return n!==void 0&&`src`in n?`<figure><img src="${n.src}" alt="${RV(e.name)}"><figcaption>${r}</figcaption></figure>`:`<p class="placeholder">[image: ${r}${n!==void 0&&`reason`in n?` — ${n.reason}`:``}]</p>`}).join(``)}async function HV(e,t){let{embedded:n,skipped:r}=await BV(e.items,t.loadImage),i=RV(xP(e.title)||`neko-session`),a=[];for(let r of e.items)if(r.type===`system`)a.push(`<div class="system">${RV(xP(r.text))}</div>`);else if(r.type===`user`){let e=gP(r);a.push(`<section class="msg user"><div class="role">User</div>${e===``?``:`<div class="text">${RV(e)}</div>`}${VV(r.images,n)}</section>`)}else if(r.type===`assistant`){let e=t.includeThinking&&r.thinking.trim()!==``?`<details class="thinking"><summary>Thinking</summary><div class="text">${RV(r.thinking.trim())}</div></details>`:``,n=r.text.trim()===``?``:`<div class="md">${zV.parse(r.text.trim(),{async:!1})}</div>`,i=r.note===null?``:`<div class="note">${RV(xP(r.note))}</div>`;a.push(`<section class="msg assistant"><div class="role">Assistant</div>${e}${n}${i}</section>`)}else{let e=_P(r),t=vP(r),i=[`<b>Tool</b> ${RV(r.name)}`,r.summary===``?``:`<span class="args">${RV(xP(r.summary))}</span>`,e===`ok`?``:`<span class="status">[${e}]</span>`,r.durationMs===null?``:`<span class="duration">(${bP(r.durationMs)})</span>`].filter(Boolean).join(` `);a.push(`<details class="tool ${e}"><summary>${i}</summary>${r.detail===null||r.detail===``?``:`<pre>${RV(r.detail)}</pre>`}${t===``?``:`<div class="label">${e===`running`?`Output so far`:`Result`}</div><pre>${RV(t)}</pre>`}${r.note===null?``:`<div class="note">${RV(xP(r.note))}</div>`}${VV(r.images,n)}</details>`)}return{content:`<!doctype html>
108
+ <html lang="en">
109
+ <head>
110
+ <meta charset="utf-8">
111
+ <meta http-equiv="Content-Security-Policy" content="${IV}">
112
+ <meta name="viewport" content="width=device-width, initial-scale=1">
113
+ <title>${i}</title>
114
+ <style>${LV}</style>
115
+ </head>
116
+ <body>
117
+ <main>
118
+ <h1>${i}</h1>
119
+ <p class="meta">${RV(xP(e.model))} · ${RV(xP(e.cwd))} · ${RV(e.exportedAt.toISOString())}</p>
120
+ ${a.join(`
121
+ `)}
122
+ </main>
123
+ </body>
124
+ </html>
125
+ `,skippedImages:r}}var UV={markdown:`md`,html:`html`,json:`json`},WV={markdown:`text/markdown;charset=utf-8`,html:`text/html;charset=utf-8`,json:`application/json;charset=utf-8`},GV=60;function KV(e){return e.type===`user`?gP(e):e.type===`assistant`?e.text.trim():``}function qV(e,t,n){let r=e.replace(/[\\/:*?"<>|\u0000-\u001f\u007f]/g,`-`).replace(/\s+/g,` `).replace(/-{2,}/g,`-`),i=Array.from(r).slice(0,GV).join(``).replace(/^[\s.-]+|[\s.-]+$/g,``)||`neko-session`,a=(e,t=2)=>String(e).padStart(t,`0`);return`${i}-${`${a(n.getFullYear(),4)}${a(n.getMonth()+1)}${a(n.getDate())}-${a(n.getHours())}${a(n.getMinutes())}${a(n.getSeconds())}`}.${UV[t]}`}async function JV(e,t,n){if(t.items.length===0)throw Error(`Nothing to export yet - start a conversation first`);let r=UV[e],i=WV[e];if(e===`html`){let{content:e,skippedImages:a}=await HV(t,n);return{content:e,mimeType:i,extension:r,skippedImages:a}}return{content:e===`markdown`?ZV(t,n):$V(t,n),mimeType:i,extension:r,skippedImages:0}}function YV(e){let t=0;for(let n of e.matchAll(/`+/g))t=Math.max(t,n[0].length);let n="`".repeat(Math.max(3,t+1));return`${n}\n${e}\n${n}`}var XV=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`);function ZV(e,t){let n=[`# ${xP(e.title)||`neko-session`}`,``,`- **Model:** ${xP(e.model)}`,`- **Workspace:** ${xP(e.cwd)}`,`- **Exported:** ${e.exportedAt.toISOString()}`,``],r=null,i=e=>{r!==e&&(r=e,n.push(`---`,``,e===`user`?`## User`:`## Assistant`,``))};for(let a of e.items)if(a.type===`system`)r=null,n.push(`---`,``,`*${XV(xP(a.text))}*`,``);else if(a.type===`user`){i(`user`);let e=gP(a);e!==``&&n.push(e,``);for(let e of a.images??[])n.push(`> [image] ${XV(yP(e))}`,``)}else a.type===`assistant`?(i(`assistant`),t.includeThinking&&a.thinking.trim()!==``&&n.push(`<details>`,`<summary>Thinking</summary>`,``,a.thinking.trim(),``,`</details>`,``),a.text.trim()!==``&&n.push(a.text.trim(),``),a.note!==null&&n.push(`> ${XV(xP(a.note))}`,``)):(i(`assistant`),n.push(...QV(a)));return`${n.join(`
126
+ `).trimEnd()}\n`}function QV(e){let t=_P(e),n=[`<details>`,`<summary>${XV([`Tool: ${e.name}`,e.summary===``?``:`· ${xP(e.summary)}`,t===`ok`?``:`[${t}]`,e.durationMs===null?``:`(${bP(e.durationMs)})`].filter(Boolean).join(` `))}</summary>`,``];e.detail!==null&&e.detail!==``&&n.push(YV(e.detail),``);let r=vP(e);r!==``&&n.push(t===`running`?`Output so far:`:`Result:`,``,YV(r),``),e.note!==null&&n.push(`> ${XV(xP(e.note))}`,``);for(let t of e.images??[])n.push(`> [image] ${XV(yP(t))}`,``);return n.push(`</details>`,``),n}function $V(e,t){let n=e.items.map(e=>{switch(e.type){case`user`:return{type:`user`,text:gP(e),images:(e.images??[]).map(({name:e,mimeType:t,width:n,height:r,bytes:i})=>({name:e,mimeType:t,width:n,height:r,bytes:i}))};case`assistant`:return{type:`assistant`,text:e.text,...t.includeThinking&&e.thinking.trim()!==``?{thinking:e.thinking}:{},stopReason:e.stopReason,note:e.note};case`tool`:return{type:`tool`,name:e.name,summary:e.summary,detail:e.detail,status:e.phase,isError:e.isError,result:vP(e),durationMs:e.durationMs,note:e.note,images:(e.images??[]).map(({name:e,mimeType:t,width:n,height:r,bytes:i})=>({name:e,mimeType:t,width:n,height:r,bytes:i}))};default:return{type:`system`,text:e.text}}});return`${JSON.stringify({format:`neko-conversation`,version:1,session:{id:e.sessionId,title:e.title,model:e.model,cwd:e.cwd,exportedAt:e.exportedAt.toISOString()},items:n},null,2)}\n`}var eH={pending:`border-tianyi-300 bg-tianyi-100 text-tianyi-900`,answered:`border-ink-200 bg-ink-50 text-ink-700`,skipped:`border-ink-200 bg-ink-50 text-ink-700`,cancelled:`border-sakura-300 bg-sakura-50 text-sakura-800`};function tH(e,t){return e.status===`answered`?t(`askUser.answer`,{answer:IP(zP(e))}):e.status===`skipped`?t(`askUser.skipped`):e.status===`cancelled`?t(`askUser.cancelled`):null}function nH({interaction:e,onLocate:t}){let n=B(),r=tH(e,n);return(0,A.jsxs)(`section`,{"aria-label":n(`askUser.record`),"data-ask-user-row":!0,"data-status":e.status,className:`rounded-card border border-tianyi-200 bg-surface px-3 py-2 text-sm shadow-soft`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-tianyi-700 px-2 py-0.5 text-xs font-semibold text-on-accent`,children:[(0,A.jsx)(zR,{name:`sparkles`,size:12}),n(`askUser.badge`)]}),(0,A.jsx)(`span`,{className:`shrink-0 rounded-full border px-2 py-0.5 text-xs font-medium ${eH[e.status]}`,children:NP(e.status)}),t&&(0,A.jsx)(`button`,{type:`button`,className:`focus-neko ml-auto shrink-0 rounded-full border border-tianyi-300 px-3 py-1 text-xs text-tianyi-900 hover:bg-tianyi-50`,onClick:t,children:n(`askUser.locate`)})]}),(0,A.jsx)(`p`,{className:`mt-1.5 max-h-40 overflow-y-auto whitespace-pre-wrap break-words text-ink-900`,children:IP(e.question)}),r!==null&&(0,A.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words text-xs text-ink-700`,children:r})]})}async function rH(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.activeElement,n=document.getSelection(),r=n?Array.from({length:n.rangeCount},(e,t)=>n.getRangeAt(t)):[],i=document.createElement(`textarea`);i.value=e,i.setAttribute(`readonly`,``),i.style.cssText=`position:fixed;top:0;left:-9999px;opacity:0`,document.body.append(i),i.select();let a=!1;try{a=document.execCommand(`copy`)}finally{if(i.remove(),n){n.removeAllRanges();for(let e of r)n.addRange(e)}t?.focus?.()}if(!a)throw Error(`Clipboard unavailable`)}var iH=1500;function aH({text:e,label:t}){let n=B(),r=t??n(`copy.label`),[i,a]=(0,f.useState)(`idle`),o=(0,f.useRef)(void 0);if((0,f.useEffect)(()=>()=>clearTimeout(o.current),[]),e===``)return null;let s=e=>{a(e),clearTimeout(o.current),o.current=setTimeout(()=>a(`idle`),iH)};return(0,A.jsxs)(`span`,{className:`copy-row`,"data-state":i,children:[(0,A.jsx)(`button`,{type:`button`,className:`copy-btn focus-neko`,"aria-label":r,title:r,onClick:()=>{rH(e).then(()=>s(`copied`),()=>s(`failed`))},children:(0,A.jsx)(zR,{name:i===`copied`?`check`:`copy`,size:15})}),(0,A.jsx)(`output`,{className:`copy-status`,"aria-live":`polite`,children:i===`copied`?n(`copy.copied`):i===`failed`?n(`copy.failed`):``})]})}var oH=(0,f.createContext)(null);function sH({image:e}){let t=B(),{currentSessionId:n,phase:r}=QN(),i=(0,f.useContext)(oH),[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(0),m=(0,f.useRef)(null);return(0,f.useEffect)(()=>{if(!n)return;o(``);let t=!1,a=``,s=!1,l=new IntersectionObserver(l=>{!s&&l.some(e=>e.isIntersecting)&&r===`ready`&&(s=!0,(i?i(e.entryId,e.contentIndex):uP.image(e.entryId,e.contentIndex,n)).then(e=>{t||(a=URL.createObjectURL(new Blob([e.bytes],{type:e.mimeType})),o(a),c(``))}).catch(()=>{t||c(z()(`image.loadFailed`))}))});return m.current&&l.observe(m.current),()=>{t=!0,l.disconnect(),a&&URL.revokeObjectURL(a)}},[n,r,e.entryId,e.contentIndex,d,i]),(0,A.jsxs)(`div`,{ref:m,className:`max-w-full`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":t(`image.view`,{name:e.name}),className:`focus-neko max-w-full rounded-xl border border-sakura-200 p-1`,onClick:()=>{s?(c(``),p(d+1)):a&&u(!0)},children:a?(0,A.jsx)(`img`,{src:a,alt:e.name,className:`max-h-40 max-w-full rounded-lg object-contain`}):(0,A.jsx)(`span`,{className:`text-sm`,children:s||t(`image.loading`)})}),l&&a&&(0,A.jsxs)(UR,{title:e.name,onClose:()=>u(!1),children:[(0,A.jsx)(`div`,{className:`min-h-0 overflow-auto bg-surface p-3 sm:p-4`,children:(0,A.jsx)(`img`,{src:a,alt:e.name,className:`max-h-[65dvh] w-full rounded-lg object-contain`})}),(0,A.jsx)(`div`,{className:`flex shrink-0 justify-end border-t border-sakura-200 bg-surface px-4 py-3`,children:(0,A.jsxs)(`a`,{href:a,download:e.name,className:`btn-primary focus-neko inline-flex min-h-10 items-center gap-2 rounded-full px-5 py-2 text-sm font-medium no-underline`,children:[(0,A.jsx)(`svg`,{"aria-hidden":`true`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:(0,A.jsx)(`path`,{d:`M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4`})}),t(`image.save`)]})})]})]})}function cH({images:e}){return(0,A.jsx)(`div`,{className:`my-2 flex flex-wrap gap-2`,children:e.map(e=>(0,A.jsx)(sH,{image:e},`${e.entryId}:${e.contentIndex}`))})}function lH({text:e,jobId:t,job:n}){let r=B(),{head:i,command:a,output:o}=Dz(e),s=o===void 0?void 0:Pz(o),c=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`font-medium text-tianyi-700`,children:r(`job.reportTitle`,{id:t})}),(0,A.jsx)(`span`,{className:`min-w-0 break-words text-ink-700`,children:i.replace(/^\[|\]$/g,``)}),n&&(0,A.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2 text-ink-600`,children:r(`job.reportCurrent`,{status:jz(n,Date.now())})})]});return(0,A.jsx)(`div`,{className:`chat-row anim-other`,"data-job-report":t,children:(0,A.jsx)(`div`,{className:`min-w-0 rounded-xl border border-sakura-200 bg-surface px-3 py-2 text-xs`,children:s===void 0?(0,A.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:c}):(0,A.jsxs)(`details`,{children:[(0,A.jsx)(`summary`,{className:`focus-neko flex cursor-pointer flex-wrap items-center gap-x-2 gap-y-1`,children:c}),a!==void 0&&(0,A.jsxs)(`code`,{className:`mt-2 block whitespace-pre-wrap break-all text-ink-600`,children:[`$ `,a]}),(0,A.jsx)(`pre`,{className:`mt-1 max-h-72 overflow-auto whitespace-pre-wrap break-words font-mono text-ink-800`,children:s})]})})})}function uH(e,t){this.v=e,this.k=t}function dH(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 fH(e){if(Array.isArray(e))return e}function pH(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){if(Object(n)!==n)return;c=!1}else 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 mH(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
127
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hH(e,t){return fH(e)||pH(e,t)||gH(e,t)||mH()}function gH(e,t){if(e){if(typeof e==`string`)return dH(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)?dH(e,t):void 0}}function _H(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof uH;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}_H.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},_H.prototype.next=function(e){return this._invoke(`next`,e)},_H.prototype.throw=function(e){return this._invoke(`throw`,e)},_H.prototype.return=function(e){return this._invoke(`return`,e)};var vH=Object.entries,yH=Object.setPrototypeOf,bH=Object.isFrozen,xH=Object.getPrototypeOf,SH=Object.getOwnPropertyDescriptor,CH=Object.freeze,wH=Object.seal,TH=Object.create,EH=typeof Reflect<`u`&&Reflect,DH=EH.apply,OH=EH.construct;CH||=function(e){return e},wH||=function(e){return e},DH||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},OH||=function(e){return new e(...[...arguments].slice(1))};var kH=YH(Array.prototype.forEach);Array.prototype.indexOf;var AH=YH(Array.prototype.lastIndexOf),jH=YH(Array.prototype.pop),MH=YH(Array.prototype.push);Array.prototype.slice;var NH=YH(Array.prototype.splice),PH=Array.isArray,FH=YH(String.prototype.toLowerCase),IH=YH(String.prototype.toString),LH=YH(String.prototype.match),RH=YH(String.prototype.replace),zH=YH(String.prototype.indexOf),BH=YH(String.prototype.trim),VH=YH(Number.prototype.toString),HH=YH(Boolean.prototype.toString),UH=typeof BigInt>`u`?null:YH(BigInt.prototype.toString),WH=typeof Symbol>`u`?null:YH(Symbol.prototype.toString),GH=YH(Object.prototype.hasOwnProperty),KH=YH(Object.prototype.toString),qH=YH(RegExp.prototype.test),JH=XH(TypeError);function YH(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return DH(e,t,n)}}function XH(e){return function(){return OH(e,[...arguments])}}function ZH(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:FH;if(yH&&yH(e,null),!PH(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(bH(t)||(t[r]=e),i=e)}e[i]=!0}return e}function QH(e){for(let t=0;t<e.length;t++)GH(e,t)||(e[t]=null);return e}function $H(e){let t=TH(null);for(let r of vH(e)){var n=hH(r,2);let i=n[0],a=n[1];GH(e,i)&&(t[i]=PH(a)?QH(a):a&&typeof a==`object`&&a.constructor===Object?$H(a):a)}return t}function eU(e){switch(typeof e){case`string`:return e;case`number`:return VH(e);case`boolean`:return HH(e);case`bigint`:return UH?UH(e):`0`;case`symbol`:return WH?WH(e):`Symbol()`;case`undefined`:return KH(e);case`function`:case`object`:{if(e===null)return KH(e);let t=e,n=tU(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:KH(e)}return KH(e)}default:return KH(e)}}function tU(e,t){for(;e!==null;){let n=SH(e,t);if(n){if(n.get)return YH(n.get);if(typeof n.value==`function`)return YH(n.value)}e=xH(e)}function n(){return null}return n}function nU(e){try{return qH(e,``),!0}catch{return!1}}var rU=CH(`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(`.`)),iU=CH(`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(`.`)),aU=CH([`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`]),oU=CH([`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`]),sU=CH(`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(`.`)),cU=CH([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),lU=CH([`#text`]),uU=CH(`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(`.`)),dU=CH(`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.pointer-events.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.vector-effect.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(`.`)),fU=CH(`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(`.`)),pU=CH([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),mU=wH(/{{[\w\W]*|^[\w\W]*}}/g),hU=wH(/<%[\w\W]*|^[\w\W]*%>/g),gU=wH(/\${[\w\W]*/g),_U=wH(/^data-[\-\w.\u00B7-\uFFFF]+$/),vU=wH(/^aria-[\-\w]+$/),yU=wH(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bU=wH(/^(?:\w+script|data):/i),xU=wH(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),SU=wH(/^html$/i),CU=wH(/^[a-z][.\w]*(-[.\w]+)+$/i),wU=wH(/<[/\w!]/g),TU=wH(/<[/\w]/g),EU=wH(/<\/no(script|embed|frames)/i),DU=wH(/\/>/i),OU={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},kU=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],AU=CH(ZH({},kU)),jU=function(){let e={};return kH(kU,t=>{e[t]=wH(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),CH(e)}(),MU=function(){return typeof window>`u`?null:window},NU=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}},PU=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},FU=function(e,t,n,r){return GH(e,t)&&PH(e[t])?ZH(r.base?$H(r.base):{},e[t],r.transform):n},IU=function(e,t,n){let r=GH(e,t)?e[t]:void 0;return r&&typeof r==`object`?$H(r):n()};function LU(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MU(),t=e=>LU(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==OU.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=tU(d,`cloneNode`),p=tU(d,`remove`),m=tU(d,`removeAttributeNode`),h=tU(d,`nextSibling`),g=tU(d,`childNodes`),_=tU(d,`parentNode`),v=tU(d,`shadowRoot`),y=tU(d,`attributes`),b=o&&o.prototype?tU(o.prototype,`nodeType`):null,x=o&&o.prototype?tU(o.prototype,`nodeName`):null,S=o&&o.prototype?tU(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,ee=``,te,ne=!1,re=0,E=function(){if(re>0)throw JH(`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.`)},ie=function(e){E(),re++;try{return T.createHTML(e)}finally{re--}},ae=function(e){E(),re++;try{return T.createScriptURL(e)}finally{re--}},oe=function(){return ne||=(te=NU(u,i),!0),te},D=n,se=D.implementation,ce=D.createNodeIterator,le=D.createDocumentFragment,ue=D.getElementsByTagName,de=r.importNode,fe=PU();t.isSupported=typeof vH==`function`&&typeof _==`function`&&se&&se.createHTMLDocument!==void 0;let pe=mU,me=hU,he=gU,ge=_U,_e=vU,ve=bU,ye=xU,be=CU,O=yU,k=null,xe=ZH({},[...rU,...iU,...aU,...sU,...lU]),Se=null,Ce=ZH({},[...uU,...dU,...fU,...pU]),we=Object.seal(TH(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}})),Te=null,Ee=null,De=Object.seal(TH(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Oe=!0,ke=!0,Ae=!1,je=!0,Me=!1,Ne=!0,Pe=!1,Fe=!1,Ie=null,Le=null,Re=!1,ze=!1,Be=!1,Ve=!1,He=!0,Ue=!1,We=`user-content-`,Ge=!0,Ke=!1,qe={},Je=null,Ye=ZH({},`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(`.`)),Xe=null,Ze=ZH({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Qe=null,$e=ZH({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),et=`http://www.w3.org/1998/Math/MathML`,tt=`http://www.w3.org/2000/svg`,nt=`http://www.w3.org/1999/xhtml`,rt=nt,it=!1,at=null,ot=ZH({},[et,tt,nt],IH),st=CH([`mi`,`mo`,`mn`,`ms`,`mtext`]),ct=ZH({},st),lt=CH([`annotation-xml`]),ut=ZH({},lt),dt=ZH({},[`title`,`style`,`font`,`a`,`script`]),ft=null,pt=[`application/xhtml+xml`,`text/html`],mt=null,ht=null,gt=n.createElement(`form`),_t=function(e){return e instanceof RegExp||e instanceof Function},vt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ht&&ht===e)return;(!e||typeof e!=`object`)&&(e={}),e=$H(e),ft=pt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,mt=ft===`application/xhtml+xml`?IH:FH,k=FU(e,`ALLOWED_TAGS`,xe,{transform:mt}),Se=FU(e,`ALLOWED_ATTR`,Ce,{transform:mt}),at=FU(e,`ALLOWED_NAMESPACES`,ot,{transform:IH}),Qe=FU(e,`ADD_URI_SAFE_ATTR`,$e,{transform:mt,base:$e}),Xe=FU(e,`ADD_DATA_URI_TAGS`,Ze,{transform:mt,base:Ze}),Je=FU(e,`FORBID_CONTENTS`,Ye,{transform:mt}),Te=FU(e,`FORBID_TAGS`,$H({}),{transform:mt}),Ee=FU(e,`FORBID_ATTR`,$H({}),{transform:mt}),qe=GH(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?$H(e.USE_PROFILES):e.USE_PROFILES:!1,Oe=e.ALLOW_ARIA_ATTR!==!1,ke=e.ALLOW_DATA_ATTR!==!1,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,je=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Me=e.SAFE_FOR_TEMPLATES||!1,Ne=e.SAFE_FOR_XML!==!1,Pe=e.WHOLE_DOCUMENT||!1,ze=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,Ve=e.RETURN_TRUSTED_TYPE||!1,Re=e.FORCE_BODY||!1,He=e.SANITIZE_DOM!==!1,Ue=e.SANITIZE_NAMED_PROPS||!1,Ge=e.KEEP_CONTENT!==!1,Ke=e.IN_PLACE||!1,O=nU(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:yU,rt=typeof e.NAMESPACE==`string`?e.NAMESPACE:nt,ct=IU(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>ZH({},st)),ut=IU(e,`HTML_INTEGRATION_POINTS`,()=>ZH({},lt));let t=IU(e,`CUSTOM_ELEMENT_HANDLING`,()=>TH(null));if(we=TH(null),GH(t,`tagNameCheck`)&&_t(t.tagNameCheck)&&(we.tagNameCheck=t.tagNameCheck),GH(t,`attributeNameCheck`)&&_t(t.attributeNameCheck)&&(we.attributeNameCheck=t.attributeNameCheck),GH(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(we.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),wH(we),Me&&(ke=!1),Be&&(ze=!0),qe&&(k=ZH({},lU),Se=TH(null),qe.html===!0&&(ZH(k,rU),ZH(Se,uU)),qe.svg===!0&&(ZH(k,iU),ZH(Se,dU),ZH(Se,pU)),qe.svgFilters===!0&&(ZH(k,aU),ZH(Se,dU),ZH(Se,pU)),qe.mathMl===!0&&(ZH(k,sU),ZH(Se,fU),ZH(Se,pU))),De.tagCheck=null,De.attributeCheck=null,GH(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?De.tagCheck=e.ADD_TAGS:PH(e.ADD_TAGS)&&(k===xe&&(k=$H(k)),ZH(k,e.ADD_TAGS,mt))),GH(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?De.attributeCheck=e.ADD_ATTR:PH(e.ADD_ATTR)&&(Se===Ce&&(Se=$H(Se)),ZH(Se,e.ADD_ATTR,mt))),GH(e,`ADD_FORBID_CONTENTS`)&&PH(e.ADD_FORBID_CONTENTS)&&(Je===Ye&&(Je=$H(Je)),ZH(Je,e.ADD_FORBID_CONTENTS,mt)),Ge&&(k[`#text`]=!0),Pe&&ZH(k,[`html`,`head`,`body`]),k.table&&(ZH(k,[`tbody`]),delete Te.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw JH(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw JH(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{ee=ie(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,ee=``):(T===void 0&&(T=oe()),T&&typeof ee==`string`&&(ee=ie(``)));CH&&CH(e),ht=e},yt=ZH({},[...iU,...aU,...oU]),bt=ZH({},[...sU,...cU]),xt=function(e,t,n){return t.namespaceURI===nt?e===`svg`:t.namespaceURI===et?e===`svg`&&(n===`annotation-xml`||ct[n]):!!yt[e]},St=function(e,t,n){return t.namespaceURI===nt?e===`math`:t.namespaceURI===tt?e===`math`&&ut[n]:!!bt[e]},Ct=function(e,t,n){return t.namespaceURI===tt&&!ut[n]||t.namespaceURI===et&&!ct[n]?!1:!bt[e]&&(dt[e]||!yt[e])},wt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:rt,tagName:`template`});let n=FH(e.tagName),r=FH(t.tagName);return at[e.namespaceURI]?e.namespaceURI===tt?xt(n,t,r):e.namespaceURI===et?St(n,t,r):e.namespaceURI===nt?Ct(n,t,r):!!(ft===`application/xhtml+xml`&&at[e.namespaceURI]):!1},Tt=function(e){MH(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw JH(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Et=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Dt=function(e){At(e);let t=g(e);if(t){let e=[];kH(t,t=>{MH(e,t)}),kH(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Et(e,r,i)}},Ot=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}MH(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(ze||Be)try{Tt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},kt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||Se[mt(i)]||Et(e,r,i)}},At=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===OU.element&&kt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},jt=function(e,t){return Ne?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Mt=function(e){if(!Ne)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===OU.processingInstruction||n===OU.comment&&qH(TU,e.data)){try{p(e)}catch{}continue}if(n===OU.element){let t=e,n=mt(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&jt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Nt=function(e){let t=null,r=null;if(Re)e=`<remove></remove>`+e;else{let t=LH(e,/^[\r\n\t ]+/);r=t&&t[0]}ft===`application/xhtml+xml`&&rt===nt&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?ie(e):e;if(rt===nt)try{t=new l().parseFromString(i,ft)}catch{}if(!t||!t.documentElement){t=se.createDocument(rt,`template`,null);try{t.documentElement.innerHTML=it?ee:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),rt===nt?ue.call(t,Pe?`html`:`body`)[0]:Pe?t.documentElement:a},Pt=function(e){let t=S?S(e):e.ownerDocument;return ce.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ft=function(e){return e=RH(e,pe,` `),e=RH(e,me,` `),e=RH(e,he,` `),e},It=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ce.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Ft(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&kH(i,e=>{Rt(e.content)&&It(e.content)})},Lt=function(e){let t=x?x(e):null;return typeof t!=`string`||mt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Rt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===OU.documentFragment}catch{return!1}},zt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Bt(e,n,r){e.length!==0&&kH(e,e=>{e.call(t,n,r,ht)})}let Vt=function(e,t){return!!(Ne&&e.hasChildNodes()&&!zt(e.firstElementChild)&&qH(wU,e.textContent)&&qH(wU,e.innerHTML)||Ne&&e.namespaceURI===nt&&AU[t]&&(zt(e.firstElementChild)||typeof e.textContent==`string`&&qH(jU[t],e.textContent))||e.nodeType===OU.processingInstruction||Ne&&e.nodeType===OU.comment&&qH(TU,e.data))},Ht=function(e,t){return e instanceof RegExp?qH(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Ut=function(e,t,n){if(!Te[t]&&Yt(t)&&Ht(we.tagNameCheck,t))return!1;if(Ge&&!Je[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Tt(e),!0},Wt=function(e,t,n,r){return e.length===0?t:t===n||t===r?$H(t):t},Gt=function(e,t){return e===t||_(e)!==null?!1:(Ke&&At(e),!0)},Kt=function(e,n){if(Bt(fe.beforeSanitizeElements,e,null),Gt(e,n))return!0;if(Lt(e))return Tt(e),!0;let r=mt(w(e));if(k=Wt(fe.uponSanitizeElement,k,xe,Ie),Bt(fe.uponSanitizeElement,e,{tagName:r,allowedTags:k}),Gt(e,n))return!0;if(Vt(e,r))return Tt(e),!0;if(Te[r]||!(De.tagCheck instanceof Function&&De.tagCheck(r))&&!k[r]){let t=Ut(e,r,n);return t===!1&&(Bt(fe.afterSanitizeElements,e,null),Gt(e,n))?!0:t}if(C(e)===OU.element&&!wt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&qH(EU,e.innerHTML))return Tt(e),!0;if(Me&&e.nodeType===OU.text){let n=Ft(e.textContent);e.textContent!==n&&(MH(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Bt(fe.afterSanitizeElements,e,null),Gt(e,n)},qt=function(e,t,r){if(Ee[t]||jt(t,e)||He&&(t===`id`||t===`name`)&&(r in n||r in gt))return!1;let i=Se[t]||De.attributeCheck instanceof Function&&De.attributeCheck(t,e);return ke&&qH(ge,t)||Oe&&qH(_e,t)?!0:i?Qe[t]||qH(O,RH(r,ye,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&zH(r,`data:`)===0&&Xe[e]||Ae&&!qH(ve,RH(r,ye,``))?!0:!r:Yt(e)&&Ht(we.tagNameCheck,e)&&Ht(we.attributeNameCheck,t,e)||t===`is`&&we.allowCustomizedBuiltInElements&&Ht(we.tagNameCheck,r)},Jt=ZH({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Yt=function(e){return!Jt[FH(e)]&&qH(be,e)},Xt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ie(r);case`TrustedScriptURL`:return ae(r)}return r},Zt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Lt(e)||(Tt(e),!1)}catch{return Ot(t,e),!1}},Qt=function(e,n){if(Bt(fe.beforeSanitizeAttributes,e,null),Gt(e,n))return;let r=e.attributes;if(!r||Lt(e))return;Se=Wt(fe.uponSanitizeAttribute,Se,Ce,Le);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:Se,forceKeepAttr:void 0},a=r.length,o=mt(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=mt(s),d=l,f=s===`value`?d:BH(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Bt(fe.uponSanitizeAttribute,e,i),f=i.attrValue,Ue&&(u===`id`||u===`name`)&&zH(f,We)!==0&&(Ot(s,e,n),f=We+f,p=!0),Ne&&qH(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||u===`attributename`&&LH(f,`href`)?Ot(s,e,n):i.forceKeepAttr||(i.keepAttr?!je&&qH(DU,f)?Ot(s,e,n):(Me&&(f=Ft(f)),qt(o,u,f)?(f=Xt(o,u,c,f),f!==d&&Zt(e,s,c,f)&&p&&jH(t.removed)):Ot(s,e,n)):Ot(s,e,n))}Bt(fe.afterSanitizeAttributes,e,null),Gt(e,n)},$t=function(e){let t=null,n=Pt(e);for(Bt(fe.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Bt(fe.uponSanitizeShadowNode,t,null),Kt(t,e),Qt(t,e),Rt(t.content)&&$t(t.content),C(t)===OU.element){let e=v(t);Rt(e)&&(en(e),$t(e))}Bt(fe.afterSanitizeShadowDOM,e,null)},en=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){$t(e.shadow);continue}let n=e.node,r=C(n)===OU.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&mt(e)===`template`){let e=n.content;Rt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Rt(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(it=!e,it&&(e=`<!-->`),typeof e!=`string`&&!zt(e)&&(e=eU(e),typeof e!=`string`))throw JH(`dirty is not a string, aborting`);if(!t.isSupported)return e;Fe?(k=Ie,Se=Le):vt(n),(fe.uponSanitizeElement.length>0||fe.uponSanitizeAttribute.length>0)&&(k=$H(k)),fe.uponSanitizeAttribute.length>0&&(Se=$H(Se)),t.removed=[];let c=Ke&&typeof e!=`string`&&zt(e);if(c){Mt(e);let t=w(e);if(typeof t==`string`){let n=mt(t);if(!k[n]||Te[n])throw Dt(e),JH(`root node is forbidden and cannot be sanitized in-place`)}if(Lt(e))throw Dt(e),JH(`root node is clobbered and cannot be sanitized in-place`);try{en(e)}catch(t){throw Dt(e),t}}else if(zt(e))i=Nt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===OU.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),en(i);else{if(!ze&&!Me&&!Pe&&e.indexOf(`<`)===-1)return T&&Ve?ie(e):e;if(i=Nt(e),!i)return ze?null:Ve?ee:``}i&&Re&&Tt(i.firstChild);let l=c?e:i;try{let e=Pt(l);for(;o=e.nextNode();)Kt(o,l),Qt(o,l),Rt(o.content)&&$t(o.content)}catch(n){throw c&&(Dt(e),kH(t.removed,e=>{e.element&&At(e.element)})),n}if(c){let n=!1;if(kH(t.removed,t=>{t.element&&(t.element===e&&(n=!0),At(t.element))}),n)throw JH(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Me&&It(e),e}if(ze){if(Me&&It(i),Be)for(s=le.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(Se.shadowroot||Se.shadowrootmode)&&(s=de.call(r,s,!0)),s}let u=Pe?i.outerHTML:i.innerHTML;return Pe&&k[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&qH(SU,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
128
+ `+u),Me&&(u=Ft(u)),T&&Ve?ie(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vt(e),Fe=!0,Ie=k,Le=Se},t.clearConfig=function(){ht=null,Fe=!1,Ie=null,Le=null,T=te,ee=``},t.isValidAttribute=function(e,t,n){ht||vt({});let r=mt(e),i=mt(t);return qt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&GH(fe,e)&&MH(fe[e],t)},t.removeHook=function(e,t){if(GH(fe,e)){if(t!==void 0){let n=AH(fe[e],t);return n===-1?void 0:NH(fe[e],n,1)[0]}return jH(fe[e])}},t.removeHooks=function(e){GH(fe,e)&&(fe[e]=[])},t.removeAllHooks=function(){fe=PU()},t}var RU=LU(),zU=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=new RegExp(y(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],(e[0]===`(`||/^\(\?[<']/.test(e[0]))&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,ee=`[a-zA-Z_]\\w*`,te=`\\b\\d+(\\.\\d+)?`,ne=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,re=`\\b(0b[01]+)`,E=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,ie=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},ae={begin:`\\\\[\\s\\S]`,relevance:0},oe={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[ae]},D={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[ae]},se={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ce=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},le=ce(`//`,`$`),ue=ce(`/\\*`,`\\*/`),de=ce(`#`,`$`),fe=Object.freeze({__proto__:null,APOS_STRING_MODE:oe,BACKSLASH_ESCAPE:ae,BINARY_NUMBER_MODE:{scope:`number`,begin:re,relevance:0},BINARY_NUMBER_RE:re,COMMENT:ce,C_BLOCK_COMMENT_MODE:ue,C_LINE_COMMENT_MODE:le,C_NUMBER_MODE:{scope:`number`,begin:ne,relevance:0},C_NUMBER_RE:ne,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:de,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:te,relevance:0},NUMBER_RE:te,PHRASAL_WORDS_MODE:se,QUOTE_STRING_MODE:D,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ae,{begin:/\[/,end:/\]/,relevance:0,contains:[ae]}]},RE_STARTERS_RE:E,SHEBANG:ie,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:ee,relevance:0}});function pe(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function me(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function he(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=pe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ge(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function _e(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ve(e,t){e.relevance===void 0&&(e.relevance=1)}var ye=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},be=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],O=`keyword`;function k(e,t,n=O){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,k(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,xe(n[0],n[1])]})}}function xe(e,t){return t?Number(t):+!Se(e)}function Se(e){return be.includes(e.toLowerCase())}var Ce={},we=e=>{console.error(e)},Te=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ee=(e,t)=>{Ce[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Ce[`${e}/${t}`]=!0)},De=Error();function Oe(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function ke(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw we(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),De;if(typeof e.beginScope!=`object`||e.beginScope===null)throw we(`beginScope must be object`),De;Oe(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Ae(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw we(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),De;if(typeof e.endScope!=`object`||e.endScope===null)throw we(`endScope must be object`),De;Oe(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function je(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Me(e){je(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),ke(e),Ae(e)}function Ne(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[me,_e,Me,ye].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[he,ge,ve].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=k(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Fe(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Pe(e){return e?e.endsWithParent||Pe(e.starts):!1}function Fe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Pe(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Ie=`11.12.0`,Le=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Re=i,ze=a,Be=Symbol(`nomatch`),Ve=7,He=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=oe(n[1]);return t||(Te(s.replace(`{}`,n[1])),Te(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||oe(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(Ee(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),Ee(`10.7.0`,`Please use highlight(code, options) instead.
129
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};de(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,de(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!E.keywords){ae.addText(D);return}let e=0;E.keywordPatternRe.lastIndex=0;let t=E.keywordPatternRe.exec(D),n=``;for(;t;){n+=D.substring(e,t.index);let r=te.case_insensitive?t[0].toLowerCase():t[0],i=u(E,r);if(i){let[e,a]=i;if(ae.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Ve&&(se+=a),e.startsWith(`_`))n+=t[0];else{let n=te.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=E.keywordPatternRe.lastIndex,t=E.keywordPatternRe.exec(D)}n+=D.substring(e),ae.addText(n)}function f(){if(D===``)return;let e=null;if(typeof E.subLanguage==`string`){if(!t[E.subLanguage]){ae.addText(D);return}e=v(E.subLanguage,D,!0,ie[E.subLanguage]),ie[E.subLanguage]=e._top}else e=S(D,E.subLanguage.length?E.subLanguage:null);E.relevance>0&&(se+=e.relevance),ae.__addSublanguage(e._emitter,e.language)}function p(){E.subLanguage==null?d():f(),D=``}function m(e,t){e!==``&&(ae.startScope(t),ae.addText(e),ae.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=te.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(D=i,d(),D=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&ae.openNode(te.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(D,te.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),D=``):e.beginScope._multi&&(h(e.beginScope,t),D=``)),E=Object.create(e,{parent:{value:E}}),E}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return E.matcher.regexIndex===0?(D+=e[0],1):(ue=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?D+=t:(n.excludeBegin&&(D+=t),p(),!n.returnBegin&&!n.excludeBegin&&(D=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(E,e,r);if(!i)return Be;let a=E;E.endScope&&E.endScope._wrap?(p(),m(t,E.endScope._wrap)):E.endScope&&E.endScope._multi?(p(),h(E.endScope,e)):a.skip?D+=t:(a.returnEnd||a.excludeEnd||(D+=t),p(),a.excludeEnd&&(D=t));do E.scope&&ae.closeNode(),!E.skip&&!E.subLanguage&&(se+=E.relevance),E=E.parent;while(E!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=E;t!==te;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>ae.openNode(e))}let T={};function ee(t,r){let a=r&&r[0];if(D+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(D+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(E.scope||`<unnamed>`)+`"`);throw e.mode=E,e}if(r.type===`end`){let e=C(r);if(e!==Be)return e}if(r.type===`illegal`&&a===``)return r.index===n.length||(D+=`
130
+ `),1;if(le>1e5&&le>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return D+=a,a.length}let te=oe(e);if(!te)throw we(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let ne=Ne(te),re=``,E=a||ne,ie={},ae=new l.__emitter(l);w();let D=``,se=0,ce=0,le=0,ue=!1;try{if(te.__emitTokens)te.__emitTokens(n,ae);else{for(E.matcher.considerAll();;){le++,ue?ue=!1:E.matcher.considerAll(),E.matcher.lastIndex=ce;let e=E.matcher.exec(n);if(!e)break;let t=ee(n.substring(ce,e.index),e);ce=e.index+t}ee(n.substring(ce))}return ae.finalize(),re=ae.toHTML(),{language:e,value:re,relevance:se,illegal:!1,_emitter:ae,_top:E}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Re(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:ce,context:n.slice(ce-100,ce+100),mode:t.mode,resultSoFar:re},_emitter:ae};if(o)return{language:e,value:Re(n),illegal:!1,relevance:0,errorRaised:t,_emitter:ae,_top:E};throw t}}function b(e){let t={value:Re(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(oe).filter(se).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(oe(e.language).supersetOf===t.language)return 1;if(oe(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(de(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Le(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),de(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=ze(l,e)}let ee=()=>{re(),Ee(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function te(){re(),Ee(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let ne=!1;function re(){function e(){re()}document.readyState===`loading`?(ne||window.addEventListener(`DOMContentLoaded`,e,!1),ne=!0):document.querySelectorAll(l.cssSelector).forEach(w)}function E(n,r){let i=null;try{i=r(e)}catch(e){if(we(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)we(e);else throw e;i=c}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&D(i.aliases,{languageName:n})}function ie(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function ae(){return Object.keys(t)}function oe(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function D(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function se(e){let t=oe(e);return t&&!t.disableAutodetect}function ce(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function le(e){ce(e),a.push(e)}function ue(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function de(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function pe(e){return Ee(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),Ee(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:re,highlightElement:w,highlightBlock:pe,configure:T,initHighlighting:ee,initHighlightingOnLoad:te,registerLanguage:E,unregisterLanguage:ie,listLanguages:ae,getLanguage:oe,registerAliases:D,autoDetection:se,inherit:ze,addPlugin:le,removePlugin:ue}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Ie,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in fe)typeof fe[e]==`object`&&n(fe[e]);return Object.assign(e,fe),e},Ue=He({});Ue.newInstance=()=>He({}),t.exports=Ue,Ue.HighlightJS=Ue,Ue.default=Ue}))()).default;function BU(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function VU(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,variants:[{begin:`\\b[a-z\\d_]*_t\\b`},{match:t.concat(/\batomic_/,t.either(`bool`,`char`,`schar`,`uchar`,`short`,`ushort`,`int`,`uint`,`long`,`ulong`,`llong`,`ullong`,`char16_t`,`char32_t`,`wchar_t`,`int_least8_t`,`uint_least8_t`,`int_least16_t`,`uint_least16_t`,`int_least32_t`,`uint_least32_t`,`int_least64_t`,`uint_least64_t`,`int_fast8_t`,`uint_fast8_t`,`int_fast16_t`,`uint_fast16_t`,`int_fast32_t`,`uint_fast32_t`,`int_fast64_t`,`uint_fast64_t`,`intptr_t`,`uintptr_t`,`size_t`,`ptrdiff_t`,`intmax_t`,`uintmax_t`),/\b/)}]},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},s={className:`number`,variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={scope:`meta`,begin:/#\s*include\b/,end:/$/,keywords:{keyword:`include`},contains:[{begin:/\\\n/},o,{scope:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),n,e.C_BLOCK_COMMENT_MODE]},u=[c,l],d={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},f=t.optional(r)+e.IDENT_RE+`\\s*\\(`,p={keyword:`asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma`.split(`.`),type:`float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary`.split(`.`),literal:`true false NULL`,built_in:`std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr`},m=[...u,a,n,e.C_BLOCK_COMMENT_MODE,s,o],h={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:p,contains:m.concat([{begin:/\(/,end:/\)/,keywords:p,contains:m.concat([`self`]),relevance:0}]),relevance:0},g={begin:`(`+i+`[\\*&\\s]+){1,12}`+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:p,relevance:0},{begin:f,returnBegin:!0,contains:[e.inherit(d,{className:`title.function`})],relevance:0},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,...u]};return{name:`C`,aliases:[`h`],keywords:p,disableAutodetect:!0,illegal:`</`,contains:[].concat(h,g,m,[...u,{begin:e.IDENT_RE+`::`,keywords:p},{className:`class`,beginKeywords:`enum class struct union`,end:/[{;:<>=]/,contains:[{beginKeywords:`final class struct`},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:o,keywords:p}}}function HU(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(?!struct)(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},s={className:`number`,variants:[{begin:`[+-]?(?:(?:\\b[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|\\b[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|\\b0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},c=[{scope:`meta`,begin:/#\s*include\b/,end:/$/,keywords:{keyword:`include`},contains:[{begin:/\\\n/},o,{scope:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),n,e.C_BLOCK_COMMENT_MODE]}],l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),f=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],p=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),m=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),h={type:f,keyword:d,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:p},g={className:`function.dispatch`,relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,`(?!${d.join(`|`)})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[g,...c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:h,contains:_.concat([{begin:/\(/,end:/\)/,keywords:h,contains:_.concat([`self`]),relevance:0}]),relevance:0},y={className:`function`,begin:`(`+i+`[\\*&\\s]+){1,12}`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[l],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,s]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,...c]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:h,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(v,y,g,_,[...c,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:h,contains:[`self`,a]},{begin:e.IDENT_RE+`::`,keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}var UU=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:`number`,begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),WU=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),GU=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),KU=[...WU,...GU],qU=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),JU=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),YU=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),XU=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.corner-bottom-left-shape.corner-bottom-right-shape.corner-shape.corner-top-left-shape.corner-top-right-shape.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.unicode-range.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function ZU(e){let t=e.regex,n=UU(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+JU.join(`|`)+`)`},{begin:`:(:)?(`+YU.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+XU.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:qU.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+KU.join(`|`)+`)\\b`}]}}function QU(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function $U(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\b0[bB](_?[01])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}function eW(e){let t=e.regex,n={className:`number`,relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:`variable`,variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:`literal`,begin:/\bon|off|true|false|yes|no\b/},o={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:`'''`,end:`'''`,relevance:10},{begin:`"""`,end:`"""`,relevance:10},{begin:`"`,end:`"`},{begin:`'`,end:`'`}]},s={begin:/\[/,end:/\]/,contains:[r,a,i,o,n,`self`],relevance:0},c=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:`TOML, also INI`,aliases:[`toml`],case_insensitive:!0,illegal:/\S/,contains:[r,{className:`section`,begin:/\[+/,end:/\]+/},{begin:t.concat(c,`(\\s*\\.\\s*`,c,`)*`,t.lookahead(/\s*=\s*[^#\s]/)),className:`attr`,starts:{end:/$/,contains:[r,s,a,i,o,n]}}]}}var tW=`[0-9](_*[0-9])*`,nW=`\\.(${tW})`,rW=`[0-9a-fA-F](_*[0-9a-fA-F])*`,iW={className:`number`,variants:[{begin:`(\\b(${tW})((${nW})|\\.)?|(${nW}))[eE][+-]?(${tW})[fFdD]?\\b`},{begin:`\\b(${tW})((${nW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${nW})[fFdD]?\\b`},{begin:`\\b(${tW})[fFdD]\\b`},{begin:`\\b0[xX]((${rW})\\.?|(${rW})?\\.(${rW}))[pP][+-]?(${tW})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${rW})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function aW(e,t,n){return n===-1?``:e.replace(t,r=>aW(e,t,n-1))}function oW(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=`(?:(?:\\s*\\[\\s*])+)?`,i=`(?:\\?(?:\\s+(?:extends|super)\\s+[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*<@@@>(?:(?:\\s*\\[\\s*])+)?)?|[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*<@@@>(?:(?:\\s*\\[\\s*])+)?)`,a=aW(`(?:\\s*<\\s*`+i+`(?:\\s*,\\s*`+i+`)*\\s*>)?`,/<@@@>/g,2),o={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},s={className:`meta`,begin:`@`+n,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},c={className:`params`,begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:o,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{beginKeywords:`new throw return else yield assert`,relevance:0},{begin:[n,t.concat(a,r,/\s+/),n,r,/\s*/,/=(?!=)/],className:{1:`type`,3:`variable`,6:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[c,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{begin:[n,t.concat(a,r,/\s+/),n,/\s*(?=\()/],className:{1:`type`,3:`title.function`},keywords:o,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,iW,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},iW,s]}}var sW=`[A-Za-z$_][0-9A-Za-z$_]*`,cW=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),lW=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],uW=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),dW=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],fW=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],pW=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],mW=[].concat(fW,uW,dW);function hW(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=sW,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);((a=o.match(/^\s*=/))||(a=o.match(/^\s+extends\s+/))&&a.index===0)&&t.ignoreMatch()}},s={$pattern:sW,keyword:cW,literal:lW,built_in:mW,"variable.language":pW},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...uW,...dW]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function te(e){return t.concat(`(?!`,e.join(`|`),`)`)}let ne={match:t.concat(/\b/,te([...fW,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},re={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},E={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ie=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,ae={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ie)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},ae,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ie,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},re,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},ne,ee,S,E,{match:/\$[(.]/}]}}var gW={scope:`number`,match:`([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity`,relevance:0};function _W(e){let t={className:`attr`,begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`,`json5`],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,gW,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function vW(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,r,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function yW(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.lazy.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.aiter.all.anext.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozendict.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.sentinel.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function bW(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={scope:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!(?:let|for|while|if|else|match)\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(16|32|64|128))?`,s=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.raw.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f16`,`f32`,`f64`,`f128`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|"|\\|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{scope:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/\bsafe/,/\s+/,/extern/],scope:{1:`keyword`,3:`keyword`}},{begin:[/fn/,/\s+/,r],scope:{1:`keyword`,3:`title.function`}},{scope:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{scope:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],scope:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],scope:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{scope:`punctuation`,begin:`->`},a]}}function xW(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var SW=`[A-Za-z$_][0-9A-Za-z$_]*`,CW=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),wW=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],TW=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),EW=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],DW=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],OW=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],kW=[].concat(DW,TW,EW);function AW(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=SW,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);((a=o.match(/^\s*=/))||(a=o.match(/^\s+extends\s+/))&&a.index===0)&&t.ignoreMatch()}},s={$pattern:SW,keyword:CW,literal:wW,built_in:kW,"variable.language":OW},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...TW,...EW]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function te(e){return t.concat(`(?!`,e.join(`|`),`)`)}let ne={match:t.concat(/\b/,te([...DW,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},re={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},E={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ie=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,ae={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ie)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},ae,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ie,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},re,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},ne,ee,S,E,{match:/\$[(.]/}]}}function jW(e){let t=e.regex,n=AW(e),r=SW,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:SW,keyword:CW.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:wW,built_in:kW.concat(i),"variable.language":OW},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function MW(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:`css`}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:`javascript`}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function NW(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}zU.registerLanguage(`bash`,BU),zU.registerLanguage(`c`,VU),zU.registerLanguage(`cpp`,HU),zU.registerLanguage(`css`,ZU),zU.registerLanguage(`diff`,QU),zU.registerLanguage(`go`,$U),zU.registerLanguage(`ini`,eW),zU.registerLanguage(`java`,oW),zU.registerLanguage(`javascript`,hW),zU.registerLanguage(`json`,_W),zU.registerLanguage(`markdown`,vW),zU.registerLanguage(`python`,yW),zU.registerLanguage(`rust`,bW),zU.registerLanguage(`sql`,xW),zU.registerLanguage(`typescript`,jW),zU.registerLanguage(`xml`,MW),zU.registerLanguage(`yaml`,NW);var PW={shell:`bash`};function FW(e){if(e===void 0)return!1;let t=PW[e.trim().toLowerCase()]??e.trim().toLowerCase();return t!==``&&zU.getLanguage(t)!==void 0}function IW(e,t){let n=t===void 0?``:PW[t.trim().toLowerCase()]??t.trim().toLowerCase();if(n!==``&&zU.getLanguage(n)!==void 0)try{return zU.highlight(e,{language:n}).value}catch{}return LW(e)}function LW(e){return e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`)}var V=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},RW=/([A-Z])/g,zW=e=>e.replace(RW,`-$1`).toLowerCase(),BW={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},VW=/[&><"']/g,HW=e=>String(e).replace(VW,e=>BW[e]),UW=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?UW(e.body[0]):e:e.type===`font`?UW(e.body):e,WW=new Set([`mathord`,`textord`,`atom`]),GW=e=>WW.has(UW(e).type),KW=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},qW={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function JW(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function YW(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:JW(Array.isArray(e.type)?e.type[0]:e.type)}function XW(e,t,n,r){var i=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,a=Object.prototype.hasOwnProperty.call(r,`processor`)?r.processor:void 0;e[t]=i===void 0?YW(r):a?a(i):i}var ZW=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(qW)){var n=qW[t];n&&XW(this,t,e,n)}}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=KW(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},QW=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return sG[cG[this.id]]}sub(){return sG[lG[this.id]]}fracNum(){return sG[uG[this.id]]}fracDen(){return sG[dG[this.id]]}cramp(){return sG[fG[this.id]]}text(){return sG[pG[this.id]]}isTight(){return this.size>=2}},$W=0,eG=1,tG=2,nG=3,rG=4,iG=5,aG=6,oG=7,sG=[new QW($W,0,!1),new QW(eG,0,!0),new QW(tG,1,!1),new QW(nG,1,!0),new QW(rG,2,!1),new QW(iG,2,!0),new QW(aG,3,!1),new QW(oG,3,!0)],cG=[rG,iG,rG,iG,aG,oG,aG,oG],lG=[iG,iG,iG,iG,oG,oG,oG,oG],uG=[tG,nG,rG,iG,aG,oG,aG,oG],dG=[nG,nG,iG,iG,oG,oG,oG,oG],fG=[eG,eG,nG,nG,iG,iG,oG,oG],pG=[$W,eG,tG,nG,tG,nG,tG,nG],mG={DISPLAY:sG[$W],TEXT:sG[tG],SCRIPT:sG[rG],SCRIPTSCRIPT:sG[aG]},hG=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function gG(e){for(var t=0;t<hG.length;t++)for(var n=hG[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var _G=[];hG.forEach(e=>e.blocks.forEach(e=>_G.push(...e)));function vG(e){for(var t=0;t<_G.length;t+=2)if(e>=_G[t]&&e<=_G[t+1])return!0;return!1}var yG=e=>e+` `+e,bG=80,xG=function(e,t){return`M95,`+(622+e+t)+`
131
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
132
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
133
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
134
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
135
+ c69,-144,104.5,-217.7,106.5,-221
136
+ l`+e/2.075+` -`+e+`
137
+ c5.3,-9.3,12,-14,20,-14
138
+ H400000v`+(40+e)+`H845.2724
139
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
140
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
141
+ M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},SG=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
142
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
143
+ c340,-704.7,510.7,-1060.3,512,-1067
144
+ l`+e/2.084+` -`+e+`
145
+ c4.7,-7.3,11,-11,19,-11
146
+ H40000v`+(40+e)+`H1012.3
147
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
148
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
149
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
150
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
151
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},CG=function(e,t){return`M983 `+(10+e+t)+`
152
+ l`+e/3.13+` -`+e+`
153
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
154
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
155
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
156
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
157
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
158
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
159
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
160
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},wG=function(e,t){return`M424,`+(2398+e+t)+`
161
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
162
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
163
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
164
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
165
+ l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
166
+ v`+(40+e)+`H1014.6
167
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
168
+ c-2,6,-10,9,-24,9
169
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
170
+ h400000v`+(40+e)+`h-400000z`},TG=function(e,t){return`M473,`+(2713+e+t)+`
171
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
172
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
173
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
174
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
175
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
176
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
177
+ 606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},EG=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},DG=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
178
+ H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
179
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
180
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
181
+ 219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},OG=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=xG(t,bG);break;case`sqrtSize1`:r=SG(t,bG);break;case`sqrtSize2`:r=CG(t,bG);break;case`sqrtSize3`:r=wG(t,bG);break;case`sqrtSize4`:r=TG(t,bG);break;case`sqrtTall`:r=DG(t,bG,n)}return r},kG=function(e,t){switch(e){case`⎜`:return yG(`M291 0 H417 V`+t+` H291z`);case`∣`:return yG(`M145 0 H188 V`+t+` H145z`);case`∥`:return yG(`M145 0 H188 V`+t+` H145z`)+yG(`M367 0 H410 V`+t+` H367z`);case`⎟`:return yG(`M457 0 H583 V`+t+` H457z`);case`⎢`:return yG(`M319 0 H403 V`+t+` H319z`);case`⎥`:return yG(`M263 0 H347 V`+t+` H263z`);case`⎪`:return yG(`M384 0 H504 V`+t+` H384z`);case`⏐`:return yG(`M312 0 H355 V`+t+` H312z`);case`‖`:return yG(`M257 0 H300 V`+t+` H257z`)+yG(`M478 0 H521 V`+t+` H478z`);default:return``}},AG={doubleleftarrow:`M262 157
182
+ l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
183
+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
184
+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
185
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
186
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
187
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
188
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
189
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
190
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
191
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
192
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
193
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
194
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
195
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
196
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
197
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
198
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
199
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
200
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
201
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
202
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
203
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
204
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
205
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
206
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
207
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
208
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
209
+ 435 0h399565z`,leftgroupunder:`M400000 262
210
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
211
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
212
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
213
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
214
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
215
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
216
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
217
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
218
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
219
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
220
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
221
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
222
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
223
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
224
+ v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
225
+ -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
226
+ -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
227
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:yG(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:yG(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:yG(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:yG(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
228
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
229
+ c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
230
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:yG(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
231
+ c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
232
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
233
+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
234
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
235
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
236
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
237
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
238
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
239
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
240
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
241
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
242
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
243
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
244
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
245
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
246
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
247
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
248
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
249
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
250
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
251
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
252
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
253
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
254
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
255
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
256
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
257
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
258
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
259
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
260
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
261
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
262
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
263
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
264
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
265
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
266
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
267
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
268
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
269
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
270
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
271
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
272
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
273
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
274
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
275
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
276
+ m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
277
+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
278
+ -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
279
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:yG(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:yG(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:yG(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
280
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
281
+ -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
282
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
283
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
284
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
285
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
286
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
287
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
288
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
289
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
290
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
291
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
292
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
293
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
294
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
295
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
296
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
297
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
298
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
299
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
300
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
301
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
302
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
303
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
304
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
305
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
306
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
307
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
308
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
309
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
310
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
311
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
312
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
313
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
314
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
315
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
316
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
317
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
318
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
319
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
320
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
321
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
322
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
323
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
324
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
325
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
326
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
327
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
328
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
329
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
330
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
331
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
332
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
333
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
334
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
335
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
336
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
337
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
338
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
339
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
340
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
341
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
342
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
343
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
344
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
345
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
346
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
347
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
348
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
349
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
350
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
351
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
352
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},jG=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
353
+ H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
354
+ M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
355
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
356
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
357
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
358
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
359
+ M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
360
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
361
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z
362
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
363
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
364
+ M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
365
+ M347 1759 V0 h-84 V1759 v`+t+` v602 h84z`;case`lparen`:return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
366
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
367
+ -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
368
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
369
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
370
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
371
+ l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
372
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case`rparen`:return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
373
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
374
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
375
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
376
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
377
+ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
378
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
379
+ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
380
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function MG(e){return`toText`in e}var NG=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(MG(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},PG={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},FG={ex:!0,em:!0,mu:!0},IG=function(e){return typeof e!=`string`&&(e=e.unit),e in PG||e in FG||e===`ex`},LG=function(e,t){var n;if(e.unit in PG)n=PG[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new V(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},H=function(e){return+e.toFixed(4)+`em`},RG=function(e){return e.filter(e=>e).join(` `)},zG=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=zW(n)+`:`+r+`;`)}return t},BG=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},VG=function(e){var t=document.createElement(e);t.className=RG(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},HG=/[\s"'>/=\x00-\x1f]/,UG=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+HW(RG(this.classes))+`"`);var n=zG(this.style);n&&(t+=` style="`+HW(n)+`"`);for(var r of Object.keys(this.attributes)){if(HG.test(r))throw new V(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+HW(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},WG=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,BG.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return VG.call(this,`span`)}toMarkup(){return UG.call(this,`span`)}},GG=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,BG.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return VG.call(this,`a`)}toMarkup(){return UG.call(this,`a`)}},KG=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+HW(this.src)+`"`+(` alt="`+HW(this.alt)+`"`),t=zG(this.style);return t&&(e+=` style="`+HW(t)+`"`),e+=`'/>`,e}},qG={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},JG=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=gG(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=qG[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=H(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=RG(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=HW(RG(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+H(this.italic)+`;`),n+=zG(this.style),n&&(e=!0,t+=` style="`+HW(n)+`"`);var r=HW(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},YG=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+HW(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},XG=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,AG[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+HW(this.alternate)+`"/>`:`<path d="`+HW(AG[this.pathName])+`"/>`}},ZG=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+HW(this.attributes[t])+`"`;return e+=`/>`,e}};function QG(e){if(e instanceof JG)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function $G(e){if(e instanceof WG)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var eK=e=>e instanceof WG||e instanceof GG||e instanceof NG,tK={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},nK={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},rK={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function iK(e,t){tK[e]=t}function aK(e,t,n){if(!tK[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=tK[t][r];if(!i&&e[0]in rK&&(r=rK[e[0]].charCodeAt(0),i=tK[t][r]),!i&&n===`text`&&vG(r)&&(i=tK[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var oK={};function sK(e){var t=e>=5?0:e>=3?1:2;if(!oK[t]){var n=oK[t]={cssEmPerMu:nK.quad[t]/18};for(var r of Object.keys(nK))n[r]=nK[r][t]}return oK[t]}var cK={math:{},text:{}};function U(e,t,n,r,i,a){cK[e][i]={font:t,group:n,replace:r},a&&r&&(cK[e][r]=cK[e][i])}var W=`math`,G=`text`,K=`main`,q=`ams`,lK=`accent-token`,uK=`bin`,dK=`close`,fK=`inner`,pK=`mathord`,mK=`op-token`,hK=`open`,gK=`punct`,J=`rel`,_K=`spacing`,Y=`textord`;U(W,K,J,`≡`,`\\equiv`,!0),U(W,K,J,`≺`,`\\prec`,!0),U(W,K,J,`≻`,`\\succ`,!0),U(W,K,J,`∼`,`\\sim`,!0),U(W,K,J,`⊥`,`\\perp`),U(W,K,J,`⪯`,`\\preceq`,!0),U(W,K,J,`⪰`,`\\succeq`,!0),U(W,K,J,`≃`,`\\simeq`,!0),U(W,K,J,`∣`,`\\mid`,!0),U(W,K,J,`≪`,`\\ll`,!0),U(W,K,J,`≫`,`\\gg`,!0),U(W,K,J,`≍`,`\\asymp`,!0),U(W,K,J,`∥`,`\\parallel`),U(W,K,J,`⋈`,`\\bowtie`,!0),U(W,K,J,`⌣`,`\\smile`,!0),U(W,K,J,`⊑`,`\\sqsubseteq`,!0),U(W,K,J,`⊒`,`\\sqsupseteq`,!0),U(W,K,J,`≐`,`\\doteq`,!0),U(W,K,J,`⌢`,`\\frown`,!0),U(W,K,J,`∋`,`\\ni`,!0),U(W,K,J,`∝`,`\\propto`,!0),U(W,K,J,`⊢`,`\\vdash`,!0),U(W,K,J,`⊣`,`\\dashv`,!0),U(W,K,J,`∋`,`\\owns`),U(W,K,gK,`.`,`\\ldotp`),U(W,K,gK,`⋅`,`\\cdotp`),U(W,K,gK,`⋅`,`·`),U(G,K,Y,`⋅`,`·`),U(W,K,Y,`#`,`\\#`),U(G,K,Y,`#`,`\\#`),U(W,K,Y,`&`,`\\&`),U(G,K,Y,`&`,`\\&`),U(W,K,Y,`ℵ`,`\\aleph`,!0),U(W,K,Y,`∀`,`\\forall`,!0),U(W,K,Y,`ℏ`,`\\hbar`,!0),U(W,K,Y,`∃`,`\\exists`,!0),U(W,K,Y,`∇`,`\\nabla`,!0),U(W,K,Y,`♭`,`\\flat`,!0),U(W,K,Y,`ℓ`,`\\ell`,!0),U(W,K,Y,`♮`,`\\natural`,!0),U(W,K,Y,`♣`,`\\clubsuit`,!0),U(W,K,Y,`℘`,`\\wp`,!0),U(W,K,Y,`♯`,`\\sharp`,!0),U(W,K,Y,`♢`,`\\diamondsuit`,!0),U(W,K,Y,`ℜ`,`\\Re`,!0),U(W,K,Y,`♡`,`\\heartsuit`,!0),U(W,K,Y,`ℑ`,`\\Im`,!0),U(W,K,Y,`♠`,`\\spadesuit`,!0),U(W,K,Y,`§`,`\\S`,!0),U(G,K,Y,`§`,`\\S`),U(W,K,Y,`¶`,`\\P`,!0),U(G,K,Y,`¶`,`\\P`),U(W,K,Y,`†`,`\\dag`),U(G,K,Y,`†`,`\\dag`),U(G,K,Y,`†`,`\\textdagger`),U(W,K,Y,`‡`,`\\ddag`),U(G,K,Y,`‡`,`\\ddag`),U(G,K,Y,`‡`,`\\textdaggerdbl`),U(W,K,dK,`⎱`,`\\rmoustache`,!0),U(W,K,hK,`⎰`,`\\lmoustache`,!0),U(W,K,dK,`⟯`,`\\rgroup`,!0),U(W,K,hK,`⟮`,`\\lgroup`,!0),U(W,K,uK,`∓`,`\\mp`,!0),U(W,K,uK,`⊖`,`\\ominus`,!0),U(W,K,uK,`⊎`,`\\uplus`,!0),U(W,K,uK,`⊓`,`\\sqcap`,!0),U(W,K,uK,`∗`,`\\ast`),U(W,K,uK,`⊔`,`\\sqcup`,!0),U(W,K,uK,`◯`,`\\bigcirc`,!0),U(W,K,uK,`∙`,`\\bullet`,!0),U(W,K,uK,`‡`,`\\ddagger`),U(W,K,uK,`≀`,`\\wr`,!0),U(W,K,uK,`⨿`,`\\amalg`),U(W,K,uK,`&`,`\\And`),U(W,K,J,`⟵`,`\\longleftarrow`,!0),U(W,K,J,`⇐`,`\\Leftarrow`,!0),U(W,K,J,`⟸`,`\\Longleftarrow`,!0),U(W,K,J,`⟶`,`\\longrightarrow`,!0),U(W,K,J,`⇒`,`\\Rightarrow`,!0),U(W,K,J,`⟹`,`\\Longrightarrow`,!0),U(W,K,J,`↔`,`\\leftrightarrow`,!0),U(W,K,J,`⟷`,`\\longleftrightarrow`,!0),U(W,K,J,`⇔`,`\\Leftrightarrow`,!0),U(W,K,J,`⟺`,`\\Longleftrightarrow`,!0),U(W,K,J,`↦`,`\\mapsto`,!0),U(W,K,J,`⟼`,`\\longmapsto`,!0),U(W,K,J,`↗`,`\\nearrow`,!0),U(W,K,J,`↩`,`\\hookleftarrow`,!0),U(W,K,J,`↪`,`\\hookrightarrow`,!0),U(W,K,J,`↘`,`\\searrow`,!0),U(W,K,J,`↼`,`\\leftharpoonup`,!0),U(W,K,J,`⇀`,`\\rightharpoonup`,!0),U(W,K,J,`↙`,`\\swarrow`,!0),U(W,K,J,`↽`,`\\leftharpoondown`,!0),U(W,K,J,`⇁`,`\\rightharpoondown`,!0),U(W,K,J,`↖`,`\\nwarrow`,!0),U(W,K,J,`⇌`,`\\rightleftharpoons`,!0),U(W,q,J,`≮`,`\\nless`,!0),U(W,q,J,``,`\\@nleqslant`),U(W,q,J,``,`\\@nleqq`),U(W,q,J,`⪇`,`\\lneq`,!0),U(W,q,J,`≨`,`\\lneqq`,!0),U(W,q,J,``,`\\@lvertneqq`),U(W,q,J,`⋦`,`\\lnsim`,!0),U(W,q,J,`⪉`,`\\lnapprox`,!0),U(W,q,J,`⊀`,`\\nprec`,!0),U(W,q,J,`⋠`,`\\npreceq`,!0),U(W,q,J,`⋨`,`\\precnsim`,!0),U(W,q,J,`⪹`,`\\precnapprox`,!0),U(W,q,J,`≁`,`\\nsim`,!0),U(W,q,J,``,`\\@nshortmid`),U(W,q,J,`∤`,`\\nmid`,!0),U(W,q,J,`⊬`,`\\nvdash`,!0),U(W,q,J,`⊭`,`\\nvDash`,!0),U(W,q,J,`⋪`,`\\ntriangleleft`),U(W,q,J,`⋬`,`\\ntrianglelefteq`,!0),U(W,q,J,`⊊`,`\\subsetneq`,!0),U(W,q,J,``,`\\@varsubsetneq`),U(W,q,J,`⫋`,`\\subsetneqq`,!0),U(W,q,J,``,`\\@varsubsetneqq`),U(W,q,J,`≯`,`\\ngtr`,!0),U(W,q,J,``,`\\@ngeqslant`),U(W,q,J,``,`\\@ngeqq`),U(W,q,J,`⪈`,`\\gneq`,!0),U(W,q,J,`≩`,`\\gneqq`,!0),U(W,q,J,``,`\\@gvertneqq`),U(W,q,J,`⋧`,`\\gnsim`,!0),U(W,q,J,`⪊`,`\\gnapprox`,!0),U(W,q,J,`⊁`,`\\nsucc`,!0),U(W,q,J,`⋡`,`\\nsucceq`,!0),U(W,q,J,`⋩`,`\\succnsim`,!0),U(W,q,J,`⪺`,`\\succnapprox`,!0),U(W,q,J,`≆`,`\\ncong`,!0),U(W,q,J,``,`\\@nshortparallel`),U(W,q,J,`∦`,`\\nparallel`,!0),U(W,q,J,`⊯`,`\\nVDash`,!0),U(W,q,J,`⋫`,`\\ntriangleright`),U(W,q,J,`⋭`,`\\ntrianglerighteq`,!0),U(W,q,J,``,`\\@nsupseteqq`),U(W,q,J,`⊋`,`\\supsetneq`,!0),U(W,q,J,``,`\\@varsupsetneq`),U(W,q,J,`⫌`,`\\supsetneqq`,!0),U(W,q,J,``,`\\@varsupsetneqq`),U(W,q,J,`⊮`,`\\nVdash`,!0),U(W,q,J,`⪵`,`\\precneqq`,!0),U(W,q,J,`⪶`,`\\succneqq`,!0),U(W,q,J,``,`\\@nsubseteqq`),U(W,q,uK,`⊴`,`\\unlhd`),U(W,q,uK,`⊵`,`\\unrhd`),U(W,q,J,`↚`,`\\nleftarrow`,!0),U(W,q,J,`↛`,`\\nrightarrow`,!0),U(W,q,J,`⇍`,`\\nLeftarrow`,!0),U(W,q,J,`⇏`,`\\nRightarrow`,!0),U(W,q,J,`↮`,`\\nleftrightarrow`,!0),U(W,q,J,`⇎`,`\\nLeftrightarrow`,!0),U(W,q,J,`△`,`\\vartriangle`),U(W,q,Y,`ℏ`,`\\hslash`),U(W,q,Y,`▽`,`\\triangledown`),U(W,q,Y,`◊`,`\\lozenge`),U(W,q,Y,`Ⓢ`,`\\circledS`),U(W,q,Y,`®`,`\\circledR`),U(G,q,Y,`®`,`\\circledR`),U(W,q,Y,`∡`,`\\measuredangle`,!0),U(W,q,Y,`∄`,`\\nexists`),U(W,q,Y,`℧`,`\\mho`),U(W,q,Y,`Ⅎ`,`\\Finv`,!0),U(W,q,Y,`⅁`,`\\Game`,!0),U(W,q,Y,`‵`,`\\backprime`),U(W,q,Y,`▲`,`\\blacktriangle`),U(W,q,Y,`▼`,`\\blacktriangledown`),U(W,q,Y,`■`,`\\blacksquare`),U(W,q,Y,`⧫`,`\\blacklozenge`),U(W,q,Y,`★`,`\\bigstar`),U(W,q,Y,`∢`,`\\sphericalangle`,!0),U(W,q,Y,`∁`,`\\complement`,!0),U(W,q,Y,`ð`,`\\eth`,!0),U(G,K,Y,`ð`,`ð`),U(W,q,Y,`╱`,`\\diagup`),U(W,q,Y,`╲`,`\\diagdown`),U(W,q,Y,`□`,`\\square`),U(W,q,Y,`□`,`\\Box`),U(W,q,Y,`◊`,`\\Diamond`),U(W,q,Y,`¥`,`\\yen`,!0),U(G,q,Y,`¥`,`\\yen`,!0),U(W,q,Y,`✓`,`\\checkmark`,!0),U(G,q,Y,`✓`,`\\checkmark`),U(W,q,Y,`ℶ`,`\\beth`,!0),U(W,q,Y,`ℸ`,`\\daleth`,!0),U(W,q,Y,`ℷ`,`\\gimel`,!0),U(W,q,Y,`ϝ`,`\\digamma`,!0),U(W,q,Y,`ϰ`,`\\varkappa`),U(W,q,hK,`┌`,`\\@ulcorner`,!0),U(W,q,dK,`┐`,`\\@urcorner`,!0),U(W,q,hK,`└`,`\\@llcorner`,!0),U(W,q,dK,`┘`,`\\@lrcorner`,!0),U(W,q,J,`≦`,`\\leqq`,!0),U(W,q,J,`⩽`,`\\leqslant`,!0),U(W,q,J,`⪕`,`\\eqslantless`,!0),U(W,q,J,`≲`,`\\lesssim`,!0),U(W,q,J,`⪅`,`\\lessapprox`,!0),U(W,q,J,`≊`,`\\approxeq`,!0),U(W,q,uK,`⋖`,`\\lessdot`),U(W,q,J,`⋘`,`\\lll`,!0),U(W,q,J,`≶`,`\\lessgtr`,!0),U(W,q,J,`⋚`,`\\lesseqgtr`,!0),U(W,q,J,`⪋`,`\\lesseqqgtr`,!0),U(W,q,J,`≑`,`\\doteqdot`),U(W,q,J,`≓`,`\\risingdotseq`,!0),U(W,q,J,`≒`,`\\fallingdotseq`,!0),U(W,q,J,`∽`,`\\backsim`,!0),U(W,q,J,`⋍`,`\\backsimeq`,!0),U(W,q,J,`⫅`,`\\subseteqq`,!0),U(W,q,J,`⋐`,`\\Subset`,!0),U(W,q,J,`⊏`,`\\sqsubset`,!0),U(W,q,J,`≼`,`\\preccurlyeq`,!0),U(W,q,J,`⋞`,`\\curlyeqprec`,!0),U(W,q,J,`≾`,`\\precsim`,!0),U(W,q,J,`⪷`,`\\precapprox`,!0),U(W,q,J,`⊲`,`\\vartriangleleft`),U(W,q,J,`⊴`,`\\trianglelefteq`),U(W,q,J,`⊨`,`\\vDash`,!0),U(W,q,J,`⊪`,`\\Vvdash`,!0),U(W,q,J,`⌣`,`\\smallsmile`),U(W,q,J,`⌢`,`\\smallfrown`),U(W,q,J,`≏`,`\\bumpeq`,!0),U(W,q,J,`≎`,`\\Bumpeq`,!0),U(W,q,J,`≧`,`\\geqq`,!0),U(W,q,J,`⩾`,`\\geqslant`,!0),U(W,q,J,`⪖`,`\\eqslantgtr`,!0),U(W,q,J,`≳`,`\\gtrsim`,!0),U(W,q,J,`⪆`,`\\gtrapprox`,!0),U(W,q,uK,`⋗`,`\\gtrdot`),U(W,q,J,`⋙`,`\\ggg`,!0),U(W,q,J,`≷`,`\\gtrless`,!0),U(W,q,J,`⋛`,`\\gtreqless`,!0),U(W,q,J,`⪌`,`\\gtreqqless`,!0),U(W,q,J,`≖`,`\\eqcirc`,!0),U(W,q,J,`≗`,`\\circeq`,!0),U(W,q,J,`≜`,`\\triangleq`,!0),U(W,q,J,`∼`,`\\thicksim`),U(W,q,J,`≈`,`\\thickapprox`),U(W,q,J,`⫆`,`\\supseteqq`,!0),U(W,q,J,`⋑`,`\\Supset`,!0),U(W,q,J,`⊐`,`\\sqsupset`,!0),U(W,q,J,`≽`,`\\succcurlyeq`,!0),U(W,q,J,`⋟`,`\\curlyeqsucc`,!0),U(W,q,J,`≿`,`\\succsim`,!0),U(W,q,J,`⪸`,`\\succapprox`,!0),U(W,q,J,`⊳`,`\\vartriangleright`),U(W,q,J,`⊵`,`\\trianglerighteq`),U(W,q,J,`⊩`,`\\Vdash`,!0),U(W,q,J,`∣`,`\\shortmid`),U(W,q,J,`∥`,`\\shortparallel`),U(W,q,J,`≬`,`\\between`,!0),U(W,q,J,`⋔`,`\\pitchfork`,!0),U(W,q,J,`∝`,`\\varpropto`),U(W,q,J,`◀`,`\\blacktriangleleft`),U(W,q,J,`∴`,`\\therefore`,!0),U(W,q,J,`∍`,`\\backepsilon`),U(W,q,J,`▶`,`\\blacktriangleright`),U(W,q,J,`∵`,`\\because`,!0),U(W,q,J,`⋘`,`\\llless`),U(W,q,J,`⋙`,`\\gggtr`),U(W,q,uK,`⊲`,`\\lhd`),U(W,q,uK,`⊳`,`\\rhd`),U(W,q,J,`≂`,`\\eqsim`,!0),U(W,K,J,`⋈`,`\\Join`),U(W,q,J,`≑`,`\\Doteq`,!0),U(W,q,uK,`∔`,`\\dotplus`,!0),U(W,q,uK,`∖`,`\\smallsetminus`),U(W,q,uK,`⋒`,`\\Cap`,!0),U(W,q,uK,`⋓`,`\\Cup`,!0),U(W,q,uK,`⩞`,`\\doublebarwedge`,!0),U(W,q,uK,`⊟`,`\\boxminus`,!0),U(W,q,uK,`⊞`,`\\boxplus`,!0),U(W,q,uK,`⋇`,`\\divideontimes`,!0),U(W,q,uK,`⋉`,`\\ltimes`,!0),U(W,q,uK,`⋊`,`\\rtimes`,!0),U(W,q,uK,`⋋`,`\\leftthreetimes`,!0),U(W,q,uK,`⋌`,`\\rightthreetimes`,!0),U(W,q,uK,`⋏`,`\\curlywedge`,!0),U(W,q,uK,`⋎`,`\\curlyvee`,!0),U(W,q,uK,`⊝`,`\\circleddash`,!0),U(W,q,uK,`⊛`,`\\circledast`,!0),U(W,q,uK,`⋅`,`\\centerdot`),U(W,q,uK,`⊺`,`\\intercal`,!0),U(W,q,uK,`⋒`,`\\doublecap`),U(W,q,uK,`⋓`,`\\doublecup`),U(W,q,uK,`⊠`,`\\boxtimes`,!0),U(W,q,J,`⇢`,`\\dashrightarrow`,!0),U(W,q,J,`⇠`,`\\dashleftarrow`,!0),U(W,q,J,`⇇`,`\\leftleftarrows`,!0),U(W,q,J,`⇆`,`\\leftrightarrows`,!0),U(W,q,J,`⇚`,`\\Lleftarrow`,!0),U(W,q,J,`↞`,`\\twoheadleftarrow`,!0),U(W,q,J,`↢`,`\\leftarrowtail`,!0),U(W,q,J,`↫`,`\\looparrowleft`,!0),U(W,q,J,`⇋`,`\\leftrightharpoons`,!0),U(W,q,J,`↶`,`\\curvearrowleft`,!0),U(W,q,J,`↺`,`\\circlearrowleft`,!0),U(W,q,J,`↰`,`\\Lsh`,!0),U(W,q,J,`⇈`,`\\upuparrows`,!0),U(W,q,J,`↿`,`\\upharpoonleft`,!0),U(W,q,J,`⇃`,`\\downharpoonleft`,!0),U(W,K,J,`⊶`,`\\origof`,!0),U(W,K,J,`⊷`,`\\imageof`,!0),U(W,q,J,`⊸`,`\\multimap`,!0),U(W,q,J,`↭`,`\\leftrightsquigarrow`,!0),U(W,q,J,`⇉`,`\\rightrightarrows`,!0),U(W,q,J,`⇄`,`\\rightleftarrows`,!0),U(W,q,J,`↠`,`\\twoheadrightarrow`,!0),U(W,q,J,`↣`,`\\rightarrowtail`,!0),U(W,q,J,`↬`,`\\looparrowright`,!0),U(W,q,J,`↷`,`\\curvearrowright`,!0),U(W,q,J,`↻`,`\\circlearrowright`,!0),U(W,q,J,`↱`,`\\Rsh`,!0),U(W,q,J,`⇊`,`\\downdownarrows`,!0),U(W,q,J,`↾`,`\\upharpoonright`,!0),U(W,q,J,`⇂`,`\\downharpoonright`,!0),U(W,q,J,`⇝`,`\\rightsquigarrow`,!0),U(W,q,J,`⇝`,`\\leadsto`),U(W,q,J,`⇛`,`\\Rrightarrow`,!0),U(W,q,J,`↾`,`\\restriction`),U(W,K,Y,`‘`,"`"),U(W,K,Y,`$`,`\\$`),U(G,K,Y,`$`,`\\$`),U(G,K,Y,`$`,`\\textdollar`),U(W,K,Y,`%`,`\\%`),U(G,K,Y,`%`,`\\%`),U(W,K,Y,`_`,`\\_`),U(G,K,Y,`_`,`\\_`),U(G,K,Y,`_`,`\\textunderscore`),U(W,K,Y,`∠`,`\\angle`,!0),U(W,K,Y,`∞`,`\\infty`,!0),U(W,K,Y,`′`,`\\prime`),U(W,K,Y,`△`,`\\triangle`),U(W,K,Y,`Γ`,`\\Gamma`,!0),U(W,K,Y,`Δ`,`\\Delta`,!0),U(W,K,Y,`Θ`,`\\Theta`,!0),U(W,K,Y,`Λ`,`\\Lambda`,!0),U(W,K,Y,`Ξ`,`\\Xi`,!0),U(W,K,Y,`Π`,`\\Pi`,!0),U(W,K,Y,`Σ`,`\\Sigma`,!0),U(W,K,Y,`Υ`,`\\Upsilon`,!0),U(W,K,Y,`Φ`,`\\Phi`,!0),U(W,K,Y,`Ψ`,`\\Psi`,!0),U(W,K,Y,`Ω`,`\\Omega`,!0),U(W,K,Y,`A`,`Α`),U(W,K,Y,`B`,`Β`),U(W,K,Y,`E`,`Ε`),U(W,K,Y,`Z`,`Ζ`),U(W,K,Y,`H`,`Η`),U(W,K,Y,`I`,`Ι`),U(W,K,Y,`K`,`Κ`),U(W,K,Y,`M`,`Μ`),U(W,K,Y,`N`,`Ν`),U(W,K,Y,`O`,`Ο`),U(W,K,Y,`P`,`Ρ`),U(W,K,Y,`T`,`Τ`),U(W,K,Y,`X`,`Χ`),U(W,K,Y,`¬`,`\\neg`,!0),U(W,K,Y,`¬`,`\\lnot`),U(W,K,Y,`⊤`,`\\top`),U(W,K,Y,`⊥`,`\\bot`),U(W,K,Y,`∅`,`\\emptyset`),U(W,q,Y,`∅`,`\\varnothing`),U(W,K,pK,`α`,`\\alpha`,!0),U(W,K,pK,`β`,`\\beta`,!0),U(W,K,pK,`γ`,`\\gamma`,!0),U(W,K,pK,`δ`,`\\delta`,!0),U(W,K,pK,`ϵ`,`\\epsilon`,!0),U(W,K,pK,`ζ`,`\\zeta`,!0),U(W,K,pK,`η`,`\\eta`,!0),U(W,K,pK,`θ`,`\\theta`,!0),U(W,K,pK,`ι`,`\\iota`,!0),U(W,K,pK,`κ`,`\\kappa`,!0),U(W,K,pK,`λ`,`\\lambda`,!0),U(W,K,pK,`μ`,`\\mu`,!0),U(W,K,pK,`ν`,`\\nu`,!0),U(W,K,pK,`ξ`,`\\xi`,!0),U(W,K,pK,`ο`,`\\omicron`,!0),U(W,K,pK,`π`,`\\pi`,!0),U(W,K,pK,`ρ`,`\\rho`,!0),U(W,K,pK,`σ`,`\\sigma`,!0),U(W,K,pK,`τ`,`\\tau`,!0),U(W,K,pK,`υ`,`\\upsilon`,!0),U(W,K,pK,`ϕ`,`\\phi`,!0),U(W,K,pK,`χ`,`\\chi`,!0),U(W,K,pK,`ψ`,`\\psi`,!0),U(W,K,pK,`ω`,`\\omega`,!0),U(W,K,pK,`ε`,`\\varepsilon`,!0),U(W,K,pK,`ϑ`,`\\vartheta`,!0),U(W,K,pK,`ϖ`,`\\varpi`,!0),U(W,K,pK,`ϱ`,`\\varrho`,!0),U(W,K,pK,`ς`,`\\varsigma`,!0),U(W,K,pK,`φ`,`\\varphi`,!0),U(W,K,uK,`∗`,`*`,!0),U(W,K,uK,`+`,`+`),U(W,K,uK,`−`,`-`,!0),U(W,K,uK,`⋅`,`\\cdot`,!0),U(W,K,uK,`∘`,`\\circ`,!0),U(W,K,uK,`÷`,`\\div`,!0),U(W,K,uK,`±`,`\\pm`,!0),U(W,K,uK,`×`,`\\times`,!0),U(W,K,uK,`∩`,`\\cap`,!0),U(W,K,uK,`∪`,`\\cup`,!0),U(W,K,uK,`∖`,`\\setminus`,!0),U(W,K,uK,`∧`,`\\land`),U(W,K,uK,`∨`,`\\lor`),U(W,K,uK,`∧`,`\\wedge`,!0),U(W,K,uK,`∨`,`\\vee`,!0),U(W,K,Y,`√`,`\\surd`),U(W,K,hK,`⟨`,`\\langle`,!0),U(W,K,hK,`∣`,`\\lvert`),U(W,K,hK,`∥`,`\\lVert`),U(W,K,dK,`?`,`?`),U(W,K,dK,`!`,`!`),U(W,K,dK,`⟩`,`\\rangle`,!0),U(W,K,dK,`∣`,`\\rvert`),U(W,K,dK,`∥`,`\\rVert`),U(W,K,J,`=`,`=`),U(W,K,J,`:`,`:`),U(W,K,J,`≈`,`\\approx`,!0),U(W,K,J,`≅`,`\\cong`,!0),U(W,K,J,`≥`,`\\ge`),U(W,K,J,`≥`,`\\geq`,!0),U(W,K,J,`←`,`\\gets`),U(W,K,J,`>`,`\\gt`,!0),U(W,K,J,`∈`,`\\in`,!0),U(W,K,J,``,`\\@not`),U(W,K,J,`⊂`,`\\subset`,!0),U(W,K,J,`⊃`,`\\supset`,!0),U(W,K,J,`⊆`,`\\subseteq`,!0),U(W,K,J,`⊇`,`\\supseteq`,!0),U(W,q,J,`⊈`,`\\nsubseteq`,!0),U(W,q,J,`⊉`,`\\nsupseteq`,!0),U(W,K,J,`⊨`,`\\models`),U(W,K,J,`←`,`\\leftarrow`,!0),U(W,K,J,`≤`,`\\le`),U(W,K,J,`≤`,`\\leq`,!0),U(W,K,J,`<`,`\\lt`,!0),U(W,K,J,`→`,`\\rightarrow`,!0),U(W,K,J,`→`,`\\to`),U(W,q,J,`≱`,`\\ngeq`,!0),U(W,q,J,`≰`,`\\nleq`,!0),U(W,K,_K,`\xA0`,`\\ `),U(W,K,_K,`\xA0`,`\\space`),U(W,K,_K,`\xA0`,`\\nobreakspace`),U(G,K,_K,`\xA0`,`\\ `),U(G,K,_K,`\xA0`,` `),U(G,K,_K,`\xA0`,`\\space`),U(G,K,_K,`\xA0`,`\\nobreakspace`),U(W,K,_K,``,`\\nobreak`),U(W,K,_K,``,`\\allowbreak`),U(W,K,gK,`,`,`,`),U(W,K,gK,`;`,`;`),U(W,q,uK,`⊼`,`\\barwedge`,!0),U(W,q,uK,`⊻`,`\\veebar`,!0),U(W,K,uK,`⊙`,`\\odot`,!0),U(W,K,uK,`⊕`,`\\oplus`,!0),U(W,K,uK,`⊗`,`\\otimes`,!0),U(W,K,Y,`∂`,`\\partial`,!0),U(W,K,uK,`⊘`,`\\oslash`,!0),U(W,q,uK,`⊚`,`\\circledcirc`,!0),U(W,q,uK,`⊡`,`\\boxdot`,!0),U(W,K,uK,`△`,`\\bigtriangleup`),U(W,K,uK,`▽`,`\\bigtriangledown`),U(W,K,uK,`†`,`\\dagger`),U(W,K,uK,`⋄`,`\\diamond`),U(W,K,uK,`⋆`,`\\star`),U(W,K,uK,`◃`,`\\triangleleft`),U(W,K,uK,`▹`,`\\triangleright`),U(W,K,hK,`{`,`\\{`),U(G,K,Y,`{`,`\\{`),U(G,K,Y,`{`,`\\textbraceleft`),U(W,K,dK,`}`,`\\}`),U(G,K,Y,`}`,`\\}`),U(G,K,Y,`}`,`\\textbraceright`),U(W,K,hK,`{`,`\\lbrace`),U(W,K,dK,`}`,`\\rbrace`),U(W,K,hK,`[`,`\\lbrack`,!0),U(G,K,Y,`[`,`\\lbrack`,!0),U(W,K,dK,`]`,`\\rbrack`,!0),U(G,K,Y,`]`,`\\rbrack`,!0),U(W,K,hK,`(`,`\\lparen`,!0),U(W,K,dK,`)`,`\\rparen`,!0),U(G,K,Y,`<`,`\\textless`,!0),U(G,K,Y,`>`,`\\textgreater`,!0),U(W,K,hK,`⌊`,`\\lfloor`,!0),U(W,K,dK,`⌋`,`\\rfloor`,!0),U(W,K,hK,`⌈`,`\\lceil`,!0),U(W,K,dK,`⌉`,`\\rceil`,!0),U(W,K,Y,`\\`,`\\backslash`),U(W,K,Y,`∣`,`|`),U(W,K,Y,`∣`,`\\vert`),U(G,K,Y,`|`,`\\textbar`,!0),U(W,K,Y,`∥`,`\\|`),U(W,K,Y,`∥`,`\\Vert`),U(G,K,Y,`∥`,`\\textbardbl`),U(G,K,Y,`~`,`\\textasciitilde`),U(G,K,Y,`\\`,`\\textbackslash`),U(G,K,Y,`^`,`\\textasciicircum`),U(W,K,J,`↑`,`\\uparrow`,!0),U(W,K,J,`⇑`,`\\Uparrow`,!0),U(W,K,J,`↓`,`\\downarrow`,!0),U(W,K,J,`⇓`,`\\Downarrow`,!0),U(W,K,J,`↕`,`\\updownarrow`,!0),U(W,K,J,`⇕`,`\\Updownarrow`,!0),U(W,K,mK,`∐`,`\\coprod`),U(W,K,mK,`⋁`,`\\bigvee`),U(W,K,mK,`⋀`,`\\bigwedge`),U(W,K,mK,`⨄`,`\\biguplus`),U(W,K,mK,`⋂`,`\\bigcap`),U(W,K,mK,`⋃`,`\\bigcup`),U(W,K,mK,`∫`,`\\int`),U(W,K,mK,`∫`,`\\intop`),U(W,K,mK,`∬`,`\\iint`),U(W,K,mK,`∭`,`\\iiint`),U(W,K,mK,`∏`,`\\prod`),U(W,K,mK,`∑`,`\\sum`),U(W,K,mK,`⨂`,`\\bigotimes`),U(W,K,mK,`⨁`,`\\bigoplus`),U(W,K,mK,`⨀`,`\\bigodot`),U(W,K,mK,`∮`,`\\oint`),U(W,K,mK,`∯`,`\\oiint`),U(W,K,mK,`∰`,`\\oiiint`),U(W,K,mK,`⨆`,`\\bigsqcup`),U(W,K,mK,`∫`,`\\smallint`),U(G,K,fK,`…`,`\\textellipsis`),U(W,K,fK,`…`,`\\mathellipsis`),U(G,K,fK,`…`,`\\ldots`,!0),U(W,K,fK,`…`,`\\ldots`,!0),U(W,K,fK,`⋯`,`\\@cdots`,!0),U(W,K,fK,`⋱`,`\\ddots`,!0),U(W,K,Y,`⋮`,`\\varvdots`),U(G,K,Y,`⋮`,`\\varvdots`),U(W,K,lK,`ˊ`,`\\acute`),U(W,K,lK,`ˋ`,`\\grave`),U(W,K,lK,`¨`,`\\ddot`),U(W,K,lK,`~`,`\\tilde`),U(W,K,lK,`ˉ`,`\\bar`),U(W,K,lK,`˘`,`\\breve`),U(W,K,lK,`ˇ`,`\\check`),U(W,K,lK,`^`,`\\hat`),U(W,K,lK,`⃗`,`\\vec`),U(W,K,lK,`˙`,`\\dot`),U(W,K,lK,`˚`,`\\mathring`),U(W,K,pK,``,`\\@imath`),U(W,K,pK,``,`\\@jmath`),U(W,K,Y,`ı`,`ı`),U(W,K,Y,`ȷ`,`ȷ`),U(G,K,Y,`ı`,`\\i`,!0),U(G,K,Y,`ȷ`,`\\j`,!0),U(G,K,Y,`ß`,`\\ss`,!0),U(G,K,Y,`æ`,`\\ae`,!0),U(G,K,Y,`œ`,`\\oe`,!0),U(G,K,Y,`ø`,`\\o`,!0),U(G,K,Y,`Æ`,`\\AE`,!0),U(G,K,Y,`Œ`,`\\OE`,!0),U(G,K,Y,`Ø`,`\\O`,!0),U(G,K,lK,`ˊ`,`\\'`),U(G,K,lK,`ˋ`,"\\`"),U(G,K,lK,`ˆ`,`\\^`),U(G,K,lK,`˜`,`\\~`),U(G,K,lK,`ˉ`,`\\=`),U(G,K,lK,`˘`,`\\u`),U(G,K,lK,`˙`,`\\.`),U(G,K,lK,`¸`,`\\c`),U(G,K,lK,`˚`,`\\r`),U(G,K,lK,`ˇ`,`\\v`),U(G,K,lK,`¨`,`\\"`),U(G,K,lK,`˝`,`\\H`),U(G,K,lK,`◯`,`\\textcircled`);var vK={"--":!0,"---":!0,"``":!0,"''":!0};U(G,K,Y,`–`,`--`,!0),U(G,K,Y,`–`,`\\textendash`),U(G,K,Y,`—`,`---`,!0),U(G,K,Y,`—`,`\\textemdash`),U(G,K,Y,`‘`,"`",!0),U(G,K,Y,`‘`,`\\textquoteleft`),U(G,K,Y,`’`,`'`,!0),U(G,K,Y,`’`,`\\textquoteright`),U(G,K,Y,`“`,"``",!0),U(G,K,Y,`“`,`\\textquotedblleft`),U(G,K,Y,`”`,`''`,!0),U(G,K,Y,`”`,`\\textquotedblright`),U(W,K,Y,`°`,`\\degree`,!0),U(G,K,Y,`°`,`\\degree`),U(G,K,Y,`°`,`\\textdegree`,!0),U(W,K,Y,`£`,`\\pounds`),U(W,K,Y,`£`,`\\mathsterling`,!0),U(G,K,Y,`£`,`\\pounds`),U(G,K,Y,`£`,`\\textsterling`,!0),U(W,q,Y,`✠`,`\\maltese`),U(G,q,Y,`✠`,`\\maltese`);for(var yK=`0123456789/@."`,bK=0;bK<yK.length;bK++){var xK=yK.charAt(bK);U(W,K,Y,xK,xK)}for(var SK=`0123456789!@*()-=+";:?/.,`,CK=0;CK<SK.length;CK++){var wK=SK.charAt(CK);U(G,K,Y,wK,wK)}for(var TK=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,EK=0;EK<TK.length;EK++){var DK=TK.charAt(EK);U(W,K,pK,DK,DK),U(G,K,Y,DK,DK)}U(W,q,Y,`C`,`ℂ`),U(G,q,Y,`C`,`ℂ`),U(W,q,Y,`H`,`ℍ`),U(G,q,Y,`H`,`ℍ`),U(W,q,Y,`N`,`ℕ`),U(G,q,Y,`N`,`ℕ`),U(W,q,Y,`P`,`ℙ`),U(G,q,Y,`P`,`ℙ`),U(W,q,Y,`Q`,`ℚ`),U(G,q,Y,`Q`,`ℚ`),U(W,q,Y,`R`,`ℝ`),U(G,q,Y,`R`,`ℝ`),U(W,q,Y,`Z`,`ℤ`),U(G,q,Y,`Z`,`ℤ`),U(W,K,pK,`h`,`ℎ`),U(G,K,pK,`h`,`ℎ`);for(var OK,kK=0;kK<TK.length;kK++){var AK=TK.charAt(kK);OK=String.fromCharCode(55349,56320+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK),OK=String.fromCharCode(55349,56372+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK),OK=String.fromCharCode(55349,56424+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK),OK=String.fromCharCode(55349,56580+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK),OK=String.fromCharCode(55349,56684+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK),OK=String.fromCharCode(55349,56736+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK),OK=String.fromCharCode(55349,56788+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK),OK=String.fromCharCode(55349,56840+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK),OK=String.fromCharCode(55349,56944+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK),kK<26&&(OK=String.fromCharCode(55349,56632+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK),OK=String.fromCharCode(55349,56476+kK),U(W,K,pK,AK,OK),U(G,K,Y,AK,OK))}OK=String.fromCharCode(55349,56668),U(W,K,pK,`k`,OK),U(G,K,Y,`k`,OK);for(var jK=0;jK<10;jK++){var MK=jK.toString();OK=String.fromCharCode(55349,57294+jK),U(W,K,pK,MK,OK),U(G,K,Y,MK,OK),OK=String.fromCharCode(55349,57314+jK),U(W,K,pK,MK,OK),U(G,K,Y,MK,OK),OK=String.fromCharCode(55349,57324+jK),U(W,K,pK,MK,OK),U(G,K,Y,MK,OK),OK=String.fromCharCode(55349,57334+jK),U(W,K,pK,MK,OK),U(G,K,Y,MK,OK)}for(var NK=`ÐÞþ`,PK=0;PK<NK.length;PK++){var FK=NK.charAt(PK);U(W,K,pK,FK,FK),U(G,K,Y,FK,FK)}var IK={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},LK={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},RK={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},zK={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},BK={mathClass:``,textClass:``,font:``},VK={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},HK={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},UK={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},WK={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},GK={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},KK={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},qK={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},JK=[IK,IK,LK,LK,RK,RK,zK,BK,BK,BK,VK,VK,HK,HK,UK,UK,WK,WK,GK,GK,KK,KK,BK,BK,qK,qK],YK=[IK,BK,WK,GK,qK],XK=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return JK[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return YK[Math.floor((r-120782)/10)];if(r===120485||r===120486)return JK[0];if(120486<r&&r<120782)return BK;throw new V(`Unsupported character: `+e)};function ZK(e){var t=e.strict,n=e.errorCode,r=e.errorMsg,i=e.token,a=e.report,o=t;if(typeof t==`function`){if(a)o=t(n,r,i);else try{o=t(n,r,i)}catch{o=`error`}}switch(o){case!0:case`error`:if(a)throw new V(`LaTeX-incompatible input and strict mode is set to 'error': `+(r+` [`+n+`]`),i);return!0;case!1:case`ignore`:if(!a)return!1;break;default:if(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(r+` [`+n+`]`)),!a)return!1}}var QK=function(e,t,n){if(cK[n][e]){var r=cK[n][e].replace;r&&(e=r)}return{value:e,metrics:aK(e,t,n)}},$K=function(e,t,n,r,i){var a=QK(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new JG(e,o.height,o.depth,c,o.skew,o.width,i)}else ZK({strict:r.strict,errorCode:`symbolNotInFont`,errorMsg:`No character metrics for '`+e+`' in style '`+t+`' and mode '`+n+`'`,report:!0}),s=new JG(e,0,0,0,0,0,i);s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();return l&&(s.style.color=l),s},eq=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&QK(e,`Main-Bold`,t).metrics?$K(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||cK[t][e].font===`main`?$K(e,`Main-Regular`,t,n,r):$K(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},tq=function(e,t,n){return n!==`textord`&&QK(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},nq=function(e,t){var n=e.type===`mathord`?`mathord`:`textord`,r=e.mode,i=e.text,a=[`mord`],o=t.font,s=t.fontFamily,c=t.fontWeight,l=t.fontShape,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=XK(i);f=m.font,p=m[r+`Class`]}if(f)return $K(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=tq(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=hq[o].fontName,g=[o]):(h=mq(s,c,l),g=[s,c,l]);if(QK(i,h,r).metrics)return $K(i,h,r,t,a.concat(g));if(Object.prototype.hasOwnProperty.call(vK,i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push($K(i[y],h,r,t,a.concat(g)));return lq(v)}}if(n===`mathord`)return $K(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=cK[r][i]&&cK[r][i].font;if(b===`ams`)return $K(i,mq(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return $K(i,mq(`textrm`,c,l),r,t,a.concat(c,l));var x=mq(b,c,l);return $K(i,x,r,t,a.concat(x,c,l))}throw Error(`unexpected type: `+n+` in makeOrd`)},rq=(e,t)=>{if(RG(e.classes)!==RG(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},iq=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof JG&&r instanceof JG&&rq(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},aq=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},X=function(e,t,n,r){var i=new WG(e,t,n,r);return aq(i),i},oq=(e,t,n,r)=>new WG(e,t,n,r),sq=function(e,t,n){var r=X([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=H(r.height),r.maxFontSize=1,r},cq=function(e,t,n,r){var i=new GG(e,t,n,r);return aq(i),i},lq=function(e){var t=new NG(e);return aq(t),t},uq=function(e,t){return e instanceof NG?X([],[e],t):e},dq=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},fq=function(e,t){for(var n=dq(e),r=n.children,i=n.depth,a=0,o=0;o<r.length;o++){var s=r[o];if(s.type===`elem`){var c=s.elem;a=Math.max(a,c.maxFontSize,c.height)}}a+=2;var l=X([`pstrut`],[]);l.style.height=H(a);for(var u=[],d=i,f=i,p=i,m=0;m<r.length;m++){var h=r[m];if(h.type===`kern`)p+=h.size;else{var g=h.elem,_=h.wrapperClasses||[],v=h.wrapperStyle||{},y=X(_,[l,g],void 0,v);y.style.top=H(-a-p-g.depth),h.marginLeft&&(y.style.marginLeft=h.marginLeft),h.marginRight&&(y.style.marginRight=h.marginRight),u.push(y),p+=g.height+g.depth}d=Math.min(d,p),f=Math.max(f,p)}var b=X([`vlist`],u);b.style.height=H(f);var x;if(d<0){var S=X([`vlist`],[X([],[])]);S.style.height=H(-d),x=[X([`vlist-r`],[b,X([`vlist-s`],[new JG(`​`)])]),X([`vlist-r`],[S])]}else x=[X([`vlist-r`],[b])];var C=X([`vlist-t`],x);return x.length===2&&C.classes.push(`vlist-t2`),C.height=f,C.depth=-d,C},pq=(e,t)=>{var n=X([`mspace`],[],t),r=LG(e,t);return n.style.marginRight=H(r),n},mq=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},hq={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},gq={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},_q=function(e,t){var n=gq[e],r=n[0],i=n[1],a=n[2],o=oq([`katex-overlay`],[new YG([new XG(r)],{width:H(i),height:H(a),style:`width:`+H(i),viewBox:`0 0 `+1e3*i+` `+1e3*a,preserveAspectRatio:`xMinYMin`})],t);return o.height=a,o.style.height=H(a),o.style.width=H(i),o},vq={number:3,unit:`mu`},yq={number:4,unit:`mu`},bq={number:5,unit:`mu`},xq={mord:{mop:vq,mbin:yq,mrel:bq,minner:vq},mop:{mord:vq,mop:vq,mrel:bq,minner:vq},mbin:{mord:yq,mop:yq,mopen:yq,minner:yq},mrel:{mord:bq,mop:bq,mopen:bq,minner:bq},mopen:{},mclose:{mop:vq,mbin:yq,mrel:bq,minner:vq},mpunct:{mord:vq,mop:vq,mrel:bq,mopen:vq,mclose:vq,mpunct:vq,minner:vq},minner:{mord:vq,mop:vq,mbin:yq,mrel:bq,mopen:vq,mpunct:vq,minner:vq}},Sq={mord:{mop:vq},mop:{mord:vq,mop:vq},mbin:{},mrel:{},mopen:{},mclose:{mop:vq},mpunct:{},minner:{mop:vq}},Cq={},wq={},Tq={};function Z(e){for(var t=e.type,n=e.names,r=e.htmlBuilder,i=e.mathmlBuilder,a=0;a<n.length;++a)Cq[n[a]]=e;t&&(r&&(wq[t]=r),i&&(Tq[t]=i))}function Eq(e){var t=e.type,n=e.htmlBuilder,r=e.mathmlBuilder;n&&(wq[t]=n),r&&(Tq[t]=r)}var Dq=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},Oq=function(e){return e.type===`ordgroup`?e.body:[e]},kq=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),Aq=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),jq={display:mG.DISPLAY,text:mG.TEXT,script:mG.SCRIPT,scriptscript:mG.SCRIPTSCRIPT},Mq={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},Nq=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=zq(e[a],t);if(o instanceof NG){var s=o.children;i.push(...s)}else i.push(o)}if(iq(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(jq[l.style]))}var u=X([r[0]||`leftmost`],[],t),d=X([r[1]||`rightmost`],[],t),f=n===`root`;return Pq(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&Aq.has(r)?t.classes[0]=`mord`:r===`mbin`&&kq.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),Pq(i,(e,t)=>{var n=Lq(t),r=Lq(e),i=n&&r?e.hasClass(`mtight`)?Sq[n]?.[r]:xq[n]?.[r]:null;if(i)return pq(i,c)},{node:u},d,f),i},Pq=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=Fq(o);if(s)Pq(s.children,t,n,null,i);else{var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`katex-newline`)&&(n.node=X([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}}r&&e.pop()},Fq=function(e){return e instanceof NG||e instanceof GG||e instanceof WG&&e.hasClass(`enclosing`)?e:null},Iq=function(e,t){var n=Fq(e);if(n){var r=n.children;if(r.length){if(t===`right`)return Iq(r[r.length-1],`right`);if(t===`left`)return Iq(r[0],`left`)}}return e},Lq=function(e,t){return e?(t&&(e=Iq(e,t)),Mq[e.classes[0]]||null):null},Rq=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return X(t.concat(n))},zq=function(e,t,n){if(!e)return X();if(wq[e.type]){var r=wq[e.type](e,t);if(n&&t.size!==n.size){r=X(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new V(`Got group of unknown type: '`+e.type+`'`)};function Bq(e,t){var n=X([`katex-base`],e,t),r=X([`katex-strut`]);return r.style.height=H(n.height+n.depth),n.depth&&(r.style.verticalAlign=H(-n.depth)),n.children.unshift(r),n}function Vq(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=Nq(e,t,`root`),i;r.length===2&&r[1].hasClass(`katex-tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`katex-newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(Bq(o,t)),o=[])}else r[s].hasClass(`katex-newline`)&&(o.pop(),o.length>0&&(a.push(Bq(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(Bq(o,t));var l;n?(l=Bq(Nq(n,t,!0),t),l.classes=[`katex-tag`],a.push(l)):i&&a.push(i);var u=X([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=H(u.height+u.depth),u.depth&&(d.style.verticalAlign=H(-u.depth))}return u}function Hq(e){return new NG(e)}var Q=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e.setAttribute(n,r)}this.classes.length>0&&(e.className=RG(this.classes));for(var i=0;i<this.children.length;i++)if(this.children[i]instanceof Uq&&this.children[i+1]instanceof Uq){for(var a=this.children[i].toText()+this.children[++i].toText();this.children[i+1]instanceof Uq;)a+=this.children[++i].toText();e.appendChild(new Uq(a).toNode())}else e.appendChild(this.children[i].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e+=` `+n+`="`,e+=HW(r),e+=`"`}this.classes.length>0&&(e+=` class ="`+HW(RG(this.classes))+`"`),e+=`>`;for(var i=0;i<this.children.length;i++)e+=this.children[i].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},Uq=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return HW(this.toText())}toText(){return this.text}},Wq=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?`  `:e>=-.05556&&e<=-.05555?` ⁣`:e>=-.1667&&e<=-.1666?` ⁣`:e>=-.2223&&e<=-.2222?` ⁣`:e>=-.2778&&e<=-.2777?` ⁣`:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,H(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+H(this.width)+`"/>`}toText(){return this.character?this.character:` `}},Gq=new Set([`\\imath`,`\\jmath`]),Kq=new Set([`mrow`,`mtable`]),qq=function(e,t,n){var r,i;return cK[t][e]&&cK[t][e].replace&&e.charCodeAt(0)!==55349&&(!Object.prototype.hasOwnProperty.call(vK,e)||(n==null||(r=n.fontFamily)==null?void 0:r.slice(4,6))!==`tt`&&(n==null||(i=n.font)==null?void 0:i.slice(4,6))!==`tt`)&&(e=cK[t][e].replace),new Uq(e)},Jq=function(e){return e.length===1?e[0]:new Q(`mrow`,e)},Yq={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},Xq=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=Yq[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(Gq.has(a))return null;if(cK[r][a]){var o=cK[r][a].replace;o&&(a=o)}var s=hq[n].fontName;return aK(a,s,r)?hq[n].variant:null};function Zq(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof Uq&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof Uq&&n.text===`,`}return!1}var Qq=function(e,t,n){if(e.length===1){var r=eJ(e[0],t);return n&&r instanceof Q&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=eJ(e[o],t);if(s instanceof Q&&a instanceof Q){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)||s.type===`mn`&&a.type===`mn`||Zq(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&Zq(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||Zq(a))){var c=s.children[0];c instanceof Q&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof Uq&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof Uq&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},$q=function(e,t,n){return Jq(Qq(e,t,n))},eJ=function(e,t){if(!e)return new Q(`mrow`);if(Tq[e.type])return Tq[e.type](e,t);throw new V(`Got group of unknown type: '`+e.type+`'`)};function tJ(e,t,n,r,i){var a=Qq(e,n),o=a.length===1&&a[0]instanceof Q&&Kq.has(a[0].type)?a[0]:new Q(`mrow`,a),s=new Q(`annotation`,[new Uq(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Q(`math`,[new Q(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),X([i?`katex`:`katex-mathml`],[c])}var nJ=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],rJ=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],iJ=function(e,t){return t.size<2?e:nJ[e-1][t.size-1]},aJ=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.strict=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=rJ[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this.strict=t.strict,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness,strict:this.strict};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:iJ(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:rJ[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=iJ(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`katex-sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`katex-sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=sK(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};aJ.BASESIZE=6;var oJ=e=>new aJ({style:e.displayMode?mG.DISPLAY:mG.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness,strict:e.strict}),sJ=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=X(n,[e])}return e},cJ=function(e,t,n){var r=oJ(n),i;return n.output===`mathml`?tJ(e,t,r,n.displayMode,!0):(i=n.output===`html`?X([`katex`],[Vq(e,r)]):X([`katex`],[tJ(e,t,r,n.displayMode,!1),Vq(e,r)]),sJ(i,n))},lJ=function(e,t){return sJ(X([`katex`],[Vq(e,oJ(t))]),t)},uJ={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},dJ=function(e){var t=new Q(`mo`,[new Uq(uJ[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},fJ={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},pJ=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),mJ=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(pJ.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:oq([],[new YG([new XG(o)],{width:`100%`,height:H(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=fJ[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var d=u[0],f=u[1],p=u[2],m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
381
+ `+h+` children.`);for(var v=0;v<h;v++){var y=new YG([new XG(d[v])],{width:`400em`,height:H(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=oq([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=H(m),l.push(b)}return{span:X([`katex-stretchy`],l,t),minWidth:f,height:m}}var r=n(),i=r.span,a=r.minWidth,o=r.height;return i.height=o,i.style.height=H(o),a>0&&(i.style.minWidth=H(a)),i},hJ=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=X([`katex-stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new ZG({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new ZG({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=oq([],[new YG(c,{width:`100%`,height:H(o)})],i)}return a.height=o,a.style.height=H(o),a},gJ=[`bin`,`close`,`inner`,`open`,`punct`,`rel`],_J=[`accent-token`,`mathord`,`op-token`,`spacing`,`textord`],vJ=new Set(gJ),yJ=new Set(_J);function bJ(e){return vJ.has(e)}function xJ(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function SJ(e){var t=CJ(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function CJ(e){return e.type===`atom`||yJ.has(e.type)?e:null}function wJ(e,t,n){var r=``;for(var i of e.body)if(i.type===`textord`)r+=i.text;else if(n&&i.type===`spacing`&&i.text===` `)r+=` `;else throw new V(t,e);return r}var TJ=e=>{if(e instanceof JG)return e;if(eK(e)&&e.children.length===1)return TJ(e.children[0])},EJ=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=xJ(e.base,`accent`),n=r.base,e.base=n,i=$G(zq(e,t)),e.base=r):(r=xJ(e,`accent`),n=r.base);var a=zq(n,t.havingCrampedStyle()),o=r.isShifty&&GW(n),s=0;o&&(s=TJ(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=mJ(r,t),u=fq({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+H(2*s)+`)`,marginLeft:H(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=_q(`vec`,t),f=gq.vec[1]):(d=nq({type:`textord`,mode:r.mode,text:r.label},t),d=QG(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=X([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=H(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=fq({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=X([`mord`,`katex-accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},DJ=(e,t)=>{var n=e.isStretchy?dJ(e.label):new Q(`mo`,[qq(e.label,e.mode)]),r=new Q(`mover`,[eJ(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},OJ=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Z({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],numArgs:1,handler:(e,t)=>{var n=Dq(t[0]),r=!OJ.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:EJ,mathmlBuilder:DJ}),Z({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(ZK({strict:e.parser.settings.strict,errorCode:`mathVsTextAccents`,errorMsg:`LaTeX's accent `+e.funcName+` works only in text mode`,report:!0}),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),Z({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=zq(e.base,t),r=mJ(e,t),i=e.label===`\\utilde`?.12:0;return X([`mord`,`accentunder`],[fq({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=dJ(e.label),r=new Q(`munder`,[eJ(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var kJ=e=>{var t=new Q(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Z({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=e.funcName;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=uq(zq(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=uq(zq(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=mJ(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=fq({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=fq({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return X([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=dJ(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=kJ(eJ(e.body,t));r=e.below?new Q(`munderover`,[n,kJ(eJ(e.below,t)),i]):new Q(`mover`,[n,i])}else e.below?r=new Q(`munder`,[n,kJ(eJ(e.below,t))]):(r=kJ(),r=new Q(`mover`,[n,r]));return r}});function AJ(e,t){var n=Nq(e.body,t,!0);return X([e.mclass],n,t)}function jJ(e,t){var n,r=Qq(e.body,t);return e.mclass===`minner`?n=new Q(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Q(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Q(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):(e.mclass===`mopen`||e.mclass===`mclose`)&&(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`)),n}Z({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],numArgs:1,primitive:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:Oq(i),isCharacterBox:GW(i)}},htmlBuilder:AJ,mathmlBuilder:jJ});var MJ=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Z({type:`mclass`,names:[`\\@binrel`],numArgs:2,handler(e,t){return{type:`mclass`,mode:e.parser.mode,mclass:MJ(t[0]),body:Oq(t[1]),isCharacterBox:GW(t[1])}}}),Z({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],numArgs:2,handler(e,t){var n=e.parser,r=e.funcName,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:MJ(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:Oq(i)},c=r===`\\underset`?{type:`supsub`,mode:a.mode,base:s,sub:a}:{type:`supsub`,mode:a.mode,base:s,sup:a};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:GW(c)}}}),Z({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`pmb`,mode:e.parser.mode,mclass:MJ(t[0]),body:Oq(t[0])}},htmlBuilder(e,t){var n=Nq(e.body,t,!0),r=X([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Q(`mstyle`,Qq(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var NJ={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},PJ=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),FJ=e=>e.type===`textord`&&e.text===`@`,IJ=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function LJ(e,t,n){var r=NJ[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function RJ(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new V(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=PJ(),c=0;c<o.length;c++)if(!FJ(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=SJ(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l)){if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(IJ(o[p],l)){f=!1,c=p;break}if(FJ(o[p]))throw new V(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new V(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new V(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[LJ(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=PJ()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Z({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=uq(zq(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=H(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Q(`mrow`,[eJ(e.label,t)]);return n=new Q(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Q(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Z({type:`cdlabelparent`,names:[`\\\\cdparent`],numArgs:1,handler(e,t){return{type:`cdlabelparent`,mode:e.parser.mode,fragment:t[0]}},htmlBuilder(e,t){var n=uq(zq(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Q(`mrow`,[eJ(e.fragment,t)])}}),Z({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=wJ(xJ(t[0],`ordgroup`),`\\@char has non-numeric argument`),i=parseInt(r),a;if(isNaN(i))throw new V(`\\@char has non-numeric argument `+r);if(i<0||i>1114111)throw new V(`\\@char with invalid code point `+r);return i<=65535?a=String.fromCharCode(i):(i-=65536,a=String.fromCharCode((i>>10)+55296,(i&1023)+56320)),{type:`textord`,mode:n.mode,text:a}}}),Z({type:`color`,names:[`\\textcolor`],numArgs:2,allowedInText:!0,argTypes:[`color`,`original`],handler(e,t){var n=e.parser,r=xJ(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:Oq(i)}},htmlBuilder:(e,t)=>lq(Nq(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Q(`mstyle`,Qq(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n}}),Z({type:`color`,names:[`\\color`],numArgs:1,allowedInText:!0,argTypes:[`color`],handler(e,t){var n=e.parser,r=e.breakOnTokenText,i=xJ(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}}}),Z({type:`cr`,names:[`\\\\`],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=t.gullet.future().text===`[`?t.parseSizeGroup(!0):null,r=!t.settings.displayMode||!ZK({strict:t.settings.strict,errorCode:`newLineInDisplayMode`,errorMsg:`In LaTeX, \\\\ or \\newline does nothing in display mode`,report:!1});return{type:`cr`,mode:t.mode,newLine:r,size:n&&xJ(n,`size`).value}},htmlBuilder(e,t){var n=X([`mspace`],[],t);return e.newLine&&(n.classes.push(`katex-newline`),e.size&&(n.style.marginTop=H(LG(e.size,t)))),n},mathmlBuilder(e,t){var n=new Q(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,H(LG(e.size,t)))),n}});var zJ={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},BJ=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new V(`Expected a control sequence`,e);return t},VJ=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},HJ=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Z({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],numArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=e.funcName;t.consumeSpaces();var r=t.fetch();if(zJ[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=zJ[r.text]),xJ(t.parseFunction(),`internal`);throw new V(`Invalid token after macro prefix`,r)}}),Z({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new V(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new V(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new V(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new V(`Expected a macro definition`);else s[a].push(r.text);var c=t.gullet.consumeArg().tokens;return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===zJ[n]),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\let`,`\\\\globallet`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=BJ(t.gullet.popToken());return t.gullet.consumeSpaces(),HJ(t,r,VJ(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=BJ(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return HJ(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var UJ=function(e,t,n){var r=aK(cK.math[e]&&cK.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},WJ=function(e,t,n,r){var i=n.havingBaseStyle(t),a=X(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},GJ=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=H(i),e.height-=i,e.depth+=i},KJ=function(e,t,n,r,i,a){var o=WJ($K(e,`Main-Regular`,i,r),t,r,a);return n&&GJ(o,r,t),o},qJ=function(e,t,n,r){return $K(e,`Size`+t+`-Regular`,n,r)},JJ=function(e,t,n,r,i,a){var o=qJ(e,t,i,r),s=WJ(X([`delimsizing`,`size`+t],[o],r),mG.TEXT,r,a);return n&&GJ(s,r,mG.TEXT),s},YJ=function(e,t,n,r){return{type:`elem`,elem:X([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[X([],[$K(e,t,n,r)])])}},XJ=function(e,t,n){var r=tK[`Size4-Regular`][e.charCodeAt(0)]?tK[`Size4-Regular`][e.charCodeAt(0)][4]:tK[`Size1-Regular`][e.charCodeAt(0)][4],i=oq([],[new YG([new XG(`inner`,kG(e,Math.round(1e3*t)))],{width:H(r),height:H(t),style:`width:`+H(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=H(t),i.style.width=H(r),{type:`elem`,elem:i}},ZJ=.008,QJ={type:`kern`,size:-1*ZJ},$J=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),eY=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),tY=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):$J.has(e)?(c=`∣`,u=`vert`,d=333):eY.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=UJ(o,f,i),m=p.height+p.depth,h=UJ(c,f,i),g=h.height+h.depth,_=UJ(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=UJ(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,ee=[];if(u.length>0){var te=C-m-v,ne=Math.round(C*1e3),re=jG(u,Math.round(te*1e3)),E=new XG(u,re),ie=H(d/1e3),ae=H(ne/1e3),oe=oq([],[new YG([E],{width:ie,height:ae,viewBox:`0 0 `+d+` `+ne})],r);oe.height=ne/1e3,oe.style.width=ie,oe.style.height=ae,ee.push({type:`elem`,elem:oe})}else{if(ee.push(YJ(l,f,i,r)),ee.push(QJ),s===null){var D=C-m-v+2*ZJ;ee.push(XJ(c,D,r))}else{var se=(C-m-v-y)/2+2*ZJ;ee.push(XJ(c,se,r)),ee.push(QJ),ee.push(YJ(s,f,i,r)),ee.push(QJ),ee.push(XJ(c,se,r))}ee.push(QJ),ee.push(YJ(o,f,i,r))}var ce=r.havingBaseStyle(mG.TEXT);return WJ(X([`delimsizing`,`mult`],[fq({positionType:`bottom`,positionData:T,children:ee})],ce),mG.TEXT,r,a)},nY=80,rY=.08,iY=function(e,t,n,r,i){return oq([`hide-tail`],[new YG([new XG(e,OG(e,r,n))],{width:`400em`,height:H(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},aY=function(e,t){var n=t.havingBaseSizing(),r=hY(`\\surd`,e*n.sizeMultiplier,pY,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+nY,e<1?i=1:e<1.4&&(i=.7),s=(1+a+rY)/i,c=(1+a)/i,o=iY(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+nY)*lY[r.size],c=(lY[r.size]+a)/i,s=(lY[r.size]+a+rY)/i,o=iY(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+rY,c=e+a,l=Math.floor(1e3*e+a)+nY,o=iY(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=H(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},oY=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),sY=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),cY=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),lY=[0,1.2,1.8,2.4,3],uY=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),oY.has(e)||cY.has(e))return JJ(e,t,!1,n,r,i);if(sY.has(e))return tY(e,lY[t],!1,n,r,i);throw new V(`Illegal delimiter: '`+e+`'`)},dY=[{type:`small`,style:mG.SCRIPTSCRIPT},{type:`small`,style:mG.SCRIPT},{type:`small`,style:mG.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],fY=[{type:`small`,style:mG.SCRIPTSCRIPT},{type:`small`,style:mG.SCRIPT},{type:`small`,style:mG.TEXT},{type:`stack`}],pY=[{type:`small`,style:mG.SCRIPTSCRIPT},{type:`small`,style:mG.SCRIPT},{type:`small`,style:mG.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],mY=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},hY=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=UJ(e,mY(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},gY=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=cY.has(e)?dY:oY.has(e)?pY:fY,s=hY(e,t,o,r);return s.type===`small`?KJ(e,s.style,n,r,i,a):s.type===`large`?JJ(e,s.size,n,r,i,a):tY(e,t,n,r,i,a)},_Y=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return gY(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},vY={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},yY=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function bY(e){return`isMiddle`in e}function xY(e,t){var n=CJ(e);if(n&&yY.has(n.text))return n;throw n?new V(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new V(`Invalid delimiter type '`+e.type+`'`,e)}Z({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=xY(Dq(t[0]),e);return{type:`delimsizing`,mode:e.parser.mode,size:vY[e.funcName].size,mclass:vY[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X([e.mclass]):uY(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(qq(e.delim,e.mode));var n=new Q(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=H(lY[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function SY(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Z({type:`leftright-right`,names:[`\\right`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new V(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:xY(t[0],e).text,color:n}}}),Z({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=xY(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=xJ(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{SY(e);for(var n=Nq(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];bY(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?Rq(t,[`mopen`]):_Y(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(bY(u)){var d=u.isMiddle;n[l]=_Y(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=Rq(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=_Y(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),X([`minner`],n,t)},mathmlBuilder:(e,t)=>{SY(e);var n=Qq(e.body,t);if(e.left!==`.`){var r=new Q(`mo`,[qq(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Q(`mo`,[qq(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return Jq(n)}}),Z({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=xY(t[0],e);if(!e.parser.leftrightDepth)throw new V(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=Rq(t,[]):(n=uY(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Q(`mo`,[e.delim===`\\vert`||e.delim===`|`?qq(`|`,`text`):qq(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}}),Z({type:`enclose`,names:[`\\colorbox`],numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=xJ(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:(e,t)=>{var n=uq(zq(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=GW(e.body);if(r===`sout`)a=X([`katex-stretchy`,`katex-sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=LG({number:.6,unit:`pt`},t),l=LG({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=H(d/2+c);var f=Math.floor(1e3*d*i);a=oq([`hide-tail`],[new YG([new XG(`phase`,EG(f))],{width:`400em`,height:H(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=H(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=hJ(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=H(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=H(h),a.style.borderRightWidth=H(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=fq({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=fq({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?X([`mord`,`cancel-lap`],[g],t):X([`mord`],[g],t)},mathmlBuilder:(e,t)=>{var n,r=new Q(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[eJ(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+H(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r}}),Z({type:`enclose`,names:[`\\fcolorbox`],numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=xJ(t[0],`color-token`).color,o=xJ(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}}}),Z({type:`enclose`,names:[`\\fbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\fbox`,body:t[0]}}}),Z({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\sout`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName;n.mode===`math`&&ZK({strict:n.settings.strict,errorCode:`mathVsSout`,errorMsg:`LaTeX's \\sout works only in text mode`,report:!0});var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\angl`],numArgs:1,argTypes:[`hbox`],allowedInText:!1,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\angl`,body:t[0]}}});var CY={};function wY(e){for(var t=e.type,n=e.names,r=e.props,i=e.handler,a=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)CY[n[c]]=s;a&&(wq[t]=a),o&&(Tq[t]=o)}var TY={};function $(e,t){TY[e]=t}var EY=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},DY=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,EY.range(this,t))}};function OY(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var kY=e=>{if(!e.parser.settings.displayMode)throw new V(`{`+e.envName+`} can be used only in display mode.`)},AY=new Set([`gather`,`gather*`]);function jY(e){if(!e.includes(`ed`))return!e.includes(`*`)}function MY(e,t,n){var r=t.hskipBeforeAndAfter,i=t.addJot,a=t.cols,o=t.arraystretch,s=t.colSeparationType,c=t.autoTag,l=t.singleRow,u=t.emptySingleRow,d=t.maxNumCols,f=t.leqno;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new V(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new DY(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(OY(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new V(`Too many tab characters: &`,e.nextToken);ZK({strict:e.settings.strict,errorCode:`textEnv`,errorMsg:`Too few columns specified in the {array} column argument.`,report:!0})}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&!Array.isArray(v?.[v.length-1])&&!(c&&v?.[v.length-1]===!0)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(OY(e)),m=[],h.push(m),y()}else throw new V(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function NY(e){return e.slice(0,1)===`d`?`display`:`text`}var PY=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(mG.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?LG({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=zq(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=LG(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var ee=_/2+t.fontMetrics().axisHeight,te=e.cols||[],ne=[],re,E,ie=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var ae=s[n],oe=ae.pos-ee,D=e.tags[n],se=void 0;se=D===!0?X([`eqn-num`],[],t):D===!1?X([],[],t):X([],Nq(D,t,!0),t),se.depth=ae.depth,se.height=ae.height,ie.push({type:`elem`,elem:se,shift:oe})}for(r=0,E=0;r<o||E<te.length;++r,++E){for(var ce=te[E],le=!0;(ue=ce)?.type===`separator`;){var ue;if(le||(re=X([`arraycolsep`],[]),re.style.width=H(t.fontMetrics().doubleRuleSep),ne.push(re)),ce.separator===`|`||ce.separator===`:`){var de=ce.separator===`|`?`solid`:`dashed`,fe=X([`vertical-separator`],[],t);fe.style.height=H(_),fe.style.borderRightWidth=H(l),fe.style.borderRightStyle=de,fe.style.margin=`0 `+H(-l/2);var pe=_-ee;pe&&(fe.style.verticalAlign=H(-pe)),ne.push(fe)}else throw new V(`Invalid separator type: `+ce.separator);E++,ce=te[E],le=!1}if(!(r>=o)){var me=void 0;(r>0||e.hskipBeforeAndAfter)&&(me=ce?.pregap??d,me!==0&&(re=X([`arraycolsep`],[]),re.style.width=H(me),ne.push(re)));var he=[];for(n=0;n<i;++n){var ge=s[n],_e=ge.cells[r];if(_e){var ve=ge.pos-ee;_e.depth=ge.depth,_e.height=ge.height,he.push({type:`elem`,elem:_e,shift:ve})}}var ye=fq({positionType:`individualShift`,children:he}),be=X([`col-align-`+(ce?.align||`c`)],[ye]);ne.push(be),(r<o-1||e.hskipBeforeAndAfter)&&(me=ce?.postgap??d,me!==0&&(re=X([`arraycolsep`],[]),re.style.width=H(me),ne.push(re)))}}var O=X([`mtable`],ne);if(c.length>0){for(var k=sq(`katex-hline`,t,l),xe=sq(`katex-hdashline`,t,l),Se=[{type:`elem`,elem:O,shift:0}];c.length>0;){var Ce=c.pop(),we=Ce.pos-ee;Ce.isDashed?Se.push({type:`elem`,elem:xe,shift:we}):Se.push({type:`elem`,elem:k,shift:we})}O=fq({positionType:`individualShift`,children:Se})}if(ie.length===0)return X([`mord`],[O],t);var Te=X([`katex-tag`],[fq({positionType:`individualShift`,children:ie})],t);return lq([O,Te])},FY={c:`center `,l:`left `,r:`right `},IY=function(e,t){for(var n=[],r=new Q(`mtd`,[],[`mtr-glue`]),i=new Q(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new Q(`mtd`,[eJ(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Q(`mtr`,s))}var l=new Q(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,H(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=FY[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new Q(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new Q(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},LY=function(e,t){e.envName.includes(`ed`)||kY(e);var n=[],r=e.envName===`split`,i=MY(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:jY(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes(`at`)?`alignat`:`align`,maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},`display`),a=0,o=0,s={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){var c=`Number of columns should be a positive integer`,l=wJ(t[0],c);if(!/^[0-9]+$/.test(l)||Number(l)<1)throw new V(c,t[0]);a=Number(l),o=a*2}var u=!o;i.body.forEach(function(e){for(var t=1;t<e.length;t+=2)xJ(xJ(e[t],`styling`).body[0],`ordgroup`).body.unshift(s);if(u)o<e.length&&(o=e.length);else{var n=e.length/2;if(a<n)throw new V(`Too many math in a row: `+(`expected `+a+`, but got `+n),e[0])}});for(var d=0;d<o;++d){var f=`r`,p=0;d%2==1?f=`l`:d>0&&u&&(p=1),n[d]={type:`align`,align:f,pregap:p,postgap:0}}return i.colSeparationType=u?`align`:`alignat`,i};wY({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(CJ(t[0])?[t[0]]:xJ(t[0],`ordgroup`).body).map(function(e){var t=SJ(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new V(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return MY(e.parser,r,NY(e.envName))},htmlBuilder:PY,mathmlBuilder:IY}),wY({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new V(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=MY(e.parser,r,NY(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:PY,mathmlBuilder:IY}),wY({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=MY(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:PY,mathmlBuilder:IY}),wY({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(CJ(t[0])?[t[0]]:xJ(t[0],`ordgroup`).body).map(function(e){var t=SJ(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new V(`Unknown column alignment: `+t,e)});if(n.length>1)throw new V(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=MY(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new V(`{subarray} can contain only one column`);return i},htmlBuilder:PY,mathmlBuilder:IY}),wY({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=MY(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},NY(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:PY,mathmlBuilder:IY}),wY({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:LY,htmlBuilder:PY,mathmlBuilder:IY}),wY({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){AY.has(e.envName)&&kY(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:jY(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return MY(e.parser,t,`display`)},htmlBuilder:PY,mathmlBuilder:IY}),wY({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:LY,htmlBuilder:PY,mathmlBuilder:IY}),wY({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){kY(e);var t={autoTag:jY(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return MY(e.parser,t,`display`)},htmlBuilder:PY,mathmlBuilder:IY}),wY({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return kY(e),RJ(e.parser)},htmlBuilder:PY,mathmlBuilder:IY}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),Z({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new V(e.funcName+` valid only within array environment`)}});var RY=CY;Z({type:`environment`,names:[`\\begin`,`\\end`],numArgs:1,argTypes:[`text`],handler(e,t){var n=e.parser,r=e.funcName,i=t[0];if(i.type!==`ordgroup`)throw new V(`Invalid environment name`,i);var a=wJ(i,`Environment name should contain only text characters and spaces`,!0);if(r===`\\begin`){if(!Object.prototype.hasOwnProperty.call(RY,a))throw new V(`No such environment: `+a,i);var o=RY[a],s=n.parseArguments(`\\begin{`+a+`}`,o),c=s.args,l=s.optArgs,u={mode:n.mode,envName:a,parser:n},d=o.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=xJ(n.parseFunction(),`environment`);if(p.name!==a)throw new V(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var zY=(e,t)=>{var n=e.font,r=t.withFont(n);return zq(e.body,r)},BY=(e,t)=>{var n=e.font,r=t.withFont(n);return eJ(e.body,r)},VY={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};Z({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=Dq(t[0]),a=r in VY?VY[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:zY,mathmlBuilder:BY}),Z({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`mclass`,mode:n.mode,mclass:MJ(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:GW(r)}}}),Z({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=e.breakOnTokenText,a=n.mode,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}}});var HY=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=zq(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=zq(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=LG(e.barSize,t),u=sq(`frac-line`,t,d)):u=sq(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===mG.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=fq({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=fq({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===mG.DISPLAY.size?t.fontMetrics().delim1:n.size===mG.SCRIPTSCRIPT.size?t.havingStyle(mG.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?Rq(t,[`mopen`]):gY(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?X([]):e.rightDelim==null?Rq(t,[`mclose`]):gY(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return X([`mord`].concat(a.sizingClasses(t)),[x,X([`mfrac`],[g]),S],t)},UY=(e,t)=>{var n=new Q(`mfrac`,[eJ(e.numer,t),eJ(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=LG(e.barSize,t);n.setAttribute(`linethickness`,H(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Q(`mo`,[new Uq(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Q(`mo`,[new Uq(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return Jq(i)}return n},WY=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;Z({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),WY({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:HY,mathmlBuilder:UY}),Z({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],numArgs:0,infix:!0,handler(e){var t=e.parser,n=e.funcName,r=e.token,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var GY=[`display`,`text`,`script`,`scriptscript`],KY=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Z({type:`genfrac`,names:[`\\genfrac`],numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`],handler(e,t){var n=e.parser,r=t[4],i=t[5],a=Dq(t[0]),o=a.type===`atom`&&a.family===`open`?KY(a.text):null,s=Dq(t[1]),c=s.type===`atom`&&s.family===`close`?KY(s.text):null,l=xJ(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=xJ(p.body[0],`textord`);f=GY[Number(m.text)]}}else p=xJ(p,`textord`),f=GY[Number(p.text)];return WY({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),Z({type:`infix`,names:[`\\above`],numArgs:1,argTypes:[`size`],infix:!0,handler(e,t){var n=e.parser;e.funcName;var r=e.token;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:xJ(t[0],`size`).value,token:r}}}),Z({type:`genfrac`,names:[`\\\\abovefrac`],numArgs:3,argTypes:[`math`,`size`,`math`],handler:(e,t)=>{var n=e.parser;e.funcName;var r=t[0],i=xJ(t[1],`infix`).size;if(!i)throw Error(`\\\\abovefrac expected size, but got `+String(i));var a=t[2],o=i.number>0;return{type:`genfrac`,mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var qY=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?zq(e.sup,t.havingStyle(n.sup()),t):zq(e.sub,t.havingStyle(n.sub()),t),i=xJ(e.base,`horizBrace`)):i=xJ(e,`horizBrace`);var a=zq(i.base,t.havingBaseStyle(mG.DISPLAY)),o=mJ(i,t),s=i.isOver?fq({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):fq({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=X([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?fq({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):fq({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return X([`minner`,i.isOver?`mover`:`munder`],[s],t)};Z({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:qY,mathmlBuilder:(e,t)=>{var n=dJ(e.label);return new Q(e.isOver?`mover`:`munder`,[eJ(e.base,t),n])}}),Z({type:`href`,names:[`\\href`],numArgs:2,argTypes:[`url`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[1],i=xJ(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:Oq(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=Nq(e.body,t,!1);return cq(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=$q(e.body,t);return n instanceof Q||(n=new Q(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Z({type:`href`,names:[`\\url`],numArgs:1,argTypes:[`url`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=xJ(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:Oq(s)}}}),Z({type:`hbox`,names:[`\\hbox`],numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0,handler(e,t){return{type:`hbox`,mode:e.parser.mode,body:Oq(t[0])}},htmlBuilder(e,t){return lq(Nq(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Q(`mrow`,Qq(e.body,t.withFont(``)))}}),Z({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName;e.token;var i=xJ(t[0],`raw`).string,a=t[1];n.settings.strict&&ZK({strict:n.settings.strict,errorCode:`htmlExtension`,errorMsg:`HTML extension is disabled on strict mode`,report:!0});var o,s={};switch(r){case`\\htmlClass`:s.class=i,o={command:`\\htmlClass`,class:i};break;case`\\htmlId`:s.id=i,o={command:`\\htmlId`,id:i};break;case`\\htmlStyle`:s.style=i,o={command:`\\htmlStyle`,style:i};break;case`\\htmlData`:for(var c=`{,}`,l=[],u=``,d=0;d<i.length;d++)i.startsWith(c,d)?(u+=`,`,d+=c.length-1):i[d]===`,`?(l.push(u),u=``):u+=i[d];l.push(u);for(var f=0;f<l.length;f++){var p=l[f],m=p.indexOf(`=`);if(m<0)throw new V(`\\htmlData key/value '`+p+`' missing equals sign`);var h=p.slice(0,m),g=p.slice(m+1);s[`data-`+h.trim()]=g}o={command:`\\htmlData`,attributes:s};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(o)?{type:`html`,mode:n.mode,attributes:s,body:Oq(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=Nq(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=X(r,n,t);for(var a of Object.entries(e.attributes)){var o=a[0],s=a[1];o!==`class`&&i.setAttribute(o,s)}return i},mathmlBuilder:(e,t)=>$q(e.body,t)}),Z({type:`htmlmathml`,names:[`\\html@mathml`],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>({type:`htmlmathml`,mode:e.parser.mode,html:Oq(t[0]),mathml:Oq(t[1])}),htmlBuilder:(e,t)=>lq(Nq(e.html,t,!1)),mathmlBuilder:(e,t)=>$q(e.mathml,t)});var JY=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new V(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!IG(n))throw new V(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Z({type:`includegraphics`,names:[`\\includegraphics`],numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1,handler:(e,t,n)=>{var r=e.parser,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=xJ(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=JY(d);break;case`height`:a=JY(d);break;case`totalheight`:o=JY(d);break;default:throw new V(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=xJ(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=LG(e.height,t),r=0;e.totalheight.number>0&&(r=LG(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=LG(e.width,t));var a={height:H(n+r)};i>0&&(a.width=H(i)),r>0&&(a.verticalAlign=H(-r));var o=new KG(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Q(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=LG(e.height,t),i=0;if(e.totalheight.number>0&&(i=LG(e.totalheight,t)-r,n.setAttribute(`valign`,H(-i))),n.setAttribute(`height`,H(r+i)),e.width.number>0){var a=LG(e.width,t);n.setAttribute(`width`,H(a))}return n.setAttribute(`src`,e.src),n}}),Z({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=xJ(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||ZK({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`),report:!0}),n.mode!==`math`&&ZK({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` works only in math mode`,report:!0})):o&&ZK({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` doesn't support mu units`,report:!0})}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return pq(e.dimension,t)},mathmlBuilder(e,t){return new Wq(LG(e.dimension,t))}}),Z({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=X([],[zq(e.body,t)]),n=X([`katex-inner`],[n],t)):n=X([`katex-inner`],[zq(e.body,t)]);var r=X([`katex-fix`],[]),i=X([e.alignment],[n,r],t),a=X([`katex-strut`]);return a.style.height=H(i.height+i.depth),i.depth&&(a.style.verticalAlign=H(-i.depth)),i.children.unshift(a),i=X([`katex-thinbox`],[i],t),X([`mord`,`katex-vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[eJ(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Z({type:`styling`,names:[`\\(`,`$`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var n=e.funcName,r=e.parser,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),Z({type:`text`,names:[`\\)`,`\\]`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new V(`Mismatched `+e.funcName)}});var YY=(e,t)=>{switch(t.style.size){case mG.DISPLAY.size:return e.display;case mG.TEXT.size:return e.text;case mG.SCRIPT.size:return e.script;case mG.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Z({type:`mathchoice`,names:[`\\mathchoice`],numArgs:4,primitive:!0,handler:(e,t)=>({type:`mathchoice`,mode:e.parser.mode,display:Oq(t[0]),text:Oq(t[1]),script:Oq(t[2]),scriptscript:Oq(t[3])}),htmlBuilder:(e,t)=>lq(Nq(YY(e,t),t,!1)),mathmlBuilder:(e,t)=>$q(YY(e,t),t)});var XY=(e,t,n,r,i,a,o)=>{e=X([],[e]);var s=n&&GW(n),c,l;if(t){var u=zq(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=zq(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=fq({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:H(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:H(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=fq({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:H(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=fq({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:H(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=X([`mspace`],[],r);m.style.marginRight=H(a),p.unshift(m)}return X([`mop`,`op-limits`],p,r)},ZY=new Set([`\\smallint`]),QY=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=xJ(e.base,`op`),i=!0):a=xJ(e,`op`);var o=t.style,s=!1;o.size===mG.DISPLAY.size&&a.symbol&&!ZY.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=$K(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=_q(d+`Size`+(s?`2`:`1`),t);c=fq({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=Nq(a.body,t,!0);p.length===1&&p[0]instanceof JG?(c=p[0],c.classes[0]=`mop`):c=X([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(eq(a.name[h],a.mode,t));c=X([`mop`],m,t)}var g=0,_=0;return(c instanceof JG||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?XY(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=H(g)),c)},$Y=(e,t)=>{var n;if(e.symbol)n=new Q(`mo`,[qq(e.name,e.mode)]),ZY.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Q(`mo`,Qq(e.body,t));else{n=new Q(`mi`,[new Uq(e.name.slice(1))]);var r=new Q(`mo`,[qq(`⁡`,`text`)]);n=e.parentIsSupSub?new Q(`mrow`,[n,r]):Hq([n,r])}return n},eX={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Z({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),numArgs:0,handler:(e,t)=>{var n=e.parser,r=e.funcName;return r.length===1&&(r=eX[r]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:QY,mathmlBuilder:$Y}),Z({type:`op`,names:[`\\mathop`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Oq(r)}}});var tX={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Z({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],numArgs:0,allowedInArgument:!0,handler(e){var t=e.parser,n=e.funcName;return n.length===1&&(n=tX[n]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var nX=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=xJ(e.base,`operatorname`),i=!0):a=xJ(e,`operatorname`);var o;if(a.body.length>0){for(var s=Nq(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof JG&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=X([`mop`],s,t)}else o=X([`mop`],[],t);return i?XY(o,n,r,t,t.style,0,0):o};Z({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`operatorname`,mode:n.mode,body:Oq(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:nX,mathmlBuilder:(e,t)=>{for(var n=Qq(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof Wq)){if(a instanceof Q)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof Uq?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}r&&(n=[new Uq(n.map(e=>e.toText()).join(``))]);var s=new Q(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Q(`mo`,[qq(`⁡`,`text`)]);return e.parentIsSupSub?new Q(`mrow`,[s,c]):Hq([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),Eq({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?lq(Nq(e.body,t,!1)):X([`mord`],Nq(e.body,t,!0),t)},mathmlBuilder(e,t){return $q(e.body,t,!0)}}),Z({type:`overline`,names:[`\\overline`],numArgs:1,handler(e,t){var n=e.parser,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=zq(e.body,t.havingCrampedStyle()),r=sq(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-overline`],[fq({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new Uq(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`mover`,[eJ(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Z({type:`phantom`,names:[`\\phantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`phantom`,mode:n.mode,body:Oq(r)}},htmlBuilder:(e,t)=>lq(Nq(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Q(`mphantom`,Qq(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),Z({type:`vphantom`,names:[`\\vphantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>X([`mord`,`rlap`],[X([`katex-inner`],[zq(e.body,t.withPhantom())]),X([`katex-fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[new Q(`mphantom`,Qq(Oq(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Z({type:`raisebox`,names:[`\\raisebox`],numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0,handler(e,t){var n=e.parser,r=xJ(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=zq(e.body,t);return fq({positionType:`shift`,positionData:-LG(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Q(`mpadded`,[eJ(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}});var rX=(e,t)=>({type:`reflectbox`,mode:e.parser.mode,body:t[0]});Z({type:`reflectbox`,names:[`\\reflectbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler:rX,htmlBuilder(e,t){return X([`mord`,`reflectbox`],[zq(e.body,t)],t)},mathmlBuilder(e,t){return eJ(e.body,t)}}),Z({type:`reflectbox`,names:[`\\mathreflectbox`],numArgs:1,argTypes:[`math`],handler:rX}),Z({type:`internal`,names:[`\\relax`],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){return{type:`internal`,mode:e.parser.mode}}}),Z({type:`rule`,names:[`\\rule`],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`],handler(e,t,n){var r=e.parser,i=n[0],a=xJ(t[0],`size`),o=xJ(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&xJ(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X([`mord`,`katex-rule`],[],t),r=LG(e.width,t),i=LG(e.height,t),a=e.shift?LG(e.shift,t):0;return n.style.borderRightWidth=H(r),n.style.borderTopWidth=H(i),n.style.bottom=H(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=LG(e.width,t),r=LG(e.height,t),i=e.shift?LG(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Q(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,H(n)),o.setAttribute(`height`,H(r));var s=new Q(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,H(i)):(s.setAttribute(`height`,H(i)),s.setAttribute(`depth`,H(-i))),s.setAttribute(`voffset`,H(i)),s}});function iX(e,t,n){for(var r=Nq(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`katex-sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return lq(r)}var aX=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Z({type:`sizing`,names:aX,numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:aX.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return iX(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Q(`mstyle`,Qq(e.body,n));return r.setAttribute(`mathsize`,H(n.sizeMultiplier)),r}}),Z({type:`smash`,names:[`\\smash`],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r=e.parser,i=!1,a=!1,o=n[0]&&xJ(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=SJ(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=X([],[zq(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return X([`mord`,`katex-smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return X([`mord`],[fq({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[eJ(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Z({type:`sqrt`,names:[`\\sqrt`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=zq(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=uq(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<mG.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,o=aY(n.height+n.depth+a+r,t),s=o.span,c=o.ruleWidth,l=o.advanceWidth,u=s.height-c;u>n.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=H(l);var f=fq({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]});if(e.index){var p=t.havingStyle(mG.SCRIPTSCRIPT),m=zq(e.index,p,t);return X([`mord`,`sqrt`],[X([`katex-root`],[fq({positionType:`shift`,positionData:-(.6*(f.height-f.depth)),children:[{type:`elem`,elem:m}]})]),f],t)}return X([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var n=e.body,r=e.index;return r?new Q(`mroot`,[eJ(n,t),eJ(r,t)]):new Q(`msqrt`,[eJ(n,t)])}});var oX={display:mG.DISPLAY,text:mG.TEXT,script:mG.SCRIPT,scriptscript:mG.SCRIPTSCRIPT};function sX(e){return e in oX}Z({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!sX(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=oX[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),iX(e.body,r,t)},mathmlBuilder(e,t){var n=oX[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Q(`mstyle`,Qq(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var cX=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===mG.DISPLAY.size||n.alwaysHandleSupSub)?QY:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===mG.DISPLAY.size||n.limits)?nX:null:n.type===`accent`?GW(n.base)?EJ:null:n.type===`horizBrace`&&!e.sub===n.isOver?qY:null:null};Eq({type:`supsub`,htmlBuilder(e,t){var n=cX(e,t);if(n)return n(e,t);var r=e.base,i=e.sup,a=e.sub,o=zq(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&GW(r);if(i){var p=t.havingStyle(t.style.sup());s=zq(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=zq(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===mG.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=H(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof JG||y)&&(v=H(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=fq({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=fq({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=fq({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return X([Lq(o,`right`)||`mord`],[o,X([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[eJ(e.base,t)];e.sub&&a.push(eJ(e.sub,t)),e.sup&&a.push(eJ(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===mG.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===mG.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===mG.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===mG.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===mG.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===mG.DISPLAY)?`munder`:`msub`}return new Q(o,a)}}),Eq({type:`atom`,htmlBuilder(e,t){return eq(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Q(`mo`,[qq(e.text,e.mode)]);if(e.family===`bin`){var r=Xq(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var lX={mi:`italic`,mn:`normal`,mtext:`normal`};Eq({type:`mathord`,htmlBuilder(e,t){return nq(e,t)},mathmlBuilder(e,t){var n=new Q(`mi`,[qq(e.text,e.mode,t)]),r=Xq(e,t)||`italic`;return r!==lX[n.type]&&n.setAttribute(`mathvariant`,r),n}}),Eq({type:`textord`,htmlBuilder(e,t){return nq(e,t)},mathmlBuilder(e,t){var n=qq(e.text,e.mode,t),r=Xq(e,t)||`normal`,i=e.mode===`text`?new Q(`mtext`,[n]):/[0-9]/.test(e.text)?new Q(`mn`,[n]):e.text===`\\prime`?new Q(`mo`,[n]):new Q(`mi`,[n]);return r!==lX[i.type]&&i.setAttribute(`mathvariant`,r),i}});var uX=new Map([[`\\nobreak`,`nobreak`],[`\\allowbreak`,`allowbreak`]]),dX=new Map([[` `,{}],[`\\ `,{}],[`~`,{className:`nobreak`}],[`\\space`,{}],[`\\nobreakspace`,{className:`nobreak`}]]);Eq({type:`spacing`,htmlBuilder(e,t){var n=dX.get(e.text),r=uX.get(e.text);if(n){var i=n.className||``;if(e.mode===`text`){var a=nq(e,t);return a.classes.push(i),a}return X([`mspace`,i],[eq(e.text,e.mode,t)],t)}if(r)return X([`mspace`,r],[],t);throw new V(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(dX.has(e.text))n=new Q(`mtext`,[new Uq(`\xA0`)]);else if(uX.has(e.text))return new Q(`mspace`);else throw new V(`Unknown type of space "`+e.text+`"`);return n}});var fX=()=>{var e=new Q(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};Eq({type:`tag`,mathmlBuilder(e,t){var n=new Q(`mtable`,[new Q(`mtr`,[fX(),new Q(`mtd`,[$q(e.body,t)]),fX(),new Q(`mtd`,[$q(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var pX={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},mX={"\\textbf":`textbf`,"\\textmd":`textmd`},hX={"\\textit":`textit`,"\\textup":`textup`},gX=(e,t)=>{var n=e.font;return n?pX[n]?t.withTextFontFamily(pX[n]):mX[n]?t.withTextFontWeight(mX[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(hX[n]):t};Z({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`text`,mode:n.mode,body:Oq(i),font:r}},htmlBuilder(e,t){var n=gX(e,t);return X([`mord`,`text`],Nq(e.body,n,!0),n)},mathmlBuilder(e,t){var n=gX(e,t);return $q(e.body,n)}}),Z({type:`underline`,names:[`\\underline`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`underline`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=zq(e.body,t),r=sq(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-underline`],[fq({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new Uq(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`munder`,[eJ(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Z({type:`vcenter`,names:[`\\vcenter`],numArgs:1,argTypes:[`original`],allowedInText:!1,handler(e,t){return{type:`vcenter`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=zq(e.body,t),r=t.fontMetrics().axisHeight;return fq({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Q(`mrow`,[new Q(`mpadded`,[eJ(e.body,t)],[`vcenter`])])}}),Z({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new V(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=_X(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push($K(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return X([`mord`,`text`].concat(i.sizingClasses(t)),iq(r),i)},mathmlBuilder(e,t){var n=new Q(`mtext`,[new Uq(_X(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var _X=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),vX=Cq,yX=`[ \r
382
+ ]`,bX=`\\\\[a-zA-Z@]+`,xX=`\\\\[^\ud800-\udfff]`,SX=`(`+bX+`)`+yX+`*`,CX=`\\\\(
383
+ |[ \r ]+
384
+ ?)[ \r ]*`,wX=`[̀-ͯ]`,TX=RegExp(wX+`+$`),EX=`(`+yX+`+)|`+(CX+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(wX+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(wX+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+SX)+(`|`+xX+`)`),DX=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(EX,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new DY(`EOF`,new EY(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new V(`Unexpected character: '`+e[t]+`'`,new DY(e[t],new EY(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
385
+ `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,ZK({strict:this.settings.strict,errorCode:`commentAtEnd`,errorMsg:`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`,report:!0})):this.tokenRegex.lastIndex=i+1,this.lex()}return new DY(r,new EY(this,t,this.tokenRegex.lastIndex))}},OX=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new V(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t of Object.keys(e))e[t]===void 0?delete this.current[t]:this.current[t]=e[t]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!Object.prototype.hasOwnProperty.call(i,e)&&(i[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}t==null?delete this.current[e]:this.current[e]=t}},kX=TY;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var AX={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new V("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=AX[t.text],r==null||r>=n)throw new V(`Invalid base-`+n+` digit `+t.text);for(var i;(i=AX[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var jX=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new V(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new V(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new V(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new V(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>jX(e,!1,!0,!1)),$(`\\renewcommand`,e=>jX(e,!0,!1,!1)),$(`\\providecommand`,e=>jX(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),vX[n],cK.math[n],cK.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var MX={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},NX=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in MX?t=MX[n]:(n.slice(0,4)===`\\not`||n in cK.math&&NX.has(cK.math[n].group))&&(t=`\\dotsb`),t});var PX={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in PX?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in PX&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in PX?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new V(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var FX=H(tK[`Main-Regular`][84][1]-.7*tK[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+FX+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+FX+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`↤`,`\\mapsfrom`),$(`\\mapsfrom`,"\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var IX=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,IX(!1)),$(`\\bra@set`,IX(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var LX={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},RX=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new OX(kX,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new DX(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken();var i=this.consumeArg([`]`]);r=i.tokens,n=i.end}else{var a=this.consumeArg();r=a.tokens,t=a.start,n=a.end}return this.pushToken(new DY(`EOF`,n.loc)),this.pushTokens(r),new DY(``,EY.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new V(`Extra }`,i)}else if(i.text===`EOF`)throw new V(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new V(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new V(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new V(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new V(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new V(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new V(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new DY(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new DX(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(vX,e)||Object.prototype.hasOwnProperty.call(cK.math,e)||Object.prototype.hasOwnProperty.call(cK.text,e)||Object.prototype.hasOwnProperty.call(LX,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(vX,e)&&!vX[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},zX=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,BX=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),VX={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},HX={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},UX=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new RX(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new V(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new DY(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&vX[i.text]&&vX[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new V(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new V(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new V(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new V(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new V(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new V(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(BX[i.text]){var s=zX.test(i.text),c=[];for(c.push(new DY(BX[i.text])),this.consume();;){var l=this.fetch().text;if(!BX[l]||zX.test(l)!==s)break;c.unshift(new DY(BX[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n&&r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:n?{type:`supsub`,mode:this.mode,base:t,sup:n}:r?{type:`supsub`,mode:this.mode,base:t,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=vX[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new V(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new V(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new V(`Can't use function '`+r+`' in math mode`,n);var a=this.parseArguments(r,i),o=a.args,s=a.optArgs;return this.callFunction(r,o,s,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=vX[e];if(o&&o.handler)return o.handler(a,t,n);throw new V(`No function handler for `+e)}parseArguments(e,t){var n=t.numOptionalArgs??0,r=t.numArgs+n;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=t.argTypes?.[o],c=o<n;(`primitive`in t&&t.primitive&&s==null||t.type===`sqrt`&&o===1&&a[0]==null)&&(s=`primitive`);var l=this.parseGroupOfType(`argument to '`+e+`'`,s,c);if(c)a.push(l);else if(l!=null)i.push(l);else throw new V(`Null argument, please report this as a bug`)}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new V(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new V(`Expected group as `+e,this.fetch());return a;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new V(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;for(var n=``,r;(r=this.fetch()).text!==`EOF`;)n+=r.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new V(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new V(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new V(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!IG(i))throw new V(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:EY.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!Object.prototype.hasOwnProperty.call(LX,r)){if(this.settings.throwOnError)throw new V(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(a&&a.type===`textord`){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:EY.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:EY.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:EY.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new V(`\\verb assertion failed --
386
+ please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Object.prototype.hasOwnProperty.call(HX,t[0])&&!cK[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&ZK({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Accented Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}),t=HX[t[0]]+t.slice(1));var i=TX.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(cK[this.mode][t]){this.settings.strict&&this.mode===`math`&&NK.includes(t)&&ZK({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e});var o=cK[this.mode][t].group,s=EY.range(e);a=bJ(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(vG(t.charCodeAt(0))?this.mode===`math`&&ZK({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}):ZK({strict:this.settings.strict,errorCode:`unknownSymbol`,errorMsg:`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),report:!0,token:e})),a={type:`textord`,mode:`text`,loc:EY.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!VX[l])throw new V(`Unknown accent ' `+l+`'`,e);var u=VX[l][this.mode]||VX[l].text;if(!u)throw new V(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:EY.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};UX.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var WX=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new UX(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new V(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new DY(`\\df@tag`)])}]}return r},GX=function(e,t,n){t.textContent=``;var r=YX(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),GX=function(){throw new V(`KaTeX doesn't work in quirks mode.`)});var KX=function(e,t){return YX(e,t).toMarkup()},qX=function(e,t){return WX(e,new ZW(t))},JX=function(e,t,n){if(n.throwOnError||!(e instanceof V))throw e;var r=X([`katex-error`],[new JG(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},YX=function(e,t){var n=new ZW(t);try{return cJ(WX(e,n),e,n)}catch(t){return JX(t,e,n)}},XX={version:`0.19.0`,render:GX,renderToString:KX,ParseError:V,SETTINGS_SCHEMA:qW,__parse:qX,__renderToDomTree:YX,__renderToHTMLTree:function(e,t){var n=new ZW(t);try{return lJ(WX(e,n),n)}catch(t){return JX(t,e,n)}},__setFontMetrics:iK,__defineSymbol:U,__defineFunction:Z,__defineMacro:$,__domTree:{Span:WG,Anchor:GG,SymbolNode:JG,SvgNode:YG,PathNode:XG,LineNode:ZG}},ZX=500,QX=new Map;function $X(e,t){let n=`${+!!t}:${e}`;if(QX.has(n)){let e=QX.get(n)??null;return QX.delete(n),QX.set(n,e),e}let r;try{let n=XX.renderToString(e,{displayMode:t,output:`htmlAndMathml`,throwOnError:!0,trust:!1,strict:`ignore`,maxExpand:1e3,maxSize:50});r=RU.sanitize(n,{USE_PROFILES:{html:!0,svg:!0,mathMl:!0}})}catch{r=null}return QX.set(n,r),QX.size>ZX&&QX.delete(QX.keys().next().value),r}var eZ=null;function tZ(e,t){let n=eZ;eZ=e;try{return t()}finally{eZ=n}}function nZ(e,t){let n=RegExp(`<span data-math="${t.nonce}:(\\d+)"></span>`,`g`);return e.replace(n,(e,n)=>t.items[Number(n)]??e)}function rZ(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function iZ(e,t,n){let r=$X(e,t);return r===null||eZ===null?rZ(n):(eZ.items.push(r),`<span data-math="${eZ.nonce}:${eZ.items.length-1}"></span>`)}var aZ=[/^\$\$[ \t]*\n?([\s\S]+?)\n?[ \t]*\$\$[ \t]*(?:\n|$)/,/^\\\[[ \t]*\n?([\s\S]+?)\n?[ \t]*\\\][ \t]*(?:\n|$)/],oZ=/^(?:\\\(([\s\S]+?)\\\)|(\$\$?)(?![\s$])((?:\\[\s\S]|[^$\\`])+?)(?<!\s)\2(?!\d))/,sZ=/^\\[()[\]]/;function cZ(e,t){let n=e.search(t);return n<0?void 0:n}var lZ=new kV({extensions:[{name:`mathLiteral`,level:`inline`,start:e=>cZ(e,/\\[()[\]]/),tokenizer(e){let t=sZ.exec(e);return t?{type:`mathLiteral`,raw:t[0]}:void 0},renderer:e=>rZ(e.raw)},{name:`mathBlock`,level:`block`,start:e=>e.match(/^(?:\$\$|\\\[)/m)?.index,tokenizer(e){for(let t of aZ){let n=t.exec(e);if(n?.[1]?.trim())return{type:`mathBlock`,raw:n[0],text:n[1].trim()}}},renderer:e=>`<p>${iZ(e.text,!0,e.raw.trimEnd())}</p>\n`},{name:`mathInline`,level:`inline`,start:e=>cZ(e,/\$|\\\(/),tokenizer(e){let t=oZ.exec(e),n=t?.[1]??t?.[3];if(t&&n?.trim())return{type:`mathInline`,raw:t[0],text:n.trim(),display:t[2]===`$$`}},renderer:e=>iZ(e.text,e.display,e.raw)}],renderer:{code({text:e,lang:t}){return`<pre><code class="${FW(t)?`hljs language-${t??``}`:`hljs`}">${IW(e,t)}</code></pre>`}}});function uZ(e){let t={nonce:crypto.randomUUID(),items:[]},n=tZ(t,()=>lZ.parse(e,{async:!1,gfm:!0,breaks:!0}));return nZ(RU.sanitize(n,{USE_PROFILES:{html:!0}}),t)}function dZ({text:e}){let t=(0,f.useMemo)(()=>uZ(e),[e]);return(0,A.jsx)(`div`,{className:`md`,dangerouslySetInnerHTML:{__html:t}})}function fZ({interaction:e,status:t}){let n=B();return(0,A.jsxs)(`section`,{"aria-label":n(`plan.row.section`),"data-plan-row":!0,"data-status":t,className:`rounded-card border border-tianyi-200 bg-surface px-3 py-2 text-sm shadow-soft`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-tianyi-700 px-2 py-0.5 text-xs font-semibold text-on-accent`,children:[(0,A.jsx)(zR,{name:`sparkles`,size:12}),n(`plan.card.badge`)]}),t!==void 0&&(0,A.jsx)(`span`,{className:`shrink-0 rounded-full border border-ink-200 bg-ink-50 px-2 py-0.5 text-xs font-medium text-ink-700`,children:VP(t)})]}),(0,A.jsx)(`p`,{className:`mt-1.5 whitespace-pre-wrap break-words font-semibold text-ink-900`,children:IP(e.title)}),(0,A.jsx)(`ol`,{className:`mt-1 max-h-40 list-decimal space-y-0.5 overflow-y-auto pl-5 text-ink-800`,children:e.steps.map((e,t)=>(0,A.jsx)(`li`,{className:`break-words pl-1`,children:(0,A.jsx)(dZ,{text:e})},t))})]})}function pZ({invocation:e}){let[t,n]=(0,f.useState)(!1);return(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-sakura-200 bg-surface text-left shadow-soft`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),"aria-expanded":t,className:`focus-neko flex w-full items-center gap-2 px-3 py-2`,children:[(0,A.jsx)(`span`,{className:`text-sakura-500`,children:(0,A.jsx)(zR,{name:`sparkles`,size:14})}),(0,A.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-semibold text-sakura-800`,children:[`skill:`,e.name]}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,title:e.location,children:e.location}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:t?`▾`:`▸`})]}),t&&(0,A.jsx)(`div`,{className:`border-t border-sakura-100 px-3 py-2`,children:(0,A.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`,children:e.body.trim()})})]})}function mZ({text:e}){let t=B(),[n,r]=(0,f.useState)(!1);return e.trim()===``?null:(0,A.jsxs)(`div`,{className:`rounded-xl border border-dashed border-sakura-300 bg-sakura-50/70`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>{r(!n)},className:`focus-neko flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-ink-600 italic`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,children:n?`▾`:`▸`}),t(`thinking.label`)]}),n&&(0,A.jsx)(`div`,{className:`px-3 pb-2 text-sm whitespace-pre-wrap text-ink-600 italic`,children:e})]})}function hZ(e,t=`edit`){if(t===`write`)return e.startsWith(`+ `)?{prefix:`+`,lineNum:``,content:e.slice(2)}:null;let n=e.match(/^([+\- ])( *\d+) (.*)$/),r=n?.[1];return r!==`+`&&r!==`-`&&r!==` `?null:{prefix:r,lineNum:n?.[2]??``,content:n?.[3]??``}}function gZ(e,t){if(e===`write`){let e=t.trim();return e===``?null:e}if(e===`edit`){let e=(t.match(/^(.*) \(\d+ edits\)$/)?.[1]??``).trim();return e===``?null:e}return null}function _Z(e){if(e==null)return;let t=e.split(`/`).pop()??``,n=t.lastIndexOf(`.`);if(n<=0)return;let r=t.slice(n+1).trim().toLowerCase();return FW(r)?r:void 0}function vZ(e,t,n=`edit`){let r=e.split(`
387
+ `),i=r.map(e=>hZ(e,n)),a=[],o=[],s=[],c=[];for(let e=0;e<i.length;e++){let t=i[e];t==null?(s.push(-1),c.push(-1)):(t.prefix===`-`?s.push(-1):(s.push(a.length),a.push(t.content)),t.prefix===`+`?c.push(-1):(c.push(o.length),o.push(t.content)))}let l=t!==void 0&&FW(t)?t:void 0;if(l!==void 0)try{return{kind:`highlighted`,rows:yZ(r,i,s,c,bZ(zU.highlight(a.join(`
388
+ `),{language:l}).value),bZ(zU.highlight(o.join(`
389
+ `),{language:l}).value))}}catch{}return{kind:`plain`,rows:yZ(r,i,s,c,a.map(LW),o.map(LW))}}function yZ(e,t,n,r,i,a){return t.map((t,o)=>{if(t===null)return{kind:`context`,gutter:``,html:LW(e[o]??``)};let s=`${t.prefix}${t.lineNum}`;if(t.prefix===`-`)return{kind:`removed`,gutter:s,html:a[r[o]??-1]??``};let c=i[n[o]??-1]??``;return t.prefix===`+`?{kind:`added`,gutter:s,html:c}:{kind:`context`,gutter:s,html:c}})}function bZ(e){let t=[],n=[],r=/<span class="([^"]*)">|<\/span>|\n/g,i=``,a=0;for(let o of e.matchAll(r)){let r=o.index;i+=e.slice(a,r),a=r+o[0].length,o[0]===`
390
+ `?(t.push(i+n.map(()=>`</span>`).join(``)),i=n.map(e=>`<span class="${e}">`).join(``)):o[1]===void 0?(n.pop(),i+=o[0]):(n.push(o[1]),i+=o[0])}return t.push(i+e.slice(a)),t}function xZ(e){let t=(0,f.useMemo)(()=>vZ(e.diff,_Z(e.path),e.format).rows.map(e=>({...e,html:RU.sanitize(e.html,{USE_PROFILES:{html:!0}})})),[e.diff,e.path,e.format]);return(0,A.jsx)(`div`,{className:e.className,children:t.map((e,t)=>(0,A.jsxs)(`div`,{className:`whitespace-pre ${e.kind===`added`?`diff-line-add`:e.kind===`removed`?`diff-line-del`:``}`,children:[(0,A.jsx)(`span`,{className:`diff-gutter`,children:e.gutter}),(0,A.jsx)(`span`,{dangerouslySetInnerHTML:{__html:e.html}})]},t))})}var SZ={pending:{label:`tool.status.pending`,icon:`clock`,spin:!1,className:`border-ink-200 bg-ink-100 text-ink-600`},running:{label:`tool.status.running`,icon:`spinner`,spin:!0,className:`border-tianyi-300 bg-tianyi-100 text-tianyi-900`},doneOk:{label:`tool.status.done`,icon:`check`,spin:!1,className:`border-ink-200 bg-ink-50 text-ink-600`},doneError:{label:`tool.status.failed`,icon:`close`,spin:!1,className:`border-2 border-sakura-500 bg-sakura-100 text-sakura-900 font-semibold`}};function CZ(e){let t=B(),[n,r]=(0,f.useState)(!1),i=e.phase===`done`?e.isError?SZ.doneError:SZ.doneOk:SZ[e.phase],a=e.phase===`done`&&e.durationMs!==void 0&&e.durationMs!==null?` · ${(e.durationMs/1e3).toFixed(1)}s`:``,o=n&&e.diff!=null,s=e.diffAdded??null,c=e.diffRemoved??null,l=s!==null&&c!==null?s>0&&c>0?`(+${s}/-${c})`:s>0?`(+${s})`:c>0?`(-${c})`:null:null,u=e.detail!==null&&!(e.name===`write`&&e.diff!=null&&!e.diffTruncated),d=u||e.output!=null||e.result!=null||e.note!=null||e.diff!=null;return(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-tianyi-200 bg-surface shadow-soft`,children:[(0,A.jsxs)(`button`,{type:`button`,"aria-expanded":d?n:void 0,onClick:()=>{d&&r(!n)},className:`focus-neko flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,A.jsx)(`span`,{className:`text-tianyi-500`,children:(0,A.jsx)(zR,{name:`bolt`,size:14})}),(0,A.jsx)(`span`,{className:`font-mono text-sm font-semibold text-tianyi-800`,children:e.name}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,children:[e.summary,l!==null&&(0,A.jsxs)(`span`,{className:`text-ink-400`,children:[` `,l]})]}),(0,A.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${i.className}`,children:[(0,A.jsx)(zR,{name:i.icon,size:12,className:i.spin?`animate-spin`:void 0}),t(i.label),a]}),d&&(0,A.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:n?`▾`:`▸`})]}),n&&(0,A.jsxs)(`div`,{className:`space-y-2 border-t border-tianyi-100 px-3 py-2`,children:[o&&e.diff!=null&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`tool.diff`)}),e.diffTruncated&&(0,A.jsx)(`div`,{className:`mb-1 text-xs text-ink-600`,children:t(`tool.diffTruncated`)}),(0,A.jsx)(xZ,{diff:e.diff,path:gZ(e.name,e.summary),format:e.name===`write`?`write`:`edit`,className:`max-h-48 overflow-auto rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`})]}),u&&(0,A.jsxs)(`div`,{children:[e.name===`write`&&e.diffTruncated&&(0,A.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`tool.fullWrite`)}),(0,A.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`,children:e.detail})]}),e.output!=null&&e.output!==``&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:t(`tool.output`)}),(0,A.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg bg-tianyi-50 p-2 font-mono text-xs text-ink-700`,children:e.output})]}),e.result!=null&&e.result!==``&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`mb-1 text-xs font-medium ${e.isError?`text-sakura-800`:`text-ink-600`}`,children:e.isError?t(`tool.errorOutput`):t(`tool.result`)}),(0,A.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg p-2 font-mono text-xs ${e.isError?`bg-sakura-50 text-sakura-900`:`bg-ink-50 text-ink-700`}`,children:e.result})]}),e.note!=null&&(0,A.jsx)(`div`,{className:`text-xs italic text-ink-500`,children:WN(e.note,t)})]})]})}var wZ=48,TZ=(e,t)=>e(`task.status.${t}`);function EZ(){let e=B(),t=`var(--color-sakura-200)`,n=`var(--color-sakura-300)`,r=`var(--color-tianyi-800)`;return(0,A.jsxs)(`svg`,{width:`132`,height:`112`,viewBox:`0 0 132 112`,fill:`none`,"aria-hidden":`true`,children:[(0,A.jsx)(`title`,{children:e(`message.cat`)}),(0,A.jsx)(`path`,{d:`M30 46 L24 14 L54 30 Z`,fill:t,stroke:n,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,A.jsx)(`path`,{d:`M102 46 L108 14 L78 30 Z`,fill:t,stroke:n,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,A.jsx)(`path`,{d:`M32 39 L29 23 L46 32 Z`,fill:n,opacity:`0.55`}),(0,A.jsx)(`path`,{d:`M100 39 L103 23 L86 32 Z`,fill:n,opacity:`0.55`}),(0,A.jsx)(`ellipse`,{cx:`66`,cy:`66`,rx:`44`,ry:`38`,fill:`var(--color-surface)`,stroke:t,strokeWidth:`2.5`}),(0,A.jsx)(`circle`,{cx:`50`,cy:`62`,r:`5`,fill:r}),(0,A.jsx)(`circle`,{cx:`82`,cy:`62`,r:`5`,fill:r}),(0,A.jsx)(`circle`,{cx:`51.8`,cy:`60`,r:`1.6`,fill:`var(--color-surface)`}),(0,A.jsx)(`circle`,{cx:`83.8`,cy:`60`,r:`1.6`,fill:`var(--color-surface)`}),(0,A.jsx)(`ellipse`,{cx:`40`,cy:`74`,rx:`6.5`,ry:`3.6`,fill:n,opacity:`0.65`}),(0,A.jsx)(`ellipse`,{cx:`92`,cy:`74`,rx:`6.5`,ry:`3.6`,fill:n,opacity:`0.65`}),(0,A.jsx)(`path`,{d:`M62 71 q4 4.5 4 1 q0 -3.5 4 -1`,stroke:`var(--color-sakura-800)`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`}),(0,A.jsx)(`path`,{d:`M18 64 L32 66 M19 72 L32 70`,stroke:t,strokeWidth:`2`,strokeLinecap:`round`}),(0,A.jsx)(`path`,{d:`M114 64 L100 66 M113 72 L100 70`,stroke:t,strokeWidth:`2`,strokeLinecap:`round`})]})}function DZ({text:e,images:t,skill:n,defaultImagePrompt:r,copy:i}){let a=B();return n===void 0?(0,A.jsxs)(`div`,{className:`chat-row anim-user flex flex-col items-end`,children:[(0,A.jsxs)(`div`,{className:`bubble-user chat-bubble px-4 py-2.5 whitespace-pre-wrap${r?` [&>div]:mt-0`:``}`,children:[e,r&&(0,A.jsxs)(`details`,{className:`min-w-0 text-sm`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer min-h-8 py-1 text-ink-500 focus-visible:outline-2 focus-visible:outline-sakura-500`,children:a(`message.defaultImagePrompt`)}),(0,A.jsx)(`p`,{className:`pt-2 whitespace-pre-wrap break-words`,children:r.text})]}),t&&(0,A.jsx)(cH,{images:t})]}),(0,A.jsx)(aH,{text:i})]}):(0,A.jsxs)(`div`,{className:`chat-row anim-user flex flex-col items-end`,children:[(0,A.jsxs)(`div`,{className:`chat-bubble flex min-w-0 flex-col items-stretch gap-1.5`,children:[(0,A.jsx)(pZ,{invocation:n}),n.args!==``&&(0,A.jsx)(`div`,{className:`bubble-user px-4 py-2.5 whitespace-pre-wrap`,children:n.args})]}),(0,A.jsx)(aH,{text:i})]})}function OZ({thinking:e,text:t}){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(mZ,{text:e}),t.trim()!==``&&(0,A.jsx)(dZ,{text:t})]})}function kZ({item:e}){let t=B();return e.text.trim()===``&&e.thinking.trim()===``&&e.note===null?null:(0,A.jsxs)(`div`,{className:`chat-row anim-other flex flex-col items-start`,children:[(0,A.jsxs)(`div`,{className:`bubble-assistant space-y-1.5 px-4 py-2.5`,children:[(0,A.jsx)(OZ,{thinking:e.thinking,text:e.text}),e.note!==null&&(0,A.jsxs)(`div`,{className:`text-xs text-sakura-800 italic`,children:[`⚠ `,WN(e.note,t)]})]}),(0,A.jsx)(aH,{text:KV(e),label:t(`message.copyAnswer`)})]})}function AZ({text:e,decision:t}){let n=B();return(0,A.jsx)(`div`,{className:`chat-row anim-other flex justify-center`,"data-plan-decision":t?``:void 0,children:(0,A.jsx)(`span`,{className:`rounded-full bg-ink-100 px-3 py-1 text-xs text-ink-600`,children:WN(e,n)})})}function jZ({item:e,pending:t,plan:n}){let r=e.interaction;if(r?.kind===`ask_user`){let e=r.status===`pending`?t?.find(e=>e.id===r.id):void 0;return(0,A.jsx)(`div`,{className:`chat-row anim-other`,children:(0,A.jsx)(nH,{interaction:r,onLocate:e?()=>{let t=$N().currentSessionId;t&&vF.open(t,e)}:void 0})})}return r?.kind===`submit_plan`?(0,A.jsx)(`div`,{className:`chat-row anim-other`,children:(0,A.jsx)(fZ,{interaction:r,status:n?.version===r.version?n.status:void 0})}):(0,A.jsxs)(`div`,{className:`chat-row anim-other`,children:[(0,A.jsx)(CZ,{name:e.name,summary:e.summary,detail:e.detail,phase:e.phase,isError:e.isError,output:e.output,result:e.result,durationMs:e.durationMs,note:e.note,diff:e.diff,diffAdded:e.diffAdded,diffRemoved:e.diffRemoved,diffTruncated:e.diffTruncated}),e.images&&(0,A.jsx)(cH,{images:e.images})]})}function MZ({streaming:e,busy:t}){let n=e.text.trim()!==``||e.thinking.trim()!==``;return(0,A.jsxs)(A.Fragment,{children:[n&&(0,A.jsx)(`div`,{className:`chat-row stream-block flex justify-start`,children:(0,A.jsxs)(`div`,{className:`bubble-assistant space-y-1.5 px-4 py-2.5`,children:[(0,A.jsx)(OZ,{thinking:e.thinking,text:e.text}),t&&(0,A.jsx)(`span`,{className:`stream-caret`,"aria-hidden":!0})]})}),e.toolCalls.map(e=>(0,A.jsx)(`div`,{className:`chat-row anim-other`,children:(0,A.jsx)(CZ,{name:e.name,summary:e.summary,detail:e.detail,phase:e.phase,output:e.output,diff:e.diff,diffAdded:e.diffAdded,diffRemoved:e.diffRemoved,diffTruncated:e.diffTruncated})},`st${e.callId}`))]})}function NZ({view:e,busy:t,onSubagent:n,emptyLabel:r,onLoadEarlier:i,tray:a,focusEntry:o}){let s=B(),c=(0,f.useRef)(null),l=(0,f.useRef)(``),u=(0,f.useRef)(!0),d=(0,f.useRef)(!1),[p,m]=(0,f.useState)(!1),h=e?.items??[],g=e?.streaming??null,_=e=>{let t=c.current;t!==null&&t.scrollTo({top:t.scrollHeight,behavior:e?`smooth`:`auto`})};return(0,f.useEffect)(()=>{if(!u.current)return;let e=c.current;e!==null&&e.scrollTo({top:e.scrollHeight})}),(0,f.useEffect)(()=>{if(!o||!h.some(e=>e.type===`user`&&e.id===o.id))return;let e=`${o.id}:${o.nonce}`;if(l.current===e)return;let t=c.current,n=t?.querySelector(`[data-entry-id="${o.id}"]`);t&&n&&(l.current=e,u.current=!1,t.scrollTop+=n.getBoundingClientRect().top-t.getBoundingClientRect().top,m(!0))},[o,h]),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsx)(`div`,{ref:c,onScroll:()=>{let e=c.current;if(e===null)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<wZ;if(u.current=t,m(!t),e.scrollTop<=24&&i&&!d.current){d.current=!0,u.current=!1;let t=e.scrollTop,n=e.scrollHeight;i().finally(()=>{requestAnimationFrame(()=>{c.current===e&&(e.scrollTop=t+e.scrollHeight-n),d.current=!1})})}},className:`min-h-0 flex-1 overflow-y-auto`,children:(0,A.jsxs)(`div`,{className:`chat-column flex flex-col gap-3 px-4 py-5`,children:[h.length===0&&g===null&&(r?(0,A.jsx)(`p`,{className:`p-4 text-sm text-ink-500`,children:r}):(0,A.jsxs)(`div`,{className:`mt-[14vh] flex flex-col items-center gap-4 text-center`,children:[(0,A.jsx)(`div`,{className:`welcome-cat`,children:(0,A.jsx)(EZ,{})}),(0,A.jsxs)(`div`,{className:`text-4xl font-extrabold tracking-tight`,children:[(0,A.jsx)(`span`,{className:`logo-gradient`,children:`neko`}),(0,A.jsx)(`span`,{className:`text-tianyi-600`,children:`.`}),(0,A.jsx)(`span`,{className:`logo-gradient`,children:`harness`})]}),(0,A.jsx)(`p`,{className:`max-w-sm text-sm text-ink-600`,children:s(`message.welcome`)})]})),h.map(t=>{switch(t.type){case`user`:{let n=e?.rounds?.find(e=>e.inputEntryId===t.id||e.taskId===t.subagentRoundId);return(0,A.jsxs)(`div`,{"data-entry-id":t.id,children:[n&&(0,A.jsxs)(`details`,{className:`chat-row border-t border-sakura-200 pt-2 text-xs text-ink-500`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer`,children:s(`message.round`,{round:n.round??``,title:n.title,status:TZ(s,n.status)})}),(0,A.jsx)(`p`,{className:`pt-1`,children:n.roundUsage?s(`message.roundUsage`,{input:n.roundUsage.input,output:n.roundUsage.output,cacheRead:n.roundUsage.cacheRead,cacheWrite:n.roundUsage.cacheWrite,cost:n.roundUsage.cost.toFixed(4)}):s(`message.roundUsageMissing`)})]}),(0,A.jsx)(DZ,{text:t.text,copy:KV(t),images:t.images,skill:t.skill,defaultImagePrompt:t.defaultImagePrompt})]},t.key)}case`assistant`:return(0,A.jsx)(kZ,{item:t},t.key);case`tool`:{let r=e?.subagents?.find(e=>e.callId===t.callId);return r&&n?(0,A.jsxs)(`button`,{type:`button`,onClick:()=>n(r.taskId),className:`focus-neko rounded-2xl border border-sakura-200 bg-surface p-4 text-left`,children:[(0,A.jsx)(`span`,{className:`text-tianyi-700`,children:r.role}),` · `,r.title,(0,A.jsxs)(`span`,{className:`block text-xs text-ink-500`,children:[TZ(s,r.status),` `,r.approvalCount?s(`message.approvalsPending`,{count:r.approvalCount}):s(`message.viewProcess`)]})]},t.key):(0,A.jsxs)(`div`,{children:[(0,A.jsx)(jZ,{item:t,pending:e?.questions?.pending,plan:e?.plan?.current}),e?.approvals?.filter(e=>e.callId===t.callId&&e.status!==`pending`).map(e=>(0,A.jsx)(`p`,{className:`chat-row text-xs text-ink-500`,children:s(`message.approvalLine`,{status:s(`approval.status.${e.status}`)})},e.id))]},t.key)}case`system`:return t.jobId===void 0?(0,A.jsx)(AZ,{text:t.text,decision:t.planDecision!==void 0},t.key):(0,A.jsx)(lH,{text:t.text,jobId:t.jobId,job:e?.jobs?.find(e=>e.jobId===t.jobId)},t.key);default:return null}}),g!==null&&(0,A.jsx)(MZ,{streaming:g,busy:t})]})}),(p||a)&&(0,A.jsxs)(`div`,{className:`discrete-in flex shrink-0 items-center justify-center gap-2 border-t border-sakura-100 bg-base/70 py-1.5`,children:[a,p&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>{u.current=!0,m(!1),_(!0)},className:`focus-neko rounded-full border border-sakura-300 bg-surface px-3.5 py-1 text-xs font-medium text-sakura-800 hover:bg-sakura-50`,children:s(`message.toBottom`)})]})]})}var PZ=()=>document.querySelector(`textarea[data-composer-input]`)?.focus();function FZ(){let{currentSessionId:e}=QN();return e?(0,A.jsx)(IZ,{sessionId:e},e):null}function IZ({sessionId:e}){let t=B(),n=WP(QN()),r=n?.awaiting??null,i=n?.online??!1,[a,o]=(0,f.useState)(null),s=(0,f.useRef)(!0);(0,f.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let c=(0,f.useRef)(new Set),l=(0,f.useRef)(null),u=n?.current??null;return(0,f.useEffect)(()=>{let e=l.current;l.current=r,!(e===null||e.version===r?.version||c.current.has(e.version))&&o(u!==null&&u.version===e.version?t(`plan.card.gone`,{status:VP(u.status)}):t(`plan.card.goneOther`))},[r,u,t]),r===null&&a===null?null:(0,A.jsx)(`section`,{"aria-label":t(`plan.card.section`),"data-plan-dock":!0,className:`flex shrink-0 flex-col px-3 pt-0.5 pb-1 sm:px-4`,children:(0,A.jsxs)(`div`,{className:`chat-column flex flex-col gap-1.5`,children:[a!==null&&(0,A.jsxs)(`output`,{"data-plan-notice":!0,className:`flex items-start gap-2 rounded-xl border border-tianyi-200 bg-surface px-3 py-2 text-sm text-ink-800`,children:[(0,A.jsx)(`span`,{className:`max-h-24 min-w-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words`,children:a}),(0,A.jsx)(KR,{label:t(`plan.card.dismiss`),onClick:()=>o(null)})]}),r!==null&&(0,A.jsx)(LZ,{sessionId:e,plan:r,online:i,deciding:c.current,onSettled:(e,t)=>{s.current&&o(KP(e,t))}},r.version)]})})}function LZ(e){let t=B(),{plan:n,online:r}=e,[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(!1),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(``),p=(0,f.useRef)(!1),m=(0,f.useRef)(null),h=(0,f.useRef)(null),g=(0,f.useId)();(0,f.useLayoutEffect)(()=>()=>{m.current?.contains(document.activeElement)&&PZ()},[]),(0,f.useEffect)(()=>{o&&h.current?.focus()},[o]);let _=c.trim(),v=!r||i!==null,y=async i=>{if(!p.current&&r){p.current=!0,e.deciding.add(n.version),a(i.kind),d(``);try{let r=await uP.planRespond(e.sessionId,{version:n.version,decision:i});if(r.status===`awaiting_approval`)throw Error(t(`plan.card.notSaved`));let a=r.status===qP(i.kind)&&(i.kind===`approve`||r.feedback===i.feedback);e.onSettled(r,a)}catch(e){d(t(`plan.card.submitFailed`,{error:YP(e)})+(i.kind===`revise`?t(`plan.card.draftKept`):``))}finally{e.deciding.delete(n.version),p.current=!1,a(null)}}},b=async()=>{if(!p.current&&r){p.current=!0,e.deciding.add(n.version),a(`exit`),d(``);try{await uP.planMode(e.sessionId,`normal`)}catch(e){d(t(`plan.card.exitFailed`,{error:YP(e)}))}finally{e.deciding.delete(n.version),p.current=!1,a(null)}}};return(0,A.jsxs)(`section`,{ref:m,"aria-label":t(`plan.card.awaiting`),"data-plan-card":!0,"data-version":n.version,className:`flex max-h-[min(50dvh,32rem)] flex-col rounded-xl border border-tianyi-300 bg-tianyi-50 text-sm shadow-soft`,children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-3 py-1.5`,children:[(0,A.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-tianyi-700 px-2 py-0.5 text-xs font-semibold text-on-accent`,children:[(0,A.jsx)(zR,{name:`sparkles`,size:12}),t(`plan.card.badge`)]}),(0,A.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-tianyi-900`,children:[VP(`awaiting_approval`),r?``:t(`plan.card.offline`)]})]}),(0,A.jsxs)(`div`,{"data-plan-body":!0,className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain border-t border-tianyi-200 px-3 py-2`,children:[(0,A.jsx)(`h2`,{"data-plan-title":!0,className:`whitespace-pre-wrap break-words font-semibold text-ink-900`,children:IP(n.title)}),(0,A.jsx)(`ol`,{"data-plan-steps":!0,className:`list-decimal space-y-1 pl-5 text-ink-900`,children:n.steps.map((e,t)=>(0,A.jsx)(`li`,{className:`break-words pl-1`,children:(0,A.jsx)(dZ,{text:e})},t))}),n.note!==``&&(0,A.jsx)(`div`,{"data-plan-note":!0,className:`break-words text-xs text-ink-700`,children:(0,A.jsx)(dZ,{text:n.note})}),o&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`${g}-feedback`,className:`mb-1 block text-xs font-medium text-ink-600`,children:t(`plan.card.feedback`)}),(0,A.jsx)(`textarea`,{ref:h,id:`${g}-feedback`,rows:3,value:c,maxLength:fj.feedbackChars,disabled:v,className:`focus-neko max-h-40 w-full resize-y rounded-lg border border-sakura-200 bg-surface px-2 py-1.5 text-base text-ink-900 disabled:opacity-60 sm:text-sm`,onChange:e=>l(e.target.value)})]})]}),(0,A.jsxs)(`div`,{className:`shrink-0 space-y-1 border-t border-tianyi-200 px-3 py-2`,children:[!r&&(0,A.jsx)(`output`,{className:`block text-xs text-sakura-800`,children:t(`plan.card.offlineNote`)}),u&&(0,A.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-sakura-800`,children:u}),(0,A.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:o?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,disabled:v||_===``,className:`btn-primary focus-neko h-9 rounded-full px-4 text-sm disabled:opacity-50`,onClick:()=>void y({kind:`revise`,feedback:_}),children:t(i===`revise`?`plan.card.submitting`:`plan.card.submitFeedback`)}),(0,A.jsx)(`button`,{type:`button`,disabled:v,className:`focus-neko h-9 rounded-full border border-ink-300 bg-surface px-3 text-sm text-ink-700 hover:bg-ink-50 disabled:opacity-50`,onClick:()=>{s(!1),d(``)},children:t(`common.cancel`)}),(0,A.jsx)(`span`,{className:`min-w-0 text-xs text-ink-500`,children:_===``?t(`plan.card.needFeedback`):`${c.length}/${fj.feedbackChars}`})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,disabled:v,className:`btn-primary focus-neko h-9 rounded-full px-4 text-sm disabled:opacity-50`,onClick:()=>void y({kind:`approve`}),children:t(i===`approve`?`plan.card.submitting`:`plan.card.approve`)}),(0,A.jsx)(`button`,{type:`button`,disabled:v,className:`focus-neko h-9 rounded-full border border-ink-300 bg-surface px-3 text-sm text-ink-700 hover:bg-ink-50 disabled:opacity-50`,onClick:()=>s(!0),children:t(`plan.card.revise`)}),(0,A.jsx)(`button`,{type:`button`,disabled:v,className:`focus-neko h-9 rounded-full border border-sakura-300 bg-surface px-3 text-sm text-sakura-800 hover:bg-sakura-50 disabled:opacity-50`,onClick:()=>void b(),children:t(i===`exit`?`plan.card.processing`:`plan.card.exit`)}),(0,A.jsx)(`span`,{className:`min-w-0 text-xs text-ink-500`,children:t(`plan.card.hint`)})]})})]})]})}var RZ=[],zZ=e=>e instanceof Error?e.message:String(e),BZ=()=>document.querySelector(`textarea[data-composer-input]`)?.focus();function VZ(e){return document.querySelector(`dialog[open]`)!==null||(e?.subagents??[]).some(e=>(e.approvalCount??0)>0&&e.historyThrough===void 0)}function HZ(e,t){if(t)return LP(e);let n=z();return e.status===`cancelled`?n(`question.card.cancelledElsewhere`):n(`question.card.handledElsewhere`,{result:LP(e)})}function UZ(){let{currentSessionId:e}=QN();return e?(0,A.jsx)(WZ,{sessionId:e},e):null}function WZ({sessionId:e}){let t=B(),n=QN(),r=_F(),i=kP(n),a=i?.online??!1,[o,s]=(0,f.useState)(()=>new Set),[c,l]=(0,f.useState)({}),[u,d]=(0,f.useState)(null),p=(0,f.useRef)(!0);(0,f.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]);let m=i?.pending??RZ,h=m.map(t=>({summary:t,key:gF(e,t.id,t.version)})).filter(({key:e})=>!o.has(e)),g=h.find(({summary:t})=>t.id===r.active[e])??h[0],_=g!==void 0&&r.fold[g.key]===`open`,v=g===void 0?void 0:c[g.key];(0,f.useLayoutEffect)(()=>{let t=h.some(({key:e})=>vF.state.fold[e]===`open`);for(let{summary:r,key:i}of h){if(vF.state.fold[i]!==void 0)continue;let a=r.id===g?.summary.id&&!t&&!nz(e)&&!VZ(n.view);vF.setFold(i,a?`open`:`folded`),a&&(t=!0)}});let y=(0,f.useCallback)((e,t,n)=>{vF.clearDraft(e),s(t=>new Set(t).add(e)),d(HZ(t,n))},[]),b=i!==null,x=(0,f.useRef)(new Map);(0,f.useEffect)(()=>{if(!b)return;let t=new Map(m.map(t=>[gF(e,t.id,t.version),t]));for(let[n,r]of x.current)t.has(n)||o.has(n)||m.some(e=>e.id===r.id)||(vF.clearDraft(n),uP.questionGet(e,r.id).then(e=>{p.current&&d(e!==null&&e.status!==`pending`?HZ(e,!1):z()(`question.card.gone`))}).catch(()=>{p.current&&d(z()(`question.card.gone`))}));x.current=t},[b,m,e,o]),(0,f.useEffect)(()=>{a&&l(e=>GZ(e))},[a]);let S=g?.key,C=g?.summary,w=v===void 0;if((0,f.useEffect)(()=>{if(S===void 0||C===void 0||!_||!a||!w)return;let n=S;l(e=>({...e,[n]:{state:`loading`}})),uP.questionGet(e,C.id).then(e=>{p.current&&(e===null?l(e=>({...e,[n]:{state:`error`,message:t(`question.card.notFound`)}})):e.status===`pending`?l(t=>({...t,[n]:{state:`ready`,record:e}})):y(n,e,!1))}).catch(e=>{p.current&&l(t=>({...t,[n]:{state:`error`,message:zZ(e)}}))})},[S,C,_,a,w,e,y,t]),g===void 0&&u===null)return null;let T=g===void 0?0:h.indexOf(g);return(0,A.jsx)(`section`,{"aria-label":t(`question.card.dock`),"data-question-dock":!0,className:`flex shrink-0 flex-col px-3 pt-0.5 pb-1 sm:px-4`,children:(0,A.jsxs)(`div`,{className:`chat-column flex flex-col gap-1.5`,children:[u!==null&&(0,A.jsxs)(`output`,{"data-question-notice":!0,className:`flex items-start gap-2 rounded-xl border border-tianyi-200 bg-surface px-3 py-2 text-sm text-ink-800`,children:[(0,A.jsx)(`span`,{className:`max-h-24 min-w-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words`,children:IP(u)}),(0,A.jsx)(KR,{label:t(`question.card.dismiss`),onClick:()=>d(null)})]}),h.length>1&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-ink-700`,children:[(0,A.jsx)(`span`,{children:t(`question.card.count`,{total:h.length,index:T+1})}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full border border-tianyi-300 px-2.5 py-0.5 disabled:opacity-50`,disabled:T===0,onClick:()=>vF.setActive(e,h[T-1].summary.id),children:t(`question.card.prev`)}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full border border-tianyi-300 px-2.5 py-0.5 disabled:opacity-50`,disabled:T===h.length-1,onClick:()=>vF.setActive(e,h[T+1].summary.id),children:t(`question.card.next`)})]}),g!==void 0&&(0,A.jsx)(KZ,{sessionId:e,summary:g.summary,questionKey:g.key,slot:v,online:a,open:_,onRetry:()=>l(({[g.key]:e,...t})=>t),onSettled:(e,t)=>y(g.key,e,t)},g.key)]})})}function GZ(e){return Object.values(e).some(e=>e.state===`error`)?Object.fromEntries(Object.entries(e).filter(([,e])=>e.state!==`error`)):e}function KZ(e){let t=B(),{summary:n,questionKey:r,open:i,online:a}=e,o=_F(),s=vF.draft(r),[c,l]=(0,f.useState)(null),[u,d]=(0,f.useState)(``),p=(0,f.useRef)(!1),m=(0,f.useRef)(null),h=(0,f.useRef)(null),g=(0,f.useRef)(null),_=(0,f.useId)(),v=e.slot?.state===`ready`?e.slot.record:null,y=(v?.options.length??n.optionCount)>0;(0,f.useLayoutEffect)(()=>()=>{m.current?.contains(document.activeElement)&&BZ()},[]);let b=o.focus?.key===r?o.focus:null,x=e.slot?.state;(0,f.useEffect)(()=>{if(b===null||!i||(x===void 0||x===`loading`)&&a)return;let e=h.current;(e?.querySelector(`[data-recommended] input:not(:disabled)`)??e?.querySelector(`input:not(:disabled)`)??e?.querySelector(`textarea:not(:disabled)`)??g.current)?.focus(),m.current?.scrollIntoView?.({block:`nearest`}),vF.consumeFocus(b.nonce)},[b,i,a,x]);let S=!a||c!==null||v===null,C=v!==null&&Ej(v,s)!==null,w=!S&&v!==null&&!C,T=async r=>{if(!p.current&&a&&v!==null){p.current=!0,l(r.kind===`skip`?`skip`:`answer`),d(``);try{let i=await uP.questionRespond(e.sessionId,{id:n.id,version:n.version,response:r});if(i.status===`pending`)throw Error(t(`question.card.notSaved`));e.onSettled(i,RP(i,r))}catch(e){d(t(`question.card.submitFailed`,{error:zZ(e)}))}finally{p.current=!1,l(null)}}},ee=()=>{let e=Tj(s);e!==null&&w&&T(e)},te=IP(n.preview).replace(/\s+/g,` `),ne=`${_}-body`;return(0,A.jsxs)(`section`,{ref:m,"aria-label":t(`question.card.section`),"data-question-card":!0,"data-open":i,className:`flex max-h-[min(42dvh,28rem)] flex-col rounded-xl border border-tianyi-300 bg-tianyi-50 text-sm shadow-soft`,children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-3 py-1.5`,children:[(0,A.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-tianyi-700 px-2 py-0.5 text-xs font-semibold text-on-accent`,children:[(0,A.jsx)(zR,{name:`sparkles`,size:12}),t(`question.card.section`)]}),(0,A.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-tianyi-900`,children:[t(`question.card.awaiting`),a?``:t(`question.card.offline`)]}),i?(0,A.jsx)(`span`,{className:`min-w-0 flex-1`}):(0,A.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-ink-700`,title:te,children:[te,n.preview.length>=dj.previewChars?`…`:``]}),!i&&(s.optionIds.length>0||s.text!==``)&&(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:t(`question.card.draftKept`)}),(0,A.jsx)(`button`,{ref:g,type:`button`,className:`focus-neko h-9 shrink-0 rounded-full border border-tianyi-300 bg-surface px-3 text-xs text-tianyi-900 hover:bg-tianyi-100`,"aria-expanded":i,"aria-controls":ne,"aria-label":t(i?`question.card.foldTitle`:`question.card.unfoldTitle`),onClick:()=>vF.setFold(r,i?`folded`:`open`),children:t(i?`question.card.fold`:`question.card.unfold`)})]}),i&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{ref:h,id:ne,"data-question-body":!0,className:`min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain border-t border-tianyi-200 px-3 py-2`,children:v===null?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-ink-900`,children:IP(n.preview)}),e.slot?.state===`error`?(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`p`,{role:`alert`,className:`min-w-0 break-words text-sm text-sakura-800`,children:t(`question.card.loadFailed`,{message:e.slot.message})}),a&&(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full border border-tianyi-300 px-3 py-1 text-xs`,onClick:e.onRetry,children:t(`common.retry`)})]}):(0,A.jsx)(`output`,{className:`block text-xs text-ink-600`,children:t(a?`question.card.loading`:`question.card.loadOffline`)})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-ink-900`,"data-question-text":!0,children:IP(v.question)}),v.options.length>0&&(0,A.jsxs)(`fieldset`,{className:`min-w-0 space-y-1.5`,"data-question-options":!0,children:[(0,A.jsx)(`legend`,{className:`mb-1 text-xs font-medium text-ink-600`,children:v.multiple?t(`question.card.chooseMany`):t(`question.card.chooseOne`)}),v.options.map((e,n)=>{let i=`${_}-option-${n}`,a=e.description?`${i}-description`:void 0;return(0,A.jsxs)(`div`,{"data-option-id":e.id,"data-recommended":e.recommended?``:void 0,className:`flex min-w-0 items-start gap-2 rounded-lg border border-tianyi-200 bg-surface px-2 py-1.5 has-[:checked]:border-tianyi-500 has-[:checked]:bg-tianyi-100`,children:[(0,A.jsx)(`input`,{id:i,type:v.multiple?`checkbox`:`radio`,name:`${_}-choice`,value:e.id,checked:s.optionIds.includes(e.id),disabled:S,"aria-describedby":a,className:`mt-1 h-4 w-4 shrink-0 accent-tianyi-600`,onChange:()=>vF.setDraft(r,wj(v,s,e.id))}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`label`,{htmlFor:i,className:`block cursor-pointer whitespace-pre-wrap break-words`,children:[IP(e.label),e.recommended&&(0,A.jsxs)(A.Fragment,{children:[` `,(0,A.jsx)(`span`,{className:`rounded-full border border-sakura-300 bg-sakura-50 px-1.5 py-0.5 text-xs text-sakura-800`,children:t(`question.card.recommended`)})]})]}),e.description&&(0,A.jsx)(`p`,{id:a,className:`whitespace-pre-wrap break-words text-xs text-ink-600`,children:IP(e.description)})]})]},e.id)}),!v.multiple&&s.optionIds.length>0&&(0,A.jsx)(`button`,{type:`button`,disabled:S,className:`focus-neko rounded-full px-2 py-0.5 text-xs text-tianyi-800 underline disabled:opacity-50`,onClick:()=>vF.setDraft(r,{...s,optionIds:[]}),children:t(`question.card.clear`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`${_}-text`,className:`mb-1 block text-xs font-medium text-ink-600`,children:t(y?`question.card.extra`:`question.card.yourAnswer`)}),(0,A.jsx)(`textarea`,{id:`${_}-text`,rows:y?2:3,value:s.text,maxLength:dj.textChars,disabled:S,className:`focus-neko max-h-40 w-full resize-y rounded-lg border border-sakura-200 bg-surface px-2 py-1.5 text-base text-ink-900 disabled:opacity-60 sm:text-sm`,onChange:e=>vF.setDraft(r,{...s,text:e.target.value})})]})]})}),(0,A.jsxs)(`div`,{className:`shrink-0 space-y-1 border-t border-tianyi-200 px-3 py-2`,children:[!a&&(0,A.jsx)(`output`,{className:`block text-xs text-sakura-800`,children:t(`question.card.offlineNote`)}),u&&(0,A.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-sakura-800`,children:u}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:!w,className:`btn-primary focus-neko h-9 rounded-full px-4 text-sm disabled:opacity-50`,onClick:ee,children:t(c===`answer`?`question.card.submitting`:`question.card.submit`)}),(0,A.jsx)(`button`,{type:`button`,disabled:S,title:t(`question.card.skipTitle`),className:`focus-neko h-9 rounded-full border border-ink-300 bg-surface px-3 text-sm text-ink-700 hover:bg-ink-50 disabled:opacity-50`,onClick:()=>void T({kind:`skip`}),children:t(c===`skip`?`question.card.skipping`:`question.card.skip`)}),(0,A.jsx)(`span`,{className:`min-w-0 text-xs text-ink-500`,children:t(C&&c===null?`question.card.needInput`:`question.card.foldHint`)})]})]})]})]})}var qZ={zh:`zh-CN`,en:`en-GB`};function JZ(e,t=FN()){return new Date(e).toLocaleString(qZ[t])}function YZ(e,t=FN()){return new Date(e).toLocaleDateString(qZ[t])}function XZ(e,t,n=FN()){return ta(e,t,n)}var ZZ=Date.now(),QZ=new Set,$Z,eQ=()=>{ZZ=Date.now();for(let e of QZ)e()},tQ=e=>(QZ.add(e),QZ.size===1&&(eQ(),$Z=setInterval(eQ,6e4),window.addEventListener(`focus`,eQ)),()=>{QZ.delete(e),QZ.size||(clearInterval($Z),window.removeEventListener(`focus`,eQ))}),nQ=()=>(0,f.useSyncExternalStore)(tQ,()=>ZZ);function rQ(e){let t=/^([A-Za-z]:)[\\/]/.exec(e)?.[1];if(t!==void 0){let n=`${t}\\`,r=e.slice(n.length).split(/[\\/]+/).filter(Boolean);return{root:`/`,rootLabel:z()(`path.thisComputer`),crumbs:[{label:t,path:n},...r.map((e,t)=>({label:e,path:n+r.slice(0,t+1).join(`\\`)}))]}}let n=e.split(`/`).filter(Boolean);return{root:`/`,rootLabel:`/`,crumbs:n.map((e,t)=>({label:e,path:`/${n.slice(0,t+1).join(`/`)}`}))}}function iQ({initialPath:e,onClose:t}){let n=B(),[r,i]=(0,f.useState)(e),[a,o]=(0,f.useState)(e),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(null),[m,h]=(0,f.useState)(!0),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(0),S=(0,f.useRef)(0),C=(0,f.useRef)(null),w=(0,f.useRef)(!1);(0,f.useEffect)(()=>{let e=++S.current;return h(!0),y(``),p(null),uP.browse({path:r,query:s,showHidden:l}).then(t=>{e===S.current&&(p(t),o(e=>e===r?t.path:e),h(!1))},t=>{e===S.current&&(y(String(t)),h(!1))}),()=>{++S.current}},[r,s,l,b]);let T=e=>{C.current?.focus(),i(e),o(e),c(``),x(e=>e+1)},ee=async()=>{if(!d?.next||m)return;let e=++S.current;h(!0),y(``);try{let t=await uP.browse({path:r,query:s,showHidden:l,cursor:d.next});e===S.current&&p({...t,entries:[...d.entries,...t.entries]})}catch(t){e===S.current&&y(String(t))}finally{e===S.current&&h(!1)}},te=async()=>{if(!(!d||m||w.current)){w.current=!0,_(!0),y(``);try{await uP.addWorkspace(d.path),t()}catch(e){y(String(e))}finally{w.current=!1,_(!1)}}},{root:ne,rootLabel:re,crumbs:E}=rQ(d?.path??r);return(0,A.jsxs)(UR,{title:n(`sessions.addWorkspace`),onClose:t,locked:g,children:[(0,A.jsxs)(`div`,{className:`picker-controls`,children:[(0,A.jsx)(`p`,{className:`text-ink-500`,children:n(`picker2.hint`)}),(0,A.jsxs)(`nav`,{className:`breadcrumbs`,"aria-label":n(`picker2.pathNav`),children:[(0,A.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>T(ne),children:re}),E.map(e=>(0,A.jsxs)(`button`,{type:`button`,disabled:g,onClick:()=>T(e.path),children:[e.label,` /`]},e.path))]}),(0,A.jsxs)(`form`,{className:`path-form`,onSubmit:e=>{e.preventDefault(),T(a)},children:[(0,A.jsx)(`input`,{ref:C,"aria-label":n(`picker2.fullPath`),value:a,disabled:g,onChange:e=>o(e.target.value)}),(0,A.jsx)(`button`,{className:`btn-outline`,type:`submit`,disabled:g,children:n(`picker2.go`)})]}),(0,A.jsxs)(`div`,{className:`filter-row`,children:[(0,A.jsx)(`input`,{"aria-label":n(`picker2.filter`),placeholder:n(`picker2.filterPlaceholder`),value:s,disabled:g,onChange:e=>c(e.target.value)}),(0,A.jsxs)(`label`,{children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:l,disabled:g,onChange:e=>u(e.target.checked)}),n(`picker2.hidden`)]})]})]}),(0,A.jsxs)(`fieldset`,{className:`folder-list`,"aria-label":n(`picker2.list`),"aria-busy":m,onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled)`)];t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()},children:[v&&(0,A.jsxs)(`div`,{role:`alert`,className:`error-text`,children:[v,(0,A.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:g,onClick:()=>x(e=>e+1),children:n(`common.retry`)})]}),d?.parent&&(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:g||m,onClick:()=>T(d.parent),children:[(0,A.jsx)(zR,{name:`up`}),n(`picker2.parent`)]}),d?.entries.map(e=>(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:g||m||!!e.error,title:e.error??e.path,onClick:()=>T(e.path),children:[(0,A.jsx)(zR,{name:`folder`}),(0,A.jsx)(`span`,{className:`truncate min-w-0`,children:e.name}),e.error&&(0,A.jsx)(`span`,{className:`text-ink-500`,children:n(`picker2.inaccessible`)})]},e.path)),m&&(0,A.jsx)(`output`,{className:`empty-text`,children:n(`picker2.loading`)}),!m&&d?.entries.length===0&&(0,A.jsx)(`p`,{className:`empty-text`,children:n(`picker2.noMatch`)}),d?.next&&(0,A.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:m||g,onClick:()=>void ee(),children:n(`picker2.more`)})]}),(0,A.jsxs)(`div`,{className:`picker-footer`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`strong`,{children:GR(d?.path??r)}),(0,A.jsx)(`p`,{className:`path-text`,children:d?.path??r})]}),(0,A.jsxs)(`div`,{className:`actions`,children:[(0,A.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:g,onClick:t,children:n(`common.cancel`)}),(0,A.jsx)(`button`,{type:`button`,className:`btn-primary px-3 py-1.5`,disabled:!d||m||g||!!v,onClick:()=>void te(),children:n(g?`picker2.adding`:`picker2.choose`)})]})]})]})}function aQ({open:e,onClose:t}){let n=B(),r=n(`common.newSession`),i=QN(),a=nQ(),o=BR(),[s,c]=(0,f.useState)(null),l=i.sessions.find(e=>e.id===s?.id),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(``),y=i.phase!==`ready`||i.operating,b=VN(i.sessions,i.workspaceRoot).filter(e=>ea(e,_)),x=e=>{e.then(()=>{o&&t()}).catch(fP)};if(!e)return null;let S=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`sidebar-top`,children:[(0,A.jsxs)(`div`,{className:`workspace-heading`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`workspace-trigger`,"aria-label":n(`sessions.switchWorkspace`),"aria-expanded":s!==null&&!s.id,disabled:y,onClick:e=>c({anchor:e.currentTarget}),children:[(0,A.jsx)(`span`,{className:`workspace-mark`,children:(0,A.jsx)(zR,{name:`folder`})}),(0,A.jsx)(`span`,{className:`truncate min-w-0`,children:GR(i.workspaceRoot)||n(`common.workspace`)}),(0,A.jsx)(zR,{name:`chevron`})]}),!o&&(0,A.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":n(`sessions.collapse`),title:n(`sessions.collapse`),onClick:t,children:(0,A.jsx)(zR,{name:`panel`})})]}),(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row font-medium`,disabled:y,onClick:()=>x(uP.createSession()),children:[(0,A.jsx)(zR,{name:`plus`}),n(`sessions.new`)]}),(0,A.jsxs)(`div`,{className:`search-box`,children:[(0,A.jsx)(zR,{name:`search`}),(0,A.jsx)(`input`,{"aria-label":n(`sessions.searchAria`),placeholder:n(`sessions.searchPlaceholder`),value:_,onChange:e=>v(e.target.value)})]})]}),(0,A.jsxs)(`div`,{className:`section-label`,children:[n(`sessions.heading`),` `,(0,A.jsx)(`span`,{children:b.length})]}),(0,A.jsxs)(`div`,{className:`session-scroll`,children:[(0,A.jsx)(`ul`,{className:`session-list`,children:b.map(e=>(0,A.jsxs)(`li`,{className:`session-row ${e.id===i.currentSessionId?`is-active`:``}`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row session-select`,disabled:y,"aria-current":e.id===i.currentSessionId?`page`:void 0,"aria-describedby":`session-tip-${e.id}`,onClick:()=>x(uP.selectSession(e.id)),children:[(0,A.jsx)(zR,{name:`chat`}),(0,A.jsxs)(`span`,{className:`session-copy`,children:[(0,A.jsx)(`span`,{className:`truncate min-w-0`,children:Xi(e,r)}),(0,A.jsxs)(`span`,{className:`session-meta${e.awaitingAnswer===!0||e.awaitingPlan===!0?` font-semibold text-tianyi-800`:``}`,children:[(0,A.jsx)(`time`,{dateTime:new Date(Zi(e)).toISOString(),children:XZ(Zi(e),a)}),PP(e)]}),(0,A.jsxs)(`span`,{className:`session-tooltip`,role:`tooltip`,id:`session-tip-${e.id}`,children:[Xi(e,r),(0,A.jsx)(`br`,{}),JZ(Zi(e))]})]})]}),(0,A.jsx)(`button`,{type:`button`,className:`icon-btn row-more`,disabled:y,"aria-label":n(`sessions.actionsFor`,{name:Xi(e,r)}),title:n(`sessions.actions`),onClick:t=>c({anchor:t.currentTarget,id:e.id}),children:(0,A.jsx)(zR,{name:`more`})})]},e.id))}),b.length===0&&(0,A.jsx)(`div`,{className:`empty-text`,children:i.phase===`ready`?n(_?`sessions.noMatch`:`sessions.empty`):n(`sessions.waitingGateway`)})]}),(0,A.jsxs)(`div`,{className:`sidebar-bottom`,children:[(0,A.jsx)(`span`,{className:`path-text`,title:i.workspaceRoot,children:i.workspaceRoot}),(0,A.jsxs)(Hr,{to:`/skills`,className:`chrome-row`,onClick:()=>{o&&t()},children:[(0,A.jsx)(zR,{name:`store`}),n(`sessions.market`)]}),(0,A.jsxs)(Hr,{to:`/settings`,className:`chrome-row`,onClick:()=>{o&&t()},children:[(0,A.jsx)(zR,{name:`settings`}),n(`sessions.settings`)]})]})]});return(0,A.jsxs)(A.Fragment,{children:[o?(0,A.jsx)(UR,{title:n(`sessions.drawer`),drawer:!0,onClose:t,children:S}):(0,A.jsx)(`aside`,{className:`chrome sidebar`,"aria-label":n(`sessions.drawer`),children:S}),s&&(0,A.jsx)(WR,{anchor:s.anchor,label:s.id?n(`sessions.actions`):n(`sessions.chooseWorkspace`),onClose:()=>c(null),children:s.id?(0,A.jsxs)(A.Fragment,{children:[l&&(0,A.jsxs)(`div`,{className:`session-details`,children:[(0,A.jsx)(`strong`,{children:Xi(l,r)}),(0,A.jsx)(`small`,{children:JZ(Zi(l))})]}),(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row`,onClick:()=>{m(s.id),g(``),c(null)},children:[(0,A.jsx)(zR,{name:`archive`}),n(`sessions.archive`)]})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`section-label`,children:n(`common.workspace`)}),(0,A.jsx)(`div`,{className:`workspace-options`,children:i.workspaces.map(e=>(0,A.jsxs)(`button`,{type:`button`,className:`workspace-option ${e.path===i.workspaceRoot?`is-active`:``}`,title:e.path,onClick:()=>{c(null),v(``),x(uP.selectWorkspace(e.path))},children:[(0,A.jsx)(zR,{name:`folder`}),(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`strong`,{children:GR(e.path)}),(0,A.jsx)(`small`,{children:e.path})]}),e.path===i.workspaceRoot&&(0,A.jsx)(`span`,{role:`img`,"aria-label":n(`sessions.currentWorkspace`),children:`✓`})]},e.path))}),(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row add-workspace`,onClick:()=>{c(null),d(!0)},children:[(0,A.jsx)(zR,{name:`plus`}),n(`sessions.addWorkspace`)]})]})}),u&&(0,A.jsx)(iQ,{initialPath:i.workspaceRoot,onClose:()=>d(!1)}),p&&(0,A.jsx)(UR,{title:n(`sessions.archive`),locked:i.operating,onClose:()=>m(null),children:(0,A.jsxs)(`div`,{className:`confirm-body`,children:[(0,A.jsx)(`p`,{children:n(`sessions.archiveConfirm`,{name:Xi(i.sessions.find(e=>e.id===p)??{title:``,firstPromptPreview:``},r)})}),h&&(0,A.jsx)(`p`,{role:`alert`,className:`error-text`,children:h}),(0,A.jsxs)(`div`,{className:`actions`,children:[(0,A.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:i.operating,onClick:()=>m(null),children:n(`common.cancel`)}),(0,A.jsx)(`button`,{type:`button`,className:`btn-primary`,disabled:i.operating,onClick:()=>{uP.archiveSession(p).then(()=>m(null)).catch(e=>g(String(e)))},children:n(`sessions.confirmArchive`)})]})]})})]})}function oQ(){let{shell:e}=QN(),t=B(),[n,r]=(0,f.useState)(null),i=hz(e),a=e?.status===`missing`?JSON.stringify([e.reason,e.detail]):null;return i===void 0||n===a?null:(0,A.jsxs)(`div`,{className:`discrete-in flex items-center gap-2 border-b border-sakura-300 bg-sakura-100 py-1 pr-2 pl-9 text-xs text-sakura-900`,role:`alert`,"data-shell-notice":!0,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 text-center`,children:i}),(0,A.jsx)(KR,{label:t(`shell.dismiss`),onClick:()=>r(a)})]})}function sQ(e,t){let n=new Map(e.map(e=>[e.key,e]));for(let e of t){let t=n.get(e.key);(t?.type!==`tool`||e.type!==`tool`||t.phase!==`done`||e.phase===`done`)&&n.set(e.key,e)}return[...n.values()].sort((e,t)=>(e.order??0)-(t.order??0))}function cQ({entry:e,active:t,target:n}){let r=B(),{phase:i,operating:a,view:o}=QN(),[s,c]=(0,f.useState)(null),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)([]),[m,h]=(0,f.useState)(),[g,_]=(0,f.useState)(!1),[,v]=(0,f.useState)(Date.now);(0,f.useEffect)(()=>{if(!t||e.activeRoundId===null)return;let n=setInterval(()=>v(Date.now()),1e3);return()=>clearInterval(n)},[t,e.activeRoundId]);let y=i===`ready`&&!a&&o!==null,b=(0,f.useMemo)(()=>y&&t?uP.subagent(e.agentId):null,[y,t,e.agentId]),x=(0,f.useRef)(0);(0,f.useEffect)(()=>{let e=++x.current;if(_(!1),h(void 0),!b)return;let t=b.view.subscribe(t=>{e===x.current&&b.error&&u(b.error),e===x.current&&t&&(c(e=>(e?.items.length&&!t.items.some(t=>e.items.some(e=>e.key===t.key))&&h(t.historyBefore),{...t,items:sQ(e?.items??[],t.items)})),h(e=>e===void 0?t.historyBefore:e),b.error||u(``))});return()=>{x.current++,t()}},[b]);let S=(0,f.useMemo)(()=>b?(e,t)=>Ji(n=>b.getImage({entryId:e,contentIndex:t,offset:n})):null,[b]),C=(0,f.useMemo)(()=>s?{...s,items:sQ(d,s.items)}:null,[s,d]),w=(0,f.useCallback)(async()=>{if(!b||g||m==null)return;let e=x.current;_(!0);try{let t=await b.history(m==null?{}:{before:m});if(e!==x.current)return;p(e=>sQ(e,t.items)),h(t.next)}catch(t){e===x.current&&u(String(t))}finally{e===x.current&&_(!1)}},[b,g,m]),T=n?s?.rounds?.find(e=>e.taskId===n.taskId)?.inputEntryId:void 0,ee=s?.rounds?.find(t=>t.taskId===(e.activeRoundId??e.lastRoundId));return(0,f.useEffect)(()=>{t&&T!==void 0&&C&&!C.items.some(e=>e.type===`user`&&e.id===T)&&m!=null&&!g&&w()},[t,T,C,m,g,w]),(0,A.jsxs)(`div`,{className:`${t?`flex`:`hidden`} min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-sakura-100 p-3 text-xs`,children:[(0,A.jsxs)(`span`,{children:[e.historyThrough===void 0?``:r(`subagent.history`),r(`task.status.${e.status}`)]}),s&&(0,A.jsxs)(`span`,{title:r(`subagent.usage`),children:[`↑`,s.usage.input,` ↓`,s.usage.output,` · $`,s.usage.cost.toFixed(4)]}),ee&&(0,A.jsxs)(`span`,{title:r(`subagent.duration`),children:[Math.max(0,Math.round(((ee.endedAt??Date.now())-ee.createdAt)/1e3)),`s`]}),e.historyThrough===void 0&&(e.status===`running`||e.status===`queued`)&&(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-lg border border-sakura-300 px-2 leading-[14px]`,onClick:()=>{b?.stop({taskId:e.activeRoundId}).catch(e=>u(String(e)))},children:r(`subagent.stop`)})]}),l&&(0,A.jsx)(`p`,{role:`alert`,className:`p-3 text-sm text-sakura-800`,children:l}),(0,A.jsx)(oH.Provider,{value:S,children:(0,A.jsx)(NZ,{view:C,focusEntry:T!==void 0&&n?{id:T,nonce:n.nonce}:void 0,onLoadEarlier:t&&m!=null?w:void 0,busy:s?.busy??!1,emptyLabel:e.status===`queued`?r(`subagent.queued`):r(`subagent.noContent`)})})]})}function lQ({entries:e,selected:t,open:n,onSelect:r,onClose:i,approval:a,target:o}){let s=B(),[c,l]=(0,f.useState)([]),u=(0,f.useRef)(null),d=(0,f.useRef)(null),[p,m]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);return(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>m(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,f.useEffect)(()=>{t!==null&&l(e=>e.includes(t)?e:[...e,t])},[t]),(0,f.useEffect)(()=>{if(!n)return;let e=document.activeElement,t=p&&d.current?.parentElement?[...d.current.parentElement.children].filter(e=>e instanceof HTMLElement&&e!==d.current):[],r=t.map(e=>e.inert);return t.forEach(e=>{e.inert=!0}),u.current?.focus(),()=>{t.forEach((e,t)=>{e.inert=r[t]}),e?.isConnected&&e.focus()}},[n,p]),(0,A.jsxs)(`aside`,{ref:d,role:p?`dialog`:`complementary`,"aria-modal":p&&n?!0:void 0,"aria-label":s(`subagent.title`),className:`${n?`flex`:`hidden`} fixed inset-0 z-30 min-w-0 flex-col border-l border-sakura-200 bg-base lg:static lg:z-auto lg:w-[min(42vw,40rem)] lg:shrink-0`,onKeyDown:e=>{if(e.currentTarget.contains(e.target)){if(e.key===`Tab`&&window.innerWidth<1024){let t=[...e.currentTarget.querySelectorAll(`button:not([disabled]),a[href],summary,[tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}e.key===`Escape`&&(e.stopPropagation(),i())}},children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,A.jsx)(`strong`,{className:`text-sm text-ink-800`,children:s(`subagent.title`)}),(0,A.jsx)(`button`,{ref:u,type:`button`,className:`focus-neko rounded-lg px-2 py-1 text-sm text-ink-600 hover:bg-sakura-50`,onClick:i,children:s(`common.close`)})]}),(0,A.jsx)(`div`,{className:`max-h-44 shrink-0 overflow-auto border-b border-sakura-100 p-2`,children:e.map(e=>(0,A.jsxs)(`button`,{type:`button`,"aria-pressed":t===e.agentId,className:`focus-neko flex w-full min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm ${t===e.agentId?`bg-tianyi-100`:`hover:bg-sakura-50`}`,onClick:()=>r(e.agentId),children:[(0,A.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,A.jsx)(`span`,{className:`text-tianyi-700`,children:e.role}),` · `,e.title]}),(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:s(`subagent.rounds`,{count:e.roundCount})})]},e.agentId))}),c.map(r=>{let i=e.find(e=>e.agentId===r);return i?(0,A.jsx)(cQ,{entry:i,active:n&&r===t,target:r===t?o:void 0},r):null}),a]})}var uQ={pending:`border-ink-300 bg-surface text-ink-600`,in_progress:`border-tianyi-300 bg-tianyi-100 text-tianyi-900`,completed:`border-ink-200 bg-ink-50 text-ink-600`};function dQ(e){let t=B(),n=OP(QN());return n===null||n.total===0?null:(0,A.jsxs)(`button`,{type:`button`,className:`focus-neko shrink-0 whitespace-nowrap rounded-full border border-sakura-300 px-2.5 py-0.5 text-xs text-sakura-800 hover:bg-sakura-50`,"aria-expanded":e.open,"aria-controls":e.panelId,"aria-label":t(`todo.aria`,{done:n.completed,total:n.total,offline:n.offline?t(`todo.ariaOffline`):``}),title:t(`todo.progressTitle`),onClick:e.onToggle,children:[(0,A.jsxs)(`span`,{className:`max-sm:hidden`,"aria-hidden":!0,children:[t(`todo.label`),` `]}),(0,A.jsxs)(`span`,{"aria-hidden":!0,children:[n.completed,`/`,n.total]})]})}function fQ(e){let t=B(),n=OP(QN());return n===null||n.total===0?null:(0,A.jsxs)(`section`,{id:e.id,"aria-label":t(`todo.panel`),"data-todo-panel":!0,className:`flex max-h-[min(45dvh,20rem)] min-h-[3rem] shrink-[10] flex-col border-b border-sakura-200 bg-base`,onKeyDown:t=>{t.key===`Escape`&&(t.stopPropagation(),e.onClose())},children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 px-4 py-1.5 text-xs`,children:[(0,A.jsx)(`strong`,{className:`text-ink-800`,children:t(`todo.heading`,{done:n.completed,total:n.total})}),n.offline&&(0,A.jsx)(`output`,{className:`rounded-full border border-sakura-300 bg-sakura-50 px-2 py-0.5 text-sakura-800`,children:t(`todo.offlineNote`)}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko ml-auto rounded-lg px-2 py-1 text-ink-600 hover:bg-sakura-50`,onClick:e.onClose,children:t(`common.close`)})]}),(0,A.jsx)(`div`,{className:`chat-column flex min-h-0 flex-1 flex-col`,children:(0,A.jsx)(`section`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-2`,"data-todo-scroll":!0,tabIndex:0,"aria-label":t(`todo.items`),children:(0,A.jsx)(`ol`,{className:`space-y-1.5`,children:n.items.map(e=>(0,A.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 text-sm`,"data-status":e.status,children:[(0,A.jsxs)(`span`,{className:`mt-0.5 inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${uQ[e.status]}`,children:[(0,A.jsx)(zR,{name:e.status===`completed`?`check`:e.status===`in_progress`?`spinner`:`clock`,size:12}),MP(e.status)]}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words text-ink-800`,children:IP(e.text)})]},e.id))})})})]})}var pQ=class extends Error{constructor(){super(z()(`export.cancelled`)),this.name=`ExportCancelledError`}};async function mQ(e){let{snapshot:t}=e,n=e.now??new Date,r=!1,i=await JV(e.format,{...t,exportedAt:n},{includeThinking:e.includeThinking,loadImage:n=>e.currentSessionId()===t.sessionId?e.readImage(n,t.sessionId):(r=!0,Promise.reject(new pQ))});if(r)throw new pQ;return{...i,fileName:qV(t.title,e.format,n)}}function hQ(e){let t=z();return e.skippedImages>0?t(`export.doneSkipped`,{name:e.fileName,count:e.skippedImages}):t(`export.done`,{name:e.fileName})}function gQ(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.hidden=!0,document.body.append(i);try{i.click()}finally{i.remove(),setTimeout(()=>URL.revokeObjectURL(r),0)}}var _Q=[{format:`markdown`,label:`Markdown (.md)`},{format:`html`,label:`HTML (.html)`},{format:`json`,label:`JSON (.json)`}];function vQ(){let e=B(),{view:t,currentSessionId:n,sessions:r}=QN(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(!1),[c,l]=(0,f.useState)(!1),u=(0,f.useRef)(!1),d=t===null||n===null||t.items.length===0,p=e(c?`export.busy`:d?`export.empty`:`export.title`),m=async i=>{if(u.current||t===null||n===null)return;u.current=!0,l(!0),a(null);let s=r.find(e=>e.id===n);try{let r=await mQ({format:i,includeThinking:o,snapshot:{sessionId:n,title:s?Xi(s,e(`common.newSession`)):e(`common.newSession`),model:t.model,cwd:t.cwd,items:t.items},currentSessionId:()=>$N().currentSessionId,readImage:(e,t)=>uP.image(e.entryId,e.contentIndex,t)});gQ(r.fileName,r.content,r.mimeType),eP.notice({level:`info`,text:hQ(r)})}catch(t){eP.notice({level:`error`,text:t instanceof pQ?t.message:e(`export.failed`,{error:t instanceof Error?t.message:String(t)})})}finally{u.current=!1,l(!1)}};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,className:`icon-btn export-btn`,"aria-label":e(`export.title`),"aria-haspopup":`dialog`,"aria-expanded":i!==null,"aria-disabled":c||void 0,disabled:d&&!c,title:p,onClick:e=>{c||a(i===null?e.currentTarget:null)},children:[(0,A.jsx)(zR,{name:`download`}),(0,A.jsx)(`span`,{className:`export-label`,children:e(c?`export.busy`:`export.button`)})]}),i&&(0,A.jsxs)(WR,{anchor:i,label:e(`export.title`),onClose:()=>a(null),children:[(0,A.jsx)(`div`,{className:`section-label`,children:e(`export.format`)}),_Q.map(({format:e,label:t})=>(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row`,onClick:()=>void m(e),children:[(0,A.jsx)(zR,{name:`download`}),t]},e)),(0,A.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":o,className:`chrome-row export-option`,onClick:()=>s(!o),children:[(0,A.jsx)(`span`,{className:`export-check`,"aria-hidden":`true`,children:o?`✓`:``}),e(`export.thinking`)]})]})]})}var yQ={资源管理器:`open.explorer`,文件管理器:`open.fileManager`,"未找到 VS Code(Code.exe)":`open.noVscodeExe`,"未找到 VS Code(命令 code 不在 PATH 中)":`open.noVscodeCommand`,"未找到 explorer.exe(需启用 Windows 互操作)":`open.noExplorer`,"未找到 xdg-open":`open.noXdg`};function bQ(e,t=z()){let n=yQ[e];return n===void 0?e:t(n)}var xQ=`neko.openTarget`;function SQ(e=localStorage){try{let t=e.getItem(xQ);return t===`vscode`||t===`file-manager`?t:void 0}catch{return}}function CQ(e,t=localStorage){try{t.setItem(xQ,e)}catch{}}function wQ(e,t){return e.find(e=>e.id===t&&e.available)??e.find(e=>e.available)}function TQ(e){if(typeof e!=`object`||!e)return!1;let{csrf:t,targets:n}=e;return typeof t==`string`&&Array.isArray(n)&&n.every(e=>typeof e==`object`&&!!e&&(e.id===`vscode`||e.id===`file-manager`)&&typeof e.label==`string`&&typeof e.available==`boolean`)}async function EQ(){try{let e=await fetch(`/api/local/session`,{cache:`no-store`});if(!e.ok)return null;let t=await e.json();return TQ(t)?t:null}catch{return null}}var DQ=class extends Error{constructor(e){super(e),this.name=`OpenWorkspaceError`}};async function OQ(e){let t,n;try{let r=await e.json();typeof r.code==`string`&&(t=r.code),typeof r.message==`string`&&(n=r.message)}catch{}let r=z();return e.status===403?r(`open.forbidden`):t===`invalid_path`?r(`open.invalidPath`):(t===`unavailable`||t===`launch_failed`)&&n!==void 0&&n!==``?bQ(n,r):r(`open.requestFailedStatus`,{status:e.status})}async function kQ(e,t,n){let r;try{r=await fetch(`/api/open`,{method:`POST`,headers:{"content-type":`application/json`,"x-neko-csrf":e},body:JSON.stringify({target:t,path:n})})}catch(e){throw new DQ(z()(`open.requestFailed`,{error:e instanceof Error?e.message:String(e)}))}if(!r.ok)throw new DQ(await OQ(r))}function AQ({size:e=18}){return(0,A.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,A.jsx)(`path`,{d:`M21.6 4.1 17.4 2 9.2 9.6 4.9 6.3 3 7.2v9.6l1.9.9 4.3-3.3 8.2 7.6 4.2-2.1z`,fill:`#0078D4`}),(0,A.jsx)(`path`,{d:`M17.4 7.4 11.6 12l5.8 4.6z`,fill:`#fff`}),(0,A.jsx)(`path`,{d:`M4.9 6.3 9.2 9.6 3 7.2zM4.9 17.7l4.3-3.3L3 16.8z`,fill:`#2AA1F5`,opacity:`0.9`})]})}function jQ({size:e=18}){return(0,A.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,A.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`18`,rx:`4.5`,fill:`#2F8CF7`}),(0,A.jsx)(`path`,{d:`M12 3h5.5A4.5 4.5 0 0 1 22 7.5v9a4.5 4.5 0 0 1-4.5 4.5H12z`,fill:`#E8F1FE`}),(0,A.jsx)(`path`,{d:`M8 9.5v2M16 9.5v2M7.5 15.5c2.7 2 6.3 2 9 0`,stroke:`#0B3A7A`,strokeWidth:`1.4`,strokeLinecap:`round`,fill:`none`})]})}function MQ({size:e=18}){return(0,A.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,A.jsx)(`path`,{d:`M2 6.5A1.5 1.5 0 0 1 3.5 5h5.3l2 2.2h9.7A1.5 1.5 0 0 1 22 8.7V18a1.5 1.5 0 0 1-1.5 1.5h-17A1.5 1.5 0 0 1 2 18z`,fill:`#F4B63F`}),(0,A.jsx)(`path`,{d:`M2 10.2h20V18a1.5 1.5 0 0 1-1.5 1.5h-17A1.5 1.5 0 0 1 2 18z`,fill:`#FFD76A`})]})}function NQ({size:e=18}){return(0,A.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,A.jsx)(`path`,{d:`M2 6.5A1.5 1.5 0 0 1 3.5 5h5.3l2 2.2h9.7A1.5 1.5 0 0 1 22 8.7V18a1.5 1.5 0 0 1-1.5 1.5h-17A1.5 1.5 0 0 1 2 18z`,fill:`#7FA6C9`}),(0,A.jsx)(`path`,{d:`M2 10.2h20V18a1.5 1.5 0 0 1-1.5 1.5h-17A1.5 1.5 0 0 1 2 18z`,fill:`#A9C6E0`})]})}function PQ({id:e,label:t,size:n}){return e===`vscode`?(0,A.jsx)(AQ,{size:n}):t===`Finder`?(0,A.jsx)(jQ,{size:n}):t===`资源管理器`?(0,A.jsx)(MQ,{size:n}):(0,A.jsx)(NQ,{size:n})}function FQ({ready:e}){let t=B(),{workspaceRoot:n,currentSessionId:r,sessions:i,view:a}=QN(),[o,s]=(0,f.useState)(null),[c,l]=(0,f.useState)(()=>SQ()),[u,d]=(0,f.useState)(null),[p,m]=(0,f.useState)(!1),h=(0,f.useRef)(!1),g=(0,f.useRef)(!0);if((0,f.useEffect)(()=>(g.current=!0,EQ().then(e=>{g.current&&s(e)}),()=>{g.current=!1}),[]),o===null)return null;let _=i.find(e=>e.id===r),v=a?.cwd??_?.workspaceRoot??n,y=wQ(o.targets,c),b=e&&r!==null&&v!==``&&y!==void 0&&!p,x=y===void 0?t(`open.title`):t(`open.withTarget`,{target:bQ(y.label,t)}),S=y===void 0?t(`open.noTargets`):r===null?t(`open.pickSession`):e?void 0:t(`open.notReady`),C=async e=>{if(!(h.current||v===``)){h.current=!0,m(!0),d(null);try{await kQ(o.csrf,e,v),CQ(e),l(e)}catch(e){eP.notice({level:`error`,text:t(`open.failed`,{error:e instanceof Error?e.message:String(e)})}),EQ().then(e=>{g.current&&e!==null&&s(e)})}finally{h.current=!1,m(!1)}}},w=e=>{u===null?(d(e),EQ().then(e=>{g.current&&e!==null&&s(e)})):d(null)};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`span`,{className:`open-split`,"data-open-workspace":!0,children:[(0,A.jsx)(`button`,{type:`button`,className:`icon-btn open-main`,"aria-label":x,title:b||p?x:t(`open.disabledTitle`,{label:x,reason:S??t(`open.unavailable`)}),disabled:!b,onClick:()=>y!==void 0&&void C(y.id),children:y===void 0?(0,A.jsx)(zR,{name:`folder`}):(0,A.jsx)(PQ,{id:y.id,label:y.label})}),(0,A.jsx)(`button`,{type:`button`,className:`icon-btn open-more`,"aria-label":t(`open.choose`),title:t(`open.choose`),"aria-haspopup":`dialog`,"aria-expanded":u!==null,disabled:!e||r===null||p,onClick:e=>w(e.currentTarget),children:(0,A.jsx)(zR,{name:`chevron`,size:16})})]}),u&&(0,A.jsxs)(WR,{anchor:u,label:t(`open.title`),onClose:()=>d(null),children:[(0,A.jsx)(`div`,{className:`section-label`,children:t(`open.title`)}),o.targets.map(e=>(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:!e.available,title:e.available||e.reason===void 0?void 0:bQ(e.reason,t),onClick:()=>void C(e.id),children:[(0,A.jsx)(PQ,{id:e.id,label:e.label}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`span`,{className:`block truncate`,children:bQ(e.label,t)}),!e.available&&e.reason!==void 0&&(0,A.jsx)(`span`,{className:`block truncate text-xs text-ink-500`,children:bQ(e.reason,t)})]})]},e.id))]})]})}var IQ={ready:`common.connected`,connecting:`common.connecting`,reconnecting:`common.reconnecting`,error:`common.connectionFailed`};function LQ(e){let t=B(),{workspaceRoot:n,currentSessionId:r,operating:i,sessions:a,view:o}=QN(),s=o?.jobs,c=s?.filter(e=>e.status===`running`).length??0,l=a.find(e=>e.id===r);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`header`,{className:`chrome topbar`,children:[(0,A.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":t(`topbar.toggleSidebar`),title:t(`topbar.toggleSidebar`),"aria-expanded":e.sidebarOpen,onClick:e.onToggleSessions,children:(0,A.jsx)(zR,{name:`panel`})}),(0,A.jsxs)(`span`,{className:`topbar-path`,title:n,children:[(0,A.jsx)(zR,{name:`folder`}),(0,A.jsx)(`span`,{className:`truncate min-w-0`,children:GR(n)||t(`common.workspace`)})]}),(0,A.jsx)(`span`,{className:`text-ink-500`,children:`/`}),(0,A.jsx)(`span`,{className:`truncate min-w-0`,title:l?Xi(l,t(`common.newSession`)):void 0,children:l?Xi(l,t(`common.newSession`)):t(`common.newSession`)}),(0,A.jsx)(`output`,{className:`conn-status ${e.conn===`ready`?`is-connected`:e.conn===`error`?`is-error`:``}`,children:t(i?`topbar.switching`:IQ[e.conn])}),e.todos&&(0,A.jsx)(dQ,{open:e.todos.open,onToggle:e.todos.onToggle,panelId:e.todos.panelId}),s!==void 0&&s.length>0&&e.onToggleJobs&&(0,A.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 whitespace-nowrap rounded-full border border-sakura-300 px-2.5 py-0.5 text-xs text-sakura-800 hover:bg-sakura-50`,"aria-expanded":e.jobsOpen,title:t(`job.panel`),onClick:e.onToggleJobs,children:t(`topbar.jobs`,{state:c>0?t(`topbar.jobsRunning`,{count:c}):t(`topbar.jobsCount`,{count:s.length})})}),(0,A.jsx)(FQ,{ready:e.conn===`ready`&&!i}),e.workspace&&(0,A.jsxs)(`button`,{type:`button`,"data-workspace-entry":!0,className:`icon-btn workspace-entry`,"aria-expanded":e.workspace.open,"aria-label":e.workspace.count>0?t(`topbar.workspaceAria`,{count:e.workspace.count}):t(`common.workspace`),title:t(`topbar.workspaceTitle`),onClick:e.workspace.onToggle,children:[(0,A.jsx)(zR,{name:`panel-right`}),e.workspace.count>0&&(0,A.jsx)(`span`,{className:`workspace-badge`,"aria-hidden":`true`,children:e.workspace.count>99?`99+`:e.workspace.count})]}),(0,A.jsx)(vQ,{})]}),(0,A.jsx)(mz,{})]})}var RQ=e=>e instanceof Error?e.message:String(e),zQ=e=>e!==void 0&&/not found|ENOENT|不存在/i.test(e);function BQ(e){let t=e.lastIndexOf(`/`);return t<0?{name:e,dir:``}:{name:e.slice(t+1),dir:e.slice(0,t)}}function VQ(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(+(e<10240))} KiB`:`${(e/1048576).toFixed(1)} MiB`}var HQ=e=>e===`main`?z()(`agent.main`):e;function UQ(e){if(e===``)return 1;let t=e.split(`
391
+ `).length;return e.endsWith(`
392
+ `)?t-1:t}function WQ(e){let t=e.split(`/`).slice(0,-1);return t.map((e,n)=>t.slice(0,n+1).join(`/`))}function GQ(e,t,n,r=0){let[i,a]=(0,f.useState)({key:e,status:`loading`,data:void 0,error:void 0}),[o,s]=(0,f.useState)(0),c=(0,f.useRef)(n);c.current=n,(0,f.useEffect)(()=>{if(!t)return;let n=new AbortController;a(t=>({key:e,status:`loading`,data:t.key===e?t.data:void 0,error:void 0}));let r=e=>{n.signal.aborted||a(e)};return Promise.resolve().then(()=>c.current(n.signal)).then(t=>r(()=>({key:e,status:`ready`,data:t,error:void 0})),t=>r(n=>({key:e,status:`error`,data:n.key===e?n.data:void 0,error:RQ(t)}))),()=>n.abort()},[e,t,r,o]);let l=(0,f.useCallback)(()=>s(e=>e+1),[]),u=i.key===e;return{status:u?i.status:`loading`,data:u?i.data:void 0,error:u?i.error:void 0,reload:l}}var KQ=(e,t)=>(0,A.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[(0,A.jsxs)(`span`,{className:`text-[#117555]`,children:[`+`,e]}),` `,(0,A.jsxs)(`span`,{className:`text-sakura-800`,children:[`-`,t]})]}),qQ=`shrink-0 rounded-full border px-1.5 py-px text-[11px] leading-4`;function JQ(e){let t=B(),{list:n}=e;return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`changes-list`,children:[(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-1.5`,children:[e.status===`error`&&(0,A.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 p-2 text-xs text-sakura-800`,children:[(0,A.jsx)(`span`,{className:`min-w-0 break-words`,children:t(`changes.listFailed`,{error:e.error??``})}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-md border border-sakura-300 px-2 py-0.5`,onClick:e.onRetry,children:t(`common.retry`)})]}),!n&&e.status===`loading`&&(0,A.jsx)(`output`,{className:`block p-2 text-xs text-ink-500`,children:t(`common.loadingEllipsis`)}),n&&n.files.length===0&&(0,A.jsx)(`div`,{"data-testid":`changes-empty`,className:`p-3 text-sm text-ink-700`,children:(0,A.jsx)(`p`,{className:`font-medium`,children:t(`changes.empty`)})}),n?.files.map(n=>{let{name:r,dir:i}=BQ(n.path);return(0,A.jsxs)(`button`,{type:`button`,"data-path":n.path,title:n.path,className:`focus-neko flex w-full min-w-0 flex-col gap-0.5 rounded-lg px-2 py-1.5 text-left hover:bg-sakura-50`,onClick:()=>e.onSelect(n.path),children:[(0,A.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-ink-800`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:r}),KQ(n.added,n.removed),(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:t(`changes.ops`,{count:n.ops})})]}),(0,A.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-ink-500`,children:[n.outside&&(0,A.jsx)(`span`,{className:`${qQ} border-sakura-300 bg-sakura-50 text-sakura-900`,children:t(`changes.outside`)}),(0,A.jsx)(`span`,{className:`min-w-0 max-w-full truncate`,dir:`ltr`,children:i===``?t(`changes.root`):i}),n.agents.map(e=>(0,A.jsx)(`span`,{className:`${qQ} border-tianyi-200 bg-tianyi-50 text-tianyi-900`,children:HQ(e)},e))]})]},n.path)}),n?.truncated&&(0,A.jsx)(`p`,{role:`note`,className:`p-2 text-xs text-sakura-800`,children:t(`changes.listIncomplete`)})]}),(0,A.jsx)(`p`,{className:`shrink-0 border-t border-sakura-100 px-3 py-1.5 text-[11px] text-ink-500`,children:t(`changes.scopeNote`)})]})}function YQ({detail:e}){let t=B(),n=(0,f.useMemo)(()=>[...e.ops].sort((e,t)=>e.seq-t.seq),[e.ops]);return(0,A.jsx)(`ol`,{className:`flex flex-col gap-3 p-3`,children:n.map((n,r)=>(0,A.jsxs)(`li`,{"data-testid":`change-op`,className:`min-w-0 rounded-lg border border-tianyi-200 bg-surface`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 border-b border-tianyi-100 px-2 py-1 text-xs text-ink-700`,children:[(0,A.jsx)(`span`,{className:`font-medium`,children:r+1}),(0,A.jsx)(`span`,{children:HQ(n.agent)}),(0,A.jsx)(`span`,{className:`font-mono text-tianyi-800`,children:n.tool}),KQ(n.added,n.removed),n.truncated&&(0,A.jsx)(`span`,{className:`${qQ} border-sakura-300 bg-sakura-50 text-sakura-900`,children:t(`changes.truncated`)})]}),(0,A.jsx)(xZ,{diff:n.diff,path:e.path,format:n.tool===`write`?`write`:`edit`,className:`max-h-80 overflow-auto p-2 font-mono text-xs text-ink-700`})]},n.seq))})}function XQ(e){let t=B(),n=GQ(`change:${e.path}`,e.active,()=>e.api().change(e.path),e.revision),{name:r,dir:i}=BQ(e.path),a=n.data,o=a?a.outside===!0:e.outside===!0;return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`change-detail`,children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sakura-100 px-3 py-2 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50`,onClick:e.onBack,children:t(`changes.backToList`)}),(0,A.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-sm text-ink-800`,title:e.path,children:r}),!o&&(0,A.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50`,onClick:()=>e.onView(e.path),children:t(`changes.viewCurrent`)})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-ink-500`,children:[o&&(0,A.jsx)(`span`,{className:`${qQ} border-sakura-300 bg-sakura-50 text-sakura-900`,children:t(`changes.outside`)}),(0,A.jsx)(`span`,{className:`min-w-0 break-all`,title:e.path,children:i===``?t(`viewer.workspaceRoot`):i})]})]}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden`,children:[n.status===`error`&&(0,A.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 p-3 text-xs text-sakura-800`,children:[(0,A.jsx)(`span`,{className:`min-w-0 break-words`,children:t(`changes.detailFailed`,{error:n.error??``})}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-md border border-sakura-300 px-2 py-0.5`,onClick:n.reload,children:t(`common.retry`)})]}),!a&&n.status===`loading`&&(0,A.jsx)(`output`,{className:`block p-3 text-xs text-ink-500`,children:t(`common.loadingEllipsis`)}),a===null&&(0,A.jsx)(`p`,{className:`p-3 text-sm text-ink-600`,children:t(`changes.noRecords`)}),a&&(0,A.jsxs)(A.Fragment,{children:[a.truncated&&(0,A.jsx)(`p`,{role:`note`,className:`px-3 pt-2 text-xs text-sakura-800`,children:t(`changes.detailIncomplete`)}),(0,A.jsx)(YQ,{detail:a})]})]})]})}var ZQ=`focus-neko flex w-full min-w-0 cursor-pointer items-center gap-1.5 rounded-md py-1 pr-2 text-left text-sm text-ink-800 hover:bg-sakura-50 aria-selected:bg-tianyi-100`;function QQ(e,t,n,r){let i=e.currentTarget.closest(`[role=tree]`);if(!i)return;let a=[...i.querySelectorAll(`[role=treeitem][data-path]`)],o=a.indexOf(e.currentTarget),s=t.kind===`directory`,c=r.expanded.has(t.path),l=t=>{t&&(e.preventDefault(),t.focus())};switch(e.key){case`ArrowDown`:return l(a[o+1]);case`ArrowUp`:return l(a[o-1]);case`Home`:return l(a[0]);case`End`:return l(a.at(-1));case`ArrowRight`:return s?c?l(a[o+1]?.dataset.parent===t.path?a[o+1]:void 0):(e.preventDefault(),r.onToggle(t.path)):void 0;case`ArrowLeft`:return s&&c?(e.preventDefault(),r.onToggle(t.path)):l(a.find(e=>e.dataset.path===n));case`Enter`:case` `:return e.preventDefault(),s?r.onToggle(t.path):r.onOpen(t.path)}}function $Q({entry:e,parent:t,depth:n,first:r,ctx:i}){let a=B(),o=e.kind===`directory`,s=o&&i.expanded.has(e.path),c=(0,f.useRef)(i.onRowGone);return c.current=i.onRowGone,(0,f.useEffect)(()=>{let t=e.path;return()=>c.current(t)},[e.path]),(0,A.jsxs)(`div`,{role:`treeitem`,tabIndex:i.focusPath===e.path||i.focusPath===null&&r?0:-1,"aria-level":n+1,"aria-expanded":o?s:void 0,"aria-selected":i.selected===e.path,"data-path":e.path,"data-parent":t,title:e.path,className:ZQ,style:{paddingLeft:`${.375+n*.875}rem`},onFocus:()=>i.onFocusPath(e.path),onClick:()=>o?i.onToggle(e.path):i.onOpen(e.path),onKeyDown:n=>QQ(n,e,t,i),children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`w-3 shrink-0 text-ink-400`,children:o?s?`▾`:`▸`:``}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:`w-3.5 shrink-0 text-ink-400`,children:o&&(0,A.jsx)(zR,{name:`folder`,size:14})}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.kind===`symlink`&&(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,title:a(`tree.symlinkTitle`),role:`img`,"aria-label":a(`tree.symlink`),children:`↪`}),e.protected&&(0,A.jsx)(`span`,{className:`shrink-0 text-ink-500`,title:a(`tree.protectedTitle`),role:`img`,"aria-label":a(`tree.protected`),children:(0,A.jsx)(zR,{name:`key`,size:13})})]})}function e$({path:e,depth:t,ctx:n}){let r=B(),i=GQ(e,n.active,t=>n.api().dir(e,t),n.version),a={paddingLeft:`${.375+t*.875+1.25}rem`},o=i.data?.entries;return(0,A.jsxs)(A.Fragment,{children:[o?.map((r,i)=>(0,A.jsx)(t$,{entry:r,parent:e,depth:t,first:t===0&&i===0,ctx:n},r.path)),o&&o.length===0&&i.status!==`error`&&(0,A.jsx)(`div`,{className:`py-1 pr-2 text-xs text-ink-500`,style:a,children:r(`tree.emptyDir`)}),!o&&i.status===`loading`&&(0,A.jsx)(`output`,{className:`block py-1 pr-2 text-xs text-ink-500`,style:a,children:r(`common.loadingEllipsis`)}),i.status===`error`&&(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-1 pr-2 text-xs text-sakura-800`,style:a,role:`alert`,children:[(0,A.jsx)(`span`,{className:`min-w-0 break-words`,children:r(`tree.readFailed`,{error:i.error??``})}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 rounded-md border border-sakura-300 px-2 py-0.5`,onClick:i.reload,children:r(`common.retry`)})]}),i.data&&(i.data.incomplete||i.data.limited)&&(0,A.jsx)(`div`,{className:`py-1 pr-2 text-xs text-sakura-800`,style:a,role:`note`,children:r(`tree.incomplete`,{reason:i.data.limited?r(`tree.limitedDir`):r(`tree.limitedWorkspace`)})})]})}function t$({entry:e,parent:t,depth:n,first:r,ctx:i}){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($Q,{entry:e,parent:t,depth:n,first:r,ctx:i}),e.kind===`directory`&&i.expanded.has(e.path)&&(0,A.jsx)(e$,{path:e.path,depth:n+1,ctx:i})]})}function n$(e){let t=B(),[n,r]=(0,f.useState)(null),i={api:e.api,active:e.active,version:e.version,expanded:e.expanded,selected:e.selected,focusPath:n,onToggle:t=>{r(t),e.onToggle(t)},onOpen:e.onOpen,onFocusPath:r,onRowGone:e=>r(t=>t===e?null:t)};return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-sakura-100 px-3 py-1.5 text-xs`,children:[(0,A.jsx)(`span`,{className:`text-ink-600`,children:t(`tree.readOnly`)}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50`,"aria-label":t(`tree.refreshAria`),onClick:e.onRefresh,children:t(`tree.refresh`)})]}),(0,A.jsx)(`div`,{role:`tree`,"aria-label":t(`tree.aria`),className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-1.5`,children:(0,A.jsx)(e$,{path:``,depth:0,ctx:i})})]})}var r$=2e5,i$=`neko.fileZoom`,a$=50,o$=300,s$=10,c$=e=>Math.min(o$,Math.max(a$,Math.round(e)));function l$(){try{let e=Number(localStorage.getItem(i$));return Number.isFinite(e)&&e>0?c$(e):100}catch{return 100}}function u$(e){let t=B(),n=(e.file.content??``).replace(/\n$/,``),r=(0,f.useMemo)(()=>{let t=n.length>r$?void 0:_Z(e.file.path);return RU.sanitize(IW(n,t),{USE_PROFILES:{html:!0}})},[n,e.file.path]),i=(0,f.useMemo)(()=>Array.from({length:UQ(n)},(e,t)=>t+1).join(`
393
+ `),[n]),a=(0,f.useRef)(null),o=(0,f.useRef)(e.onZoom);return o.current=e.onZoom,(0,f.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{(e.ctrlKey||e.metaKey)&&(e.preventDefault(),o.current(e.deltaY<0?s$:-10))};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]),(0,A.jsx)(`section`,{ref:a,"aria-label":t(`viewer.content`),"data-testid":`file-code`,tabIndex:0,className:`focus-neko min-h-0 flex-1 overflow-auto bg-base`,children:(0,A.jsxs)(`div`,{"data-testid":`file-code-scale`,className:`flex min-w-max font-mono`,style:{fontSize:`${12*e.zoom/100}px`,lineHeight:`${20*e.zoom/100}px`},children:[(0,A.jsx)(`pre`,{"aria-hidden":!0,"data-testid":`file-gutter`,className:`sticky left-0 shrink-0 select-none border-r border-sakura-100 bg-base px-2 py-2 text-right text-ink-400`,children:i}),(0,A.jsx)(`pre`,{className:`hljs px-3 py-2 whitespace-pre`,children:(0,A.jsx)(`code`,{dangerouslySetInnerHTML:{__html:r}})})]})})}function d$(e){return(0,A.jsxs)(`div`,{role:e.tone===`error`?`alert`:`status`,"data-testid":`file-notice`,className:`flex flex-col items-start gap-2 p-4 text-sm`,children:[(0,A.jsx)(`p`,{className:`font-medium ${e.tone===`error`?`text-sakura-800`:`text-ink-800`}`,children:e.title}),e.detail&&(0,A.jsx)(`p`,{className:`break-words text-xs text-ink-600`,children:e.detail}),e.action&&(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-lg border border-sakura-300 px-3 py-1 text-xs text-sakura-800 hover:bg-sakura-50`,onClick:e.action.run,children:e.action.label})]})}function f$(e){let t=B(),n=GQ(e.path,e.active,t=>e.api().file(e.path,t)),{name:r,dir:i}=BQ(e.path),a=(0,f.useRef)(null);(0,f.useEffect)(()=>a.current?.focus(),[]);let o=e.changes?.files.find(t=>t.path===e.path)?.lastSeq??0,s=e.changes!==void 0,c=(0,f.useRef)(void 0),[l,u]=(0,f.useState)(!1),d=n.data;(0,f.useEffect)(()=>{c.current=s?o:void 0,u(!1)},[d]),(0,f.useEffect)(()=>{s&&(c.current===void 0?c.current=o:o>c.current&&u(!0))},[s,o]);let[p,m]=(0,f.useState)(l$);(0,f.useEffect)(()=>{try{localStorage.setItem(i$,String(p))}catch{}},[p]);let h=e=>m(t=>c$(t+e)),g=`focus-neko rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50 disabled:opacity-50`,_=n.data,v=n.status===`error`&&!_&&zQ(n.error);return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`file-viewer`,children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sakura-100 px-3 py-2 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,A.jsx)(`button`,{ref:a,type:`button`,className:`focus-neko shrink-0 rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50`,onClick:e.onBack,children:e.backLabel}),(0,A.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-sm text-ink-800`,title:e.path,children:r}),(0,A.jsxs)(`fieldset`,{"aria-label":t(`viewer.zoom`),className:`flex min-w-0 shrink-0 items-center gap-1`,children:[(0,A.jsx)(`button`,{type:`button`,className:g,"aria-label":t(`viewer.zoomOut`),disabled:p<=a$,onClick:()=>h(-10),children:`−`}),(0,A.jsxs)(`button`,{type:`button`,className:`${g} min-w-12`,"aria-label":t(`viewer.zoomReset`),title:t(`viewer.zoomResetTitle`),disabled:p===100,onClick:()=>m(100),children:[p,`%`]}),(0,A.jsx)(`button`,{type:`button`,className:g,"aria-label":t(`viewer.zoomIn`),disabled:p>=o$,onClick:()=>h(s$),children:`+`})]}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko shrink-0 rounded-lg border border-sakura-300 px-2 py-0.5 text-sakura-800 hover:bg-sakura-50 disabled:opacity-50`,"aria-label":t(`viewer.refreshAria`),disabled:n.status===`loading`,onClick:n.reload,children:n.status===`loading`&&_?t(`viewer.refreshing`):t(`viewer.refresh`)})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-0.5 text-ink-500`,children:[(0,A.jsx)(`span`,{className:`min-w-0 break-all`,title:e.path,children:i===``?t(`viewer.workspaceRoot`):i}),_&&(0,A.jsx)(`span`,{className:`shrink-0`,children:VQ(_.size)})]})]}),l&&(0,A.jsxs)(`output`,{className:`flex shrink-0 flex-wrap items-center gap-2 bg-tianyi-50 px-3 py-1.5 text-xs text-tianyi-900`,children:[(0,A.jsx)(`span`,{children:t(`viewer.stale`)}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-md border border-tianyi-300 px-2 py-0.5`,onClick:n.reload,children:t(`viewer.reload`)})]}),v?(0,A.jsx)(d$,{title:t(`viewer.missing`),detail:t(`viewer.missingDetail`),action:{label:t(`common.retry`),run:n.reload}}):n.status===`error`&&!_?(0,A.jsx)(d$,{tone:`error`,title:t(`viewer.readFailed`,{error:n.error??``}),action:{label:t(`common.retry`),run:n.reload}}):_?_.kind===`protected`?(0,A.jsx)(d$,{title:t(`viewer.protected`),detail:t(`viewer.protectedDetail`)}):_.kind===`binary`?(0,A.jsx)(d$,{title:t(`viewer.binary`),detail:t(`viewer.binarySize`,{size:VQ(_.size)})}):(0,A.jsxs)(A.Fragment,{children:[n.status===`error`&&(0,A.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 flex-wrap items-center gap-2 px-3 py-1.5 text-xs text-sakura-800`,children:[(0,A.jsx)(`span`,{className:`min-w-0 break-words`,children:t(`viewer.refreshFailed`,{error:n.error??``})}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-md border border-sakura-300 px-2 py-0.5`,onClick:n.reload,children:t(`common.retry`)})]}),_.truncated&&(0,A.jsx)(`div`,{role:`note`,className:`shrink-0 bg-sakura-50 px-3 py-1.5 text-xs text-sakura-900`,children:t(`viewer.truncated`,{size:VQ(_.size)})}),(0,A.jsx)(u$,{file:_,zoom:p,onZoom:h})]}):(0,A.jsx)(d$,{title:t(`common.loadingEllipsis`)})]})}function p$({sessionId:e,open:t,onClose:n,changes:r,width:i,onWidth:a}){let o=B(),s=(0,f.useCallback)(()=>uP.workspace(e),[e]),[c,l]=(0,f.useState)(`files`),[u,d]=(0,f.useState)(()=>new Set),[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(0),y=r?.revision??0,b=(0,f.useId)(),x=e=>`${b}-tab-${e}`,S=`${b}-panel`,C=t&&c===`files`&&p===null,w=t&&c===`files`&&p!==null,T=t&&c===`changes`&&h===null,ee=t&&c===`changes`&&h!==null,te=GQ(`changes`,T||w,()=>s().changes(),y),ne=(0,f.useRef)(null),re=(0,f.useRef)(null),[E,ie]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>ie(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,f.useEffect)(()=>{if(!t)return;let e=document.activeElement,n=E&&re.current?.parentElement?[...re.current.parentElement.children].filter(e=>e instanceof HTMLElement&&e!==re.current):[],r=n.map(e=>e.inert);return n.forEach(e=>{e.inert=!0}),ne.current?.focus(),()=>{n.forEach((e,t)=>{e.inert=r[t]}),e?.isConnected&&e.focus()}},[t,E]);let ae=(0,f.useRef)(null);(0,f.useEffect)(()=>{let e=ae.current;e!==null&&p===null&&c===`files`&&(ae.current=null,[...re.current?.querySelectorAll(`[role=treeitem][data-path]`)??[]].find(t=>t.dataset.path===e)?.focus())},[p,c]);let oe=e=>d(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),D=e=>{d(t=>new Set([...t,...WQ(e)])),m(e),l(`files`)},se=e=>{l(e),document.getElementById(x(e))?.focus()},ce=e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`Home`||e.key===`End`)&&(e.preventDefault(),se(e.key===`ArrowLeft`||e.key===`Home`?`files`:`changes`))},le=(0,f.useRef)(null),ue=e=>{let t=e.key===`ArrowLeft`?LR.step:e.key===`ArrowRight`?-LR.step:0;t!==0&&(e.preventDefault(),e.stopPropagation(),a(RR(i+t)))},de=r?.files??0,fe=e=>`focus-neko rounded-t-lg border-b-2 px-3 py-1.5 text-sm ${c===e?`border-sakura-500 font-medium text-sakura-900`:`border-transparent text-ink-600 hover:bg-sakura-50`}`;return(0,A.jsxs)(`aside`,{ref:re,role:E?`dialog`:`complementary`,"aria-modal":E&&t?!0:void 0,"aria-label":o(`common.workspace`),"data-workspace-panel":!0,style:{"--workspace-w":`${i}px`},className:`${t?`flex`:`hidden`} fixed inset-0 z-30 min-w-0 flex-col border-l border-sakura-200 bg-base lg:relative lg:z-auto lg:w-[var(--workspace-w)] lg:max-w-[60vw] lg:shrink-0`,onKeyDown:e=>{if(e.currentTarget.contains(e.target)){if(e.key===`Tab`&&window.innerWidth<1024){let t=[...e.currentTarget.querySelectorAll(`button:not([disabled]),a[href],summary,[tabindex='0'],[role=treeitem][tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}e.key===`Escape`&&(e.stopPropagation(),n())}},children:[(0,A.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":o(`wspanel.resize`),"aria-valuemin":LR.min,"aria-valuemax":LR.max,"aria-valuenow":i,tabIndex:0,className:`focus-neko absolute inset-y-0 -left-1 z-10 hidden w-2 cursor-col-resize touch-none hover:bg-sakura-200 lg:block`,onKeyDown:ue,onPointerDown:e=>{le.current=e.pointerId,e.currentTarget.setPointerCapture?.(e.pointerId)},onPointerMove:e=>{le.current===e.pointerId&&a(RR(window.innerWidth-e.clientX))},onPointerUp:()=>{le.current=null},onPointerCancel:()=>{le.current=null}}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,A.jsx)(`strong`,{className:`text-sm text-ink-800`,children:o(`common.workspace`)}),(0,A.jsx)(`button`,{ref:ne,type:`button`,className:`focus-neko rounded-lg px-2 py-1 text-sm text-ink-600 hover:bg-sakura-50`,"aria-label":o(`wspanel.close`),onClick:n,children:o(`common.close`)})]}),(0,A.jsxs)(`div`,{role:`tablist`,"aria-label":o(`wspanel.views`),className:`flex shrink-0 gap-1 border-b border-sakura-100 px-2 pt-1`,children:[(0,A.jsx)(`button`,{type:`button`,role:`tab`,id:x(`files`),"aria-selected":c===`files`,"aria-controls":S,tabIndex:c===`files`?0:-1,className:fe(`files`),onClick:()=>l(`files`),onKeyDown:ce,children:o(`wspanel.files`)}),(0,A.jsx)(`button`,{type:`button`,role:`tab`,id:x(`changes`),"aria-selected":c===`changes`,"aria-controls":S,tabIndex:c===`changes`?0:-1,className:fe(`changes`),onClick:()=>l(`changes`),onKeyDown:ce,children:o(`wspanel.changes`,{count:de})})]}),(0,A.jsxs)(`div`,{role:`tabpanel`,id:S,"aria-labelledby":x(c),className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,A.jsx)(`div`,{className:`${c===`files`&&p===null?`flex`:`hidden`} min-h-0 flex-1 flex-col`,children:(0,A.jsx)(n$,{api:s,active:C,version:`${_}:${y}`,expanded:u,selected:p,onToggle:oe,onOpen:m,onRefresh:()=>v(e=>e+1)})}),c===`files`&&p!==null&&(0,A.jsx)(f$,{api:s,path:p,active:w,changes:te.data,backLabel:o(`wspanel.backToTree`),onBack:()=>{ae.current=p,m(null)}},p),c===`changes`&&h===null&&(0,A.jsx)(JQ,{list:te.data,status:te.status,error:te.error,onRetry:te.reload,onSelect:g}),c===`changes`&&h!==null&&(0,A.jsx)(XQ,{api:s,path:h,active:ee,revision:y,outside:te.data?.files.some(e=>e.path===h&&e.outside),onBack:()=>g(null),onView:D},h)]})]})}function m$(e,t=!1){let n=IN();(0,f.useEffect)(()=>{let n=null,r=()=>{let r=document.title,i=n!==null&&r===n.title?n.base:r;if(!(document.hidden&&(e>0||t))){n!==null&&r===n.title&&(document.title=i),n=null;return}let a=XP(i,e,t);document.title=a,n={base:i,title:a}};return r(),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`visibilitychange`,r),n!==null&&document.title===n.title&&(document.title=n.base)}},[e,t,n])}var h$=8e3;function g$(){let e=B(),{view:t,phase:n,notice:r,operating:i,workspaceRoot:a,currentSessionId:o,retained:s}=QN(),c=BR();(0,f.useEffect)(()=>{if(r?.level!==`info`)return;let e=setTimeout(eP.clearNotice,h$);return()=>clearTimeout(e)},[r]);let l=(0,f.useRef)(0),[u,d]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>d(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let[p,m]=(0,f.useState)({}),h=t?.agents,[g,_]=(0,f.useState)(null),v=(0,f.useRef)(g);v.current=g,(0,f.useEffect)(()=>{_(e=>e&&e.sessionId!==o?null:e)},[o]),(0,f.useEffect)(()=>{o&&h?.length&&m(e=>({...e,[o]:{open:e[o]?e[o].open:v.current?.sessionId!==o,...e[o]?.target?{target:e[o].target}:{},selected:e[o]?.selected??h[0].agentId,entries:h}}))},[h,o]);let y=g?.kind===`jobs`&&g.sessionId===o,b=g?.kind===`workspace`&&g.sessionId===o,x=e=>{if(o){if(g?.kind===e&&g.sessionId===o)return _(null);m(e=>e[o]?{...e,[o]:{...e[o],open:!1}}:e),_({sessionId:o,kind:e})}},[S,C]=(0,f.useState)(null);(0,f.useEffect)(()=>{o&&t?.changes!==void 0&&C(o)},[o,t?.changes]);let[w,T]=(0,f.useState)(LR.initial),ee=(0,f.useId)(),[te,ne]=(0,f.useState)(null),re=OP({view:t,phase:n,operating:i,currentSessionId:o,retained:s}),E=te!==null&&te===o&&(re?.total??0)>0;m$(kP({view:t,phase:n,operating:i,currentSessionId:o,retained:s})?.pending.length??0,(WP({view:t,phase:n,operating:i})?.awaiting??null)!==null);let ie=(e,t)=>{if(!o)return;_(null);let n=++l.current;m(r=>({...r,[o]:{open:!0,selected:e,entries:h??[],...t===void 0?{}:{target:{taskId:t,nonce:n}}}}))},ae=e=>{let n=t?.subagents?.find(t=>t.taskId===e);n?.agentId&&ie(n.agentId,e)},[oe,D]=(0,f.useState)(()=>!window.matchMedia(IR).matches);(0,f.useEffect)(()=>{D(!c)},[c]);let se=u&&!!p[o??``]?.open,ce=t?.busy??!1,le=t?.status??null;return(0,A.jsxs)(`div`,{className:`flex h-dvh`,children:[(0,A.jsx)(`a`,{href:`#main-content`,className:`skip-link`,children:e(`chat.skip`)}),(0,A.jsx)(aQ,{open:oe,onClose:()=>D(!1)}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,A.jsx)(LQ,{sidebarOpen:oe,conn:n,onToggleSessions:()=>D(!oe),jobsOpen:y,todos:{open:E,panelId:ee,onToggle:()=>ne(E?null:o??null)},onToggleJobs:()=>x(`jobs`),workspace:t?.changes===void 0?void 0:{open:b,count:t.changes.files,onToggle:()=>x(`workspace`)}}),(0,A.jsx)(oQ,{}),r!==null&&(0,A.jsxs)(`div`,{className:`discrete-in flex items-center gap-2 border-b py-1 pr-2 pl-9 text-xs ${r.level===`error`?`border-sakura-300 bg-sakura-100 text-sakura-900`:`border-tianyi-200 bg-tianyi-50 text-tianyi-900`}`,role:`alert`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 text-center`,children:r.text}),(0,A.jsx)(KR,{label:e(`chat.dismissNotice`),onClick:eP.clearNotice})]}),(0,A.jsxs)(`main`,{id:`main-content`,tabIndex:-1,className:`flex min-h-0 flex-1 flex-col focus:outline-none`,children:[E&&(0,A.jsx)(fQ,{id:ee,onClose:()=>ne(null)}),!o&&n===`ready`&&!i?(0,A.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-semibold text-ink-900`,children:GR(a)}),(0,A.jsx)(`p`,{className:`text-sm text-ink-600`,children:e(`chat.startHere`)}),(0,A.jsx)(`button`,{type:`button`,className:`btn-primary focus-neko rounded-xl px-4 py-2`,onClick:()=>{uP.createSession().catch(fP)},children:e(`sessions.new`)})]}):(0,A.jsx)(NZ,{view:t,busy:ce,onSubagent:ae,tray:(h?.length??0)>0?(0,A.jsxs)(`button`,{type:`button`,className:`focus-neko rounded-full border border-sakura-300 bg-surface px-3.5 py-1 text-xs font-medium text-sakura-800 hover:bg-sakura-50`,onClick:()=>ie(p[o??``]?.selected??h[0].agentId),children:[e(`chat.subagents`,{count:h.length}),h.some(e=>e.approvalCount)?e(`chat.subagentsApproval`,{count:h.reduce((e,t)=>e+(t.approvalCount??0),0)}):``,h.some(e=>e.historyThrough===void 0&&e.status===`running`)?e(`chat.subagentsRunning`,{count:h.filter(e=>e.historyThrough===void 0&&e.status===`running`).length}):``]}):void 0}),(0,A.jsxs)(`div`,{className:`flex max-h-[60dvh] shrink-[0.01] flex-col overflow-y-auto overscroll-contain`,"data-attention-stack":!0,children:[!se&&(0,A.jsx)(bz,{}),(0,A.jsx)(UZ,{}),(0,A.jsx)(FZ,{})]}),(0,A.jsx)(sz,{disabled:n!==`ready`||i,busy:ce,status:le})]})]}),Object.entries(p).map(([e,t])=>(0,A.jsx)(lQ,{entries:e===o?h??t.entries:t.entries,approval:se&&e===o?(0,A.jsx)(bz,{}):void 0,selected:t.selected,open:e===o&&t.open,onSelect:ie,target:t.target,onClose:()=>m(n=>({...n,[e]:{...t,open:!1}}))},e)),o&&t?.jobs!==void 0&&(0,A.jsx)(zz,{sessionId:o,jobs:t.jobs,open:y,onClose:()=>_(null)},o),o&&S===o&&(0,A.jsx)(p$,{sessionId:o,open:b,onClose:()=>_(null),changes:t?.changes,width:w,onWidth:T},`workspace:${o}`)]})}var _$=[{id:`sakura`,label:`appearance.theme.sakura`,blurb:`appearance.theme.sakuraBlurb`},{id:`light`,label:`appearance.theme.light`,blurb:`appearance.theme.lightBlurb`},{id:`dark`,label:`appearance.theme.dark`,blurb:`appearance.theme.darkBlurb`}],v$=[{id:`sans`,label:`appearance.font.sans`},{id:`serif`,label:`appearance.font.serif`},{id:`mono`,label:`appearance.font.mono`}],y$=[{id:`13`,label:`appearance.size.13`},{id:`14`,label:`appearance.size.14`},{id:`16`,label:`appearance.size.16`},{id:`18`,label:`appearance.size.18`}],b$=[{id:`regular`,label:`appearance.weight.regular`},{id:`medium`,label:`appearance.weight.medium`},{id:`semibold`,label:`appearance.weight.semibold`}],x$=[{id:`compact`,label:`appearance.leading.compact`},{id:`normal`,label:`appearance.leading.normal`},{id:`relaxed`,label:`appearance.leading.relaxed`}],S$=e=>[e(`appearance.sampleAssistantIntro`),``,"```ts",`function total(items: number[]) {`,` return items.reduce((sum, n) => sum + n, 0);`,`}`,"```",``,`- ${e(`appearance.sampleItem1`)}`,`- ${e(`appearance.sampleItem2`)}`].join(`
394
+ `);function C$(e){return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`appearance-${e.id}`,children:[(0,A.jsx)(`h2`,{id:`appearance-${e.id}`,className:`text-base font-bold text-ink-900`,children:e.title}),e.blurb&&(0,A.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-500`,children:e.blurb}),(0,A.jsx)(`div`,{className:`mt-3`,children:e.children})]})}function w$(e){let t=B();return(0,A.jsxs)(`fieldset`,{className:`m-0 min-w-0 border-0 p-0`,children:[(0,A.jsx)(`legend`,{className:`text-sm font-semibold text-ink-900`,children:e.label}),(0,A.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.options.map(n=>(0,A.jsxs)(`label`,{className:`choice-focus cursor-pointer rounded-full border px-3 py-1 text-xs transition-colors ${e.value===n.id?`border-sakura-400 bg-sakura-100 font-semibold text-sakura-800`:`border-sakura-200 bg-surface text-ink-700 hover:bg-sakura-50`}`,children:[(0,A.jsx)(`input`,{type:`radio`,className:`sr-only`,name:e.name,value:n.id,checked:e.value===n.id,onChange:()=>e.onPick(n.id)}),t(n.label)]},n.id))}),e.hint&&(0,A.jsx)(`p`,{className:`mt-1.5 text-[11px] text-ink-400`,children:e.hint})]})}function T$({theme:e}){let t=B();return(0,A.jsxs)(`span`,{"data-theme":e,className:`block rounded-xl border border-ink-200 bg-base p-2.5 text-ink-900`,children:[(0,A.jsxs)(`span`,{className:`flex items-center gap-1.5 pb-2`,children:[(0,A.jsx)(`span`,{className:`size-2 rounded-full bg-sakura-500`}),(0,A.jsx)(`span`,{className:`size-2 rounded-full bg-tianyi-500`}),(0,A.jsx)(`span`,{className:`h-1.5 w-8 rounded-full bg-ink-200`})]}),(0,A.jsx)(`span`,{className:`ml-auto block w-3/5 rounded-lg border border-sakura-300 bg-sakura-100 px-2 py-1 text-xs text-sakura-900`,children:t(`appearance.previewUser`)}),(0,A.jsx)(`span`,{className:`mt-1.5 block w-4/5 rounded-lg border border-tianyi-200 bg-surface px-2 py-1 text-xs text-ink-900`,children:t(`appearance.previewAssistant`)})]})}function E$(e){let t=B();return(0,A.jsxs)(`fieldset`,{className:`m-0 min-w-0 border-0 p-0`,children:[(0,A.jsx)(`legend`,{className:`sr-only`,children:t(`appearance.theme`)}),(0,A.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:_$.map(n=>{let r=e.value===n.id;return(0,A.jsxs)(`label`,{className:`choice-focus block cursor-pointer rounded-2xl border-2 p-2 transition-colors ${r?`border-sakura-500 bg-sakura-50`:`border-sakura-200 hover:bg-sakura-50`}`,children:[(0,A.jsx)(`input`,{type:`radio`,className:`sr-only`,name:`appearance-theme`,value:n.id,checked:r,onChange:()=>e.onPick(n.id)}),(0,A.jsx)(T$,{theme:n.id}),(0,A.jsxs)(`span`,{className:`mt-2 flex items-baseline gap-2 px-1 pb-0.5`,children:[(0,A.jsx)(`span`,{className:`text-sm ${r?`font-bold text-sakura-800`:`font-semibold text-ink-900`}`,children:t(n.label)}),(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(n.blurb)})]})]},n.id)})})]})}function D$({store:e=Ri()}){let t=zi(e),n=B();return(0,A.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,A.jsx)(C$,{id:`theme`,title:n(`appearance.theme`),children:(0,A.jsx)(E$,{value:t.theme,onPick:t=>e.set({theme:t})})}),(0,A.jsx)(C$,{id:`typography`,title:n(`appearance.typography`),blurb:n(`appearance.typographyBlurb`),children:(0,A.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,A.jsx)(w$,{name:`appearance-font`,label:n(`appearance.font`),hint:n(`appearance.fontHint`),options:v$,value:t.font,onPick:t=>e.set({font:t})}),(0,A.jsx)(w$,{name:`appearance-size`,label:n(`appearance.size`),options:y$,value:t.size,onPick:t=>e.set({size:t})}),(0,A.jsx)(w$,{name:`appearance-weight`,label:n(`appearance.weight`),options:b$,value:t.weight,onPick:t=>e.set({weight:t})}),(0,A.jsx)(w$,{name:`appearance-leading`,label:n(`appearance.leading`),options:x$,value:t.leading,onPick:t=>e.set({leading:t})})]})}),(0,A.jsx)(C$,{id:`preview`,title:n(`appearance.sample`),blurb:n(`appearance.sampleBlurb`),children:(0,A.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-base p-3`,"data-testid":`appearance-sample`,children:[(0,A.jsx)(`div`,{className:`bubble-user ml-auto max-w-[85%] px-4 py-2.5 whitespace-pre-wrap`,children:n(`appearance.sampleUser`)}),(0,A.jsx)(`div`,{className:`bubble-assistant max-w-full px-4 py-2.5`,children:(0,A.jsx)(dZ,{text:S$(n)})})]})}),(0,A.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:Mi(t)?n(`appearance.isDefault`):n(`appearance.customized`)}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>e.reset(),disabled:Mi(t),className:`btn-primary focus-neko h-9 rounded-full px-4 text-sm disabled:opacity-50`,children:n(`appearance.reset`)})]})]})}function O$(){let e=B();return(0,A.jsxs)(dz,{active:`appearance`,children:[(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:e(`settings.appearance.title`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:e(`settings.appearance.intro`)})]}),(0,A.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,A.jsx)(D$,{})})]})}var k$={compaction:{group:`compaction`,field:`enabled`,key:`compaction.enabled`},pruning:{group:`pruning`,field:`enabled`,key:`pruning.enabled`}},A$=[{key:`compaction.triggerPercent`,group:`compaction`,field:`triggerPercent`,label:`context.row.compactionTrigger.label`,description:`context.row.compactionTrigger.description`,unit:`percent`,presets:[30,40,50,60,70,80]},{key:`compaction.keepRecentTokens`,group:`compaction`,field:`keepRecentTokens`,label:`context.row.keepRecentTokens.label`,description:`context.row.keepRecentTokens.description`,unit:`tokens`,presets:[1e4,2e4,4e4,8e4]},{key:`pruning.triggerPercent`,group:`pruning`,field:`triggerPercent`,label:`context.row.pruningTrigger.label`,description:`context.row.pruningTrigger.description`,unit:`percent`,presets:[20,30,35,45,55]},{key:`pruning.keepRecent`,group:`pruning`,field:`keepRecent`,label:`context.row.keepRecent.label`,description:`context.row.keepRecent.description`,unit:`count`,presets:[5,10,20,40]},{key:`pruning.minChars`,group:`pruning`,field:`minChars`,label:`context.row.minChars.label`,description:`context.row.minChars.description`,unit:`chars`,presets:[2e3,4e3,8e3,16e3]},{key:`pruning.minSavePercent`,group:`pruning`,field:`minSavePercent`,label:`context.row.minSave.label`,description:`context.row.minSave.description`,unit:`percent`,presets:[2,5,10,15]}],j$={default:`context.source.default`,config:`context.source.config`,saved:`context.source.saved`};function M$(e,t){let n=e.effective[t.group],r=e.sources[t.group];return{value:n[t.field]??null,source:r[t.field]??`default`}}function N$(e,t){let n=z();switch(e){case`percent`:return`${t}%`;case`tokens`:return t>=1e3?`${Number((t/1e3).toFixed(1))}k`:String(t);case`chars`:return t>=1e3?n(`context.value.charsK`,{value:Number((t/1e3).toFixed(1))}):n(`context.value.chars`,{value:t});default:return n(`context.value.count`,{value:t})}}function P$(e,t){let n=z(),{value:r,source:i}=M$(t,e),a=typeof r==`number`?r:null,o=[{id:`default`,label:n(`context.chipDefault`),value:null,selected:i!==`saved`}];for(let t of e.presets)o.push({id:String(t),label:N$(e.unit,t),value:t,selected:i===`saved`&&a===t});return a!==null&&i!=="default"&&!e.presets.includes(a)&&o.push({id:`custom-${a}`,label:n(`context.chipCustom`,{value:N$(e.unit,a)}),value:a,selected:i===`saved`}),o}function F$(e,t){let n=z(),{value:r,source:i}=M$(t,e);return n(`context.current`,{value:typeof r==`number`?N$(e.unit,r):n(`context.nearLimit`),source:n(j$[i])})}function I$(e,t){return{[e.group]:{[e.field]:t}}}function L$(e){let t=z(),n=[],{compaction:r,pruning:i}=e.effective;return i.enabled&&n.push({id:`pruning`,label:t(`context.marker.pruning`),percent:i.triggerPercent,native:!1}),r.enabled&&n.push({id:`compaction`,label:t(`context.marker.compaction`),percent:r.triggerPercent??98,native:r.triggerPercent===null}),n}var R$=[{id:`compaction`,title:`context.group.compaction.title`,blurb:`context.group.compaction.blurb`},{id:`pruning`,title:`context.group.pruning.title`,blurb:`context.group.pruning.blurb`}];function z$(e){return(0,A.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e.checked,"aria-label":e.label,disabled:e.disabled,onClick:()=>e.onChange(!e.checked),className:`focus-neko relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-60 ${e.checked?`bg-sakura-500`:`bg-ink-200`}`,children:(0,A.jsx)(`span`,{className:`inline-block size-5 rounded-full bg-white shadow transition-transform ${e.checked?`translate-x-[22px]`:`translate-x-0.5`}`})})}function B$({items:e}){let t=B();return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-label":t(`context.threshold.aria`),children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-ink-500`,children:[(0,A.jsx)(`span`,{className:`font-semibold text-ink-900`,children:t(`context.threshold.title`)}),(0,A.jsx)(`span`,{children:t(`context.threshold.window`)})]}),(0,A.jsx)(`div`,{className:`px-6`,children:(0,A.jsx)(`div`,{className:`relative mt-9 mb-9 h-2.5 rounded-full bg-gradient-to-r from-tianyi-100 via-sakura-100 to-sakura-200`,children:e.map(e=>(0,A.jsxs)(`div`,{className:`absolute top-1/2 -translate-x-1/2 -translate-y-1/2`,style:{left:`${e.percent}%`},children:[(0,A.jsx)(`span`,{className:`block size-4 rounded-full border-2 border-surface shadow ${e.id===`pruning`?`bg-tianyi-500`:`bg-sakura-600`}`}),(0,A.jsxs)(`span`,{className:`absolute left-1/2 -translate-x-1/2 whitespace-nowrap text-xs font-semibold ${e.id===`pruning`?`-top-7 text-tianyi-800`:`top-6 text-sakura-800`}`,children:[e.label,` `,e.native?`≈`:``,e.percent,`%`]})]},e.id))})}),(0,A.jsxs)(`div`,{className:`flex justify-between text-[11px] text-ink-400`,children:[(0,A.jsx)(`span`,{children:`0%`}),(0,A.jsx)(`span`,{children:`100%`})]}),e.length===0&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(`context.threshold.allOff`)})]})}function V$(e){let{row:t,settings:n,disabled:r,dim:i,onPick:a}=e,o=B(),{source:s}=M$(n,t);return(0,A.jsxs)(`div`,{className:`transition-opacity ${i?`opacity-55`:``}`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-3`,children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-ink-900`,children:o(t.label)}),(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:F$(t,n)})]}),(0,A.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-500`,children:o(t.description)}),(0,A.jsxs)(`fieldset`,{className:`m-0 mt-2 flex min-w-0 flex-wrap gap-1.5 border-0 p-0`,children:[(0,A.jsx)(`legend`,{className:`sr-only`,children:o(t.label)}),P$(t,n).map(e=>(0,A.jsx)(`button`,{type:`button`,"aria-pressed":e.selected,disabled:r,"data-row":t.key,"data-chip":e.id,onClick:()=>!e.selected&&a(e.value),className:`focus-neko rounded-full border px-3 py-1 text-xs transition-colors disabled:opacity-60 ${e.selected?`border-sakura-400 bg-sakura-100 font-semibold text-sakura-800`:`border-sakura-200 bg-surface text-ink-700 hover:bg-sakura-50`}`,children:e.label},e.id))]}),s===`config`&&(0,A.jsx)(`p`,{className:`mt-1 text-[11px] text-ink-400`,children:o(`context.fromConfig`)})]})}function H$(e){let{settings:t,ready:n,onChange:r,onReset:i}=e,a=B(),[o,s]=(0,f.useState)(0),[c,l]=(0,f.useState)(``),u=!n||!t,d=(0,f.useRef)(0);async function p(e,t){let n=++d.current;s(e=>e+1),l(``);try{await e(),n===d.current&&l(t)}catch{n===d.current&&l(a(`context.saveFailed`))}finally{s(e=>e-1)}}let m=(e,t)=>void p(()=>r(I$(e,t)),t===null?a(`context.restored`,{label:e.label}):a(`context.saved`));if(!t)return(0,A.jsx)(`p`,{className:`text-sm text-ink-500`,children:a(`common.loading`)});let h=[...Object.values(t.sources.compaction),...Object.values(t.sources.pruning)].includes(`saved`);return(0,A.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,A.jsx)(B$,{items:L$(t)}),R$.map(e=>{let n=k$[e.id],{value:r,source:i}=M$(t,n);return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`ctx-${e.id}`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(`span`,{className:`mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-xl bg-sakura-50 text-sakura-700`,children:(0,A.jsx)(zR,{name:e.id===`compaction`?`layers`:`sparkles`,size:16})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h2`,{id:`ctx-${e.id}`,className:`text-base font-bold text-ink-900`,children:a(e.title)}),(0,A.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-500`,children:a(e.blurb)})]}),(0,A.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[(0,A.jsx)(z$,{checked:r===!0,label:e.id===`compaction`?a(`context.switch.compaction`):a(`context.switch.pruning`),disabled:u,onChange:t=>m({...n,label:a(e.title)},t)}),(0,A.jsx)(`span`,{className:`text-[11px] text-ink-400`,children:a(j$[i])})]})]}),(0,A.jsx)(`div`,{className:`mt-4 flex flex-col gap-4 border-t border-sakura-100 pt-4`,children:A$.filter(t=>t.group===e.id).map(e=>(0,A.jsx)(V$,{row:e,settings:t,disabled:u,dim:r!==!0,onPick:t=>m({...e,label:a(e.label)},t)},e.key))})]},e.id)}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:u||!h,onClick:()=>void p(i,a(`context.allRestored`)),className:`focus-neko rounded-full border border-sakura-200 bg-surface px-4 py-1.5 text-xs text-ink-700 hover:bg-sakura-50 disabled:opacity-50`,children:a(`context.restoreAll`)}),(0,A.jsx)(`output`,{"aria-live":`polite`,className:`min-h-4 text-xs text-tianyi-800`,children:o>0?a(`context.saving`):c})]})]})}function U$(){let{contextSettings:e,phase:t}=QN(),n=B();return(0,A.jsxs)(dz,{active:`context`,children:[(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:n(`settings.context.title`)}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:n(t===`ready`?`common.connected`:`common.connecting`)})]}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:n(`settings.context.intro`)})]}),(0,A.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,A.jsx)(H$,{settings:e,ready:t===`ready`,onChange:e=>uP.setContextSettings(e),onReset:()=>uP.resetContextSettings()})})]})}function W$({store:e=PN()}){let t=B(),n=IN(e),r={zh:t(`language.option.zh`),en:t(`language.option.en`)};return(0,A.jsxs)(`fieldset`,{className:`m-0 min-w-0 rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsx)(`legend`,{className:`sr-only`,children:t(`language.legend`)}),(0,A.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:wN.map(t=>(0,A.jsxs)(`label`,{className:`choice-focus cursor-pointer rounded-full border px-4 py-1.5 text-sm transition-colors ${n===t?`border-sakura-400 bg-sakura-100 font-semibold text-sakura-800`:`border-sakura-200 bg-surface text-ink-700 hover:bg-sakura-50`}`,children:[(0,A.jsx)(`input`,{type:`radio`,className:`sr-only`,name:`ui-language`,value:t,lang:t===`zh`?`zh-CN`:`en`,checked:n===t,onChange:()=>e.set(t)}),r[t]]},t))})]})}function G$(){let e=B();return(0,A.jsxs)(dz,{active:`language`,children:[(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:e(`language.title`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:e(`language.intro`)})]}),(0,A.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,A.jsx)(W$,{})})]})}var K$=function(e,t){let n=e,r=J$[t],i=null,a=0,o=null,s=[],c={},l=function(e,t){a=n*4+17,i=function(e){let t=Array(e);for(let n=0;n<e;n+=1){t[n]=Array(e);for(let r=0;r<e;r+=1)t[n][r]=null}return t}(a),u(0,0),u(a-7,0),u(0,a-7),p(),f(),h(e,t),n>=7&&m(e),o??=v(n,r,s),g(o,t)},u=function(e,t){for(let n=-1;n<=7;n+=1)if(!(e+n<=-1||a<=e+n))for(let r=-1;r<=7;r+=1)t+r<=-1||a<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?i[e+n][t+r]=!0:i[e+n][t+r]=!1)},d=function(){let e=0,t=0;for(let n=0;n<8;n+=1){l(!0,n);let r=X$.getLostPoint(c);(n==0||e>r)&&(e=r,t=n)}return t},f=function(){for(let e=8;e<a-8;e+=1)i[e][6]??(i[e][6]=e%2==0);for(let e=8;e<a-8;e+=1)i[6][e]??(i[6][e]=e%2==0)},p=function(){let e=X$.getPatternPosition(n);for(let t=0;t<e.length;t+=1)for(let n=0;n<e.length;n+=1){let r=e[t],a=e[n];if(i[r][a]==null)for(let e=-2;e<=2;e+=1)for(let t=-2;t<=2;t+=1)e==-2||e==2||t==-2||t==2||e==0&&t==0?i[r+e][a+t]=!0:i[r+e][a+t]=!1}},m=function(e){let t=X$.getBCHTypeNumber(n);for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[Math.floor(n/3)][n%3+a-8-3]=r}for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[n%3+a-8-3][Math.floor(n/3)]=r}},h=function(e,t){let n=r<<3|t,o=X$.getBCHTypeInfo(n);for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<6?i[t][8]=n:t<8?i[t+1][8]=n:i[a-15+t][8]=n}for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<8?i[8][a-t-1]=n:t<9?i[8][15-t-1+1]=n:i[8][15-t-1]=n}i[a-8][8]=!e},g=function(e,t){let n=-1,r=a-1,o=7,s=0,c=X$.getMaskFunction(t);for(let t=a-1;t>0;t-=2)for(t==6&&--t;;){for(let n=0;n<2;n+=1)if(i[r][t-n]==null){let a=!1;s<e.length&&(a=(e[s]>>>o&1)==1),c(r,t-n)&&(a=!a),i[r][t-n]=a,--o,o==-1&&(s+=1,o=7)}if(r+=n,r<0||a<=r){r-=n,n=-n;break}}},_=function(e,t){let n=0,r=0,i=0,a=Array(t.length),o=Array(t.length);for(let s=0;s<t.length;s+=1){let c=t[s].dataCount,l=t[s].totalCount-c;r=Math.max(r,c),i=Math.max(i,l),a[s]=Array(c);for(let t=0;t<a[s].length;t+=1)a[s][t]=255&e.getBuffer()[t+n];n+=c;let u=X$.getErrorCorrectPolynomial(l),d=Q$(a[s],u.getLength()-1).mod(u);o[s]=Array(u.getLength()-1);for(let e=0;e<o[s].length;e+=1){let t=e+d.getLength()-o[s].length;o[s][e]=t>=0?d.getAt(t):0}}let s=0;for(let e=0;e<t.length;e+=1)s+=t[e].totalCount;let c=Array(s),l=0;for(let e=0;e<r;e+=1)for(let n=0;n<t.length;n+=1)e<a[n].length&&(c[l]=a[n][e],l+=1);for(let e=0;e<i;e+=1)for(let n=0;n<t.length;n+=1)e<o[n].length&&(c[l]=o[n][e],l+=1);return c},v=function(e,t,n){let r=$$.getRSBlocks(e,t),i=e1();for(let t=0;t<n.length;t+=1){let r=n[t];i.put(r.getMode(),4),i.put(r.getLength(),X$.getLengthInBits(r.getMode(),e)),r.write(i)}let a=0;for(let e=0;e<r.length;e+=1)a+=r[e].dataCount;if(i.getLengthInBits()>a*8)throw`code length overflow. (`+i.getLengthInBits()+`>`+a*8+`)`;for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(236,8),i.getLengthInBits()>=a*8));)i.put(17,8);return _(i,r)};c.addData=function(e,t){t||=`Byte`;let n=null;switch(t){case`Numeric`:n=t1(e);break;case`Alphanumeric`:n=n1(e);break;case`Byte`:n=r1(e);break;case`Kanji`:n=i1(e);break;default:throw`mode:`+t}s.push(n),o=null},c.isDark=function(e,t){if(e<0||a<=e||t<0||a<=t)throw e+`,`+t;return i[e][t]},c.getModuleCount=function(){return a},c.make=function(){if(n<1){let e=1;for(;e<40;e++){let t=$$.getRSBlocks(e,r),n=e1();for(let t=0;t<s.length;t++){let r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),X$.getLengthInBits(r.getMode(),e)),r.write(n)}let i=0;for(let e=0;e<t.length;e++)i+=t[e].dataCount;if(n.getLengthInBits()<=i*8)break}n=e}l(!1,d())},c.createTableTag=function(e,t){e||=2,t=t===void 0?e*4:t;let n=``;n+=`<table style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: `+t+`px;`,n+=`">`,n+=`<tbody>`;for(let t=0;t<c.getModuleCount();t+=1){n+=`<tr>`;for(let r=0;r<c.getModuleCount();r+=1)n+=`<td style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: 0px;`,n+=` width: `+e+`px;`,n+=` height: `+e+`px;`,n+=` background-color: `,n+=c.isDark(t,r)?`#000000`:`#ffffff`,n+=`;`,n+=`"/>`;n+=`</tr>`}return n+=`</tbody>`,n+=`</table>`,n},c.createSvgTag=function(e,t,n,r){let i={};typeof arguments[0]==`object`&&(i=arguments[0],e=i.cellSize,t=i.margin,n=i.alt,r=i.title),e||=2,t=t===void 0?e*4:t,n=typeof n==`string`?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||`qrcode-description`:null,r=typeof r==`string`?{text:r}:r||{},r.text=r.text||null,r.id=r.text?r.id||`qrcode-title`:null;let a=c.getModuleCount()*e+t*2,o,s,l,u,d=``,f;for(f=`l`+e+`,0 0,`+e+` -`+e+`,0 0,-`+e+`z `,d+=`<svg version="1.1" xmlns="http://www.w3.org/2000/svg"`,d+=i.scalable?``:` width="`+a+`px" height="`+a+`px"`,d+=` viewBox="0 0 `+a+` `+a+`" `,d+=` preserveAspectRatio="xMinYMin meet"`,d+=r.text||n.text?` role="img" aria-labelledby="`+y([r.id,n.id].join(` `).trim())+`"`:``,d+=`>`,d+=r.text?`<title id="`+y(r.id)+`">`+y(r.text)+`</title>`:``,d+=n.text?`<description id="`+y(n.id)+`">`+y(n.text)+`</description>`:``,d+=`<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>`,d+=`<path d="`,l=0;l<c.getModuleCount();l+=1)for(u=l*e+t,o=0;o<c.getModuleCount();o+=1)c.isDark(l,o)&&(s=o*e+t,d+=`M`+s+`,`+u+f);return d+=`" stroke="transparent" fill="black"/>`,d+=`</svg>`,d},c.createDataURL=function(e,t){e||=2,t=t===void 0?e*4:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t;return l1(n,n,function(t,n){if(r<=t&&t<i&&r<=n&&n<i){let i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return+!c.isDark(a,i)}return 1})},c.createImgTag=function(e,t,n){e||=2,t=t===void 0?e*4:t;let r=c.getModuleCount()*e+t*2,i=``;return i+=`<img`,i+=` src="`,i+=c.createDataURL(e,t),i+=`"`,i+=` width="`,i+=r,i+=`"`,i+=` height="`,i+=r,i+=`"`,n&&(i+=` alt="`,i+=y(n),i+=`"`),i+=`/>`,i};let y=function(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charAt(n);switch(r){case`<`:t+=`&lt;`;break;case`>`:t+=`&gt;`;break;case`&`:t+=`&amp;`;break;case`"`:t+=`&quot;`;break;default:t+=r}}return t},b=function(e){e=e===void 0?2:e;let t=c.getModuleCount()*1+e*2,n=e,r=t-e,i,a,o,s,l,u={"██":`█`,"█ ":`▀`," █":`▄`," ":` `},d={"██":`▀`,"█ ":`▀`," █":` `," ":` `},f=``;for(i=0;i<t;i+=2){for(o=Math.floor((i-n)/1),s=Math.floor((i+1-n)/1),a=0;a<t;a+=1)l=`█`,n<=a&&a<r&&n<=i&&i<r&&c.isDark(o,Math.floor((a-n)/1))&&(l=` `),n<=a&&a<r&&n<=i+1&&i+1<r&&c.isDark(s,Math.floor((a-n)/1))?l+=` `:l+=`█`,f+=e<1&&i+1>=r?d[l]:u[l];f+=`
395
+ `}return t%2&&e>0?f.substring(0,f.length-t-1)+Array(t+1).join(`▀`):f.substring(0,f.length-1)};return c.createASCII=function(e,t){if(e||=1,e<2)return b(t);--e,t=t===void 0?e*2:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t,a,o,s,l,u=Array(e+1).join(`██`),d=Array(e+1).join(` `),f=``,p=``;for(a=0;a<n;a+=1){for(s=Math.floor((a-r)/e),p=``,o=0;o<n;o+=1)l=1,r<=o&&o<i&&r<=a&&a<i&&c.isDark(s,Math.floor((o-r)/e))&&(l=0),p+=l?u:d;for(s=0;s<e;s+=1)f+=p+`
396
+ `}return f.substring(0,f.length-1)},c.renderTo2dContext=function(e,t){t||=2;let n=c.getModuleCount();for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.fillStyle=c.isDark(r,i)?`black`:`white`,e.fillRect(i*t,r*t,t,t)},c};K$.stringToBytes=function(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t.push(r&255)}return t},K$.createStringToBytes=function(e,t){let n=function(){let n=s1(e),r=function(){let e=n.read();if(e==-1)throw`eof`;return e},i=0,a={};for(;;){let e=n.read();if(e==-1)break;let t=r(),o=r(),s=r(),c=String.fromCharCode(e<<8|t);a[c]=o<<8|s,i+=1}if(i!=t)throw i+` != `+t;return a}();return function(e){let t=[];for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r);if(i<128)t.push(i);else{let i=n[e.charAt(r)];typeof i==`number`?(i&255)==i?t.push(i):(t.push(i>>>8),t.push(i&255)):t.push(63)}}return t}};var q$={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},J$={L:1,M:0,Q:3,H:2},Y$={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},X$=function(){let e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r={},i=function(e){let t=0;for(;e!=0;)t+=1,e>>>=1;return t};return r.getBCHTypeInfo=function(e){let n=e<<10;for(;i(n)-i(t)>=0;)n^=t<<i(n)-i(t);return(e<<10|n)^21522},r.getBCHTypeNumber=function(e){let t=e<<12;for(;i(t)-i(n)>=0;)t^=n<<i(t)-i(n);return e<<12|t},r.getPatternPosition=function(t){return e[t-1]},r.getMaskFunction=function(e){switch(e){case Y$.PATTERN000:return function(e,t){return(e+t)%2==0};case Y$.PATTERN001:return function(e,t){return e%2==0};case Y$.PATTERN010:return function(e,t){return t%3==0};case Y$.PATTERN011:return function(e,t){return(e+t)%3==0};case Y$.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case Y$.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case Y$.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case Y$.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw`bad maskPattern:`+e}},r.getErrorCorrectPolynomial=function(e){let t=Q$([1],0);for(let n=0;n<e;n+=1)t=t.multiply(Q$([1,Z$.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case q$.MODE_NUMBER:return 10;case q$.MODE_ALPHA_NUM:return 9;case q$.MODE_8BIT_BYTE:return 8;case q$.MODE_KANJI:return 8;default:throw`mode:`+e}else if(t<27)switch(e){case q$.MODE_NUMBER:return 12;case q$.MODE_ALPHA_NUM:return 11;case q$.MODE_8BIT_BYTE:return 16;case q$.MODE_KANJI:return 10;default:throw`mode:`+e}else if(t<41)switch(e){case q$.MODE_NUMBER:return 14;case q$.MODE_ALPHA_NUM:return 13;case q$.MODE_8BIT_BYTE:return 16;case q$.MODE_KANJI:return 12;default:throw`mode:`+e}else throw`type:`+t},r.getLostPoint=function(e){let t=e.getModuleCount(),n=0;for(let r=0;r<t;r+=1)for(let i=0;i<t;i+=1){let a=0,o=e.isDark(r,i);for(let n=-1;n<=1;n+=1)if(!(r+n<0||t<=r+n))for(let s=-1;s<=1;s+=1)i+s<0||t<=i+s||(n!=0||s!=0)&&o==e.isDark(r+n,i+s)&&(a+=1);a>5&&(n+=3+a-5)}for(let r=0;r<t-1;r+=1)for(let i=0;i<t-1;i+=1){let t=0;e.isDark(r,i)&&(t+=1),e.isDark(r+1,i)&&(t+=1),e.isDark(r,i+1)&&(t+=1),e.isDark(r+1,i+1)&&(t+=1),(t==0||t==4)&&(n+=3)}for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(i,r)&&!e.isDark(i+1,r)&&e.isDark(i+2,r)&&e.isDark(i+3,r)&&e.isDark(i+4,r)&&!e.isDark(i+5,r)&&e.isDark(i+6,r)&&(n+=40);let r=0;for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)e.isDark(i,n)&&(r+=1);let i=Math.abs(100*r/t/t-50)/5;return n+=i*10,n},r}(),Z$=function(){let e=Array(256),t=Array(256);for(let t=0;t<8;t+=1)e[t]=1<<t;for(let t=8;t<256;t+=1)e[t]=e[t-4]^e[t-5]^e[t-6]^e[t-8];for(let n=0;n<255;n+=1)t[e[n]]=n;let n={};return n.glog=function(e){if(e<1)throw`glog(`+e+`)`;return t[e]},n.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},n}(),Q$=function(e,t){if(e.length===void 0)throw e.length+`/`+t;let n=function(){let n=0;for(;n<e.length&&e[n]==0;)n+=1;let r=Array(e.length-n+t);for(let t=0;t<e.length-n;t+=1)r[t]=e[t+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){let t=Array(r.getLength()+e.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let i=0;i<e.getLength();i+=1)t[n+i]^=Z$.gexp(Z$.glog(r.getAt(n))+Z$.glog(e.getAt(i)));return Q$(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;let t=Z$.glog(r.getAt(0))-Z$.glog(e.getAt(0)),n=Array(r.getLength());for(let e=0;e<r.getLength();e+=1)n[e]=r.getAt(e);for(let r=0;r<e.getLength();r+=1)n[r]^=Z$.gexp(Z$.glog(e.getAt(r))+t);return Q$(n,0).mod(e)},r},$$=function(){let e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){let n={};return n.totalCount=e,n.dataCount=t,n},n={},r=function(t,n){switch(n){case J$.L:return e[(t-1)*4+0];case J$.M:return e[(t-1)*4+1];case J$.Q:return e[(t-1)*4+2];case J$.H:return e[(t-1)*4+3];default:return}};return n.getRSBlocks=function(e,n){let i=r(e,n);if(i===void 0)throw`bad rs block @ typeNumber:`+e+`/errorCorrectionLevel:`+n;let a=i.length/3,o=[];for(let e=0;e<a;e+=1){let n=i[e*3+0],r=i[e*3+1],a=i[e*3+2];for(let e=0;e<n;e+=1)o.push(t(r,a))}return o},n}(),e1=function(){let e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){let n=Math.floor(t/8);return(e[n]>>>7-t%8&1)==1},n.put=function(e,t){for(let r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){let r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},t1=function(e){let t=q$.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+2<t.length;)e.put(i(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(i(t.substring(r,r+1)),4):t.length-r==2&&e.put(i(t.substring(r,r+2)),7))};let i=function(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*10+a(e.charAt(n));return t},a=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;throw`illegal char :`+e};return r},n1=function(e){let t=q$.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+1<t.length;)e.put(i(t.charAt(r))*45+i(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(i(t.charAt(r)),6)};let i=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;if(`A`<=e&&e<=`Z`)return e.charCodeAt(0)-65+10;switch(e){case` `:return 36;case`$`:return 37;case`%`:return 38;case`*`:return 39;case`+`:return 40;case`-`:return 41;case`.`:return 42;case`/`:return 43;case`:`:return 44;default:throw`illegal char :`+e}};return r},r1=function(e){let t=q$.MODE_8BIT_BYTE,n=K$.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){for(let t=0;t<n.length;t+=1)e.put(n[t],8)},r},i1=function(e){let t=q$.MODE_KANJI,n=K$.stringToBytes;(function(e,t){let r=n(e);if(r.length!=2||(r[0]<<8|r[1])!=t)throw`sjis not supported.`})(`友`,38726);let r=n(e),i={};return i.getMode=function(){return t},i.getLength=function(e){return~~(r.length/2)},i.write=function(e){let t=r,n=0;for(;n+1<t.length;){let r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else if(57408<=r&&r<=60351)r-=49472;else throw`illegal char at `+(n+1)+`/`+r;r=(r>>>8&255)*192+(r&255),e.put(r,13),n+=2}if(n<t.length)throw`illegal char at `+(n+1)},i},a1=function(){let e=[],t={};return t.writeByte=function(t){e.push(t&255)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n||=0,r||=e.length;for(let i=0;i<r;i+=1)t.writeByte(e[i+n])},t.writeString=function(e){for(let n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){let t=``;t+=`[`;for(let n=0;n<e.length;n+=1)n>0&&(t+=`,`),t+=e[n];return t+=`]`,t},t},o1=function(){let e=0,t=0,n=0,r=``,i={},a=function(e){r+=String.fromCharCode(o(e&63))},o=function(e){if(e<0)throw`n:`+e;if(e<26)return 65+e;if(e<52)return 97+(e-26);if(e<62)return 48+(e-52);if(e==62)return 43;if(e==63)return 47;throw`n:`+e};return i.writeByte=function(r){for(e=e<<8|r&255,t+=8,n+=1;t>=6;)a(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(a(e<<6-t),e=0,t=0),n%3!=0){let e=3-n%3;for(let t=0;t<e;t+=1)r+=`=`}},i.toString=function(){return r},i},s1=function(e){let t=e,n=0,r=0,i=0,a={};a.read=function(){for(;i<8;){if(n>=t.length){if(i==0)return-1;throw`unexpected end of file./`+i}let e=t.charAt(n);if(n+=1,e==`=`)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}let e=r>>>i-8&255;return i-=8,e};let o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(e==43)return 62;if(e==47)return 63;throw`c:`+e};return a},c1=function(e,t){let n=e,r=t,i=Array(e*t),a={};a.setPixel=function(e,t,r){i[t*n+e]=r},a.write=function(e){e.writeString(`GIF87a`),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(`,`),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);let t=s(2);e.writeByte(2);let i=0;for(;t.length-i>255;)e.writeByte(255),e.writeBytes(t,i,255),i+=255;e.writeByte(t.length-i),e.writeBytes(t,i,t.length-i),e.writeByte(0),e.writeString(`;`)};let o=function(e){let t=e,n=0,r=0,i={};return i.write=function(e,i){if(e>>>i)throw`length over`;for(;n+i>=8;)t.writeByte(255&(e<<n|r)),i-=8-n,e>>>=8-n,r=0,n=0;r=e<<n|r,n+=i},i.flush=function(){n>0&&t.writeByte(r)},i},s=function(e){let t=1<<e,n=(1<<e)+1,r=e+1,a=c();for(let e=0;e<t;e+=1)a.add(String.fromCharCode(e));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(n));let s=a1(),l=o(s);l.write(t,r);let u=0,d=String.fromCharCode(i[u]);for(u+=1;u<i.length;){let e=String.fromCharCode(i[u]);u+=1,a.contains(d+e)?d+=e:(l.write(a.indexOf(d),r),a.size()<4095&&(a.size()==1<<r&&(r+=1),a.add(d+e)),d=e)}return l.write(a.indexOf(d),r),l.write(n,r),l.flush(),s.toByteArray()},c=function(){let e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw`dup key:`+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return e[t]!==void 0},n};return a},l1=function(e,t,n){let r=c1(e,t);for(let i=0;i<t;i+=1)for(let t=0;t<e;t+=1)r.setPixel(t,i,n(t,i));let i=a1();r.write(i);let a=o1(),o=i.toByteArray();for(let e=0;e<o.length;e+=1)a.writeByte(o[e]);return a.flush(),`data:image/gif;base64,`+a};K$.stringToBytes;var u1=class extends Error{constructor(){super(`gateway_unsupported`),this.name=`GatewayUnsupportedError`}},d1;function f1(){d1=void 0}async function p1(){return d1??=fetch(`/api/mobile/session`,{cache:`no-store`}).then(async e=>{if(!e.ok)throw Error(z()(`pairing.getFailed`,{path:`/api/mobile/session`,status:e.status}));return await e.json()}).catch(e=>{throw d1=void 0,e}),d1}async function m1(e,t,n=!0){let{csrf:r}=await p1(),i=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`,"x-neko-csrf":r},body:JSON.stringify(t??null)});if(i.status===501)throw new u1;if(i.status===403&&n)return f1(),m1(e,t,!1);if(!i.ok){let e=z()(`pairing.requestFailed`,{status:i.status});try{let t=await i.json();typeof t.message==`string`&&t.message!==``&&(e=t.message)}catch{}throw Error(e)}return await i.json()}async function h1(e){let t=await fetch(e,{cache:`no-store`});if(t.status===501)throw new u1;if(!t.ok)throw Error(z()(`pairing.getFailed`,{path:e,status:t.status}));return await t.json()}var g1={session:()=>p1(),state:()=>h1(`/api/mobile/state`),enable:e=>m1(`/api/mobile/enable`,e),disable:()=>m1(`/api/mobile/disable`,null),createPairing:()=>m1(`/api/mobile/pairing`,null),cancelPairing:()=>m1(`/api/mobile/pairing/cancel`,null),revoke:e=>m1(`/api/mobile/revoke`,{deviceId:e}),regenerateCertificate:()=>m1(`/api/mobile/certificate/regenerate`,null)},_1=2592e6,v1=5e3;function y1(e){return e instanceof Error?e.message:String(e)}function b1(e){let t=B(),n=K$(0,`M`);n.addData(e.text,`Byte`),n.make();let r=n.getModuleCount(),i=r+4,a=[];for(let e=0;e<r;e+=1)for(let t=0;t<r;t+=1)n.isDark(e,t)&&a.push(`M${t+2} ${e+2}h1v1h-1z`);return(0,A.jsxs)(`svg`,{role:`img`,viewBox:`0 0 ${i} ${i}`,shapeRendering:`crispEdges`,className:`h-44 w-44 rounded-xl bg-white p-2 text-ink-900`,children:[(0,A.jsx)(`title`,{children:t(`pairing.qrTitle`)}),(0,A.jsx)(`path`,{d:a.join(` `),fill:`currentColor`})]})}function x1(){let{webInfo:e}=QN(),t=B(),n=IN(),[r,i]=(0,f.useState)(null),[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)(``),[m,h]=(0,f.useState)(`8323`),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(null),[b,x]=(0,f.useState)(0),[S,C]=(0,f.useState)(null),w=(0,f.useRef)(0),T=(0,f.useCallback)(async()=>{let e=++w.current;try{let t=await g1.state();if(e!==w.current)return;o(t),c(``),p(e=>e===``?t.candidates[0]??``:e),h(String(t.port))}catch(t){e===w.current&&c(y1(t))}},[]),ee=(0,f.useCallback)(async()=>{if(document.hidden)return;let e=++w.current;try{let t=await g1.state();if(e!==w.current)return;o(t),c(``)}catch{}},[]);(0,f.useEffect)(()=>{let e=!1;return g1.session().then(t=>{e||(i(t.supported),t.supported&&T())}).catch(t=>{e||c(y1(t))}),()=>{e=!0}},[T]),(0,f.useEffect)(()=>{if(r!==!0)return;let e,t=()=>{e!==void 0&&(clearInterval(e),e=void 0)},n=()=>{e===void 0&&(e=setInterval(()=>void ee(),v1))},i=()=>{document.hidden?t():(ee(),n())};return document.addEventListener(`visibilitychange`,i),n(),()=>{t(),document.removeEventListener(`visibilitychange`,i)}},[r,ee]),(0,f.useEffect)(()=>{if(v===null)return;let e=()=>x(Math.max(0,Math.ceil((v.expiresAt-Date.now())/1e3)));e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[v]);let te=a?.state.status===`listening`,ne=te?`${a.state.address}:${a.state.port}`:``;async function re(){if(!(a===null||g)){_(!0),c(``),u(``);try{if(te)await g1.disable(),y(null),u(t(`pairing.disabledNotice`));else{let e=Number(m);if(d.trim()===``)throw Error(t(`pairing.addressRequired`));if(!Number.isInteger(e)||e<1||e>65535)throw Error(t(`pairing.portInvalid`));await g1.enable({address:d.trim(),port:e}),u(t(`pairing.enabledNotice`,{address:`${d.trim()}:${e}`}))}await T()}catch(e){c(y1(e))}finally{_(!1)}}}async function E(){_(!0),c(``);try{let e=await g1.createPairing();y(e),u(t(`pairing.qrGenerated`))}catch(e){y(null),c(y1(e))}finally{_(!1)}}async function ie(){C(null),_(!0),c(``);try{let e=await g1.regenerateCertificate();y(null),u(t(`pairing.certRotated`,{fingerprint:e.fingerprint.slice(0,12)})),await T()}catch(e){c(y1(e))}finally{_(!1)}}async function ae(e){C(null),_(!0),c(``);try{let n=await g1.revoke(e);u(n.revoked?t(`pairing.revoked`):t(`pairing.revokeMissing`)),await T()}catch(e){c(y1(e))}finally{_(!1)}}if(r===null)return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:t(`settings.mobile.title`)}),(0,A.jsx)(`p`,{className:`mt-2 text-sm text-ink-500`,children:t(`common.loading`)})]});if(!r)return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:t(`settings.mobile.title`)}),(0,A.jsx)(`p`,{className:`mt-2 text-sm text-ink-600`,role:`alert`,children:t(`pairing.unsupported`)})]});let oe=a?.certificate??null,D=oe!==null&&oe.expiresAt-Date.now()<_1,se=a?.wsl??null,ce=a?.state.status===`listening`&&a.state.mode===`wsl-relay`,le=a===null?t(`common.loading`):a.state.status===`listening`?t(`pairing.stateOn`,{address:ne,relay:ce?t(`pairing.relayed`):``}):a.state.status===`error`?t(`pairing.stateError`):a.state.status===`disabled`?t(`pairing.stateOff`):t(`credential.working`);return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:t(`settings.mobile.title`)}),(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:le})]}),(0,A.jsx)(`p`,{className:`mb-3 text-xs text-ink-500`,children:t(`pairing.intro`)}),se!==null&&(0,A.jsx)(`p`,{className:`mb-3 rounded-xl bg-tianyi-50 px-3 py-2 text-xs text-tianyi-800`,children:t(`pairing.wslNote`)}),se?.error!=null&&(0,A.jsx)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:se.error}),a?.state.status===`error`&&(0,A.jsx)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:t(`pairing.startFailed`,{error:a.state.error})}),s!==``&&(0,A.jsx)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:s}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,A.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:te===!0,disabled:g||a===null||!te&&(a?.candidates.length??0)===0&&d===``,onChange:()=>void re(),className:`focus-neko h-4 w-4 rounded border-sakura-300 accent-sakura-600`}),t(`pairing.allow`)]}),(0,A.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,children:[t(`pairing.address`),(0,A.jsxs)(`select`,{value:d,disabled:g||te===!0,onChange:e=>p(e.target.value),className:`focus-neko rounded-xl border border-sakura-200 bg-base px-2 py-1.5 text-sm`,children:[a?.candidates.length===0&&(0,A.jsx)(`option`,{value:``,children:t(se===null?`pairing.noAddress`:`pairing.noAddressWindows`)}),(a?.candidates??[]).map(e=>(0,A.jsx)(`option`,{value:e,children:e===a?.lastConnectedAddress?t(`pairing.lastConnected`,{address:e}):e},e))]})]}),(0,A.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,htmlFor:`mobile-port`,children:[t(`pairing.port`),(0,A.jsx)(`input`,{id:`mobile-port`,type:`number`,min:1,max:65535,value:m,disabled:g||te===!0,onChange:e=>h(e.target.value),className:`focus-neko w-24 rounded-xl border border-sakura-200 bg-base px-2 py-1.5 text-sm`})]})]}),te!==!0&&(a?.candidates.length??0)===0&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(se===null?`pairing.noUsable`:`pairing.noUsableWindows`)}),te===!0&&(0,A.jsx)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[v!==null&&b>0?(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(b1,{text:v.pairingText}),(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.qrRemaining`,{seconds:b})}),(0,A.jsx)(aH,{text:v.pairingText,label:t(`pairing.copyText`)}),(0,A.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>void E(),className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,children:t(`pairing.refreshQr`)})]})]}):(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[v!==null&&b<=0&&(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.qrExpired`)}),(0,A.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>void E(),className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,children:t(`pairing.generateQr`)})]}),(0,A.jsx)(`p`,{className:`max-w-64 text-xs text-ink-500`,children:t(`pairing.scanHint`,{relay:ce?t(`pairing.relayFirewall`):``})})]})}),(0,A.jsxs)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-ink-800`,children:t(`pairing.certificate`)}),oe!==null&&(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.certInfo`,{fingerprint:oe.fingerprint.slice(0,16),date:YZ(oe.expiresAt,n)})}),(0,A.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>C(`regenerate`),className:`focus-neko ml-auto rounded-full px-3 py-1.5 text-sm text-ink-500 disabled:opacity-50`,children:t(`pairing.regenerate`)})]}),D&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-sakura-800`,role:`alert`,children:t(`pairing.certExpiring`)}),(0,A.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(`pairing.regenerateWarning`)})]}),(0,A.jsxs)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-ink-800`,children:t(`pairing.devices`)}),a===null||a.devices.length===0?(0,A.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:t(`pairing.noDevices`)}):(0,A.jsx)(`ul`,{className:`mt-2 flex flex-col gap-2`,children:a.devices.map(e=>(0,A.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex`,children:(0,A.jsx)(zR,{name:`phone`,size:15,className:`text-ink-400`})}),(0,A.jsx)(`span`,{className:`text-ink-800`,children:e.name}),(0,A.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs ${e.online?`bg-tianyi-50 text-tianyi-800`:`bg-ink-100 text-ink-500`}`,children:e.online?t(`pairing.online`):t(`pairing.offline`)}),(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:t(`pairing.lastSeen`,{time:JZ(e.lastSeenAt,n)})}),(0,A.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>C({deviceId:e.deviceId,name:e.name}),className:`focus-neko ml-auto rounded-full px-3 py-1.5 text-sm text-sakura-800 disabled:opacity-50`,children:t(`pairing.revoke`)})]},e.deviceId))})]}),e?.gatewaySpawned===!0&&(0,A.jsxs)(`p`,{className:`mt-4 rounded-xl bg-tianyi-50 px-3 py-2 text-xs text-tianyi-800`,children:[t(`pairing.spawnedBefore`),(0,A.jsx)(`code`,{className:`mx-1`,children:`neko serve`}),t(`pairing.spawnedAfter`)]}),(0,A.jsx)(`output`,{className:`mt-3 block min-h-4 text-xs text-tianyi-800`,"aria-live":`polite`,children:l}),S===`regenerate`&&(0,A.jsxs)(UR,{title:t(`pairing.regenerate`),onClose:()=>C(null),children:[(0,A.jsx)(`p`,{className:`text-sm text-ink-700`,children:t(`pairing.regenerateConfirm`)}),(0,A.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full px-4 py-1.5 text-sm text-ink-500`,onClick:()=>C(null),children:t(`common.cancel`)}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,onClick:()=>void ie(),children:t(`pairing.confirmRegenerate`)})]})]}),typeof S==`object`&&!!S&&(0,A.jsxs)(UR,{title:t(`pairing.revokeTitle`,{name:S.name}),onClose:()=>C(null),children:[(0,A.jsx)(`p`,{className:`text-sm text-ink-700`,children:t(`pairing.revokeConfirm`)}),(0,A.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full px-4 py-1.5 text-sm text-ink-500`,onClick:()=>C(null),children:t(`common.cancel`)}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,onClick:()=>void ae(S.deviceId),children:t(`pairing.confirmRevoke`)})]})]})]})}function S1(){let e=B();return(0,A.jsxs)(dz,{active:`mobile`,children:[(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:e(`settings.mobile.title`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:e(`settings.mobile.intro`)})]}),(0,A.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,A.jsx)(x1,{})})]})}var C1={saved:`credential.source.saved`,environment:`credential.source.environment`,runtime:`credential.source.runtime`,keyless:`credential.source.keyless`,none:`credential.source.none`};function w1(e){let{spec:t,status:n,ready:r,enable:i,note:a}=e,o=t.name,s=B(),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(!1),p=(0,f.useRef)(!1),[m,h]=(0,f.useState)(``);async function g(e,t){if(!p.current){p.current=!0,d(!0),h(``);try{await e(),h(t)}catch{h(s(`credential.failed`))}finally{p.current=!1,d(!1)}}}async function _(e){await g(async()=>{e?await uP.removeCredential(t.id):await uP.saveCredential(t.id,c),l(``)},s(e?`credential.removed`:`credential.saved`))}let v=u||!r||!n;return(0,A.jsxs)(`section`,{id:`credential-${t.id}`,className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:o}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i&&(0,A.jsxs)(`label`,{className:`inline-flex items-center gap-1.5 rounded-full border border-sakura-200 px-3 py-1 text-xs ${i.locked?`text-ink-500`:`cursor-pointer text-ink-700`}`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:i.enabled,disabled:v||i.locked,"aria-label":s(`credential.enableAria`,{name:o}),onChange:e=>void g(()=>i.onChange(e.target.checked),e.target.checked?s(`credential.enabledDone`):s(`credential.disabledDone`))}),i.locked?s(`credential.alwaysOn`):s(`credential.enable`)]}),(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:s(n?C1[n.source]:`common.loading`)})]})]}),(0,A.jsxs)(`p`,{className:`mb-3 text-xs text-ink-500`,children:[s(`credential.envVar`,{state:n?n.environmentConfigured?s(`credential.envConfigured`):s(`credential.envMissing`):s(`common.loading`),envVar:t.envVar}),t.keyless?s(`credential.keylessNote`):``,a?` · ${a}`:``]}),(0,A.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_(!1)},children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`${t.id}-key`,children:s(`credential.keyLabel`,{name:o})}),(0,A.jsx)(`input`,{id:`${t.id}-key`,type:`password`,autoComplete:`off`,spellCheck:!1,value:c,maxLength:4096,disabled:v,onChange:e=>l(e.target.value),placeholder:n?.savedConfigured?s(`credential.placeholderReplace`):s(`credential.placeholderNew`),className:`focus-neko w-full min-w-0 rounded-xl border border-sakura-200 bg-base px-3 py-2.5 text-sm`}),(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`button`,{type:`submit`,disabled:v||!c.trim(),className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,children:s(u?`credential.working`:`credential.save`)}),n?.savedConfigured&&(0,A.jsx)(`button`,{type:`button`,disabled:v,onClick:()=>void _(!0),className:`focus-neko rounded-full px-3 py-1.5 text-sm text-ink-500 disabled:opacity-50`,children:s(`credential.remove`)}),(0,A.jsx)(`a`,{href:t.signupUrl,target:`_blank`,rel:`noreferrer`,className:`focus-neko ml-auto inline-block rounded text-xs text-sakura-700`,children:s(`credential.getKey`,{name:o})})]})]}),(0,A.jsx)(`output`,{className:`mt-2 block min-h-4 text-xs text-tianyi-800`,children:m})]})}var T1=`credential-`;function E1(){let e=typeof window>`u`?``:window.location.hash.slice(1),t=e.startsWith(T1)?e.slice(11):``;return QP.some(e=>e.id===t)?t:`deepseek`}function D1(){let{credentials:e,phase:t}=QN(),n=B(),r=t===`ready`&&e!==null,[i,a]=(0,f.useState)(E1);(0,f.useEffect)(()=>{let e=()=>a(E1());return window.addEventListener(`hashchange`,e),window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`hashchange`,e),window.removeEventListener(`popstate`,e)}},[]);let o=QP.find(e=>e.id===i)??QP[0],s=t=>e?.statuses[t.id]?.enabled!==!1,c=QP.map(t=>{let r=e?.statuses[t.id],i=s(t);return{id:t.id,name:t.name,keywords:t.envVar,detail:i?r&&r.source!==`none`?n(`settings.credentials.configured`):n(`settings.credentials.keyMissing`):n(`settings.credentials.disabled`),tone:i?r&&r.source!==`none`?`on`:`warn`:`off`}}),l=QP.filter(s).length,u=e!==null;return(0,f.useEffect)(()=>{u&&window.location.hash===`#${T1}${i}`&&document.getElementById(`${T1}${i}`)?.scrollIntoView?.({block:`center`})},[u,i]),(0,A.jsxs)(dz,{active:`credentials`,children:[(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:n(`settings.credentials.title`)}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:n(t===`ready`?`common.connected`:`common.connecting`)})]}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:n(`settings.credentials.intro`)})]}),(0,A.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,A.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,A.jsx)(`div`,{className:`w-full min-w-0 sm:w-80`,children:(0,A.jsx)(JR,{label:n(`settings.credentials.providerLabel`),options:c,value:o.id,onChange:a})}),(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:n(`settings.credentials.enabledCount`,{enabled:l,total:QP.length})})]}),(0,A.jsx)(w1,{spec:o,status:e?.statuses[o.id],ready:r,enable:{enabled:s(o),locked:o.id===`deepseek`,onChange:e=>uP.setProviderEnabled(o.id,e)}},o.id)]})})]})}var O1=[`tavily`,`deepseek`],k1={tavily:`Tavily`,deepseek:`DeepSeek`},A1={saved:`search.source.saved`,environment:`search.source.environment`,runtime:`search.source.runtime`,keyless:`search.source.keyless`,none:`search.source.none`};function j1(e,t){let n=z(),r=e=>{let r=t?.statuses[e];return n(r?A1[r.source]:`common.loading`)},i={tavily:n(`search.tavilyDescription`,{source:r(`tavily`)}),deepseek:n(`search.deepseekDescription`,{source:r(`deepseek`)})};return O1.map(t=>({value:t,label:k1[t],description:i[t],selected:e?.selected===t}))}function M1(e,t){return e?.selected===`deepseek`&&t?.statuses.deepseek?.source===`none`?z()(`search.deepseekWarning`):null}function N1(e){let{settings:t,credentials:n,ready:r,onSelect:i}=e,a=B(),[o,s]=(0,f.useState)(!1),c=(0,f.useRef)(!1),[l,u]=(0,f.useState)(``),d=M1(t,n);async function p(e){if(!(c.current||e===t?.selected)){c.current=!0,s(!0),u(``);try{await i(e),u(a(`search.switched`,{name:k1[e]}))}catch{u(a(`search.saveFailed`))}finally{c.current=!1,s(!1)}}}let m=o||!r||!t;return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,"aria-labelledby":`search-service`,children:[(0,A.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsx)(`h2`,{id:`search-service`,className:`text-base font-bold text-ink-900`,children:a(`search.service`)}),(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:t?a(`search.current`,{name:k1[t.selected]}):a(`common.loading`)})]}),(0,A.jsx)(`p`,{className:`mb-3 text-xs text-ink-500`,children:a(`search.intro`)}),(0,A.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,disabled:m,children:[(0,A.jsx)(`legend`,{className:`sr-only`,children:a(`search.service`)}),j1(t,n).map(e=>(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-xl border px-3 py-2.5 text-sm ${e.selected?`border-sakura-400 bg-sakura-50`:`border-sakura-100`} ${m?`opacity-60`:``}`,children:[(0,A.jsx)(`input`,{type:`radio`,name:`search-provider`,value:e.value,checked:e.selected,onChange:()=>void p(e.value),className:`mt-1`}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`span`,{className:`font-semibold text-ink-900`,children:e.label}),(0,A.jsx)(`span`,{className:`block text-xs text-ink-500`,children:e.description})]})]},e.value))]}),d&&(0,A.jsx)(`p`,{className:`mt-3 text-xs text-sakura-800`,children:d}),(0,A.jsx)(`output`,{className:`mt-2 block min-h-4 text-xs text-tianyi-800`,children:l})]})}var P1=QP.find(e=>e.id===`deepseek`);function F1(){let{credentials:e,searchSettings:t,phase:n}=QN(),r=B(),i=n===`ready`&&e!==null;return(0,A.jsxs)(dz,{active:`search`,children:[(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:r(`settings.search.title`)}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:r(n===`ready`?`common.connected`:`common.connecting`)})]}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:r(`settings.search.intro`)})]}),(0,A.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,A.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,A.jsx)(N1,{settings:t,credentials:e,ready:i,onSelect:e=>uP.setSearchProvider(e)}),$P.map(t=>(0,A.jsx)(w1,{spec:t,status:e?.statuses[t.id],ready:i},t.id)),P1&&(0,A.jsx)(w1,{spec:P1,status:e?.statuses[P1.id],ready:i,note:r(`settings.search.deepseekNote`)})]})})]})}var I1=[`documents`,`development`,`frontend`,`research`,`skills`,`automation`,`database`,`writing`,`uncategorized`],L1=(e,t)=>I1.includes(t)?e(`skills.category.${t}`):t,R1=(e,t)=>e(`skills.scope.${t}`),z1=e=>e>=1048576?`${(e/1024/1024).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`,B1=e=>e===``?``:e.slice(0,10),V1=e=>e instanceof I?e.reason??null:null;function H1(e,t,n){let r=new Map;for(let i of e){let e=t===`category`?L1(n,i.category):i.source,a=r.get(e)??[];a.push(i),r.set(e,a)}return[...r.entries()].sort((e,t)=>t[1].length-e[1].length||e[0].localeCompare(t[0]))}function U1({skill:e}){let t=B();return(0,A.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs`,children:[e.installed.project&&(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-sakura-100 px-2 py-0.5 text-sakura-800`,children:[(0,A.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-sakura-500`}),e.activeLevel===`project`?t(`skills.badge.active`,{level:t(`skills.badge.project`)}):t(`skills.badge.project`)]}),e.installed.user&&(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-sakura-100 px-2 py-0.5 text-sakura-800`,children:[(0,A.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-sakura-500`}),e.activeLevel===`user`?t(`skills.badge.active`,{level:t(`skills.badge.user`)}):t(`skills.badge.user`)]}),e.installed.builtin&&(0,A.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2 py-0.5 text-ink-600`,children:t(`skills.badge.builtin`)})]})}function W1({confirm:e,onClose:t}){let n=B(),[r,i]=(0,f.useState)(!1);return(0,A.jsx)(G1,{children:(0,A.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":n(`common.cancel`),onClick:t,className:`absolute inset-0 bg-ink-900/20`}),(0,A.jsxs)(`div`,{role:`alertdialog`,"aria-modal":`true`,"aria-label":e.title,className:`relative w-full max-w-sm rounded-card border border-sakura-200 bg-surface p-5 shadow-lift`,children:[(0,A.jsx)(`h3`,{className:`text-base font-bold text-ink-900`,children:e.title}),(0,A.jsx)(`p`,{className:`mt-2 text-sm text-ink-600`,children:e.body}),(0,A.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:t,className:`focus-neko rounded-full px-4 py-1.5 text-sm text-ink-500`,children:n(`common.cancel`)}),(0,A.jsx)(`button`,{type:`button`,disabled:r,className:`focus-neko rounded-full px-4 py-1.5 text-sm font-semibold disabled:opacity-50 ${e.danger?`bg-sakura-100 text-sakura-800`:`bg-tianyi-100 text-tianyi-800`}`,onClick:()=>{i(!0),e.action().finally(()=>{i(!1),t()})},children:r?n(`skills.processing`):e.confirmLabel})]})]})]})})}function G1({children:e}){return(0,aL.createPortal)(e,document.body)}function K1({name:e,onClose:t,onChanged:n}){let r=B(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(null),[c,l]=(0,f.useState)(`about`),[u,d]=(0,f.useState)(null),[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(``),[y,b]=(0,f.useState)(null);(0,f.useEffect)(()=>{let t=!1;return a(null),s(null),d(null),l(`about`),v(``),uP.marketDetail(e).then(e=>{t||a(e)}).catch(e=>{t||s(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e]),(0,f.useEffect)(()=>{if(c!==`preview`||u!==null||p!==null)return;let t=!1;return uP.marketPreview(e).then(e=>{t||d(e)}).catch(e=>{t||m(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[c,e,u,p]);let x=async(t,i)=>{g(t),v(``);try{let o=await uP.marketInstall(e,t,i);v(o.shadowedBy===`project`?r(`skills.installedShadowed`):r(`skills.installed`)),n();let s=await uP.marketDetail(e);a(s)}catch(n){V1(n)===`skill_exists`&&!i?b({title:r(`skills.overwriteTitle`),body:r(`skills.overwriteBody`,{scope:R1(r,t),name:e}),confirmLabel:r(`skills.overwrite`),action:()=>x(t,!0)}):v(r(`skills.opFailed`,{error:n instanceof Error?n.message:String(n)}))}finally{g(null)}},S=t=>{if(i===null)return;let n=t===`user`?i.installed.user:i.installed.project,a=t===`user`&&i.installed.project;n?b({title:r(`skills.overwriteTitle`),body:r(`skills.overwriteBodyVersion`,{scope:R1(r,t),name:e,version:i.version}),confirmLabel:r(`skills.overwrite`),action:()=>x(t,!0)}):a?b({title:r(`skills.shadowTitle`),body:r(`skills.shadowBody`,{name:e}),confirmLabel:r(`skills.installAnyway`),action:()=>x(t,!1)}):x(t,!1)},C=t=>{b({title:r(`skills.uninstallTitle`),body:r(`skills.uninstallBody`,{scope:R1(r,t),name:e}),confirmLabel:r(`skills.uninstall`),danger:!0,action:async()=>{g(t),v(``);try{await uP.marketUninstall(e,t),v(r(`skills.uninstalled`)),n(),a(await uP.marketDetail(e))}catch(e){v(r(`skills.opFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{g(null)}}})};return(0,A.jsxs)(G1,{children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":r(`skills.closeDetail`),onClick:t,className:`fixed inset-0 z-40 bg-ink-900/10`}),(0,A.jsxs)(`aside`,{role:`dialog`,"aria-label":r(`skills.detailAria`,{name:e}),className:`fixed inset-0 z-50 flex flex-col bg-base sm:inset-y-0 sm:left-auto sm:right-0 sm:w-[26rem] sm:border-l sm:border-sakura-200 sm:shadow-lift`,children:[(0,A.jsxs)(`header`,{className:`flex items-center justify-between gap-2 border-b border-sakura-100 px-4 py-3`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-sakura-500`,children:(0,A.jsx)(zR,{name:`sparkles`,size:16})}),(0,A.jsx)(`h2`,{className:`truncate text-lg font-bold text-ink-900`,children:e}),i&&(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-ink-400`,children:i.version})]}),(0,A.jsx)(`button`,{type:`button`,onClick:t,"aria-label":r(`skills.closeDetail`),className:`focus-neko rounded-lg p-1 text-ink-500 hover:bg-ink-100`,children:(0,A.jsx)(zR,{name:`close`,size:16})})]}),(0,A.jsx)(`div`,{className:`flex gap-1 border-b border-sakura-100 px-4 py-2`,children:[`about`,`preview`].map(e=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>l(e),className:`focus-neko rounded-full px-3 py-1 text-sm ${c===e?`bg-tianyi-100 font-semibold text-tianyi-800`:`text-ink-500`}`,children:r(e===`about`?`skills.tab.about`:`skills.tab.preview`)},e))}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:[o!==null&&(0,A.jsx)(`p`,{className:`text-sm text-sakura-800`,children:r(`skills.loadFailed`,{error:o})}),i===null&&o===null&&(0,A.jsx)(`p`,{className:`text-sm text-ink-500`,children:r(`common.loadingEllipsis`)}),i!==null&&c===`about`&&(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(`p`,{className:`text-sm text-ink-700`,children:i.description}),(0,A.jsx)(`dl`,{className:`space-y-1.5 text-xs text-ink-600`,children:[[r(`skills.field.category`),L1(r,i.category)],[r(`skills.field.source`),i.source],[r(`skills.field.size`),z1(i.sizeBytes)],[`SHA-256`,`${i.sha256.slice(0,12)}…`],[r(`skills.field.uploaded`),B1(i.uploadedAt)],...i.license===``?[]:[[r(`skills.field.license`),i.license]]].map(([e,t])=>(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`dt`,{className:`w-14 shrink-0 text-ink-400`,children:e}),(0,A.jsx)(`dd`,{className:`min-w-0 font-mono`,children:t})]},e))}),(0,A.jsxs)(`div`,{className:`rounded-xl bg-ink-50 px-3 py-2 text-xs text-ink-600`,children:[(0,A.jsx)(U1,{skill:i}),!i.installed.project&&!i.installed.user&&!i.installed.builtin&&r(`skills.notInstalled`)]})]}),i!==null&&c===`preview`&&(0,A.jsxs)(`div`,{children:[u===null&&p===null&&(0,A.jsx)(`p`,{className:`text-sm text-ink-500`,children:r(`skills.previewLoading`)}),p!==null&&(0,A.jsx)(`p`,{className:`text-sm text-sakura-800`,children:r(`skills.previewFailed`,{error:p})}),u!==null&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(dZ,{text:u.body}),(0,A.jsx)(`h3`,{className:`mb-1 mt-4 text-xs font-medium text-ink-400`,children:r(`skills.packageFiles`)}),(0,A.jsx)(`ul`,{className:`space-y-0.5 font-mono text-xs text-ink-600`,children:u.files.map(e=>(0,A.jsx)(`li`,{children:e},e))})]})]})]}),i!==null&&(0,A.jsxs)(`footer`,{className:`space-y-2 border-t border-sakura-100 px-4 py-3`,children:[_!==``&&(0,A.jsx)(`output`,{className:`block text-xs text-tianyi-800`,children:_}),i.installed.builtin&&!i.installed.user&&!i.installed.project?(0,A.jsx)(`p`,{className:`text-xs text-ink-500`,children:r(`skills.builtinNote`)}):(0,A.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`user`,`project`].map(e=>{let t=e===`user`?i.installed.user:i.installed.project,n=R1(r,e);return t?(0,A.jsxs)(`button`,{type:`button`,disabled:h!==null,onClick:()=>C(e),className:`focus-neko inline-flex items-center gap-1.5 rounded-full border border-ink-200 px-3 py-1.5 text-sm text-ink-600 disabled:opacity-50`,children:[(0,A.jsx)(zR,{name:`trash`,size:14}),h===e?r(`skills.processing`):r(`skills.uninstallScope`,{scope:n})]},e):(0,A.jsxs)(`button`,{type:`button`,disabled:h!==null,onClick:()=>S(e),className:`focus-neko inline-flex items-center gap-1.5 rounded-full bg-tianyi-100 px-3 py-1.5 text-sm font-semibold text-tianyi-800 disabled:opacity-50`,children:[(0,A.jsx)(zR,{name:`download`,size:14}),h===e?r(`skills.installing`):r(`skills.installScope`,{scope:n})]},e)})})]})]}),y&&(0,A.jsx)(W1,{confirm:y,onClose:()=>b(null)})]})}function q1(){let e=B(),{phase:t}=QN(),[n,r]=(0,f.useState)([]),[i,a]=(0,f.useState)(!0),[o,s]=(0,f.useState)(null),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(`category`),[p,m]=(0,f.useState)(null),h=(0,f.useRef)(0),g=()=>{let e=++h.current;a(!0),s(null),uP.marketList().then(t=>{e===h.current&&r(t)}).catch(t=>{e===h.current&&s(t instanceof Error?t.message:String(t))}).finally(()=>{e===h.current&&a(!1)})};(0,f.useEffect)(()=>{t===`ready`&&g()},[t]);let _=(0,f.useMemo)(()=>{let e=c.trim().toLowerCase();return e===``?n:n.filter(t=>t.name.toLowerCase().includes(e)||t.description.toLowerCase().includes(e))},[n,c]),v=(0,f.useMemo)(()=>H1(_,u,e),[_,u,e]);return(0,A.jsxs)(`div`,{className:`flex min-h-dvh flex-col bg-base`,children:[(0,A.jsx)(`header`,{className:`sticky top-0 z-10 border-b border-sakura-100 bg-surface/90 px-4 py-3 backdrop-blur-md sm:px-6`,children:(0,A.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-wrap items-center gap-3`,children:[(0,A.jsx)(Hr,{to:`/`,className:`focus-neko inline-flex shrink-0 items-center gap-1 rounded-lg px-2 py-1 text-sm font-medium text-sakura-700 hover:bg-sakura-50`,children:e(`skills.back`)}),(0,A.jsx)(`span`,{className:`text-ink-300`,children:`/`}),(0,A.jsx)(`h1`,{className:`text-base font-bold text-ink-900 sm:text-lg`,children:e(`skills.title`)}),(0,A.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2 sm:gap-3`,children:[(0,A.jsx)(`div`,{className:`flex rounded-full border border-sakura-200 p-0.5 text-xs`,children:[`category`,`source`].map(t=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>d(t),className:`focus-neko rounded-full px-3 py-1 ${u===t?`bg-sakura-100 font-semibold text-sakura-800`:`text-ink-500 hover:text-ink-800`}`,children:e(t===`category`?`skills.groupCategory`:`skills.groupSource`)},t))}),(0,A.jsxs)(`label`,{className:`relative`,children:[(0,A.jsx)(`span`,{className:`sr-only`,children:e(`skills.search`)}),(0,A.jsx)(`span`,{className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-ink-400`,children:(0,A.jsx)(zR,{name:`search`,size:14})}),(0,A.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:e(`skills.searchPlaceholder`),className:`focus-neko w-36 rounded-full border border-sakura-200 bg-surface py-1.5 pl-8 pr-3 text-sm sm:w-56`})]}),(0,A.jsx)(`span`,{className:`text-xs text-ink-400`,children:e(t===`ready`?`common.connected`:`common.connecting`)})]})]})}),(0,A.jsxs)(`main`,{className:`mx-auto w-full max-w-7xl flex-1 px-4 py-6 sm:px-6`,children:[i&&(0,A.jsx)(`p`,{className:`py-16 text-center text-sm text-ink-500`,children:e(t===`ready`?`skills.loadingCatalog`:`skills.waitingGateway`)}),o!==null&&(0,A.jsxs)(`div`,{className:`mx-auto max-w-md rounded-card border border-sakura-200 bg-surface p-6 text-center shadow-soft`,children:[(0,A.jsx)(`p`,{className:`text-sm text-ink-700`,children:e(`skills.catalogFailed`)}),(0,A.jsx)(`p`,{className:`mt-1 break-all font-mono text-xs text-ink-400`,children:o}),(0,A.jsx)(`button`,{type:`button`,onClick:g,className:`focus-neko mt-4 rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,children:e(`common.retry`)})]}),!i&&o===null&&_.length===0&&(0,A.jsx)(`p`,{className:`py-16 text-center text-sm text-ink-500`,children:e(`skills.noMatch`)}),v.map(([e,t])=>(0,A.jsxs)(`section`,{className:`mb-7`,children:[(0,A.jsxs)(`h2`,{className:`mb-2.5 flex items-baseline gap-2 text-lg font-bold text-ink-900`,children:[e,(0,A.jsx)(`span`,{className:`text-xs font-normal text-ink-400`,children:t.length})]}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`,children:t.map(e=>(0,A.jsxs)(`button`,{type:`button`,onClick:()=>m(e.name),className:`focus-neko rounded-2xl border border-sakura-200 bg-surface p-4 text-left shadow-soft transition-shadow hover:shadow-lift`,children:[(0,A.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,A.jsx)(`span`,{className:`truncate text-base font-bold text-ink-900`,children:e.name}),(0,A.jsx)(U1,{skill:e})]}),(0,A.jsx)(`p`,{className:`mb-2.5 line-clamp-2 min-h-10 text-sm text-ink-500`,children:e.description}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-ink-400`,children:[(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-2 py-0.5 text-tianyi-800`,children:e.source}),(0,A.jsx)(`span`,{className:`font-mono`,children:e.version}),(0,A.jsx)(`span`,{children:z1(e.sizeBytes)})]})]},e.name))})]},e))]}),p!==null&&(0,A.jsx)(K1,{name:p,onClose:()=>m(null),onChanged:()=>g()})]})}var J1=qr({component:()=>(0,A.jsx)(ri,{})}),Y1=Gr({getParentRoute:()=>J1,path:`/`,component:g$}),X1=Gr({getParentRoute:()=>J1,path:`/settings`,component:D1}),Z1=Gr({getParentRoute:()=>J1,path:`/settings/search`,component:F1}),Q1=Gr({getParentRoute:()=>J1,path:`/settings/context`,component:U$}),$1=Gr({getParentRoute:()=>J1,path:`/settings/appearance`,component:O$}),e0=Gr({getParentRoute:()=>J1,path:`/settings/language`,component:G$}),t0=Gr({getParentRoute:()=>J1,path:`/settings/mobile`,component:S1}),n0=Gr({getParentRoute:()=>J1,path:`/skills`,component:q1}),r0=Gr({getParentRoute:()=>J1,path:`/about`,component:_z}),i0=li({routeTree:J1.addChildren([Y1,X1,Z1,Q1,$1,e0,t0,n0,r0])});Ri().start(),PN().start(),cP();var a0=document.getElementById(`root`);a0!==null&&(0,vi.createRoot)(a0).render((0,A.jsx)(f.StrictMode,{children:(0,A.jsx)(fi,{router:i0})}));