papilot 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -30
- package/README.zh-CN.md +54 -30
- package/bin/doctor.mjs +53 -6
- package/bin/installation.d.mts +2 -0
- package/bin/installation.mjs +7 -1
- package/dist/assets/{_virtual_papilot-licenses-BWIsfrQh.js → _virtual_papilot-licenses-D7ro6ecN.js} +54 -3
- package/dist/assets/index-Cc-awdNn.css +1 -0
- package/dist/assets/index-D_VX51no.js +265 -0
- package/dist/assets/latex-BarqJFtQ.svg +1 -0
- package/dist/assets/{math-BsEl3u6P.js → math-V9uUaUzA.js} +1 -1
- package/dist/assets/pdf-view-Bnb2uIBE.js +598 -0
- package/dist/index.html +2 -2
- package/examples/papilot-paper/main.tex +1 -1
- package/examples/papilot-paper/sections/02-using.tex +3 -1
- package/examples/papilot-paper/sections/09-agents.tex +8 -5
- package/package.json +10 -6
- package/skills/ai-review.md +18 -0
- package/skills/latex-warnings.md +1 -1
- package/src/conversation.ts +6 -0
- package/src/server/acp.ts +354 -0
- package/src/server/agents.ts +220 -43
- package/src/server/ai-review-routes.ts +72 -0
- package/src/server/ai-review.ts +38 -0
- package/src/server/app.ts +53 -11
- package/src/server/build-problems.ts +329 -0
- package/src/server/changes.ts +25 -2
- package/src/server/codex.ts +2 -1
- package/src/server/cursor.ts +153 -0
- package/src/server/latex-installation.ts +43 -0
- package/src/server/manuscript.ts +165 -23
- package/src/server/paths.ts +1 -1
- package/src/server/references.ts +70 -0
- package/src/server/review.ts +3 -3
- package/src/server/skills.ts +5 -8
- package/src/server/store.ts +20 -2
- package/src/server/update-install.ts +53 -2
- package/src/server/update-worker.ts +6 -6
- package/src/server/updates.ts +43 -14
- package/src/server/workspace.ts +183 -29
- package/src/shared.ts +78 -7
- package/src/skill-icons.ts +18 -0
- package/src/skill-metadata.ts +45 -0
- package/vendor/latex-review/dist/web/assets/index-7VKAte5x.js +19 -0
- package/vendor/latex-review/dist/web/assets/index-DEz-LsGl.css +1 -0
- package/vendor/latex-review/dist/web/index.html +2 -2
- package/vendor/latex-review/src/core/bib.ts +692 -0
- package/vendor/latex-review/src/core/changes.ts +39 -0
- package/vendor/latex-review/src/core/review.ts +1 -0
- package/vendor/latex-review/src/core/verify.ts +784 -0
- package/vendor/latex-review/src/core/view.ts +204 -0
- package/vendor/latex-review/src/render/round.ts +11 -0
- package/vendor/latex-review/src/server.ts +65 -0
- package/vendor/latex-review/src/types.ts +125 -0
- package/vendor/latex-review/src/web/effect-preferences.ts +10 -0
- package/vendor/latex-review/src/web/references.tsx +499 -0
- package/vendor/latex-review/src/web/review.tsx +259 -131
- package/vendor/latex-review/src/web/style.css +285 -0
- package/vendor/latex-review/src/web/zh-CN.ts +75 -0
- package/dist/assets/index-CIJEYlP7.js +0 -252
- package/dist/assets/index-hOJEruFc.css +0 -1
- package/dist/assets/pdf-view-Cz9_vK5U.js +0 -598
- package/vendor/latex-review/dist/web/assets/index-Be9CtgcZ.css +0 -1
- package/vendor/latex-review/dist/web/assets/index-TvMWVSaw.js +0 -19
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/math-BsEl3u6P.js","assets/math-DEcVZfaU.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
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,t.exports),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=[`yellow`,`green`,`purple`,`orange`,`red`],d=e=>e===`blue`?`yellow`:e,f=e=>e===`blue`||u.includes(e);function p(e){if(e===void 0)return{};if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Use valid instructions for each color group.`);let t={};for(let[n,r]of Object.entries(e)){if(!f(n)||typeof r!=`string`||r.length>4e3)throw Error(`Use valid instructions for each color group (up to 4000 characters).`);let e=d(n);if(t[e]&&t[e]!==r.trim())throw Error(`Use one instruction for each color group.`);r.trim()&&(t[e]=r.trim())}return t}var m=(e,t)=>u.filter(n=>!t[n]?.trim()&&e.some(e=>e.group&&d(e.group)===n&&!e.comment.trim())),h={yellow:`#eab308`,blue:`#eab308`,green:`#16a34a`,purple:`#a855f7`,orange:`#ea860c`,red:`#e05260`},g={yellow:`Yellow`,blue:`Yellow`,green:`Green`,purple:`Purple`,orange:`Orange`,red:`Red`};function _(e){return u.flatMap(t=>{let n=e.flatMap((e,n)=>e.group&&d(e.group)===t?[{note:e,index:n}]:[]);return n.length?[{group:t,entries:n}]:[]})}var v=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},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ee=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function L(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function te(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else L(te.bind(null,e))}var ne={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=te,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=L,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),y=o(((e,t)=>{t.exports=v()})),b=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})),x=o(((e,t)=>{t.exports=b()})),S=y(),C=x(),w={info:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,C.jsx)(`path`,{d:`M12 11v6m0-10h.01`})]}),code:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(`path`,{d:`m8 7-5 5 5 5m8-10 5 5-5 5M14 4l-4 16`})}),github:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(`path`,{d:`M9 19c-4.3 1.3-4.3-2.1-6-2.5m12 5v-3.9a3.4 3.4 0 0 0-.9-2.7c3-.3 6.2-1.5 6.2-6.8a5.3 5.3 0 0 0-1.4-3.7 4.9 4.9 0 0 0-.1-3.6s-1.1-.3-3.8 1.4a13.2 13.2 0 0 0-7 0C5.3.5 4.2.8 4.2.8A4.9 4.9 0 0 0 4.1 4.4a5.3 5.3 0 0 0-1.4 3.7c0 5.3 3.2 6.5 6.2 6.8a3.4 3.4 0 0 0-.9 2.7v3.9`})}),keyboard:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`}),(0,C.jsx)(`path`,{d:`M6 9h.01M10 9h.01M14 9h.01M18 9h.01M6 12h.01M10 12h.01M14 12h.01M18 12h.01M7 16h10`})]}),sun:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,C.jsx)(`path`,{d:`M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5`})]}),moon:(0,C.jsx)(`path`,{d:`M20.9 13A9 9 0 0 1 11 3.1 9 9 0 1 0 20.9 13Z`}),plus:(0,C.jsx)(`path`,{d:`M12 5v14M5 12h14`}),attachment:(0,C.jsx)(`path`,{d:`m21 11-8 8a6 6 0 0 1-8.5-8.5l9-9a4 4 0 0 1 5.7 5.7l-9 9a2 2 0 0 1-2.8-2.8l8-8`}),archive:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`4`,rx:`1`}),(0,C.jsx)(`path`,{d:`M5 7v13h14V7M10 11h4`})]}),restore:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(`path`,{d:`M3 10a9 9 0 1 1 2 9M3 4v6h6M12 7v5l3 2`})}),bolt:(0,C.jsx)(`path`,{d:`m13 2-9 12h7l-1 8 10-12h-7Z`}),compose:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),(0,C.jsx)(`path`,{d:`M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z`})]}),sidebar:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2.5`}),(0,C.jsx)(`path`,{d:`M9 3v18`})]}),panelCollapse:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2.5`}),(0,C.jsx)(`path`,{d:`M15 3v18m-8-12 3 3-3 3`})]}),panelExpand:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2.5`}),(0,C.jsx)(`path`,{d:`M15 3v18m-5-12-3 3 3 3`})]}),menu:(0,C.jsx)(`path`,{d:`M4 7h16M4 12h16M4 17h16`}),arrowUp:(0,C.jsx)(`path`,{d:`M12 19V5m-7 7 7-7 7 7`}),arrowDown:(0,C.jsx)(`path`,{d:`M12 5v14m7-7-7 7-7-7`}),arrowRight:(0,C.jsx)(`path`,{d:`M5 12h14m-6-6 6 6-6 6`}),stop:(0,C.jsx)(`rect`,{x:`7`,y:`7`,width:`10`,height:`10`,rx:`2`,fill:`currentColor`,stroke:`none`}),updown:(0,C.jsx)(`path`,{d:`m7 15 5 5 5-5M7 9l5-5 5 5`}),check:(0,C.jsx)(`path`,{d:`M20 6 9 17l-5-5`}),close:(0,C.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`}),more:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.4`,fill:`currentColor`,stroke:`none`}),(0,C.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.4`,fill:`currentColor`,stroke:`none`}),(0,C.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.4`,fill:`currentColor`,stroke:`none`})]}),external:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M15 3h6v6M10 14 21 3`}),(0,C.jsx)(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]}),paper:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`}),(0,C.jsx)(`path`,{d:`M14 2v5h5M16 13H8M16 17H8M10 9H8`})]}),compile:(0,C.jsx)(`path`,{d:`M6 3.5 21 12 6 20.5Z`,fill:`currentColor`,stroke:`none`}),pdf:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M4 9V4a2 2 0 0 1 2-2h9l5 5v2M14 2v5h6M4 20a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2`}),(0,C.jsx)(`path`,{strokeWidth:`1.5`,d:`M2.5 18v-6h2a2 2 0 0 1 0 4h-2M9.5 12v6h1.5a3 3 0 0 0 0-6ZM17 18v-6h4m-4 3h3`})]}),chat:(0,C.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z`}),split:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2.5`}),(0,C.jsx)(`path`,{d:`M14 3v18`})]}),terminal:(0,C.jsx)(`path`,{d:`m4 17 6-6-6-6m8 14h8`}),diff:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`}),(0,C.jsx)(`path`,{d:`M9 10h6m-3-3v6m-3 4h6`})]}),tool:(0,C.jsx)(`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.8-3.8a6 6 0 0 1-7.9 7.9l-6.9 6.9a2.1 2.1 0 0 1-3-3l6.9-6.9a6 6 0 0 1 7.9-7.9Z`}),alert:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,C.jsx)(`path`,{d:`M12 8v4m0 4h.01`})]}),refresh:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M21 12a9 9 0 1 1-3-6.7L21 8`}),(0,C.jsx)(`path`,{d:`M21 3v5h-5`})]}),trash:(0,C.jsx)(`path`,{d:`M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m3 0-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6m5 5v6m4-6v6`}),pause:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`rect`,{x:`6`,y:`5`,width:`4`,height:`14`,rx:`1`}),(0,C.jsx)(`rect`,{x:`14`,y:`5`,width:`4`,height:`14`,rx:`1`})]}),search:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,C.jsx)(`path`,{d:`m20 20-3.5-3.5`})]}),region:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M5 3a2 2 0 0 0-2 2m16-2a2 2 0 0 1 2 2M5 21a2 2 0 0 1-2-2M9 3h1m4 0h1M9 21h2M3 9v1m18-1v2M3 14v1`}),(0,C.jsx)(`path`,{d:`M12.5 12.5 21 15.8l-3.6 1.3-1.3 3.6Z`})]}),list:(0,C.jsx)(`path`,{d:`M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01`}),chevronDown:(0,C.jsx)(`path`,{d:`m6 9 6 6 6-6`}),chevronUp:(0,C.jsx)(`path`,{d:`m18 15-6-6-6 6`}),chevronLeft:(0,C.jsx)(`path`,{d:`m15 18-6-6 6-6`}),chevronRight:(0,C.jsx)(`path`,{d:`m9 18 6-6-6-6`}),minus:(0,C.jsx)(`path`,{d:`M5 12h14`}),branch:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M6 3v12`}),(0,C.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,C.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,C.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),commit:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,C.jsx)(`path`,{d:`M3 12h6m6 0h6`})]}),notes:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z`}),(0,C.jsx)(`path`,{d:`M8 8h8M8 12h5`})]}),pencil:(0,C.jsx)(`path`,{d:`M17 3a2.85 2.85 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z`}),pen:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M16.8 3.8a2.4 2.4 0 0 1 3.4 3.4L7 20.4 3 21l.6-4Z`}),(0,C.jsx)(`path`,{d:`m15.2 5.4 3.4 3.4M3.6 17 7 20.4`})]}),copy:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`rect`,{x:`9`,y:`9`,width:`12`,height:`12`,rx:`2`}),(0,C.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),plane:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,C.jsx)(`path`,{d:`M22 2 11 13`})]}),spark:(0,C.jsx)(`path`,{d:`M12 3c.4 3.9 2.1 5.6 6 6-3.9.4-5.6 2.1-6 6-.4-3.9-2.1-5.6-6-6 3.9-.4 5.6-2.1 6-6ZM19 15c.2 1.5.8 2.1 2.3 2.3-1.5.2-2.1.8-2.3 2.3-.2-1.5-.8-2.1-2.3-2.3 1.5-.2 2.1-.8 2.3-2.3Z`}),spellcheck:(0,C.jsx)(`path`,{d:`m3 14 4-10 4 10M4.5 10h5m3.5 7 3 3 6-7`}),compress:(0,C.jsx)(`path`,{d:`M4 5h16M4 19h16M2 12h7m-3-3 3 3-3 3m16-3h-7m3-3-3 3 3 3`}),sigma:(0,C.jsx)(`path`,{d:`M19 5V3H5l7 9-7 9h14v-2`}),checklist:(0,C.jsx)(`path`,{d:`M10 6h11M10 12h11M10 18h11M2 5l2 2 3-3M2 11l2 2 3-3M2 17l2 2 3-3`}),monitor:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`}),(0,C.jsx)(`path`,{d:`M8 21h8m-4-4v4`})]}),bell:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9`}),(0,C.jsx)(`path`,{d:`M10.3 21a1.94 1.94 0 0 0 3.4 0`})]}),key:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`circle`,{cx:`7.5`,cy:`15.5`,r:`4.5`}),(0,C.jsx)(`path`,{d:`m10.7 12.3 9.8-9.8M17 6l3 3M14.5 8.5l2 2`})]}),people:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`circle`,{cx:`9`,cy:`8`,r:`3.5`}),(0,C.jsx)(`path`,{d:`M2.5 20a6.5 6.5 0 0 1 13 0`}),(0,C.jsx)(`path`,{d:`M16 4.6a3.5 3.5 0 0 1 0 6.8M18.5 14.2A6.5 6.5 0 0 1 21.5 20`})]}),signOut:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`}),(0,C.jsx)(`path`,{d:`m16 17 5-5-5-5M21 12H9`})]}),settings:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}),(0,C.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})};function T({name:e,size:t=18}){return(0,C.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:w[e]||w.paper})}var E=new Map,D={getItem(e){if(E.has(e))return E.get(e);try{return localStorage.getItem(e)}catch{return null}},setItem(e,t){E.set(e,t);try{localStorage.setItem(e,t),E.delete(e)}catch{}},removeItem(e){E.set(e,``);try{localStorage.removeItem(e),E.delete(e)}catch{}}},O={"Save accepted changes":`保存已接受的改动`,"Commit to task branch":`提交到 task 分支`,"Built-in":`内置`,Global:`全局`,"Search skills":`搜索技能`,"Refresh skills":`刷新技能`,"Skill scope":`技能范围`,"All skills":`全部技能`,"New skill":`新建技能`,Overridden:`已被覆盖`,All:`全部`,"Loading skills…":`正在加载技能…`,"Copy and edit":`复制并编辑`,"Skill ID":`技能 ID`,"Save to":`保存到`,"Use lowercase letters, numbers and hyphens. This is also the / command name.":`使用小写字母、数字和连字符,也作为 / 指令的名称。`,"Copy this built-in skill to customize it for all papers or this paper.":`复制这个内置技能,即可为所有论文或当前论文自定义。`,"Skill content (Markdown)":`技能内容(Markdown)`,"Skill content view":`技能内容视图`,Edit:`编辑`,Preview:`预览`,"A skill with the same ID takes priority here: this paper, then global, then built-in.":`此处有同 ID 的技能优先生效:当前论文优先于全局,全局优先于内置。`,"Delete skill":`删除技能`,Saved:`已保存`,"Unsaved changes":`尚未保存`,"Select a skill or create your own.":`选择一个技能,或创建自己的技能。`,"Discard unsaved skill changes?":`放弃尚未保存的技能修改?`,"Delete this skill? Only its Markdown file is removed; supporting files stay in place.":`删除这个技能?只删除其 Markdown 文件,附属文件会保留。`,"Keep editing":`继续编辑`,"Discard changes":`放弃修改`,"This skill changed on disk. Reload it before saving.":`这个技能已在磁盘上被修改,请先复制保留当前编辑,再刷新后保存。`,"This skill changed on disk. Reload it before deleting.":`这个技能已在磁盘上被修改,请刷新后再删除。`,"A skill with this ID already exists in this location.":`此范围内已有相同 ID 的技能,请使用另一个 ID。`,"This skill no longer exists. Refresh the list.":`这个技能已不存在,请刷新列表。`,"This skill was removed on disk. Reload the list before saving.":`这个技能已从磁盘上删除,请先刷新列表。`,"The skill must contain instructions.":`请填写技能的指令正文。`,"Skill content must contain 1–20,000 characters.":`技能内容需为 1 至 20,000 个字符。`,"Apply to working directory":`应用到工作目录`,"Applying…":`正在应用…`,"Applied to working directory":`已应用到工作目录`,"Committed {hash} to {branch}":`已提交 {hash} 到 {branch}`,Attachments:`附件`,"Choose attachments":`选择附件`,"Add files or skills":`添加文件或技能`,"Add files…":`添加文件…`,"Drop files to attach":`松开以添加附件`,"Uploading…":`正在上传…`,"Upload failed. Please retry.":`上传失败,请重试。`,"Retry uploading {name}":`重新上传 {name}`,"Remove attachment {name}":`移除附件 {name}`,"Open attachment {name}":`打开附件 {name}`,"Attach up to 10 files per message.":`每条消息最多添加 10 个附件。`,"The file “{name}” is empty.":`文件“{name}”为空。`,"Files must be 25 MB or smaller.":`单个文件不能超过 25 MB。`,"Images must be 5 MB or smaller.":`单张图片不能超过 5 MB。`,"Attachments must total 100 MB or less.":`附件总大小不能超过 100 MB。`,"Antigravity opens images through its file tools. For direct image input, choose Codex or Claude.":`Antigravity 通过文件工具读取图片。需要直接传入图片时,请选择 Codex 或 Claude。`,"LaTeX Git repository · Requires a commit and latexmk":`LaTeX Git 仓库 · 需有提交记录并安装 latexmk`,"Repository path":`仓库路径`,"LaTeX engine":`LaTeX 编译引擎`,"Could not read the selected file.":`无法读取所选文件。`,"Choose up to 5,000 files, totaling less than 64 MB.":`最多选择 5,000 个文件,总大小需小于 64 MB。`,"Drop one LaTeX ZIP file.":`请拖入一个 LaTeX ZIP 文件。`,"Install TeX Live or MacTeX with latexmk on the computer running Papilot, then retry.":`请在运行 Papilot 的电脑上安装包含 latexmk 的 TeX Live 或 MacTeX,然后重试。`,"This paper may need XeLaTeX. Change the engine below and retry.":`这篇论文可能需要 XeLaTeX。请修改下方编译引擎后重试。`,"A package, font or source file may be missing. Check the details below, restore the missing file or ask for help.":`可能缺少宏包、字体或源文件。请查看下方详情,补齐文件或请求协助。`,"Check the main file and engine, or ask the assistant to fix compilation. You can also edit the saved files and retry.":`请检查主文件和编译引擎,或请助手协助修复。也可以修改已保存的文件后重试。`,"Bring your LaTeX files. Papilot prepares version history and checks compilation.":`导入 LaTeX 文件,Papilot 会准备版本历史并尝试编译。`,"Drop a LaTeX ZIP here":`将 LaTeX ZIP 拖到这里`,"Up to 64 MB · Folders and ZIPs are copied into Papilot":`最大 64 MB · 文件夹和 ZIP 会复制到 Papilot 中`,"Choose folder":`选择文件夹`,"Choose ZIP":`选择 ZIP`,"Use a folder on this computer":`使用本机文件夹`,"Use the original files on the computer running Papilot.":`直接使用运行 Papilot 的电脑上的原始文件。`,"Folder path":`文件夹路径`,"Read folder":`读取文件夹`,"Reading paper files…":`正在读取论文文件…`,"Import progress":`导入进度`,"Files received":`已接收文件`,"Version history":`版本历史`,"PDF compilation":`编译 PDF`,"Saved folder":`保存位置`,"Main TeX file":`TeX 主文件`,"Choose a main file":`请选择主文件`,"No TeX files found. Choose a folder or ZIP containing the LaTeX source.":`未找到 TeX 文件。请选择包含 LaTeX 源文件的文件夹或 ZIP。`,"Several TeX files were found. Check the selected main document before continuing.":`找到多个 TeX 文件,请确认主文件后继续。`,"The assistant is fixing compilation…":`助手正在修复编译问题…`,"Preparing version history and compiling the PDF…":`正在准备版本历史并编译 PDF…`,"Your paper compiled successfully. It is ready for editing.":`论文已成功编译,可以开始修改。`,"The paper needs a little help":`论文需要一些修复`,"Compilation details":`编译详情`,"Repair summary":`修复说明`,"Repairs are saved as uncommitted changes. Review them in the paper’s file changes.":`修复会保留为未提交的修改,可在论文的文件变更中查看。`,"Help fix compilation":`协助修复编译`,"Prepare and compile":`准备并编译`,"Retry compilation":`重新编译`,"Open paper":`打开论文`,"Add and fix later":`先添加,稍后修复`,"Connect an assistant in Settings to help repair this paper.":`请在设置中连接助手,以协助修复这篇论文。`,"Choose different files":`重新选择文件`,"Continue later":`稍后继续`,"Edit {name}":`编辑 {name}`,"Edit paper":`编辑论文`,"Remove paper":`移除论文`,"Remove paper?":`移除论文?`,"Remove from Papilot":`从 Papilot 移除`,"Paper name":`论文名称`,"Removing…":`正在移除…`,"Remove this paper and its tasks, conversations and notes from Papilot?":`从 Papilot 移除这篇论文及其任务、对话和批注记录?`,"Files on disk, Git history and task worktrees will stay in place.":`硬盘上的文件、Git 历史和任务工作树都会保留。`,"Updating…":`正在更新…`,"Update ready":`更新已就绪`,"Restarting…":`正在重启…`,"Update failed":`更新失败`,"New version":`有新版本`,"Papilot {version}":`Papilot {version}`,"Update Papilot":`更新 Papilot`,Later:`稍后`,"Retry update":`重试更新`,"Update to {version}":`更新到 {version}`,"Could not start the update. Please retry.":`未能启动更新,请重试。`,"Downloading and checking the new version…":`正在下载并检查新版本…`,"The update is ready. Waiting for tasks and PDF builds to finish before restarting.":`更新已就绪,将在任务和 PDF 编译完成后重启。`,"Restarting Papilot. This page will reconnect automatically; your drafts are kept.":`正在重启 Papilot,页面将自动重连,草稿会保留。`,"The update did not finish. Your current version is still available. You can retry here.":`更新未完成,当前版本仍然可用。你可以在这里重试。`,"Install the new version and restart automatically when tasks are idle. Your papers, tasks and settings stay in place.":`安装新版本,并在任务空闲时自动重启。论文、任务和设置都会保留。`,"Papilot cannot find npm on this computer. Updates are unavailable until npm is installed.":`Papilot 未能在这台电脑上找到 npm,安装 npm 后即可更新。`,"Generate task title":`生成任务标题`,"Generating task title…":`正在生成任务标题…`,"Retry title generation":`重新生成任务标题`,"PDF annotations":`PDF 标注`,Yellow:`黄色`,Green:`绿色`,Purple:`紫色`,Orange:`橙色`,Red:`红色`,"Annotation groups":`批注组`,"Annotation group color":`批注组颜色`,"Individual notes":`单条批注`,Color:`颜色`,"Add to group":`加入批注组`,"Quoted text":`引用原文`,"Your note":`批注内容`,"{n} location":`{n} 处`,"{n} locations":`{n} 处`,"Add to {group}":`加入{group}组`,"Instructions for color groups":`各颜色组的修改要求`,"Send annotations":`发送标注`,"Send annotations to the agent":`发送标注给代理`,"What should change in this group?":`这组内容希望怎么处理?`,"What should change in each color group?":`各颜色组需要怎样修改?`,"Instructions for {group} notes":`{group}批注的处理要求`,"Add instructions to the selected color groups above.":`请在上方为选中的颜色组填写处理要求。`,"Reasoning effort":`推理强度`,"Model default":`模型默认`,"Request failed. Please try again.":`请求失败,请重试。`,"The connection is taking too long. Check your network and try again.":`连接时间过长。请检查网络后重试。`,"The request timed out and may still be processing. Check the task status before retrying.":`请求超时,可能仍在处理中。重试前请先检查任务状态。`,Ready:`就绪`,Queued:`排队中`,"Needs your reply":`等待你的回复`,"Preparing task results":`正在整理任务结果`,"Ready for review":`待审阅`,Paused:`已暂停`,"Needs attention":`需要处理`,"Check task status":`请检查任务状态`,"Deleting task":`正在删除任务`,"Review complete":`审阅完成`,Completed:`已完成`,"{agent} is working":`{agent} 正在处理`,now:`刚刚`,"{n}m":`{n} 分钟`,"{n}h":`{n} 小时`,"{n}d":`{n} 天`,"just now":`刚刚`,"{time} ago":`{time}前`,"Details (optional)":`补充说明(选填)`,"{agent} needs your input":`{agent} 需要你的回答`,"Approve this action":`批准此操作`,"Or type your own answer":`或输入你自己的回答`,"{agent} is requesting permission for this action.":`{agent} 请求执行此操作的权限。`,"Apply file changes":`应用文件修改`,Decline:`拒绝`,"Submitting…":`正在提交…`,"Reply to {agent}":`回复 {agent}`,"Allow this action":`允许此操作`,Copied:`已复制`,"Copy message":`复制消息`,Copy:`复制`,"You, {time}":`你,{time}`,"Note on the PDF":`PDF 上的批注`,"{n} notes on the PDF":`PDF 上的 {n} 条批注`,"Marked region":`标记的区域`,"{n} accepted":`{n} 处已接受`,"{n} rejected":`{n} 处已拒绝`,"{n} comment":`{n} 条评论`,"{n} comments":`{n} 条评论`,"{n} undone":`{n} 处已撤销`,"build error":`编译错误`,"You sent review feedback, {time}":`你发送了审阅反馈,{time}`,"Review feedback":`审阅反馈`,"Build failed · sent to {agent}":`编译失败 · 已发给 {agent}`,"Papilot sent the build error to {agent}, {time}":`Papilot 已将编译错误发给 {agent},{time}`,"With review feedback":`附带审阅反馈`,"Run command":`运行命令`,"Edited {file}":`编辑了 {file}`,"Edited {n} files":`编辑了 {n} 个文件`,"Run tool":`使用工具`,Running:`运行中`,Declined:`已拒绝`,Failed:`失败`,"ran {n} command":`运行了 {n} 条命令`,"ran {n} commands":`运行了 {n} 条命令`,"edited {file}":`编辑了 {file}`,"edited {n} files":`编辑了 {n} 个文件`,"used {n} tool":`使用了 {n} 个工具`,"used {n} tools":`使用了 {n} 个工具`,", ":`,`,"{n} failed":`{n} 个失败`,"This task is being deleted":`此任务正在删除`,"Check task status before sending":`发送前请先检查任务状态`,"Sending feedback…":`正在发送反馈…`,"Sending…":`正在发送…`,"{n} review update will be sent with this message":`{n} 项审阅更新将随此消息发送`,"{n} review updates will be sent with this message":`{n} 项审阅更新将随此消息发送`,"{agent} is working · new instructions run next":`{agent} 正在工作 · 新指令已排队`,"Default model":`默认模型`,"{agent} conversation":`{agent} 对话`,Chat:`对话`,"the default model on this host ({model})":`此主机上的默认模型({model})`,"the default model on this host":`此主机上的默认模型`,"Loading conversation…":`正在加载对话…`,"Retry conversation":`重新加载对话`,"{agent} is working on this task":`{agent} 正在处理此任务`,"Task saved. Waiting for an available {agent} session.":`任务已保存。正在等待可用的 {agent} 会话。`,"{n} change to review":`{n} 处修改待审阅`,"{n} changes to review":`{n} 处修改待审阅`,"Open review":`打开审阅`,"This step needs attention":`此步骤需要处理`,"Latest messages":`最新消息`,"Instructions for {agent}":`给 {agent} 的指令`,"Queue instructions for the next turn…":`添加后续指令…`,"Ask a question or request changes…":`继续提问,或提出修改要求…`,"Pause task":`暂停任务`,"Pause {agent}":`暂停 {agent}`,"Send instructions":`发送指令`,"Send (Enter) · New line (Shift+Enter)":`发送(Enter)· 换行(Shift+Enter)`,"{n} review update not sent yet":`{n} 项审阅更新尚未发送`,"{n} review updates not sent yet":`{n} 项审阅更新尚未发送`,"Send your review decisions and comments to the agent":`把你的审阅决定和评论发送给智能体`,"Send feedback":`发送反馈`,"Open task: {title}":`打开任务:{title}`,"Archived task":`已归档任务`,"No linked task":`未关联任务`,Retry:`重试`,"Current worktree":`当前工作树`,Worktrees:`工作树`,Current:`当前`,"Commit graph":`提交关系图`,"Newest first":`最新在上`,"{n} conflicts":`{n} 个冲突`,"{n} staged":`{n} 个已暂存`,"{n} unstaged":`{n} 个未暂存`,"{n} untracked":`{n} 个未跟踪`,"Refresh worktrees and history":`刷新工作树和提交历史`,"Reading worktrees and history…":`正在读取工作树和提交历史…`,"Could not refresh the repository.":`无法刷新仓库状态。`,"Showing the last update.":`正在显示最近一次更新。`,"Bare repository":`裸仓库`,"Status unavailable":`状态不可用`,Locked:`已锁定`,"Missing worktree":`工作树路径已失效`,"No upstream branch":`未设置上游分支`,"{ahead} ahead · {behind} behind":`领先 {ahead} · 落后 {behind}`,"Changed files in {branch}":`{branch} 中改动的文件`,"Could not read this worktree.":`无法读取此工作树。`,"No other worktrees in this repository.":`此仓库没有其他工作树。`,"No commits yet":`尚无提交`,"Branches and worktrees at each commit. Select a worktree to highlight its HEAD.":`查看每次提交上的分支和工作树。选择工作树可高亮其 HEAD。`,"This worktree’s HEAD is outside the displayed history.":`此工作树的 HEAD 不在当前显示的历史范围内。`,"Showing the latest {n} commits. Older history is not shown.":`显示最近 {n} 次提交,更早的历史未展示。`,"{n} commit":`{n} 次提交`,"{n} commits":`{n} 次提交`,detached:`游离`,"{n} changed":`{n} 处改动`,clean:`无改动`,Modified:`已修改`,Added:`已添加`,Deleted:`已删除`,Renamed:`已重命名`,Conflict:`冲突`,Untracked:`未跟踪`,"Type changed":`类型已改变`,"No textual changes.":`没有文本改动。`,"The diff is too long to show in full.":`差异太长,无法完整显示。`,"Git status":`Git 状态`,"Reading Git status…":`正在读取 Git 状态…`,"Committed {hash}.":`已提交 {hash}。`,"{n} new commit on {upstream}.":`{upstream} 上有 {n} 个新提交。`,"{n} new commits on {upstream}.":`{upstream} 上有 {n} 个新提交。`,"Up to date with the remote.":`已与远程保持同步。`,"Pulled the latest commits.":`已拉取最新提交。`,"Pushed to {upstream}.":`已推送到 {upstream}。`,"Pushed to the remote.":`已推送到远程。`,"detached HEAD":`游离 HEAD`,"Compared with {upstream}":`与 {upstream} 比较`,"up to date":`已同步`,"Pulling…":`正在拉取…`,Pull:`拉取`,"Pushing…":`正在推送…`,Push:`推送`,"Publish branch":`发布分支`,"Fetch from the remote":`从远程获取`,Tracking:`跟踪`,"Stage all changes":`暂存全部改动`,"Stage or unstage every change":`暂存或取消暂存全部改动`,"Uncommitted changes":`未提交的改动`,"Commit message":`提交信息`,"Committing…":`正在提交…`,"Commit 1 file":`提交 1 个文件`,"Commit staged changes in 1 file":`提交 1 个文件中暂存的改动`,"Commit staged changes in {n} files":`提交 {n} 个文件中暂存的改动`,"Commit all {n} files":`提交全部 {n} 个文件`,"Commit {chosen} of {n} files":`提交 {n} 个文件中的 {chosen} 个`,"Generate commit message":`生成提交信息`,"Write a commit message for the chosen files with {agent}":`让 {agent} 为选中的文件写提交信息`,"{agent} is writing a commit message…":`{agent} 正在写提交信息…`,"{n} build file":`{n} 个构建文件`,"{n} build files":`{n} 个构建文件`,"Untracked build output. Add to .gitignore adds:":`未跟踪的构建产物。加入 .gitignore 会添加:`,"Add to .gitignore":`加入 .gitignore`,"{n} file staged":`已暂存 {n} 个文件`,"{n} files staged":`已暂存 {n} 个文件`,"Commit what is staged":`提交已暂存的改动`,Show:`显示`,Changes:`改动`,"What changed since the last commit, to stage, revert and commit change by change":`上次提交以来的改动,可逐处暂存、还原并提交`,"Uncommitted changes in the PDF":`PDF 中未提交的改动`,"Commit…":`提交…`,"Commit to {branch}":`提交到 {branch}`,Commit:`提交`,"What this task accepted, in {n} file:":`此任务接受的改动,共 {n} 个文件:`,"What is staged, in {n} file:":`已暂存的改动,共 {n} 个文件:`,"What is staged, in {n} files:":`已暂存的改动,共 {n} 个文件:`,"What this task accepted, in {n} files:":`此任务接受的改动,共 {n} 个文件:`,"Commit and push":`提交并推送`,"Committing and pushing…":`正在提交并推送…`,"Committed {hash} and pushed.":`已提交 {hash} 并推送。`,Merge:`合并`,"Merging…":`正在合并…`,"{branch} and {upstream} have both changed. Merge brings in the remote commits.":`{branch} 和 {upstream} 都有新提交。合并会引入远端的提交。`,"Merged {upstream}.":`已合并 {upstream}。`,"The merge stopped at conflicts.":`合并遇到了冲突。`,"Merge in progress":`合并进行中`,"Merging: {n} file has conflicts":`合并中:{n} 个文件有冲突`,"Merging: {n} files have conflicts":`合并中:{n} 个文件有冲突`,"Merging: no conflicts left":`合并中:冲突已全部解决`,"Resolve with {agent}":`让 {agent} 解决`,"{agent} is resolving…":`{agent} 正在解决…`,"{agent} on the merge":`{agent} 对这次合并的说明`,"{n} file still has conflicts.":`还有 {n} 个文件有冲突。`,"{n} files still have conflicts.":`还有 {n} 个文件有冲突。`,"Conflicts resolved. Read the diffs, then commit the merge.":`冲突已解决。看过各文件的改动后,提交这次合并。`,"Commit merge":`提交合并`,"Abort merge":`放弃合并`,"Aborting…":`正在放弃…`,"The merge was abandoned.":`已放弃这次合并。`,"Added {n} pattern to .gitignore.":`已向 .gitignore 添加 {n} 条规则。`,"Added {n} patterns to .gitignore.":`已向 .gitignore 添加 {n} 条规则。`,"Stage {path}":`暂存 {path}`,Staged:`已暂存`,"Partly staged":`部分暂存`,"Not staged":`未暂存`,"Changes in {path}":`{path} 的改动`,"Loading the diff…":`正在加载差异…`,"No uncommitted changes":`没有未提交的改动`,"Select all notes for this task":`全选本轮批注`,"Notes to send: {selected} / {total}":`本轮发送 {selected} / {total} 条批注`,"{selected} / {total} locations selected":`已选 {selected} / {total} 处`,"Collapse {group} notes":`收起{group}批注`,"Expand {group} notes":`展开{group}批注`,"Select all {group} notes for this task":`本轮选中全部{group}批注`,"Include note {n} in this task":`本轮发送批注 {n}`,"Clear selection":`取消全选`,"Select all":`全选`,"Click cards to choose which highlighted notes to send.":`点击卡片切换选择,高亮的批注会随本轮发送。`,"Add overall instructions (optional)":`补充整体修改要求(选填)`,"Address {n} PDF notes":`处理 {n} 条 PDF 批注`,"Page {n}":`第 {n} 页`,"PDF notes":`PDF 批注`,"Show note {n} on the page":`在页面上显示批注 {n}`,"Delete note {n}":`删除批注 {n}`,"Delete note":`删除批注`,"Position needs confirmation":`位置待确认`,"The position in the new PDF could not be confirmed. The original text and note are kept.":`无法确认这条批注在新 PDF 中的位置,原文和备注已保留。`,"Some note positions need confirmation. Their original text and comments are kept.":`部分批注的位置需要确认,原文和备注均已保留。`,"Send {n} note to the agent":`把 {n} 条批注发送给智能体`,"Send {n} notes to the agent":`把 {n} 条批注发送给智能体`,"PDF preview":`PDF 预览`,"The manuscript did not compile.":`稿件编译失败。`,"Opening the PDF…":`正在打开 PDF…`,"Compiling the PDF…":`正在编译 PDF…`,"Manuscript panels":`稿件面板`,Contents:`目录`,"PDF contents":`PDF 目录`,"This PDF has no bookmarks.":`此 PDF 没有书签。`,"Contents will appear when the PDF is ready.":`PDF 就绪后会显示目录。`,"You are offline. Your draft is kept in this browser.":`你已离线。草稿保存在此浏览器中。`,"Agent settings":`智能体设置`,"Add skill":`添加技能`,Fast:`快速`,"Fast mode":`快速模式`,"No notes yet":`暂无批注`,"Region note":`区域批注`,"Send {n} note":`发送 {n} 条批注`,"Send {n} notes":`发送 {n} 条批注`,"or select text to annotate":`或选中文字批注`,"Edit note":`编辑批注`,"Edit note {n}":`编辑批注 {n}`,"Edit note {n}: {comment}":`编辑批注 {n}:{comment}`,Save:`保存`,"Saving…":`正在保存…`,"Pending review":`待审阅`,Accepted:`已接受`,Rejected:`已拒绝`,"Revision requested":`需再修改`,"Partly reviewed":`部分已审阅`,"Retry linking changes":`重试关联修改`,"View changes for this note":`查看这条批注对应的修改`,"Change {n}":`修改 {n}`,"Awaiting changes":`等待修改`,"No linked change":`暂无对应修改`,"Show note {n}: {comment}":`查看批注 {n}:{comment}`,"Note {n}":`批注 {n}`,"No tasks yet":`暂无任务`,"No matching skills":`没有匹配的技能`,"{agent} is unavailable":`{agent} 不可用`,"Connection details":`连接详情`,"Faster responses; may use more of your limit.":`响应更快,可能消耗更多额度。`,Agent:`智能体`," · unavailable":` · 不可用`,Model:`模型`,"Wait for the PDF to compile.":`请等待 PDF 编译完成。`,"Fit width":`适合宽度`,"Fit page":`适合页面`,"Note for the agent":`给智能体的批注`,"What should change here?":`这里应该怎么改?`,"Add note":`添加批注`,"Adding…":`正在添加…`,"PDF controls":`PDF 控件`,"Previous page":`上一页`,"Page number":`页码`,"Next page":`下一页`,"Zoom out":`缩小`,"Zoom out (⌘−)":`缩小(⌘−)`,Zoom:`缩放`,"Zoom in":`放大`,"Zoom in (⌘+)":`放大(⌘+)`,"Find in PDF":`在 PDF 中查找`,"Find (⌘F)":`查找(⌘F)`,"Mark region":`标记区域`,"Mark a figure or region":`标记图表或区域`,"Search the PDF":`搜索 PDF`,"No matches":`无匹配`,"{current} of {total}":`{current}/{total}`,"Previous match":`上一个匹配`,"Next match":`下一个匹配`,"Close search":`关闭搜索`,"PDF pages":`PDF 页面`,"The PDF could not be opened: {error}":`无法打开 PDF:{error}`,"Note {n}: {comment}":`批注 {n}:{comment}`,"{title} PDF change review":`{title} 的 PDF 修改审阅`,"The PDF review could not be loaded.":`无法加载 PDF 审阅。`,"The PDF review is taking longer than expected.":`PDF 审阅加载时间比预期长。`,"Loading PDF review…":`正在加载 PDF 审阅…`,"Reload review":`重新加载审阅`,"Review notes":`审阅批注`,"Review note: {comment}":`审阅批注:{comment}`,"Review PDF notes":`审阅 PDF 批注`,"Review notes ({n})":`审阅批注({n})`,"Close review notes":`关闭审阅批注`,"Delete review note {n}":`删除审阅批注 {n}`,"Marked on earlier changes.":`标记于之前的修改。`,"Check the task status before sending notes.":`发送批注前请先检查任务状态。`,"Full PDF":`完整 PDF`,"Open the full PDF":`打开完整 PDF`,"Generate PDF comparison":`生成 PDF 对比`,"Regenerate PDF comparison":`重新生成 PDF 对比`,"Open review in new tab":`在新标签页中打开审阅`,"Rename {name}":`重命名 {name}`,"Papers and tasks":`论文和任务`,"Hide task list":`隐藏任务列表`,"Paper: {name}":`论文:{name}`,"Add paper…":`添加论文…`,"Add paper":`添加论文`,Manuscript:`稿件`,"Git status of the manuscript":`稿件的 Git 状态`,"New task":`新任务`,Tasks:`任务`,"Task list":`任务列表`,"{n} change to decide":`{n} 处修改待定`,"{n} changes to decide":`{n} 处修改待定`,"Task actions for {title}":`{title} 的任务操作`,"Rename…":`重命名…`,"Check status":`检查状态`,"Retry deletion…":`重试删除…`,"Delete task…":`删除任务…`,Settings:`设置`,Connected:`已连接`,Reconnecting:`正在重新连接`,"{n} active task":`{n} 个活动任务`,"{n} active tasks":`{n} 个活动任务`,"Close task list":`关闭任务列表`,"Show task list":`显示任务列表`,"Recompile PDF":`重新编译 PDF`,"Open PDF":`打开 PDF`,"PDF compiled successfully.":`PDF 编译成功。`,"Compilation failed. Click to retry.":`编译失败,点击重试。`,"Compilation status unavailable.":`暂时无法确认编译状态。`,"Manuscript view":`稿件视图`,"Git, {n} changed":`Git,{n} 处改动`,"Retry deletion":`重试删除`,Pause:`暂停`,"View details":`查看详情`,"Workspace view":`工作区视图`,"Review, {n} to decide":`审阅,{n} 处待定`,Review:`审阅`,"Chat (reply needed)":`对话(需要回复)`,"PDF review only":`只看 PDF 审阅`,Split:`分栏`,"Review and chat side by side":`审阅和对话并排`,"Chat only":`只看对话`,"This conversation has no manuscript changes.":`本次对话没有稿件修改。`,"Connection lost. Showing the last update; your draft is kept.":`连接已断开。正在显示最近一次更新,你的草稿仍然保留。`,"Retry connection":`重新连接`,"Connecting to {agent}…":`正在连接 {agent}…`,"Connecting…":`正在连接…`,Reconnect:`重新连接`,"Resize chat panel":`调整对话面板宽度`,"Drag to resize · Double-click to reset":`拖动调整宽度 · 双击还原`,"PDF review":`PDF 审阅`,"Could not generate the PDF comparison.":`PDF 对比生成失败。`,"Retry build":`重新生成`,"Deletion is in progress":`正在删除`,"This task is reserved until its worktree cleanup is confirmed. Use Retry deletion if the connection was interrupted.":`在确认工作树清理完成之前,此任务会保留。如果连接中断,请使用“重试删除”。`,"Preparing task results…":`正在整理任务结果…`,"PDF comparison":`PDF 修改对比`,"No manuscript changes":`本次没有修改论文`,"This task did not change the manuscript. Read the answer in the chat.":`本次任务没有改动论文,请在对话中查看回复。`,"Only manuscript changes need a PDF comparison. Answers to questions are in the chat.":`只有论文改动需要对比,问答内容直接在对话中查看。`,"Checking for manuscript changes. A PDF comparison is generated only when needed.":`正在检查论文是否有改动,有改动时才会生成 PDF 对比。`,"If the task changes the manuscript, a PDF comparison will appear here. Otherwise, read the answer in the chat.":`如果任务修改了论文,这里会显示 PDF 对比;问答回复在对话中查看。`,"Reply in the chat to continue. A PDF comparison is needed only if the manuscript changes.":`请先在对话中回复,让任务继续。只有论文改动才需要 PDF 对比。`,"Confirm whether the task is still running before generating a PDF comparison.":`请先确认任务是否仍在运行,再生成 PDF 对比。`,"Opening your workspace":`正在打开工作区`,"Connecting to your papers and tasks…":`正在连接你的论文和任务…`,"What are we revising next?":`接下来要修改什么?`,"Describe the revision":`描述修改`,"Start task":`开始任务`,"Start task (Enter)":`开始任务(Enter)`,"Task added: {title}":`已添加任务:{title}`,"Add your first paper":`添加你的第一篇论文`,"Dismiss error":`关闭错误提示`,Close:`关闭`,"Add a paper":`添加论文`,"/Users/you/papers/my-paper":`/Users/you/papers/my-paper`,Cancel:`取消`,"Copied path":`已复制路径`,"Copy path: {path}":`复制路径:{path}`,"{agent} is waiting for your approval":`{agent} 正在等待你的批准`,"Review ready · {n} change to decide":`审阅已就绪 · {n} 处修改待定`,"Review ready · {n} changes to decide":`审阅已就绪 · {n} 处修改待定`,"{agent} finished":`{agent} 已完成`,"A task needs attention":`有任务需要处理`,"Notifications are on":`通知已开启`,"Papilot will tell you here when a task needs you.":`任务需要你时,Papilot 会在这里通知你。`,"Runtime & diagnostics":`运行状态与诊断`,Changelog:`更新日志`,"See what changed in each release.":`了解每个版本的改进与修复。`,Contribute:`参与贡献`,"Help improve Papilot with code, docs, and ideas.":`通过代码、文档和建议,一起完善 Papilot。`,"Application dependencies":`应用依赖`,"Application interface":`应用界面`,"Review engine":`审阅引擎`,"Data folder":`数据目录`,"LaTeX engines":`LaTeX 引擎`,"Codex configuration":`Codex 配置`,"Claude configuration":`Claude 配置`,"Antigravity configuration":`Antigravity 配置`,"Agent configuration":`智能体配置`,"Paper configuration":`论文配置`,"Paper repository":`论文仓库`,"Initial commit":`初始提交`,"Main document":`主文档`,"Paper compiler":`论文编译器`,"Task folders":`任务目录`,"Remote access":`远程访问`,"Collaborator access":`协作者访问`,"Local server":`本地服务`,"Background service":`后台服务`,"Service tools":`后台服务工具`,"Service data folder":`后台服务数据目录`,"Inspect agent connections and check the environment used to build your papers.":`查看智能体连接状态,检查论文编译所需的运行环境。`,"Live connections":`当前连接`,"Papilot server":`Papilot 服务`,Disconnected:`已断开`,Unknown:`未知`,"Sign-in required":`需要登录`,Unavailable:`不可用`,"Environment checks":`环境检查`,"Includes the configuration for “{paper}”.":`同时检查「{paper}」的配置。`,"Open a paper to also check its repository and compiler configuration.":`打开论文后,还会检查它的仓库与编译配置。`,"Checking…":`正在检查…`,"Check again":`重新检查`,"Copy diagnostic summary":`复制诊断摘要`,"Checking tools and configuration. This may take a few seconds…":`正在检查工具与配置,可能需要几秒钟…`,"Could not complete the environment checks. Check the connection and try again.":`未能完成环境检查,请检查连接后重试。`,"Errors: {errors} · Warnings: {warnings}":`{errors} 项错误 · {warnings} 项提醒`,"Environment checks passed":`环境检查通过`,"Checked at {time}":`检查时间:{time}`,"Agent configuration checks do not send editing requests. Only the agents you use need to be configured.":`智能体配置检查不会发送编辑请求,只需配置你使用的智能体。`,Passed:`通过`,Warning:`提醒`,"Suggested fix":`处理建议`,"The copied summary includes versions and check results, without account names, paths, or paper contents.":`复制的摘要包含版本与检查结果,不包含账号、路径或论文内容。`,"Automatic copy is unavailable. Copy the selected summary below.":`无法自动复制,请手动复制下方已选中的摘要。`,"Diagnostic summary":`诊断摘要`,Preferences:`偏好设置`,"About Papilot":`关于 Papilot`,"Opens in a new tab":`在新标签页中打开`,"A workspace for your papers.":`为论文而生的工作空间。`,"Read, annotate, and revise your papers with AI, all in one place.":`阅读、批注,与 AI 一起修改论文,在同一处完成。`,"GitHub repository":`GitHub 仓库`,"Feedback & issues":`问题与建议`,"Report a bug or suggest an improvement.":`反馈问题,或分享你的改进建议。`,"User guide":`使用指南`,"Get started and make Papilot your own.":`了解如何开始使用和配置 Papilot。`,"Licenses & acknowledgments":`许可证与致谢`,"Papilot license":`Papilot 许可证`,"Third-party licenses":`第三方许可证`,"Libraries, fonts, and the people behind them.":`使用的开源库、字体,以及背后的贡献者。`,"Made by Cui Chen and the Papilot contributors.":`由 Cui Chen 与 Papilot 贡献者共同构建。`,"Could not load the license notices.":`无法加载许可证信息。`,"Loading license notices…":`正在加载许可证…`,"{shown} of {total} components":`显示 {shown} / {total} 个组件`,"See license notice":`参见许可声明`,"Component source":`组件源码`,"License text is not included in this package. See the component source for its terms.":`此软件包未附带许可证正文,请前往组件源码查看许可条款。`,"No components match your search.":`没有找到匹配的组件。`,"Libraries and fonts used by Papilot and its review engine. Each component is covered by its own license.":`Papilot 及其审阅引擎使用的开源库和字体。各组件分别遵循其自身的许可证。`,"Search components or licenses…":`搜索组件或许可证…`,"Search components or licenses":`搜索组件或许可证`,"This browser cannot show notifications.":`此浏览器无法显示通知。`,"Browsers show notifications only on HTTPS or localhost. Open Papilot at a secure address to use them.":`浏览器只在 HTTPS 或 localhost 上显示通知。请通过安全地址打开 Papilot 后再使用。`,"Notifications are blocked for this site. Allow them in the browser’s site settings, then turn them on here.":`此网站的通知已被屏蔽。请先在浏览器的网站设置中允许通知,再回到这里开启。`,Appearance:`外观`,Light:`浅色`,Dark:`深色`,System:`跟随系统`,Language:`语言`,"Browser default ({language})":`浏览器默认({language})`,Notifications:`通知`,"Notify me when a task needs my reply, its review is ready, or it stops with an error, while Papilot is in the background.":`Papilot 在后台时,如果任务需要我回复、审阅已就绪或因错误停止,就通知我。`,"Send a test notification":`发送测试通知`,"Sent. If nothing appeared, allow notifications for this browser in your system settings.":`已发送。如果没有看到通知,请在系统设置中允许此浏览器发送通知。`,"This browser could not show the notification.":`此浏览器无法显示这条通知。`,Polish:`润色`,Proofread:`校对`,Shorten:`精简`,"Check math":`检查数学`,Consistency:`统一表述`,"Fix LaTeX warnings":`修复 LaTeX 警告`,"Address reviewers":`回应审稿意见`,"Improve clarity and flow, keeping the meaning":`保留原意,让表达更清晰、行文更流畅`,"Fix typos, grammar and punctuation without rewording":`修正错别字、语法和标点,不改写原文`,"Cut length without losing content":`保留内容,精简篇幅`,"Find errors in notation, equations and proofs":`检查符号、公式和证明中的错误`,"Unify terms, notation, spelling and references":`统一术语、符号、拼写和引用`,"Resolve undefined references, overfull boxes and other build warnings":`修复未定义的引用、内容溢出等编译警告`,"Revise for reviewer comments and draft a point-by-point reply":`根据审稿意见修改论文,并起草逐条回复`,Skills:`技能`,"This paper":`本论文`,Yours:`你的`,"Skill: {name}":`技能:{name}`,"Remove the {name} skill":`移除技能 {name}`,"Pause this task before deleting it.":`删除前请先暂停此任务。`,"Wait for the PDF build to finish before deleting this task.":`请等 PDF 编译完成后再删除此任务。`,"Check task status before deleting this task.":`删除前请先检查任务状态。`,"Delete task?":`删除任务?`,"This permanently removes the task from Papilot, including its conversation, worktree, and PDF review files. Unaccepted edits and saved comments will be discarded, and review decisions can no longer be undone.":`这会从 Papilot 中永久删除此任务,包括它的对话、工作树和 PDF 审阅文件。未接受的修改和已保存的评论将被丢弃,审阅决定也无法再撤销。`,"Accepted changes in your manuscript stay in place. Other tasks are not affected.":`稿件中已接受的修改会保留,其他任务不受影响。`,"Deletion has already started. Retry to confirm the cleanup and remove the task.":`删除已经开始。重试以确认清理并移除任务。`,"Deleting…":`正在删除…`,"Delete task":`删除任务`,"Weekly limit":`每周额度`,"Daily limit":`每日额度`,"{n}-day limit":`{n} 天额度`,"{n}-hour limit":`{n} 小时额度`,"{n}-minute limit":`{n} 分钟额度`,"Usage limit":`用量额度`,"resets now":`即将重置`,"resets in {hours} h {minutes} min":`{hours} 小时 {minutes} 分钟后重置`,"resets in {minutes} min":`{minutes} 分钟后重置`,"resets {time}":`{time} 重置`,"{name} used":`{name}已用`,"{used}% used":`已用 {used}%`,"Limit reached":`已达上限`,"{agent} usage":`{agent} 用量`,"{agent} usage details":`{agent} 用量详情`,"Unlimited credits":`无限额度`,"{n} credits":`{n} 点额度`,"Credits available":`有可用额度`,"Sign in to continue.":`请先登录。`,"{name}, {time}":`{name},{time}`,"{name} sent review feedback, {time}":`{name} 发送了审阅反馈,{time}`,"from {name}":`来自 {name}`,People:`成员`,"Sign out":`退出登录`,"No papers yet":`还没有论文`,"No papers have been shared with you yet. Papers appear here as soon as {name} shares them.":`还没有论文共享给你。{name} 共享后,论文会立即显示在这里。`,"People you invite sign in with a passkey at the public address and can do everything you can in the papers you share with them, including approving the commands agents run on this host and pushing with its Git credentials.":`受邀成员在公开地址上用通行密钥登录。在你共享给他们的论文里,他们能做你能做的一切,包括批准 agent 在此主机上运行的命令,以及用此主机的 Git 凭据推送。`,"Agents and builds can read any file on this host, including your other papers. Invite only people you would trust with access to it.":`Agent 和编译过程可以读取此主机上的任何文件,包括你的其他论文。只邀请你愿意让其访问此主机的人。`,"To invite people, give Papilot a public HTTPS address: set PAPILOT_ACCOUNT_ORIGIN and forward it to this host, as the Collaborators section of the guide describes.":`要邀请成员,请先给 Papilot 一个公开的 HTTPS 地址:设置 PAPILOT_ACCOUNT_ORIGIN,并把它转发到此主机,具体见指南的“协作者”一节。`,"Invite someone":`邀请成员`,"Their name, as others will see it":`对方的名字,其他人会看到`,"Papers they can open":`可以打开的论文`,"Creating…":`正在创建…`,"Create invite link":`创建邀请链接`,"Loading people…":`正在加载成员…`,"{name} (you)":`{name}(你)`,Owner:`所有者`,"Invited, not joined yet":`已邀请,尚未加入`,"Last active {time}":`最近活动:{time}`,Joined:`已加入`,"Papers {name} can open":`{name} 可以打开的论文`,"Invite link for {name}":`{name} 的邀请链接`,"Open it on the device you want to sign in from. It works once, within 15 minutes.":`在要登录的设备上打开。链接只能使用一次,15 分钟内有效。`,"Send it to {name} yourself. It works once, within 7 days.":`请自行发给 {name}。链接只能使用一次,7 天内有效。`,"Passkey · {label}":`通行密钥 · {label}`,"Signed in · {label}":`已登录 · {label}`,"used {time}":`{time}使用过`,"added {time}":`{time}添加`,"Remove {device}":`移除 {device}`,Remove:`移除`,"Sign in from anywhere":`从任何地方登录`,"Invite link for a new device":`新设备的邀请链接`,"New invite link":`新的邀请链接`,"Sign out everywhere":`在所有设备上退出`,"Remove {name}":`移除 {name}`,"Remove…":`移除…`,"Signing in was cancelled. Try again when you are ready.":`登录已取消。准备好后再试一次。`,"Sign in to Papilot":`登录 Papilot`,"Use the passkey you created from your invite link.":`使用你通过邀请链接创建的通行密钥。`,"Waiting for your passkey…":`正在等待通行密钥…`,"Sign in with a passkey":`用通行密钥登录`,"This browser cannot use passkeys. Open this page in a current version of Safari, Chrome, Edge or Firefox.":`此浏览器不支持通行密钥。请用最新版的 Safari、Chrome、Edge 或 Firefox 打开此页。`,"No passkey on this device? Ask the person who invited you for a new invite link.":`这台设备上没有通行密钥?请邀请你的人发一个新的邀请链接。`,"This invite link is incomplete. Copy the whole link and open it again.":`邀请链接不完整。请复制完整链接后重新打开。`,"Creating the passkey was cancelled. The link still works; try again when you are ready.":`创建通行密钥已取消。链接仍然有效,准备好后再试一次。`,"Add a passkey":`添加通行密钥`,"Join Papilot":`加入 Papilot`,"Create a passkey to sign in to your Papilot from anywhere.":`创建通行密钥,以便从任何地方登录你的 Papilot。`,"Create a passkey on this device to sign in as {name}.":`在这台设备上创建通行密钥,以 {name} 的身份登录。`,"{inviter} invited you to work on {papers}. You will appear as {name}.":`{inviter} 邀请你参与 {papers}。你将显示为 {name}。`,"{inviter} invited you to Papilot. You will appear as {name}.":`{inviter} 邀请你加入 Papilot。你将显示为 {name}。`,"Create a passkey":`创建通行密钥`,"A passkey signs you in with Face ID, Touch ID, Windows Hello or your phone. Papilot never sees a password.":`通行密钥用面容 ID、触控 ID、Windows Hello 或手机为你登录,Papilot 不会接触任何密码。`,"Resize manuscript panel":`调整稿件右栏宽度`,"Collapse manuscript panel":`收起稿件右栏`,"Expand manuscript panel":`展开稿件右栏`,"Archived tasks":`已归档任务`,"Show current tasks":`显示未归档任务`,"Show archived tasks":`显示已归档任务`,"Search tasks":`搜索任务`,"Search tasks…":`搜索任务…`,"Search task titles and instructions":`搜索任务标题和初始指令`,"Clear task search":`清除任务搜索`,"Search archived tasks…":`搜索已归档任务…`,"Restore task":`恢复任务`,"Archive task":`归档任务`,"No matching tasks":`没有匹配的任务`,"No archived tasks":`暂无归档任务`,"Keyboard shortcuts":`键盘快捷键`,"Accept change":`接受改动`,"Accept the current proposal. In Changes, stage or unstage it.":`接受当前建议;在“改动”视图中,暂存或取消暂存。`,"Reject change":`拒绝改动`,"Reject the current proposal. In Changes, revert it.":`拒绝当前建议;在“改动”视图中,还原这处改动。`,"Request a revision":`要求修改`,"Write feedback on the current proposed change.":`为当前建议填写修改意见。`,"Next change":`下一处改动`,"Move to the next visible change.":`跳到下一处可见的改动。`,"Previous change":`上一处改动`,"Move to the previous visible change.":`跳到上一处可见的改动。`,"Next undecided change":`下一处待审阅改动`,"Jump to the next change that still needs a decision.":`跳到下一处尚未处理的改动。`,"Show LaTeX source":`显示 LaTeX 源码`,"Show or hide the source for the current change.":`展开或收起当前改动的源码。`,"Undo review decision":`撤销审阅操作`,"Undo the last review decision or revert.":`撤销上一次审阅决定或还原操作。`,"Open these shortcut settings.":`打开此快捷键设置页。`,"Review shortcuts work while the PDF review is focused. They pause while you type or select text. Changes are saved in this browser.":`快捷键在 PDF 审阅区域聚焦时生效,输入或选中文字时暂停。设置保存在当前浏览器中。`,"Click a key to change it, then press the new shortcut. Escape cancels; Backspace clears it.":`点击按键后按下新的快捷键。Esc 取消,退格键清除。`,"Change shortcut: {action}":`修改快捷键:{action}`,"This key is reserved for the browser or text editing. Choose another shortcut.":`这个按键用于浏览器或文本编辑,请换一个快捷键。`,"Already used for {action}. Choose another shortcut.":`已用于“{action}”,请换一个快捷键。`,"Press a key…":`请按下按键…`,"Not assigned":`未设置`,"Restore default shortcuts":`恢复默认快捷键`,"Standard shortcuts":`常用快捷键`,"These keep the usual browser and text-editing behavior.":`这些按键保留浏览器和文本编辑的常规行为。`,"Copy selected PDF text":`复制选中的 PDF 文字`,"Undo typing, a deleted note, or the last review decision, depending on focus.":`根据焦点位置,撤销输入、恢复删除的批注或撤销上一次审阅操作。`,"Send the review comment being written.":`发送正在填写的审阅意见。`,"Close the current editor or cancel region selection.":`关闭当前编辑器或取消画框。`},k=[{id:`en`,name:`English`},{id:`zh-CN`,name:`简体中文`}],A=`papilot:language`,j={en:{},"zh-CN":O};function M(e=typeof window>`u`?[]:navigator.languages?.length?navigator.languages:[navigator.language]){for(let t of e){let e=t.toLowerCase();if(e.startsWith(`zh`))return`zh-CN`;if(e.startsWith(`en`))return`en`}return`en`}function N(){let e=D.getItem(A);return e===`en`||e===`zh-CN`?e:`system`}var P={choice:N(),language:`en`};P.language=P.choice===`system`?M():P.choice;var F=new Set;function I(e){let t=e===`system`?M():e;(e!==P.choice||t!==P.language)&&(P={choice:e,language:t},F.forEach(e=>e())),typeof document<`u`&&(document.documentElement.lang=t)}I(P.choice),typeof window<`u`&&(window.addEventListener(`languagechange`,()=>I(P.choice)),window.addEventListener(`storage`,e=>{(e.key===A||e.key===null)&&I(N())}));function ee(e){e===`system`?D.removeItem(A):D.setItem(A,e),I(e)}var L=()=>P.language,te=()=>P.language===`zh-CN`?`zh-CN`:`en-US`;function ne(){return(0,S.useSyncExternalStore)(e=>(F.add(e),()=>{F.delete(e)}),()=>P)}function R(e,t){let n=j[P.language][e]??e;return t?n.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e):n}function re(e,t,n,r){return R(e===1?t:n,{n:e,...r})}var ie=e=>R(g[e]),ae=e=>e?{"--note-color":h[e],"--note-ink":d(e)===`yellow`?`#422f00`:`#fff`}:{};function oe({group:e}){return e?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`group-dot`,style:ae(e),"aria-hidden":`true`}),R(`Add to group`)]}):R(`Add note`)}function se({value:e,onChange:t,disabled:n}){let r=(0,S.useId)(),i=(0,S.useRef)(null),a=(0,S.useRef)(null),[o,s]=(0,S.useState)(!1);(0,S.useEffect)(()=>{n&&a.current?.hidePopover()},[n]),(0,S.useEffect)(()=>{if(!o)return;let e=()=>a.current?.hidePopover(),t=t=>{t.target instanceof Node&&t.target.contains(i.current)&&e()};return window.addEventListener(`resize`,e),document.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,e),document.removeEventListener(`scroll`,t,!0)}},[o]);function c(){return Array.from(a.current.querySelectorAll(`[role="menuitemradio"]`))}function l(){let e=a.current,t=i.current.getBoundingClientRect();e.showPopover(),e.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-e.offsetWidth-8))}px`,e.style.top=`${Math.max(8,Math.min(t.bottom+6,window.innerHeight-e.offsetHeight-8))}px`,(c().find(e=>e.getAttribute(`aria-checked`)===`true`)||c()[0])?.focus()}function f(e){a.current?.hidePopover(),i.current?.focus(),t(e)}return(0,C.jsxs)(`div`,{className:`group-picker`,style:ae(e||void 0),children:[(0,C.jsx)(`button`,{ref:i,type:`button`,className:`icon-button group-select`,"data-group":e||void 0,"aria-label":R(`Annotation group color`),title:R(`Annotation groups`),"aria-haspopup":`menu`,"aria-expanded":o,popoverTarget:r,disabled:n,onClick:e=>{e.preventDefault(),a.current?.matches(`:popover-open`)?a.current.hidePopover():l()},onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),l())},children:(0,C.jsx)(`span`,{className:`group-highlight`,"aria-hidden":`true`,children:(0,C.jsx)(T,{name:`pen`,size:18})})}),(0,C.jsxs)(`div`,{ref:a,id:r,popover:`auto`,role:`menu`,"aria-label":R(`Annotation group color`),className:`group-palette`,onToggle:e=>s(e.nativeEvent.newState===`open`),onKeyDown:e=>{if(e.key===`Tab`)a.current?.hidePopover(),i.current?.focus();else if(e.stopPropagation(),e.key===`Escape`)e.preventDefault(),a.current?.hidePopover(),i.current?.focus();else if([`ArrowLeft`,`ArrowRight`,`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){e.preventDefault();let t=c(),n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+([`ArrowRight`,`ArrowDown`].includes(e.key)?1:-1)+t.length)%t.length]?.focus()}},children:[(0,C.jsx)(`div`,{className:`group-palette-label`,children:R(`Color`)}),(0,C.jsx)(`div`,{className:`group-swatches`,children:u.map(t=>(0,C.jsx)(`button`,{type:`button`,className:`group-swatch`,role:`menuitemradio`,"aria-label":ie(t),"aria-checked":!!(e&&d(e)===t),style:ae(t),onClick:()=>f(t),children:(0,C.jsx)(`span`,{"aria-hidden":`true`})},t))}),(0,C.jsxs)(`button`,{type:`button`,className:`group-individual`,role:`menuitemradio`,"aria-checked":!e,onClick:()=>f(null),children:[(0,C.jsx)(T,{name:`notes`,size:16}),(0,C.jsx)(`span`,{children:R(`Individual notes`)}),!e&&(0,C.jsx)(T,{name:`check`,size:14})]})]})]})}function ce({group:e,value:t,disabled:n,onChange:r}){let i=(0,S.useRef)(null),a=()=>{let e=i.current;e&&e.clientWidth&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight+e.offsetHeight-e.clientHeight,160)}px`)};return(0,S.useLayoutEffect)(a,[t]),(0,S.useEffect)(()=>{let e=i.current,t=e.clientWidth,n=new ResizeObserver(()=>{e.clientWidth!==t&&(t=e.clientWidth,a())});return n.observe(e),()=>n.disconnect()},[]),(0,C.jsxs)(`div`,{className:`group-instruction-input`,children:[(0,C.jsx)(`textarea`,{ref:i,rows:1,maxLength:4e3,"aria-label":R(`Instructions for {group} notes`,{group:ie(e)}),placeholder:R(`What should change in this group?`),value:t,disabled:n,onChange:e=>r(e.target.value)}),(0,C.jsx)(T,{name:`pencil`,size:13})]})}function le({group:e,count:t,active:n,selection:r,children:i}){let[a,o]=(0,S.useState)(!0),s=(0,S.useId)(),c=(0,S.useId)(),l=r?r.count===t?!0:r.count?`mixed`:!1:void 0,u=r?R(`{selected} / {total} locations selected`,{selected:r.count,total:t}):re(t,`{n} location`,`{n} locations`);return(0,S.useEffect)(()=>{n&&o(!0)},[n]),(0,C.jsxs)(`div`,{className:`annotation-group`+(n?` active`:``),role:`group`,"aria-label":`${ie(e)} · ${u}`,"data-selected":l,style:ae(e),children:[(0,C.jsxs)(`div`,{className:`group-header`,children:[r?(0,C.jsxs)(`button`,{type:`button`,className:`group-selection-toggle`,"aria-label":R(`Select all {group} notes for this task`,{group:ie(e)}),"aria-describedby":s,"aria-pressed":l,disabled:r.disabled,onClick:r.toggle,children:[(0,C.jsx)(`span`,{className:`group-dot`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{id:s,children:u})]}):(0,C.jsxs)(`div`,{className:`group-heading`,children:[(0,C.jsx)(`span`,{className:`group-dot`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{children:u})]}),(0,C.jsx)(`button`,{type:`button`,className:`group-disclosure`,"aria-label":R(a?`Collapse {group} notes`:`Expand {group} notes`,{group:ie(e)}),"aria-expanded":a,"aria-controls":c,onClick:()=>o(e=>!e),children:(0,C.jsx)(T,{name:`chevronDown`,size:12})})]}),(0,C.jsx)(`div`,{id:c,className:`group-locations`,hidden:!a,children:i})]})}var z=`papilot:excluded-notes`;function B(){try{let e=JSON.parse(D.getItem(z)||`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>Array.isArray(e[1])&&e[1].every(e=>typeof e==`string`)))}catch{return{}}}function ue(e,t){let[n,r]=(0,S.useState)(B);(0,S.useEffect)(()=>{Object.keys(n).length?D.setItem(z,JSON.stringify(n)):D.removeItem(z)},[n]);let i=new Set(n[e]||[]);return{selected:t.filter(e=>!i.has(e.id)),has:e=>!i.has(e),set(t,n){r(r=>{let i=new Set(r[e]||[]);for(let e of t)n?i.delete(e):i.add(e);let a={...r};return i.size?a[e]=[...i]:delete a[e],a})},reset(e){r(t=>{let n={...t};return delete n[e],n})}}}var de=`papilot:group-instructions`;function fe(){let e={};try{let t=JSON.parse(D.getItem(de)||`{}`);if(!t||typeof t!=`object`||Array.isArray(t))return e;for(let[n,r]of Object.entries(t))try{e[n]=p(r)}catch{}}catch{}return e}function pe(e){let[t,n]=(0,S.useState)(fe);return(0,S.useEffect)(()=>{Object.keys(t).length?D.setItem(de,JSON.stringify(t)):D.removeItem(de)},[t]),{get:n=>t[e]?.[d(n)]||``,set(t,r){n(n=>({...n,[e]:{...n[e],[d(t)]:r}}))},forNotes(n){return Object.fromEntries(_(n).flatMap(({group:n})=>t[e]?.[n]?.trim()?[[n,t[e][n].trim()]]:[]))},sent(e,t,r){n(n=>{let i={...n},a={...i[e]},o=new Set(t.map(e=>e.id));for(let{group:e}of _(t))r.some(t=>!o.has(t.id)&&t.group&&d(t.group)===e)||delete a[e];return Object.keys(a).length?i[e]=a:delete i[e],i})}}}function me({text:e}){return(0,C.jsx)(`div`,{className:`note-quote`,children:(0,C.jsx)(`blockquote`,{className:`note-quote-text`,"aria-label":R(`Quoted text`),children:e||R(`Marked region`)})})}function he({children:e}){return(0,C.jsx)(`div`,{className:`note-body`,role:`group`,"aria-label":R(`Your note`),children:e})}var ge=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(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,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),_e=o(((e,t)=>{t.exports=ge()})),ve=o((e=>{var t=y();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.1`})),ye=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=ve()})),be=o((e=>{var t=_e(),n=y(),r=ye();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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(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)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function p(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 m(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 h(e){var t=[null,null],n=p(e);return n===null||g(t,e,n.child,{foundSelf:!1}),t}function g(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)&&g(e,t,n.child,r))return!0;n=n.sibling}return!1}function _(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 v=null,b=null;function x(e,t,n){return e===n||e===t&&(v=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(v=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,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),A=Symbol.for(`react.strict_mode`),j=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),P=Symbol.for(`react.forward_ref`),F=Symbol.for(`react.suspense`),I=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),L=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.legacy_hidden`),R=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.for(`react.view_transition`),ie=Symbol.for(`react.recoverable`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case j:return`Profiler`;case A:return`StrictMode`;case F:return`Suspense`;case I:return`SuspenseList`;case te:return`Activity`;case re:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case N:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case P:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case L:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),ve=pe(null),be=pe(null),xe=pe(null);function Se(e,t){switch(he(be,t),he(ve,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dp(t),e=fp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function Ce(){me(ge),me(ve),me(be)}function we(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,he(xe,e)),t=ge.current;var n=fp(t,e.type);t!==n&&(he(ve,e),he(ge,n))}function Te(e){ve.current===e&&(me(ge),me(ve)),xe.current===e&&(me(xe),sh._currentValue=ue)}var Ee,De;function Oe(e){if(Ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||``,De=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+Ee+e+De}var ke=!1;function Ae(e,t){if(!e||ke)return``;ke=!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{ke=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Oe(n):``}function je(e,t){switch(e.tag){case 26:case 27:case 5:return Oe(e.type);case 16:return Oe(`Lazy`);case 13:return e.child!==t&&t!==null?Oe(`Suspense Fallback`):Oe(`Suspense`);case 19:return Oe(`SuspenseList`);case 0:case 15:return Ae(e.type,!1);case 11:return Ae(e.type.render,!1);case 1:return Ae(e.type,!0);case 31:return Oe(`Activity`);case 30:return Oe(`ViewTransition`);default:return``}}function Me(e){try{var t=``,n=null;do t+=je(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var Ne=Object.prototype.hasOwnProperty,Pe=t.unstable_scheduleCallback,Fe=t.unstable_cancelCallback,Ie=t.unstable_shouldYield,Le=t.unstable_requestPaint,Re=t.unstable_now,ze=t.unstable_getCurrentPriorityLevel,Be=t.unstable_ImmediatePriority,Ve=t.unstable_UserBlockingPriority,He=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,We=t.unstable_IdlePriority,Ge=t.log,Ke=t.unstable_setDisableYieldValue,qe=null,Je=null;function Ye(e){if(typeof Ge==`function`&&Ke(e),Je&&typeof Je.setStrictMode==`function`)try{Je.setStrictMode(qe,e)}catch{}}var Xe=Math.clz32?Math.clz32:$e,Ze=Math.log,Qe=Math.LN2;function $e(e){return e>>>=0,e===0?32:31-(Ze(e)/Qe|0)|0}var et=256,tt=262144,nt=4194304;function rt(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 it(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=rt(n))):i=rt(o):i=rt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=rt(n))):i=rt(o)):i=rt(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 at(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ot(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-Xe(n),i=1<<r;t|=e[r],n&=~i}return t}function st(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 ct(){var e=nt;return nt<<=1,!(nt&62914560)&&(nt=4194304),e}function lt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ut(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dt(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-Xe(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&&ft(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ft(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Xe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function pt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Xe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function mt(e,t){var n=t&-t;return n=n&42?1:ht(n),(n&(e.suspendedLanes|t))===0?n:0}function ht(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 gt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function _t(){var e=B.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function vt(e,t){var n=B.p;try{return B.p=e,t()}finally{B.p=n}}var yt=Math.random().toString(36).slice(2),bt=`__reactFiber$`+yt,xt=`__reactProps$`+yt,St=`__reactContainer$`+yt,Ct=`__reactEvents$`+yt,wt=`__reactListeners$`+yt,Tt=`__reactHandles$`+yt,Et=`__reactResources$`+yt,Dt=`__reactMarker$`+yt,Ot=`__reactLoad$`+yt;function kt(e){delete e[bt],delete e[xt],delete e[wt],delete e[Tt]}function At(e){var t;if(t=e[bt])return t;for(var n=e.parentNode;n;){if(t=n[St]||n[bt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[bt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function jt(e){if(e=e[bt]||e[St]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Nt(e){var t=e[Et];return t||=e[Et]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Pt(e){e[Dt]=!0}function Ft(e){e[Ot]=void 0}var It=new Set,Lt={};function V(e,t){Rt(e,t),Rt(e+`Capture`,t)}function Rt(e,t){for(Lt[e]=t,e=0;e<t.length;e++)It.add(t[e])}var H=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]*$`),zt={},Bt={};function Vt(e){return Ne.call(Bt,e)?!0:Ne.call(zt,e)?!1:H.test(e)?Bt[e]=!0:(zt[e]=!0,!1)}var U=!1;function Ht(){var e=U;return U=!1,e}function Ut(e,t,n){if(Vt(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 Wt(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 Gt(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 Kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Jt(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 Yt(e){if(!e._valueTracker){var t=qt(e)?`checked`:`value`;e._valueTracker=Jt(e,t,``+e[t])}}function Xt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Zt=/[\n"\\]/g;function Qt(e){return e.replace(Zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function $t(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=``+Kt(t)):e.value!==``+Kt(t)&&(e.value=``+Kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):tn(e,Kt(n)):o===`number`&&e.value==t?tn(e,Kt(e.value)):tn(e,Kt(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=``+Kt(s):e.removeAttribute(`name`)}function en(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)){Yt(e);return}n=n==null?``:``+Kt(n),t=t==null?n:``+Kt(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),Yt(e)}function tn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function nn(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=``+Kt(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 rn(e,t,n){t!=null&&(t=``+Kt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Kt(n)}function an(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(le(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Yt(e)}function on(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sn=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 cn(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||sn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function ln(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]=``,U=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(cn(e,a,r),U=!0)}else for(var o in t)t.hasOwnProperty(o)&&cn(e,o,t[o])}function un(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 dn=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`]]),fn=/^[\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 pn(e){return fn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function mn(){}var hn=null;function gn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _n=null,vn=null;function yn(e){var t=jt(e);if(t&&(e=t.stateNode)){var n=e[xt]||null;a:switch(e=t.stateNode,t.type){case`input`:if($t(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="`+Qt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[xt]||null;if(!a)throw Error(i(90));$t(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&&Xt(r)}break a;case`textarea`:rn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&nn(e,!!n.multiple,t,!1)}}}var bn=!1;function xn(e,t,n){if(bn)return e(t,n);bn=!0;try{return e(t)}finally{if(bn=!1,(_n!==null||vn!==null)&&(Rd(),_n&&(t=_n,e=vn,vn=_n=null,yn(t),e)))for(t=0;t<e.length;t++)yn(e[t])}}function Sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[xt]||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 Cn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,wn=!1;if(Cn)try{var Tn={};Object.defineProperty(Tn,"passive",{get:function(){wn=!0}}),window.addEventListener(`test`,Tn,Tn),window.removeEventListener(`test`,Tn,Tn)}catch{wn=!1}var En=null,Dn=null,On=null;function kn(){if(On)return On;var e,t=Dn,n=t.length,r,i=`value`in En?En.value:En.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 On=i.slice(e,1<r?1-r:void 0)}function An(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 jn(){return!0}function Mn(){return!1}function Nn(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)?jn:Mn,this.isPropagationStopped=Mn,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=jn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=jn)},persist:function(){},isPersistent:jn}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fn=Nn(Pn),In=T({},Pn,{view:0,detail:0}),Ln=Nn(In),Rn,zn,Bn,Vn=T({},In,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,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!==Bn&&(Bn&&e.type===`mousemove`?(Rn=e.screenX-Bn.screenX,zn=e.screenY-Bn.screenY):zn=Rn=0,Bn=e),Rn)},movementY:function(e){return`movementY`in e?e.movementY:zn}}),Hn=Nn(Vn),Un=Nn(T({},Vn,{dataTransfer:0})),Wn=Nn(T({},In,{relatedTarget:0})),Gn=Nn(T({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Kn=Nn(T({},Pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),qn=Nn(T({},Pn,{data:0})),Jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Yn={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`},Xn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function W(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xn[e])?!!t[e]:!1}function Zn(){return W}var Qn=Nn(T({},In,{key:function(e){if(e.key){var t=Jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=An(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Yn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?An(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?An(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),G=Nn(T({},Vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),$n=Nn(T({},Pn,{submitter:0})),er=Nn(T({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),tr=Nn(T({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),nr=Nn(T({},Vn,{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})),rr=Nn(T({},Pn,{newState:0,oldState:0,source:0})),ir=[9,13,27,32],ar=Cn&&`CompositionEvent`in window,or=null;Cn&&`documentMode`in document&&(or=document.documentMode);var sr=Cn&&`TextEvent`in window&&!or,cr=Cn&&(!ar||or&&8<or&&11>=or),lr=` `,ur=!1;function dr(e,t){switch(e){case`keyup`:return ir.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function fr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var pr=!1;function mr(e,t){switch(e){case`compositionend`:return fr(t);case`keypress`:return t.which===32?(ur=!0,lr):null;case`textInput`:return e=t.data,e===lr&&ur?null:e;default:return null}}function hr(e,t){if(pr)return e===`compositionend`||!ar&&dr(e,t)?(e=kn(),On=Dn=En=null,pr=!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 cr&&t.locale!==`ko`?null:t.data;default:return null}}var gr={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 _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!gr[e.type]:t===`textarea`}function vr(e,t,n,r){_n?vn?vn.push(r):vn=[r]:_n=r,t=Jf(t,`onChange`),0<t.length&&(n=new Fn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var yr=null,br=null;function xr(e){Vf(e,0)}function Sr(e){if(Xt(Mt(e)))return e}function Cr(e,t){if(e===`change`)return t}var wr=!1;if(Cn){var Tr;if(Cn){var Er=`oninput`in document;if(!Er){var Dr=document.createElement(`div`);Dr.setAttribute(`oninput`,`return;`),Er=typeof Dr.oninput==`function`}Tr=Er}else Tr=!1;wr=Tr&&(!document.documentMode||9<document.documentMode)}function Or(){yr&&(yr.detachEvent(`onpropertychange`,kr),br=yr=null)}function kr(e){if(e.propertyName===`value`&&Sr(br)){var t=[];vr(t,br,e,gn(e)),xn(xr,t)}}function Ar(e,t,n){e===`focusin`?(Or(),yr=t,br=n,yr.attachEvent(`onpropertychange`,kr)):e===`focusout`&&Or()}function jr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Sr(br)}function Mr(e,t){if(e===`click`)return Sr(t)}function Nr(e,t){if(e===`input`||e===`change`)return Sr(t)}function Pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Fr=typeof Object.is==`function`?Object.is:Pr;function Ir(e,t){if(Fr(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(!Ne.call(t,i)||!Fr(e[i],t[i]))return!1}return!0}function Lr(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 Rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zr(e,t){var n=Rr(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=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lr(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=Lr(e.document)}return t}function Hr(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 Ur=Cn&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==Lr(r)||(r=Wr,`selectionStart`in r&&Hr(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}),Kr&&Ir(Kr,r)||(Kr=r,r=Jf(Gr,`onSelect`),0<r.length&&(t=new Fn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Xr={animationend:Yr(`Animation`,`AnimationEnd`),animationiteration:Yr(`Animation`,`AnimationIteration`),animationstart:Yr(`Animation`,`AnimationStart`),transitionrun:Yr(`Transition`,`TransitionRun`),transitionstart:Yr(`Transition`,`TransitionStart`),transitioncancel:Yr(`Transition`,`TransitionCancel`),transitionend:Yr(`Transition`,`TransitionEnd`)},Zr={},Qr={};Cn&&(Qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),`TransitionEvent`in window||delete Xr.transitionend.transition);function $r(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t=Xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qr)return Zr[e]=t[n];return e}var ei=$r(`animationend`),ti=$r(`animationiteration`),ni=$r(`animationstart`),ri=$r(`transitionrun`),ii=$r(`transitionstart`),ai=$r(`transitioncancel`),oi=$r(`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 li(e,t){si.set(e,t),V(t,[e])}var ui=0;function di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=yd.identifierPrefix;var n=ui++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function fi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Dd;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 pi(e,t){return e=fi(e),t=fi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var mi=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)},hi=[],gi=0,_i=0;function vi(){for(var e=gi,t=_i=gi=0;t<e;){var n=hi[t];hi[t++]=null;var r=hi[t];hi[t++]=null;var i=hi[t];hi[t++]=null;var a=hi[t];if(hi[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&&Si(n,i,a)}}function yi(e,t,n,r){hi[gi++]=e,hi[gi++]=t,hi[gi++]=n,hi[gi++]=r,_i|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bi(e,t,n,r){return yi(e,t,n,r),Ci(e)}function xi(e,t){return yi(e,null,null,t),Ci(e)}function Si(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-Xe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ci(e){if(50<Od)throw Od=0,kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wi={};function Ti(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 Ei(e,t,n,r){return new Ti(e,t,n,r)}function Di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Oi(e,t){var n=e.alternate;return n===null?(n=Ei(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 ki(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 Ai(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Di(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case te:return e=Ei(31,n,t,a),e.elementType=te,e.lanes=o,e;case k:return ji(n.children,a,o,t);case A:s=8,a|=24;break;case j:return e=Ei(12,n,t,a|2),e.elementType=j,e.lanes=o,e;case F:return e=Ei(13,n,t,a),e.elementType=F,e.lanes=o,e;case I:return e=Ei(19,n,t,a),e.elementType=I,e.lanes=o,e;case ne:case re:return e=a|32,e=Ei(30,n,t,e),e.elementType=re,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case M:s=9;break a;case P:s=11;break a;case ee:s=14;break a;case L:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ji(e,t,n,r){return e=Ei(7,e,r,t),e.lanes=n,e}function Mi(e,t,n){return e=Ei(6,e,null,t),e.lanes=n,e}function Ni(e){var t=Ei(18,null,null,0);return t.stateNode=e,t}function Pi(e,t,n){return t=Ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fi=new WeakMap;function Ii(e,t){if(typeof e==`object`&&e){var n=Fi.get(e);return n===void 0?(t={value:e,source:t,stack:Me(t)},Fi.set(e,t),t):n}return{value:e,source:t,stack:Me(t)}}var K=[],Li=0,q=null,Ri=0,zi=[],Bi=0,Vi=null,J=1,Hi=``;function Ui(e,t){K[Li++]=Ri,K[Li++]=q,q=e,Ri=t}function Wi(e,t,n){zi[Bi++]=J,zi[Bi++]=Hi,zi[Bi++]=Vi,Vi=e;var r=J;e=Hi;var i=32-Xe(r)-1;r&=~(1<<i),n+=1;var a=32-Xe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,J=1<<32-Xe(t)+i|n<<i|r,Hi=a+e}else J=1<<a|n<<i|r,Hi=e}function Gi(e){e.return!==null&&(Ui(e,1),Wi(e,1,0))}function Ki(e){for(;e===q;)q=K[--Li],K[Li]=null,Ri=K[--Li],K[Li]=null;for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null,J=zi[--Bi],zi[Bi]=null}function qi(e,t){zi[Bi++]=J,zi[Bi++]=Hi,zi[Bi++]=Vi,J=t.id,Hi=t.overflow,Vi=e}var Ji=null,Yi=null,Y=!1,Xi=null,Zi=!1,Qi=Error(i(519));function $i(e){throw aa(Ii(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Qi}function ea(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[bt]=e,t[xt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),en(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),an(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||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=mn),t=!0):t=!1,t||$i(e,!0)}function ta(e){for(Ji=e.return;Ji;)switch(Ji.tag){case 5:case 31:case 13:Zi=!1;return;case 27:case 3:Zi=!0;return;default:Ji=Ji.return}}function na(e){if(e!==Ji)return!1;if(!Y)return ta(e),Y=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||mp(e.type,e.memoizedProps)),n=!n),n&&Yi&&$i(e),ta(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Yi=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Yi=dm(e)}else t===27?(t=Yi,Cp(e.type)?(e=um,um=null,Yi=e):Yi=t):Yi=Ji?lm(e.stateNode.nextSibling):null;return!0}function ra(){Yi=Ji=null,Y=!1}function ia(){var e=Xi;return e!==null&&(dd===null?dd=e:dd.push.apply(dd,e),Xi=null),e}function aa(e){Xi===null?Xi=[e]:Xi.push(e)}var oa=pe(null),sa=null,ca=null;function la(e,t,n){he(oa,t._currentValue),t._currentValue=n}function ua(e){e._currentValue=oa.current,me(oa)}function da(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 fa(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),da(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),da(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),da(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 pa(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;Fr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===xe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&fa(t,e,n,r),t.flags|=262144,e!==null}function ma(e){for(e=e.firstContext;e!==null;){if(!Fr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ha(e){sa=e,ca=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ga(e){return va(sa,e)}function _a(e,t){return sa===null&&ha(e),va(e,t)}function va(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ca===null){if(e===null)throw Error(i(308));ca=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ca=ca.next=t;return n}var ya=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()})}},ba=t.unstable_scheduleCallback,xa=t.unstable_NormalPriority,Sa={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ca(){return{controller:new ya,data:new Map,refCount:0}}function wa(e){e.refCount--,e.refCount===0&&ba(xa,function(){e.controller.abort()})}function Ta(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 Ea=null;function Da(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Oa=null,ka=0,Aa=0,ja=null;function Ma(e,t){if(Oa===null){var n=Oa=[];ka=0,Aa=Pf(),ja={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ka++,t.then(Na,Na),t}function Na(){if(--ka===0&&(Ea=null,Oa!==null)){ja!==null&&(ja.status=`fulfilled`);var e=Oa;Oa=null,Aa=0,ja=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pa(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 Fa=z.S;z.S=function(e,t){if(md=Re(),typeof t==`object`&&t&&typeof t.then==`function`&&Ma(e,t),Ea!==null)for(var n=bf;n!==null;)Ta(n,Ea),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Ta(r,n),r=r.next;if(Aa!==0){r=Ea,r===null&&(r=Ea=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Fa!==null&&Fa(e,t)};var Ia=pe(null);function La(){var e=Ia.current;return e===null?Xu.pooledCache:e}function Ra(e,t){t===null?he(Ia,Ia.current):he(Ia,t.pool)}function za(){var e=La();return e===null?null:{parent:Sa._currentValue,pool:e}}var Ba=Error(i(460)),Va=Error(i(474)),Ha=Error(i(542)),Ua={then:function(){}};function Wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ga(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(mn,mn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ya(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(mn,mn);else{if(e=Xu,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,Ya(e),e}throw qa=t,Ba}}function Ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(qa=e,Ba):e}}var qa=null;function Ja(){if(qa===null)throw Error(i(459));var e=qa;return qa=null,e}function Ya(e){if(e===Ba||e===Ha)throw Error(i(483))}var Xa=null,Za=0;function Qa(e){var t=Za;return Za+=1,Xa===null&&(Xa=[]),Ga(Xa,e,t)}function $a(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function eo(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function to(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=Oi(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=Mi(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===k?(e=d(e,t,n.props.children,r,n.key),$a(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===L&&Ka(i)===t.type)?(t=a(t,n.props),$a(t,n),t.return=e,t):(t=Ai(n.type,n.key,n.props,null,e.mode,r),$a(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=Pi(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=ji(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=Mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Ai(t.type,t.key,t.props,null,e.mode,n),$a(n,t),n.return=e,n;case O:return t=Pi(t,e.mode,n),t.return=e,t;case L:return t=Ka(t),f(e,t,n)}if(le(t)||oe(t))return t=ji(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Qa(t),n);if(t.$$typeof===N)return f(e,_a(e,t),n);eo(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 D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case L:return n=Ka(n),p(e,t,n,r)}if(le(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Qa(n),r);if(n.$$typeof===N)return p(e,t,_a(e,n),r);eo(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 D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case L:return r=Ka(r),m(e,t,n,r,i)}if(le(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Qa(r),i);if(r.$$typeof===N)return m(e,t,n,_a(t,r),i);eo(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),Y&&Ui(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 Y&&Ui(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)}),Y&&Ui(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),Y&&Ui(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 Y&&Ui(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)}),Y&&Ui(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),$a(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===L&&Ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),$a(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=ji(o.props.children,e.mode,c,o.key),$a(c,o),c.return=e,e=c):(c=Ai(o.type,o.key,o.props,null,e.mode,c),$a(c,o),c.return=e,e=c)}return s(e);case O: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=Pi(o,e.mode,c),c.return=e,e=c}return s(e);case L:return o=Ka(o),_(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(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,Qa(o),c);if(o.$$typeof===N)return _(e,r,_a(e,o),c);eo(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=Mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Za=0;var i=_(e,t,n,r);return Xa=null,i}catch(t){if(t===Ba||t===Ha)throw t;var a=Ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var no=to(!0),ro=to(!1),io=!1;function ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oo(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 so(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ci(e),Si(e,null,n),t}return yi(e,r,t,n),Ci(e)}function lo(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,pt(e,n)}}function uo(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 fo=!1;function po(){if(fo){var e=ja;if(e!==null)throw e}}function mo(e,t,n,r){fo=!1;var i=e.updateQueue;io=!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?(Zu&f)===f:(r&f)===f){f!==0&&f===Aa&&(fo=!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:io=!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),ad|=o,e.lanes=o,e.memoizedState=d}}function ho(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function go(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ho(n[e],t)}var _o=pe(null),vo=pe(0);function yo(e,t){e=rd,he(vo,e),he(_o,t),rd=e|t.baseLanes}function bo(){he(vo,rd),he(_o,_o.current)}function xo(){rd=vo.current,me(_o),me(vo)}var So=pe(null),Co=null;function wo(e){var t=e.alternate;he(ko,ko.current&1),he(So,e),Co===null&&(t===null||_o.current!==null||t.memoizedState!==null)&&(Co=e)}function To(e){he(ko,ko.current),he(So,e),Co===null&&(Co=e)}function Eo(e){e.tag===22?(he(ko,ko.current),he(So,e),Co===null&&(Co=e)):Do()}function Do(){he(ko,ko.current),he(So,So.current)}function Oo(e){me(So),Co===e&&(Co=null),me(ko)}var ko=pe(0);function Ao(e,t){he(So,So.current),he(ko,t)}function jo(e){me(ko),me(So),Co===e&&(Co=null)}function Mo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(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 No=0,X=null,Po=null,Fo=null,Io=!1,Lo=!1,Ro=!1,zo=0,Bo=0,Vo=null,Ho=0;function Uo(){throw Error(i(321))}function Wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function Go(e,t,n,r,i,a){return No=a,X=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?cc:lc,Ro=!1,a=n(r,i),Ro=!1,Lo&&(a=qo(t,n,r,i)),Ko(e),a}function Ko(e){z.H=sc;var t=Po!==null&&Po.next!==null;if(No=0,Fo=Po=X=null,Io=!1,Bo=0,Vo=null,t)throw Error(i(300));e===null||Ec||(e=e.dependencies,e!==null&&ma(e)&&(Ec=!0))}function qo(e,t,n,r){X=e;var a=0;do{if(Lo&&(Vo=null),Bo=0,Lo=!1,25<=a)throw Error(i(301));if(a+=1,Fo=Po=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}z.H=uc,o=t(n,r)}while(Lo);return o}function Jo(){var e=z.H,t=e.useState()[0];return t=typeof t.then==`function`?ts(t):t,e=e.useState()[0],(Po===null?null:Po.memoizedState)!==e&&(X.flags|=1024),t}function Yo(){var e=zo!==0;return zo=0,e}function Xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Zo(e){if(Io){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Io=!1}No=0,Fo=Po=X=null,Lo=!1,Bo=zo=0,Vo=null}function Qo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fo===null?X.memoizedState=Fo=e:Fo=Fo.next=e,Fo}function $o(){if(Po===null){var e=X.alternate;e=e===null?null:e.memoizedState}else e=Po.next;var t=Fo===null?X.memoizedState:Fo.next;if(t!==null)Fo=t,Po=e;else{if(e===null)throw X.alternate===null?Error(i(467)):Error(i(310));Po=e,e={memoizedState:Po.memoizedState,baseState:Po.baseState,baseQueue:Po.baseQueue,queue:Po.queue,next:null},Fo===null?X.memoizedState=Fo=e:Fo=Fo.next=e}return Fo}function es(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ts(e){var t=Bo;return Bo+=1,Vo===null&&(Vo=[]),e=Ga(Vo,e,t),t=X,(Fo===null?t.memoizedState:Fo.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?cc:lc),e}function ns(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ts(e);if(e.$$typeof===ie)return;if(e.$$typeof===N)return ga(e)}throw Error(i(438,String(e)))}function rs(e){var t=null,n=X.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=X.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=es(),X.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]=R;return t.index++,n}function is(e,t){return typeof t==`function`?t(e):t}function as(e){return os($o(),Po,e)}function os(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?(No&f)===f:(Zu&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===Aa&&(d=!0);else if((No&p)===p){u=u.next,p===Aa&&(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,X.lanes|=p,ad|=p;f=u.action,Ro&&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,X.lanes|=f,ad|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Fr(o,e.memoizedState)&&(Ec=!0,d&&(n=ja,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 ss(e){var t=$o(),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);Fr(o,t.memoizedState)||(Ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function cs(e,t,n){var r=X,a=$o(),o=Y;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Fr((Po||a).memoizedState,n);if(s&&(a.memoizedState=n,Ec=!0),a=a.queue,Ns(ds.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Fo!==null&&!!(Fo.memoizedState.tag&1),Os(e?9:8,{destroy:void 0},us.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||No&127||ls(r,t,n)}return n}function ls(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=X.updateQueue,t===null?(t=es(),X.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function us(e,t,n,r){t.value=n,t.getSnapshot=r,fs(t)&&ps(e)}function ds(e,t,n){return n(function(){fs(t)&&ps(e)})}function fs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Fr(e,n)}catch{return!0}}function ps(e){var t=xi(e,2);t!==null&&Nd(t,e,2)}function ms(e){var t=Qo();if(typeof e==`function`){var n=e;if(e=n(),Ro){Ye(!0);try{n()}finally{Ye(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:e},t}function hs(e,t,n,r){return e.baseState=n,os(e,Po,typeof r==`function`?r:is)}function gs(e,t,n,r,a){if(ic(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)}};z.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,_s(t,o)):(o.next=n.next,t.pending=n.next=o)}}function _s(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=z.T,o={};o.types=a===null?null:a.types,z.T=o;try{var s=n(i,r),c=z.S;c!==null&&c(o,s),vs(e,t,s)}catch(n){bs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),z.T=a}}else try{a=n(i,r),vs(e,t,a)}catch(n){bs(e,t,n)}}function vs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ys(e,t,n)},function(n){return bs(e,t,n)}):ys(e,t,n)}function ys(e,t,n){t.status=`fulfilled`,t.value=n,xs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,_s(e,n)))}function bs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,xs(t),t=t.next;while(t!==r)}e.action=null}function xs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ss(e,t){return t}function Cs(e,t){if(Y){var n=Xu.formState;if(n!==null){a:{var r=X;if(Y){if(Yi){b:{for(var i=Yi,a=Zi;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Yi=lm(i.nextSibling),r=i.data===`F!`;break a}}$i(r)}r=!1}r&&(t=n[0])}}return n=Qo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ss,lastRenderedState:t},n.queue=r,n=tc.bind(null,X,r),r.dispatch=n,r=ms(!1),a=rc.bind(null,X,!1,r.queue),r=Qo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=gs.bind(null,X,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ws(e){return Ts($o(),Po,e)}function Ts(e,t,n){if(t=os(e,t,Ss)[0],e=as(is)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ts(t)}catch(e){throw e===Ba?Ha:e}else r=t;t=$o();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(X.flags|=2048,Os(9,{destroy:void 0},Es.bind(null,i,n),null)),[r,a,e]}function Es(e,t){e.action=t}function Ds(e){var t=$o(),n=Po;if(n!==null)return Ts(t,n,e);$o(),t=t.memoizedState,n=$o();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=X.updateQueue,t===null&&(t=es(),X.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 ks(){return $o().memoizedState}function As(e,t,n,r){var i=Qo();X.flags|=e,i.memoizedState=Os(1|t,{destroy:void 0},n,r===void 0?null:r)}function js(e,t,n,r){var i=$o();r=r===void 0?null:r;var a=i.memoizedState.inst;Po!==null&&r!==null&&Wo(r,Po.memoizedState.deps)?i.memoizedState=Os(t,a,n,r):(X.flags|=e,i.memoizedState=Os(1|t,a,n,r))}function Ms(e,t){As(8390656,8,e,t)}function Ns(e,t){js(2048,8,e,t)}function Ps(e){X.flags|=4;var t=X.updateQueue;if(t===null)t=es(),X.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Fs(e){var t=$o().memoizedState;return Ps({ref:t,nextImpl:e}),function(){if(Yu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Is(e,t){return js(4,2,e,t)}function Ls(e,t){return js(4,4,e,t)}function Rs(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 zs(e,t,n){n=n==null?null:n.concat([e]),js(4,4,Rs.bind(null,t,e),n)}function Bs(){}function Vs(e,t){var n=$o();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hs(e,t){var n=$o();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Wo(t,r[1]))return r[0];if(r=e(),Ro){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r}function Us(e,t,n){return n===void 0||No&1073741824&&!(Zu&261930)?e.memoizedState=t:(e.memoizedState=n,e=jd(),X.lanes|=e,ad|=e,n)}function Ws(e,t,n,r){return Fr(n,t)?n:_o.current===null?!(No&106)||No&1073741824&&!(Zu&261930)?(Ec=!0,e.memoizedState=n):(e=jd(),X.lanes|=e,ad|=e,t):(e=Us(e,n,r),Fr(e,t)||(Ec=!0),e)}function Gs(e,t,n,r,i){var a=B.p;B.p=a!==0&&8>a?a:8;var o=z.T,s={};s.types=o===null?null:o.types,z.T=s,rc(e,!1,t,n);try{var c=i(),l=z.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?nc(e,t,Pa(c,r),Ad(e)):nc(e,t,r,Ad(e))}catch(n){nc(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{B.p=a,o!==null&&s.types!==null&&(o.types=s.types),z.T=o}}function Ks(){}function qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Js(e).queue;Gs(e,a,t,ue,n===null?Ks:function(){return Ys(e),n(r)})}function Js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ys(e){var t=Js(e);t.next===null&&(t=e.alternate.memoizedState),nc(e,t.next.queue,{},Ad())}function Xs(){return ga(sh)}function Zs(){return $o().memoizedState}function Qs(){return $o().memoizedState}function $s(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=so(n);var r=co(t,e,n);r!==null&&(Nd(r,t,n),lo(r,t,n)),t={cache:Ca()},e.payload=t;return}t=t.return}}function ec(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ic(e)?ac(t,n):(n=bi(e,t,n,r),n!==null&&(Nd(n,e,r),oc(n,t,r)))}function tc(e,t,n){nc(e,t,n,Ad())}function nc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ic(e))ac(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,Fr(s,o))return yi(e,t,i,0),Xu===null&&vi(),!1}catch{}if(n=bi(e,t,i,r),n!==null)return Nd(n,e,r),oc(n,t,r),!0}return!1}function rc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ic(e)){if(t)throw Error(i(479))}else t=bi(e,n,r,2),t!==null&&Nd(t,e,2)}function ic(e){var t=e.alternate;return e===X||t!==null&&t===X}function ac(e,t){Lo=Io=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pt(e,n)}}var sc={readContext:ga,use:ns,useCallback:Uo,useContext:Uo,useEffect:Uo,useImperativeHandle:Uo,useLayoutEffect:Uo,useInsertionEffect:Uo,useMemo:Uo,useReducer:Uo,useRef:Uo,useState:Uo,useDebugValue:Uo,useDeferredValue:Uo,useTransition:Uo,useSyncExternalStore:Uo,useId:Uo,useHostTransitionStatus:Uo,useFormState:Uo,useActionState:Uo,useOptimistic:Uo,useMemoCache:Uo,useCacheRefresh:Uo,useEffectEvent:Uo},cc={readContext:ga,use:ns,useCallback:function(e,t){return Qo().memoizedState=[e,t===void 0?null:t],e},useContext:ga,useEffect:Ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),As(4194308,4,Rs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return As(4194308,4,e,t)},useInsertionEffect:function(e,t){As(4,2,e,t)},useMemo:function(e,t){var n=Qo();t=t===void 0?null:t;var r=e();if(Ro){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Qo();if(n!==void 0){var i=n(t);if(Ro){Ye(!0);try{n(t)}finally{Ye(!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=ec.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=Qo();return e={current:e},t.memoizedState=e},useState:function(e){e=ms(e);var t=e.queue,n=tc.bind(null,X,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Bs,useDeferredValue:function(e,t){return Us(Qo(),e,t)},useTransition:function(){var e=ms(!1);return e=Gs.bind(null,X,e.queue,!0,!1),Qo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=X,a=Qo();if(Y){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Zu&127||ls(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ms(ds.bind(null,r,o,e),[e]),r.flags|=2048,Os(9,{destroy:void 0},us.bind(null,r,o,n,t),null),n},useId:function(){var e=Qo(),t=Xu.identifierPrefix;if(Y){var n=Hi,r=J;n=(r&~(1<<32-Xe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=zo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ho++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Xs,useFormState:Cs,useActionState:Cs,useOptimistic:function(e){var t=Qo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=rc.bind(null,X,!0,n),n.dispatch=t,[e,t]},useMemoCache:rs,useCacheRefresh:function(){return Qo().memoizedState=$s.bind(null,X)},useEffectEvent:function(e){var t=Qo(),n={impl:e};return t.memoizedState=n,function(){if(Yu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},lc={readContext:ga,use:ns,useCallback:Vs,useContext:ga,useEffect:Ns,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:as,useRef:ks,useState:function(){return as(is)},useDebugValue:Bs,useDeferredValue:function(e,t){return Ws($o(),Po.memoizedState,e,t)},useTransition:function(){var e=as(is)[0],t=$o().memoizedState;return[typeof e==`boolean`?e:ts(e),t]},useSyncExternalStore:cs,useId:Zs,useHostTransitionStatus:Xs,useFormState:ws,useActionState:ws,useOptimistic:function(e,t){return hs($o(),Po,e,t)},useMemoCache:rs,useCacheRefresh:Qs,useEffectEvent:Fs},uc={readContext:ga,use:ns,useCallback:Vs,useContext:ga,useEffect:Ns,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:ss,useRef:ks,useState:function(){return ss(is)},useDebugValue:Bs,useDeferredValue:function(e,t){var n=$o();return Po===null?Us(n,e,t):Ws(n,Po.memoizedState,e,t)},useTransition:function(){var e=ss(is)[0],t=$o().memoizedState;return[typeof e==`boolean`?e:ts(e),t]},useSyncExternalStore:cs,useId:Zs,useHostTransitionStatus:Xs,useFormState:Ds,useActionState:Ds,useOptimistic:function(e,t){var n=$o();return Po===null?(n.baseState=e,[e,n.queue.dispatch]):hs(n,Po,e,t)},useMemoCache:rs,useCacheRefresh:Qs,useEffectEvent:Fs};function dc(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 fc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=so(r);i.payload=t,n!=null&&(i.callback=n),t=co(e,i,r),t!==null&&(Nd(t,e,r),lo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=so(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=co(e,i,r),t!==null&&(Nd(t,e,r),lo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ad(),r=so(n);r.tag=2,t!=null&&(r.callback=t),t=co(e,r,n),t!==null&&(Nd(t,e,n),lo(t,e,n))}};function pc(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?!Ir(n,r)||!Ir(i,a):!0}function mc(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&&fc.enqueueReplaceState(t,t.state,null)}function hc(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 gc(e){mi(e)}function _c(e){console.error(e)}function vc(e){mi(e)}function yc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function bc(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 xc(e,t,n){return n=so(n),n.tag=3,n.payload={element:null},n.callback=function(){yc(e,t)},n}function Sc(e){return e=so(e),e.tag=3,e}function Cc(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(){bc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){bc(t,n,r),typeof i!=`function`&&(_d===null?_d=new Set([this]):_d.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function wc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&pa(t,n,a,!0),n=So.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Co===null?Gd():n.alternate===null&&id===0&&(id=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ua?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ua?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)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Gd(),!1}if(Y)return t=So.current,t===null?(r!==Qi&&(t=Error(i(423),{cause:r}),aa(Ii(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ii(r,n),a=xc(e.stateNode,r,a),uo(e,a),id!==4&&(id=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Qi&&(e=Error(i(422),{cause:r}),aa(Ii(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ii(o,n),ud===null?ud=[o]:ud.push(o),id!==4&&(id=2),t===null)return!0;r=Ii(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=xc(n.stateNode,r,e),uo(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`&&(_d===null||!_d.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Sc(a),Cc(a,e,n,r),uo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Tc=Error(i(461)),Ec=!1;function Dc(e,t,n,r){t.child=e===null?ro(t,null,n,r):no(t,e.child,n,r)}function Oc(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 ha(t),r=Go(e,t,n,o,a,i),s=Yo(),e!==null&&!Ec?(Xo(e,t,i),nl(e,t,i)):(Y&&s&&Gi(t),t.flags|=1,Dc(e,t,r,i),t.child)}function kc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ac(e,t,a,r,i)):(e=Ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!rl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ir:n,n(o,r)&&e.ref===t.ref)return nl(e,t,i)}return t.flags|=1,e=Oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ir(a,r)&&e.ref===t.ref){if(Ec=!1,t.pendingProps=r=a,rl(e,i))e.flags&131072&&(Ec=!0);else return t.lanes=e.lanes,nl(e,t,i)}}return Rc(e,t,n,r,i)}function jc(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 Nc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ra(t,a===null?null:a.cachePool),a===null?bo():yo(t,a),Eo(t);else return r=t.lanes=536870912,Nc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ra(t,null),bo(),Do()):(Ra(t,a.cachePool),yo(t,a),Do(),t.memoizedState=null);return Dc(e,t,i,n),t.child}function Mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Nc(e,t,n,r,i){var a=La();return a=a===null?null:{parent:Sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ra(t,null),bo(),Eo(t),e!==null&&pa(e,t,r,!0),t.childLanes=i,null}function Pc(e,t){return t=qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fc(e,t,n){return no(t,e.child,null,n),e=Pc(t,t.pendingProps),e.flags|=2,Oo(t),t.memoizedState=null,e}function Ic(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Y){if(r.mode===`hidden`)return e=Pc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Mc(null,e);if(To(t),(e=Yi)?(e=am(e,Zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vi===null?null:{id:J,overflow:Hi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Ji=t,Yi=null)):e=null,e===null)throw $i(t);return t.lanes=536870912,null}return Pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(To(t),a){if(t.flags&256)t.flags&=-257,t=Fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ec||pa(e,t,n,!1),a=(n&e.childLanes)!==0,Ec||a){if(_o.current===null){if(r=Xu,r!==null&&(s=mt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,xi(e,s),Nd(r,e,s),Tc;Gd()}t=Fc(e,t,n)}else e=o.treeContext,Yi=lm(s.nextSibling),Ji=t,Y=!0,Xi=null,Zi=!1,e!==null&&qi(t,e),t=Pc(t,r),t.flags|=134221824;return t}return e=Oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Lc(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 Rc(e,t,n,r,i){return ha(t),n=Go(e,t,n,r,void 0,i),r=Yo(),e!==null&&!Ec?(Xo(e,t,i),nl(e,t,i)):(Y&&r&&Gi(t),t.flags|=1,Dc(e,t,n,i),t.child)}function zc(e,t,n,r,i,a){return ha(t),t.updateQueue=null,n=qo(t,r,n,i),Ko(e),r=Yo(),e!==null&&!Ec?(Xo(e,t,a),nl(e,t,a)):(Y&&r&&Gi(t),t.flags|=1,Dc(e,t,n,a),t.child)}function Bc(e,t,n,r,i){if(ha(t),t.stateNode===null){var a=wi,o=n.contextType;typeof o==`object`&&o&&(a=ga(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=fc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ao(t),o=n.contextType,a.context=typeof o==`object`&&o?ga(o):wi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(dc(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&&fc.enqueueReplaceState(a,a.state,null),mo(t,r,a,i),po(),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=hc(n,s);a.props=c;var l=a.context,u=n.contextType;o=wi,typeof u==`object`&&u&&(o=ga(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)&&mc(t,a,r,o),io=!1;var f=t.memoizedState;a.state=f,mo(t,r,a,i),po(),l=t.memoizedState,s||f!==l||io?(typeof d==`function`&&(dc(t,n,d,r),l=t.memoizedState),(c=io||pc(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,oo(e,t),o=t.memoizedProps,u=hc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=wi,typeof l==`object`&&l&&(c=ga(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)&&mc(t,a,r,c),io=!1,f=t.memoizedState,a.state=f,mo(t,r,a,i),po();var p=t.memoizedState;o!==d||f!==p||io||e!==null&&e.dependencies!==null&&ma(e.dependencies)?(typeof s==`function`&&(dc(t,n,s,r),p=t.memoizedState),(u=io||pc(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,Lc(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=no(t,e.child,null,i),t.child=no(t,null,n,i)):Dc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=nl(e,t,i),e}function Vc(e,t,n,r){return ra(),t.flags|=256,Dc(e,t,n,r),t.child}var Hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uc(e){return{baseLanes:e,cachePool:za()}}function Wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=cd),e}function Gc(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(Y){if(i?wo(t):Do(),(e=Yi)?(e=am(e,Zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vi===null?null:{id:J,overflow:Hi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Ji=t,Yi=null)):e=null,e===null)throw $i(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Do(),i=t.mode,a=qc({mode:`hidden`,children:a},i),r=ji(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Uc(n),r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(null,r)):(wo(t),Kc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Yc(e,t,a,o,r,c,s,n)}return i?(Do(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Oi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=ji(i,a,n,null),i.flags|=2):i=Oi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Mc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Uc(n):(a=i.cachePool,a===null?a=za():(s=Sa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(e.child,r)):(wo(t),n=e.child,e=n.sibling,n=Oi(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 Kc(e,t){return t=qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function qc(e,t){return e=Ei(22,e,null,t),e.lanes=0,e}function Jc(e,t,n){return no(t,e.child,null,n),e=Kc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(wo(t),t.flags&=-257,Jc(e,t,c)):t.memoizedState===null?(Do(),o=a.fallback,s=t.mode,a=qc({mode:`visible`,children:a.children},s),o=ji(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,no(t,e.child,null,c),a=t.child,a.memoizedState=Uc(c),a.childLanes=Wc(e,r,c),t.memoizedState=Hc,Mc(null,a)):(Do(),t.child=e.child,t.flags|=128,null);if(wo(t),sm(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,aa({value:a,source:null,stack:null})),Jc(e,t,c)}if(Ec||pa(e,t,c,!1),r=(c&e.childLanes)!==0,Ec||r){if(_o.current!==null)return Jc(e,t,c);if(r=Xu,r!==null&&(a=mt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,xi(e,a),Nd(r,e,a),Tc;return om(o)||Gd(),Jc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Yi=lm(o.nextSibling),Ji=t,Y=!0,Xi=null,Zi=!1,e!==null&&qi(t,e),t=Kc(t,a.children),t.flags|=134221824,t)}function Xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),da(e.return,t,n)}function Zc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Mo(n)===null&&(t=e),e=e.sibling}return t}function Qc(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 $c(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 el(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 Ao(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ao(t,o),i===`backwards`&&e!==null?($c(e),Dc(e,t,r,n),$c(e)):Dc(e,t,r,n),r=Y?Ri:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xc(e,n,t);else if(e.tag===19)Xc(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=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,$c(t)),Qc(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&&Mo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Qc(t,!0,n,null,a,r);break;case`together`:Qc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Qc(t,!1,i,n,a,r)}return t.child}function tl(e,t,n){var r=t.pendingProps;return la(t,t.type,r.value),Dc(e,t,r.children,n),t.child}function nl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ad|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(pa(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=Oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ma(e)))}function il(e,t,n){switch(t.tag){case 3:Se(t,t.stateNode.containerInfo),la(t,Sa,e.memoizedState.cache),ra();break;case 27:case 5:we(t);break;case 4:Se(t,t.stateNode.containerInfo);break;case 10:la(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,To(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return wo(t),t.flags|=128,null;r=pa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Gc(e,t,n):(wo(t),e=nl(e,t,n),e===null?null:e.sibling)}wo(t);break;case 19:if(t.flags&128)return el(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(pa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return el(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ao(t,ko.current),r)break;return null;case 22:return t.lanes=0,jc(e,t,n,t.pendingProps);case 24:la(t,Sa,e.memoizedState.cache)}return nl(e,t,n)}function al(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ec=!0;else{if(!rl(e,n)&&!(t.flags&128))return Ec=!1,il(e,t,n);Ec=!!(e.flags&131072)}}else Ec=!1,Y&&t.flags&1048576&&Wi(t,Ri,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ka(t.elementType),t.type=e,typeof e==`function`)Di(e)?(r=hc(e,r),t.tag=1,t=Bc(null,t,e,r,n)):(t.tag=0,t=Rc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===P){t.tag=11,t=Oc(null,t,e,r,n);break a}if(a===ee){t.tag=14,t=kc(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=tl(null,t,n);break a}}throw t=ce(e)||e,Error(i(306,t,``))}}return t;case 0:return Rc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=hc(r,t.pendingProps),Bc(e,t,r,a,n);case 3:a:{if(Se(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,oo(e,t),mo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,la(t,Sa,r),r!==o.cache&&fa(t,[Sa],n,!0),po(),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=Vc(e,t,r,n);break a}if(r!==a){a=Ii(Error(i(424)),t),aa(a),t=Vc(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(Yi=lm(e.firstChild),Ji=t,Y=!0,Xi=null,Zi=!0,n=ro(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ra(),r===a){t=nl(e,t,n);break a}Dc(e,t,r,n)}t=t.child}return t;case 26:return Lc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Y||(t.stateNode=pp(t.type,t.pendingProps,be.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return we(t),e===null&&Y&&(r=t.stateNode=hm(t.type,t.pendingProps,be.current),Ji=t,Zi=!0,a=Yi,Cp(t.type)?(um=a,Yi=lm(r.firstChild)):Yi=a),Dc(e,t,t.pendingProps.children,n),Lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Y&&((a=r=Yi)&&(r=rm(r,t.type,t.pendingProps,Zi),r===null?a=!1:(t.stateNode=r,Ji=t,Yi=lm(r.firstChild),Zi=!1,a=!0)),a||$i(t)),we(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,mp(a,o)?r=null:s!==null&&mp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Go(e,t,Jo,null,null,n),sh._currentValue=a),Lc(e,t),Dc(e,t,r,n),t.child;case 6:return e===null&&Y&&((e=n=Yi)&&(n=im(n,t.pendingProps,Zi),n===null?e=!1:(t.stateNode=n,Ji=t,Yi=null,e=!0)),e||$i(t)),null;case 13:return Gc(e,t,n);case 4:return Se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=no(t,null,r,n):Dc(e,t,r,n),t.child;case 11:return Oc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Lc(e,t),Dc(e,t,r,n),t.child;case 8:return Dc(e,t,t.pendingProps.children,n),t.child;case 12:return Dc(e,t,t.pendingProps.children,n),t.child;case 10:return tl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ha(t),a=ga(a),r=r(a),t.flags|=1,Dc(e,t,r,n),t.child;case 14:return kc(e,t,t.type,t.pendingProps,n);case 15:return Ac(e,t,t.type,t.pendingProps,n);case 19:return el(e,t,n);case 31:return Ic(e,t,n);case 22:return jc(e,t,n,t.pendingProps);case 24:return ha(t),r=ga(Sa),e===null?(a=La(),a===null&&(a=Xu,o=Ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ao(t),la(t,Sa,a)):((e.lanes&n)!==0&&(oo(e,t),mo(t,null,null,n),po()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,la(t,Sa,r),r!==a.cache&&fa(t,[Sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),la(t,Sa,r))),Dc(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:Y&&Gi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Lc(e,t),Dc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ol(e){e.flags|=4}function sl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(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(Hd())e.flags|=8192;else throw qa=Ua,Va}}else e.flags&=-16777217}function cl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Hd())e.flags|=8192;else throw qa=Ua,Va}}function ll(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ct(),e.lanes|=t,ld|=t)}function ul(e,t){if(!Y)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 dl(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 fl(e,t,n){var r=t.pendingProps;switch(Ki(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dl(t),null;case 1:return dl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ua(Sa),Ce(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(na(t)?ol(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ia())),dl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ol(t),o===null?(dl(t),sl(t,a,null,r,n)):(dl(t),cl(t,o))):o?o===e.memoizedState?(dl(t),t.flags&=-16777217):(ol(t),dl(t),cl(t,o)):(e=e.memoizedProps,e!==r&&ol(t),dl(t),sl(t,a,e,r,n)),null;case 27:if(Te(t),n=be.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}e=ge.current,na(t)?ea(t,e):(e=hm(a,r,n),t.stateNode=e,ol(t))}return dl(t),t.subtreeFlags&=-33554433,null;case 5:if(Te(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}if(o=ge.current,na(t))ea(t,o);else{var s=up(be.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[bt]=t,o[xt]=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(rp(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&&ol(t)}}return dl(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&&ol(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=be.current,na(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ji,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[bt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||$i(t,!0)}else e=up(e).createTextNode(r),e[bt]=t,t.stateNode=e}return dl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=na(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[bt]=t}else ra(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),e=!1}else n=ia(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Oo(t),t):(Oo(t),null);if(t.flags&128)throw Error(i(558))}return dl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=na(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[bt]=t}else ra(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),a=!1}else a=ia(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Oo(t),t):(Oo(t),null)}return Oo(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),ll(t,t.updateQueue),dl(t),null);case 4:return Ce(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,dl(t),null;case 10:return ua(t.type),dl(t),null;case 19:if(jo(t),r=t.memoizedState,r===null)return dl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ul(r,!1);else{if(id!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Mo(e),o!==null){for(t.flags|=128,ul(r,!1),e=o.updateQueue,t.updateQueue=e,ll(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ki(n,e),n=n.sibling;return Ao(t,ko.current&1|2),Y&&Ui(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Re()>hd&&(t.flags|=128,a=!0,ul(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Mo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ll(t,e),ul(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!Y)return dl(t),null}else 2*Re()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,a=!0,ul(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=Re(),e.sibling=null,o=ko.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Y?Ao(t,o):(n=o,he(So,t),he(ko,n),Co===null&&(Co=t)),Y&&Ui(t,r.treeForkCount),e}return dl(t),null;case 22:case 23:return Oo(t),xo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(dl(t),t.subtreeFlags&6&&(t.flags|=8192)):dl(t),n=t.updateQueue,n!==null&&ll(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&&me(Ia),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ua(Sa),dl(t),null;case 25:return null;case 30:return t.flags|=33554432,dl(t),null}throw Error(i(156,t.tag))}function pl(e,t){switch(Ki(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ua(Sa),Ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Te(t),null;case 31:if(t.memoizedState!==null){if(Oo(t),t.alternate===null)throw Error(i(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ra()}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 Ce(),null;case 10:return ua(t.type),null;case 22:case 23:return Oo(t),xo(),e!==null&&me(Ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ua(Sa),null;case 25:return null;default:return null}}function ml(e,t){switch(Ki(t),t.tag){case 3:ua(Sa),Ce();break;case 26:case 27:case 5:Te(t);break;case 4:Ce();break;case 31:t.memoizedState!==null&&Oo(t);break;case 13:Oo(t);break;case 19:jo(t);break;case 10:ua(t.type);break;case 22:case 23:Oo(t),xo(),e!==null&&me(Ia);break;case 24:ua(Sa)}}function hl(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){pf(t,t.return,e)}}function gl(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){pf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){pf(t,t.return,e)}}function _l(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{go(t,n)}catch(t){pf(e,e.return,t)}}}function vl(e,t,n){n.props=hc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){pf(e,t,n)}}function yl(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=di(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Fp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Ip(e);f(e.child,!1,$p,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){pf(e,t,n)}}function bl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){pf(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){pf(e,t,n)}else n.current=null}}function xl(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++)$(e.stateNode,t[n])}function Sl(e){for(var t=e.return;t!==null&&(Tl(t)&&$(e.stateNode,t.stateNode),!wl(t));)t=t.return}function Cl(e){for(var t=e.return;t!==null&&(Tl(t)&&tm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function wl(e){return e.tag===5||e.tag===3||e.tag===27}function Tl(e){return e&&e.tag===7&&e.stateNode!==null}function El(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){pf(e,e.return,t)}}function Dl(e,t,n){try{var r=e.stateNode;ap(r,e.type,n,t),r[xt]=t}catch(t){pf(e,e.return,t)}}function Ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cp(e.type)||e.tag===4}function kl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ol(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&&Cp(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 Al(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=mn)),xl(e,r),U=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,Cp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),xl(e,r),U=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,Cp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);rp(t,r,n),t[bt]=e,t[xt]=n}catch(t){pf(e,e.return,t)}}var Nl=!1,Pl=null;function Fl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Nl=!0)}var Il=null;function Ll(){var e=Il;return Il=null,e}var Rl=0;function zl(e,t,n,r,i){return Rl=0,Bl(e.child,t,n,r,i)}function Bl(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);Nl=!0,Ep(o,Rl===0?t:t+`_`+Rl,n),Rl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Bl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Vl(e,t){for(;e!==null;)e.tag===5?Dp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Vl(e.child,t),e=e.sibling}function Hl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Hl(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=pi(t.default,t.share),t!==`none`&&(zl(e,n,t,null,!1)||Vl(e.child,!1))}e=e.sibling}}function Ul(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=di(r,n),a=pi(r.default,n.paired?r.share:r.enter);a===`none`?Hl(e):zl(e,i,a,null,!1)?(Hl(e),n.paired||t||Md(e,r.onEnter)):Vl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e,t),e=e.sibling;else Hl(e)}function Wl(e){if(Pl!==null&&Pl.size!==0){var t=Pl;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=pi(n.default,n.share);if(a!==`none`&&(zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):Vl(e.child,!1)),t.delete(r),t.size===0)break}}}Wl(e)}e=e.sibling}}}function Gl(e){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode),r=Pl===null?void 0:Pl.get(n),i=pi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(zl(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Pl.delete(n),Md(e,t.onShare)):Vl(e.child,!1)),Pl!==null&&Wl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e),e=e.sibling;else Pl!==null&&Wl(e)}function Kl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode);t=pi(t.default,t.update),e.flags&=-5,t!==`none`&&zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Kl(e);e=e.sibling}}function ql(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,Vl(e.child,!1))}ql(e)}e=e.sibling}}function Jl(e){if(e.tag===30)e.stateNode.paired=null,Vl(e.child,!1),ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else ql(e)}function Yl(e){for(e=e.child;e!==null;)e.tag===30?Vl(e.child,!1):e.subtreeFlags&33554432&&Yl(e),e=e.sibling}function Xl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Rl<a.length){var l=a[Rl],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&&Ep(c,Rl===0?n:n+`_`+Rl,i),s&&e.flags&4||(Il===null&&(Il=[]),Il.push(c,Rl===0?r:r+`_`+Rl,t.memoizedProps)),Rl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Xl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Zl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=di(n,r),a=pi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ap)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Rl=0,i=Xl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&Zl(e,t);e=e.sibling}}var Ql=!1,$l=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,ru=null,iu=!1,au=!1,ou=!1,su=!1;function cu(e,t,n){if(e=e.containerInfo,cp=gh,e=Vr(e),Hr(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(lp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,ru=t,t=n?9270:1024;ru!==null;){if(e=ru,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Gl(r[a]);if(e.alternate===null&&e.flags&2)n&&Fl(e),lu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Gl(r),lu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Fl(e),lu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ru=r):(n&&Kl(e),lu(n))}}Pl=null}function lu(e){for(;ru!==null;){var t=ru,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=hc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){pf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(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=di(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=pi(a.default,a.update),a!==`none`&&zl(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,ru=r;break}ru=t.return}}function uu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Au(e,n),r&4&&hl(5,n);break;case 1:if(Au(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){pf(n,n.return,e)}else{var i=hc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){pf(n,n.return,e)}}}r&64&&_l(n),r&512&&yl(n,n.return);break;case 3:if(Au(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{go(e,t)}catch(e){pf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ml(n);case 26:case 5:Au(e,n),t===null&&r&4&&El(n),r&512&&yl(n,n.return);break;case 12:Au(e,n);break;case 31:Au(e,n),r&4&&yu(e,n);break;case 13:Au(e,n),r&4&&bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||Ql,!r){var a=t!==null&&t.memoizedState!==null||$l;t=Ql,i=$l,Ql=r,($l=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Mu(e,n,r)):Au(e,n),Ql=t,$l=i}break;case 30:Au(e,n),r&512&&yl(n,n.return);break;case 7:r&512&&yl(n,n.return);default:Au(e,n)}}function du(e,t){for(e=e.child;e!==null;)fu(e,t),e=e.sibling}function fu(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){pf(e,e.return,t)}pu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,U=!0}catch(t){pf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Tp(s,!0):Tp(e.stateNode,!1)}catch(t){pf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&du(e,t);break;default:du(e,t)}}function pu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:fu(n,r);break a;case 22:n.memoizedState===null&&pu(n,r);break a;default:pu(n,r)}}e=e.sibling}}function mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kt(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 hu=null,gu=!1;function _u(e,t,n){for(n=n.child;n!==null;)vu(e,t,n),n=n.sibling}function vu(e,t,n){if(Je&&typeof Je.onCommitFiberUnmount==`function`)try{Je.onCommitFiberUnmount(qe,n)}catch{}switch(n.tag){case 26:$l||bl(n,t),_u(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$l&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$l||bl(n,t),Cl(n);var r=hu,i=gu;Cp(n.type)&&(hu=n.stateNode,gu=!1),_u(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),hu=r,gu=i;break;case 5:$l||bl(n,t),Cl(n);case 6:if(n.tag===6&&Cl(n),r=hu,i=gu,hu=null,_u(e,t,n),hu=r,gu=i,hu!==null){if(gu)try{(hu.nodeType===9?hu.body:hu.nodeName===`HTML`?hu.ownerDocument.body:hu).removeChild(n.stateNode),U=!0}catch(e){pf(n,t,e)}else try{hu.removeChild(n.stateNode),U=!0}catch(e){pf(n,t,e)}}break;case 18:hu!==null&&(gu?(e=hu,wp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):wp(hu,n.stateNode));break;case 4:r=hu,i=gu,hu=n.stateNode.containerInfo,gu=!0,_u(e,t,n),hu=r,gu=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),$l||gl(4,n,t),_u(e,t,n);break;case 1:$l||(bl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&vl(n,t,r)),_u(e,t,n);break;case 21:_u(e,t,n);break;case 22:$l=(r=$l)||n.memoizedState!==null,_u(e,t,n),$l=r;break;case 30:bl(n,t),_u(e,t,n);break;case 7:$l||bl(n,t),_u(e,t,n);break;default:_u(e,t,n)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){pf(t,t.return,e)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){pf(t,t.return,e)}}function xu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function Su(e,t){var n=xu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Cu(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(Cp(l.type)){hu=l.stateNode,gu=!1;break a}break;case 5:hu=l.stateNode,gu=!1;break a;case 3:case 4:hu=l.stateNode.containerInfo,gu=!0;break a}l=l.return}if(hu===null)throw Error(i(160));vu(s,c,o),hu=null,gu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tu(t,e,n),t=t.sibling}var wu=null;function Tu(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}Cu(t,e,n),Eu(e),a&4&&(gl(3,e,e.return),hl(3,e),gl(5,e,e.return));break;case 1:Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),a&64&&Ql&&(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=wu,Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(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(Ql)e.stateNode=pp(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[Dt]||r[bt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),rp(r,t,n),r[bt]=e,Pt(r),t=r;break a;case`link`:if(o=Gm(`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),rp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`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),rp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[bt]=e,Pt(r),t=r}e.stateNode=t}}else Ql||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Dl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||$l||t.parentNode.removeChild(t)):a.count--,n===null?Ql||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),r!==null&&a&4&&Dl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Cu(t,e,n),eu=o,Eu(e),a&512&&($l||r===null||bl(r,r.return)),e.flags&32){t=e.stateNode;try{on(t,``),U=!0}catch(t){pf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Dl(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Cu(t,e,n),Eu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,U=!0}catch(t){pf(e,e.return,t)}}break;case 3:if(U=!1,Wm=null,o=wu,wu=bm(t.containerInfo),Cu(t,e,n),wu=o,Eu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){pf(e,e.return,t)}tu&&(tu=!1,Du(e)),U=!1;break;case 4:a=eu,eu=Ql,r=Ht(),o=wu,wu=bm(e.stateNode.containerInfo),Cu(t,e,n),Eu(e),wu=o,U&&au&&(ou=!0),U=r,eu=a;break;case 12:Cu(t,e,n),Eu(e);break;case 31:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 13:Cu(t,e,n),Eu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pd=Re()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Ql,l=$l,u=eu;Ql=c||o,eu=u||o,$l=l||s,Cu(t,e,n),$l=l,eu=u,Ql=c,Eu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Ql||$l||(t=s||$l,n=Ql,r=$l,Ql=o||Ql,$l=t,ju(e,2),Ql=n,$l=r),!o&&eu||du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Su(e,n))));break;case 19:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 30:a&512&&($l||r===null||bl(r,r.return)),a=Ht(),o=au,s=(n&335544064)===n,c=e.memoizedProps,au=s&&pi(c.default,c.update)!==`none`,Cu(t,e,n),Eu(e),s&&r!==null&&U&&(e.flags|=4),au=o,U=a;break;case 21:break;case 7:a&512&&($l||r===null||bl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Cu(t,e,n),Eu(e)}}function Eu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ol(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Tl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(wl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;jl(e,kl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(on(l,``),n.flags&=-33),jl(e,kl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Al(e,kl(e),u,s);break;default:throw Error(i(161))}}catch(t){pf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Du(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Du(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Ou(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ku(t,e),t=t.sibling;else Zl(t,!1)}function ku(e,t){var n=e.alternate;if(n===null)Ul(e,!1);else switch(e.tag){case 3:if(su=iu=!1,Ll(),Ou(t,e),!iu&&!ou){if(e=Il,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Dp(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}Il=null;break;case 5:Ou(t,e);break;case 4:r=iu,iu=!1,Ou(t,e),iu&&(ou=!0),iu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ou(t,e):Ul(e,!1));break;case 30:r=iu,i=Ll(),iu=!1,Ou(t,e),iu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=di(a,o),o=di(n.memoizedProps,o);var s=pi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Rl=0,t=Xl(e,n,t,o,s,a,!0),Rl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Il=i):i!==null&&(i.push.apply(i,Il),Il=i),iu=e.flags&32?!0:r;break;default:Ou(t,e)}}function Au(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uu(e,t.alternate,t),t=t.sibling}function ju(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:gl(4,n,n.return),ju(n,r);break;case 1:bl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&vl(n,n.return,i),ju(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:bl(n,n.return),n.tag!==5&&n.tag!==27||Cl(n),ju(n,r);break;case 6:Cl(n);break;case 26:bl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||$l||i.parentNode.removeChild(i),ju(n,r);break;case 22:n.memoizedState===null&&ju(n,r);break;case 30:bl(n,n.return),ju(n,r);break;case 7:bl(n,n.return);default:ju(n,r)}e=e.sibling}}function Mu(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:Mu(i,a,n),hl(4,a);break;case 1:if(Mu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){pf(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++)ho(l[i],c)}catch(e){pf(r,r.return,e)}}s&&o&64&&_l(a),yl(a,a.return);break;case 27:n&2&&Ml(a);case 5:a.tag!==5&&a.tag!==27||Sl(a),Mu(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 6:Sl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Ql||Km(bm(c.ownerDocument),a.type,c),Mu(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 12:Mu(i,a,n);break;case 31:Mu(i,a,n),s&&o&4&&yu(i,a);break;case 13:Mu(i,a,n),s&&o&4&&bu(i,a);break;case 22:a.memoizedState===null&&Mu(i,a,n),yl(a,a.return);break;case 30:Mu(i,a,n),yl(a,a.return);break;case 7:yl(a,a.return);default:Mu(i,a,n)}t=t.sibling}}function Nu(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&&wa(n))}function Pu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wa(e))}function Fu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Iu(e,t,n,r),t=t.sibling;else i&&Yl(t)}function Iu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Jl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fu(e,t,n,r),a&2048&&hl(9,t);break;case 1:Fu(e,t,n,r);break;case 3:Fu(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&&wa(a)));break;case 12:if(a&2048){Fu(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){pf(t,t.return,e)}}else Fu(e,t,n,r);break;case 31:Fu(e,t,n,r);break;case 13:Fu(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&&Jl(t),o._visibility&2?Fu(e,t,n,r):(o._visibility|=2,Lu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Jl(s),o._visibility&2?Fu(e,t,n,r):Ru(e,t)),a&2048&&Nu(s,t);break;case 24:Fu(e,t,n,r),a&2048&&Pu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Vl(a.child,!0),Vl(t.child,!0))),Fu(e,t,n,r);break;default:Fu(e,t,n,r)}}function Lu(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:Lu(a,o,s,c,i),hl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Lu(a,o,s,c,i)):u._visibility&2?Lu(a,o,s,c,i):Ru(a,o),i&&l&2048&&Nu(o.alternate,o);break;case 24:Lu(a,o,s,c,i),i&&l&2048&&Pu(o.alternate,o);break;default:Lu(a,o,s,c,i)}t=t.sibling}}function Ru(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:Ru(n,r),i&2048&&Nu(r.alternate,r);break;case 24:Ru(n,r),i&2048&&Pu(r.alternate,r);break;default:Ru(n,r)}t=t.sibling}}var zu=8192;function Bu(e,t,n){if(e.subtreeFlags&zu)for(e=e.child;e!==null;)Vu(e,t,n),e=e.sibling}function Vu(e,t,n){switch(e.tag){case 26:Bu(e,t,n),e.flags&zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,wu,e.memoizedState,e.memoizedProps));break;case 5:Bu(e,t,n),e.flags&zu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=wu;wu=bm(e.stateNode.containerInfo),Bu(e,t,n),wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zu,zu=16777216,Bu(e,t,n),zu=r):Bu(e,t,n));break;case 30:if((e.flags&zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Pl===null&&(Pl=new Map),Pl.set(r,i)}Bu(e,t,n);break;default:Bu(e,t,n)}}function Hu(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 Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Wu(e),e=e.sibling}function Wu(e){switch(e.tag){case 0:case 11:case 15:Uu(e),e.flags&2048&&gl(9,e,e.return);break;case 3:Uu(e);break;case 12:Uu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gu(e)):Uu(e);break;default:Uu(e)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gl(8,t,t.return),Gu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gu(t));break;default:Gu(t)}e=e.sibling}}function Ku(e,t){for(;ru!==null;){var n=ru;switch(n.tag){case 0:case 11:case 15:gl(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:wa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ru=r;else a:for(n=e;ru!==null;){r=ru;var i=r.sibling,a=r.return;if(mu(r),r===n){ru=null;break a}if(i!==null){i.return=a,ru=i;break a}ru=a}}}var qu={getCacheForType:function(e){var t=ga(Sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ga(Sa).controller.signal}},Ju=typeof WeakMap==`function`?WeakMap:Map,Yu=0,Xu=null,Z=null,Zu=0,Qu=0,$u=null,ed=!1,td=!1,nd=!1,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=null,dd=null,fd=!1,pd=0,md=0,hd=1/0,gd=null,_d=null,vd=0,yd=null,bd=null,xd=0,Sd=0,Cd=null,wd=null,Td=null,Ed=null,Dd=null,Od=0,kd=null;function Ad(){return Yu&2&&Zu!==0?Zu&-Zu:z.T===null?_t():Pf()}function jd(){if(cd===0){if(!(Zu&536870912)||Y){var e=tt;tt<<=1,!(tt&3932160)&&(tt=262144),cd=e}else cd=536870912}return e=So.current,e!==null&&(e.flags|=32),cd}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Fp(di(e.memoizedProps,n))),Ed===null&&(Ed=[]),Ed.push(t.bind(null,r))}}function Nd(e,t,n){(e===Xu&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)&&(Bd(e,0),Ld(e,Zu,cd,!1)),ut(e,n),Yu&2&&e===Xu||(e===Xu&&(!(Yu&2)&&(od|=n),id===4&&Ld(e,Zu,cd,!1)),Ef(e))}function Pd(e,t,n){if(Yu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||at(e,t),a=r?Jd(e,t):Kd(e,t,!0),o=r;do{if(a===0){td&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n))a=Kd(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=ud;var l=c.current.memoizedState.isDehydrated;if(l&&(Bd(c,s).flags|=256),s=Kd(c,s,!1),s!==2&&s!==6){if(nd&&!l){c.errorRecoveryDisabledLanes|=o,od|=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){Bd(e,0),Ld(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:Ld(r,t,cd,!ed);break a;case 2:dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=pd+300-Re(),10<a)){if(Ld(r,t,cd,!ed),it(r,0,!0)!==0)break a;xd=t,r.timeoutHandle=_p(Fd.bind(null,r,n,dd,gd,fd,t,cd,od,ld,ed,o,`Throttled`,-0,0),a);break a}Fd(r,n,dd,gd,fd,t,cd,od,ld,ed,o,null,-0,0)}break}}while(1);Ef(e)}function Fd(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:mn},Pl=null,Vu(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=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?pd-Re():(a&4194048)===a?md-Re():0,m=eh(d,m),m!==null)?(xd=a,e.cancelPendingCommit=m(tf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l)):tf(e,t,a,n,r,i,o,s,c,l,u,d)}function Id(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(!Fr(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 Ld(e,t,n,r){t=ot(e,t),t&=~sd,t&=~od,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Xe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ft(e,n,t)}function Rd(){return Yu&6?!0:(Df(0,!1),!1)}function zd(){if(Z!==null){if(Qu===0)var e=Z.return;else e=Z,ca=sa=null,Zo(e),Xa=null,Za=0,e=Z;for(;e!==null;)ml(e.alternate,e),e=e.return;Z=null}}function Bd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,vp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xd=0,zd(),Xu=e,Z=n=Oi(e.current,null),Zu=t,Qu=0,$u=null,ed=!1,td=at(e,t),nd=!1,ld=cd=sd=od=ad=id=0,dd=ud=null,fd=!1,rd=ot(e,t),vi(),n}function Vd(e,t){X=null,z.H=sc,t===Ba||t===Ha?(t=Ja(),Qu=3):t===Va?(t=Ja(),Qu=4):Qu=t===Tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,$u=t,Z===null&&(id=1,yc(e,Ii(t,e.current)))}function Hd(){var e=So.current;return e===null?!0:(Zu&4194048)===Zu?Co===null:(Zu&62914560)===Zu||Zu&536870912?e===Co:!1}function Ud(){var e=z.H;return z.H=sc,e===null?sc:e}function Wd(){var e=z.A;return z.A=qu,e}function Gd(){id=4,ed||(Zu&4194048)!==Zu&&So.current!==null||(td=!0),!(ad&134217727)&&!(od&134217727)||Xu===null||Ld(Xu,Zu,cd,!1)}function Kd(e,t,n){var r=Yu;Yu|=2;var i=Ud(),a=Wd();(Xu!==e||Zu!==t)&&(gd=null,Bd(e,t)),t=!1;var o=id;a:do try{if(Qu!==0&&Z!==null){var s=Z,c=$u;switch(Qu){case 8:zd(),o=6;break a;case 3:case 2:case 9:case 6:So.current===null&&(t=!0);var l=Qu;if(Qu=0,$u=null,Qd(e,s,c,l),n&&td){o=0;break a}break;default:l=Qu,Qu=0,$u=null,Qd(e,s,c,l)}}qd(),o=id;break}catch(t){Vd(e,t)}while(1);return t&&e.shellSuspendCounter++,ca=sa=null,Yu=r,z.H=i,z.A=a,Z===null&&(Xu=null,Zu=0,vi()),o}function qd(){for(;Z!==null;)Xd(Z)}function Jd(e,t){var n=Yu;Yu|=2;var r=Ud(),a=Wd();Xu!==e||Zu!==t?(gd=null,hd=Re()+500,Bd(e,t)):td=at(e,t);a:do try{if(Qu!==0&&Z!==null){t=Z;var o=$u;b:switch(Qu){case 1:Qu=0,$u=null,Qd(e,t,o,1);break;case 2:case 9:if(Wa(o)){Qu=0,$u=null,Zd(t);break}t=function(){Qu!==2&&Qu!==9||Xu!==e||(Qu=7),Ef(e)},o.then(t,t);break a;case 3:Qu=7;break a;case 4:Qu=5;break a;case 7:Wa(o)?(Qu=0,$u=null,Zd(t)):(Qu=0,$u=null,Qd(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Ym(s):c.stateNode.complete){Qu=0,$u=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,$d(u))}break b}}Qu=0,$u=null,Qd(e,t,o,5);break;case 6:Qu=0,$u=null,Qd(e,t,o,6);break;case 8:zd(),id=6;break a;default:throw Error(i(462))}}Yd();break}catch(t){Vd(e,t)}while(1);return ca=sa=null,z.H=r,z.A=a,Yu=n,Z===null?(Xu=null,Zu=0,vi(),id):0}function Yd(){for(;Z!==null&&!Ie();)Xd(Z)}function Xd(e){var t=al(e.alternate,e,rd);e.memoizedProps=e.pendingProps,t===null?$d(e):Z=t}function Zd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=zc(n,t,t.pendingProps,t.type,void 0,Zu);break;case 11:t=zc(n,t,t.pendingProps,t.type.render,t.ref,Zu);break;case 5:Zo(t);var r=t;r===Ji&&(Y?(ta(r),r.tag===5&&r.stateNode!=null&&(Yi=r.stateNode)):(ta(r),Y=!0));default:ml(n,t),t=Z=ki(t,rd),t=al(n,t,rd)}e.memoizedProps=e.pendingProps,t===null?$d(e):Z=t}function Qd(e,t,n,r){ca=sa=null,Zo(t),Xa=null,Za=0;var i=t.return;try{if(wc(e,i,t,n,Zu)){id=1,yc(e,Ii(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;id=1,yc(e,Ii(n,e.current)),Z=null;return}t.flags&32768?(Y||r===1?e=!0:td||Zu&536870912?e=!1:(ed=e=!0,(r===2||r===9||r===3||r===6)&&(r=So.current,r!==null&&r.tag===13&&(r.flags|=16384))),ef(t,e)):$d(t)}function $d(e){var t=e;do{if(t.flags&32768){ef(t,ed);return}e=t.return;var n=fl(t.alternate,t,rd);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);id===0&&(id=5)}function ef(e,t){do{var n=pl(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);id=6,Z=null}function tf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do uf();while(vd!==0);if(Yu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Z=Xu=null,Zu=0),bd=t,yd=e,xd=n,Cd=a,wd=r,nf(e,t,n,s,c,l,f)}}function nf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Sd=s,s|=_i,dt(e,n,s,r,i,a),Ed=null,(n&335544064)===n?(Dd=Da(e),r=10262):(Dd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(He,function(){return df(),null})):(e.callbackNode=null,e.callbackPriority=0),Nl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=z.T,z.T=null,i=B.p,B.p=2,a=Yu,Yu|=4;try{cu(e,t,n)}finally{Yu=a,B.p=i,z.T=r}}vd=1,Nl?Td=Np(o,e.containerInfo,Dd,of,sf,af,cf,df,rf,null,null):(of(),sf(),cf())}function rf(e){if(vd!==0){var t=yd.onRecoverableError;t(e,{componentStack:null})}}function af(){vd===3&&(vd=0,ku(bd,yd),vd=4)}function of(){if(vd===1){vd=0;var e=yd,t=bd,n=xd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=z.T,z.T=null;var i=B.p;B.p=2;var a=Yu;Yu|=4;try{au=ou=!1,Tu(t,e,n),n=lp;var o=Vr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Br(s.ownerDocument.documentElement,s)){if(c!==null&&Hr(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 _=zr(s,h),v=zr(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}}gh=!!cp,lp=cp=null}finally{Yu=a,B.p=i,z.T=r}}e.current=t,vd=2}}function sf(){if(vd===2){vd=0;var e=yd,t=bd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=z.T,z.T=null;var r=B.p;B.p=2;var i=Yu;Yu|=4;try{uu(e,t.alternate,t)}finally{Yu=i,B.p=r,z.T=n}}vd=3}}function cf(){if(vd===4||vd===3){vd=0;var e=Td;Td=null,Le();var t=yd,n=bd,r=xd,i=wd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?vd=5:(vd=0,bd=yd=null,lf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(_d=null),gt(r),n=n.stateNode,Je&&typeof Je.onCommitFiberRoot==`function`)try{Je.onCommitFiberRoot(qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=z.T,a=B.p,B.p=2,z.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{z.T=n,B.p=a}}if(i=Ed,o=Dd,Dd=null,i!==null&&(Ed=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);xd&3&&uf(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===kd?Od++:(Od=0,kd=t):(Od=0,kd=null),Df(0,!1)}}function lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,wa(t)))}function uf(){return Td!==null&&(Td.skipTransition(),Td=null),of(),sf(),cf(),df()}function df(){if(vd!==5)return!1;var e=yd,t=Sd;Sd=0;var n=gt(xd),r=z.T,a=B.p;try{B.p=32>n?32:n,z.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,Yu&6)throw Error(i(331));var c=Yu;if(Yu|=4,Wu(o.current),Iu(o,o.current,s,n),Yu=c,Df(0,!1),Je&&typeof Je.onPostCommitFiberRoot==`function`)try{Je.onPostCommitFiberRoot(qe,o)}catch{}return!0}finally{B.p=a,z.T=r,lf(e,t)}}function ff(e,t,n){t=Ii(n,t),t=xc(e.stateNode,t,2),e=co(e,t,2),e!==null&&(ut(e,2),Ef(e))}function pf(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=Ii(n,e),n=Sc(2),r=co(t,n,2),r!==null&&(Cc(n,r,t,e),ut(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ju;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)||(nd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Zu&n)===n&&(id===4||id===3&&(Zu&62914560)===Zu&&300>Re()-pd?Yu&2?sd|=n:Bd(e,0):sd|=n,ld===Zu&&(ld=0)),Ef(e)}function gf(e,t){t===0&&(t=ct()),e=xi(e,t),e!==null&&(ut(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(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),gf(e,n)}function yf(e,t){return Pe(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;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-Xe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Zu,a=it(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||at(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&gp()&&(e=Tf);for(var t=Re(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}vd!==0&&vd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Xe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=st(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Zu,n=it(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Fe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||at(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Fe(r),gt(n)){case 2:case 8:n=Ve;break;case 32:n=He;break;case 268435456:n=We;break;default:n=He}return r=jf.bind(null,e),n=Pe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Fe(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(vd!==0&&vd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(uf()&&e.callbackNode!==n)return null;var r=Zu;return r=it(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),Af(e,Re()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(uf())return null;Pd(e,t,!0)}function Nf(){xp(function(){Yu&6?Pe(Be,Of):kf()})}function Pf(){if(Tf===0){var e=Aa;e===0&&(e=et,et<<=1,!(et&261888)&&(et=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:pn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[xt]||null).action),o=r.submitter;o&&(t=(t=o[xt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Fn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<ci.length;Lf++){var Rf=ci[Lf];li(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}li(ei,`onAnimationEnd`),li(ti,`onAnimationIteration`),li(ni,`onAnimationStart`),li(`dblclick`,`onDoubleClick`),li(`focusin`,`onFocus`),li(`focusout`,`onBlur`),li(ri,`onTransitionRun`),li(ii,`onTransitionStart`),li(ai,`onTransitionCancel`),li(oi,`onTransitionEnd`),Rt(`onMouseEnter`,[`mouseout`,`mouseover`]),Rt(`onMouseLeave`,[`mouseout`,`mouseover`]),Rt(`onPointerEnter`,[`pointerout`,`pointerover`]),Rt(`onPointerLeave`,[`pointerout`,`pointerover`]),V(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),V(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),V(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),V(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),V(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),V(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(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){mi(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){mi(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Ct];n===void 0&&(n=t[Ct]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,It.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!wn||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 Kf(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=At(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}xn(function(){var r=a,i=gn(n),s=[];a:{var c=si.get(e);if(c!==void 0){var l=Fn,u=e;switch(e){case`keypress`:if(An(n)===0)break a;case`keydown`:case`keyup`:l=Qn;break;case`focusin`:u=`focus`,l=Wn;break;case`focusout`:u=`blur`,l=Wn;break;case`beforeblur`:case`afterblur`:l=Wn;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=Hn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Un;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=er;break;case ei:case ti:case ni:l=Gn;break;case oi:l=tr;break;case`scroll`:case`scrollend`:l=Ln;break;case`wheel`:l=nr;break;case`copy`:case`cut`:case`paste`:l=Kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=G;break;case`submit`:l=$n;break;case`toggle`:case`beforetoggle`:l=rr}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=Sn(m,p),g!=null&&d.push(qf(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!==hn&&(u=n.relatedTarget||n.fromElement)&&(At(u)||u[St]))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?At(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=Hn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=G,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Mt(c),h=l==null?u:Mt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,At(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,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?Mt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Cr;else if(_r(c)){if(wr)_=Nr;else{_=jr;var v=Ar}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&un(r.elementType)&&(_=Cr):_=Mr;if(_&&=_(e,r)){vr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Mt(r):window,e){case`focusin`:(_r(v)||v.contentEditable===`true`)&&(Wr=v,Gr=r,Kr=null);break;case`focusout`:Kr=Gr=Wr=null;break;case`mousedown`:qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:qr=!1,Jr(s,n,i);break;case`selectionchange`:if(Ur)break;case`keydown`:case`keyup`:Jr(s,n,i)}var y;if(ar)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 pr?dr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(cr&&n.locale!==`ko`&&(pr||b!==`onCompositionStart`?b===`onCompositionEnd`&&pr&&(y=kn()):(En=i,Dn=`value`in En?En.value:En.textContent,pr=!0)),v=Jf(r,b),0<v.length&&(b=new qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=fr(n),y!==null&&(b.data=y)))),(y=sr?mr(e,n):hr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(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=Sn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=Sn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(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=Sn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=Sn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
|
|
10
|
-
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function tp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||on(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&on(e,``+r);else return;break;case`className`:Wt(e,`class`,r);break;case`tabIndex`:Wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Wt(e,n,r);break;case`style`:ln(e,r,o);return;case`data`:if(t!==`object`){Wt(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=pn(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`&&tp(e,t,`name`,a.name,a,null),tp(e,t,`formEncType`,a.formEncType,a,null),tp(e,t,`formMethod`,a.formMethod,a,null),tp(e,t,`formTarget`,a.formTarget,a,null)):(tp(e,t,`encType`,a.encType,a,null),tp(e,t,`method`,a.method,a,null),tp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=mn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`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=pn(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`:Q(`beforetoggle`,e),Q(`toggle`,e),Ut(e,`popover`,r);break;case`xlinkActuate`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ut(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=dn.get(n)||n,Ut(e,n,r);else return}U=!0}function np(e,t,n,r,a,o){switch(n){case`style`:ln(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`)on(e,r);else if(typeof r==`number`||typeof r==`bigint`)on(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=mn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Lt.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[xt]||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}U=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ut(e,n,r)}return}U=!0}function rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`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:tp(e,t,o,s,n,null)}}a&&tp(e,t,`srcSet`,n.srcSet,n,null),r&&tp(e,t,`src`,n.src,n,null);return;case`input`:Q(`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:tp(e,t,r,d,n,null)}}en(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`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:tp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&nn(e,!!r,n,!0):nn(e,!!r,t,!1);return;case`textarea`:for(s in Q(`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:tp(e,t,s,c,n,null)}an(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:tp(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`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:tp(e,t,u,r,n,null)}return;default:if(un(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&tp(e,t,c,r,n,null))}var ip={};function ap(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)||tp(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&&(U=!0),o=m;break;case`name`:m!==f&&(U=!0),a=m;break;case`checked`:m!==f&&(U=!0),u=m;break;case`defaultChecked`:m!==f&&(U=!0),d=m;break;case`value`:m!==f&&(U=!0),s=m;break;case`defaultValue`:m!==f&&(U=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&tp(e,t,p,m,r,f)}}$t(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)||tp(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&&(U=!0),p=o;break;case`defaultValue`:o!==l&&(U=!0),c=o;break;case`multiple`:o!==l&&(U=!0),s=o;default:o!==l&&tp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?nn(e,!!n,n?[]:``,!1):nn(e,!!n,t,!0)):nn(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:tp(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&&(U=!0),p=a;break;case`defaultValue`:a!==o&&(U=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&tp(e,t,s,a,r,o)}rn(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:tp(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&&(U=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:tp(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)&&tp(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:tp(e,t,u,p,r,m)}return;default:if(un(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(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||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&tp(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||tp(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){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&&op(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&&op(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 cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 fp(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 pp(e,t,n,r){return n=up(n).createElement(e),n[bt]=r,n[xt]=t,rp(n,e,t),Pt(n),n}function mp(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 hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(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),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Dt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function Tp(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 Ep(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 Dp(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 Op(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 Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(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+=Xm(f),u>$m){s.length=o;break}f=new Promise(Mp.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 Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.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},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.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(Vp(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=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(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,zp(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,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=_(e),pm(e,t))}Ip.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=up(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,mm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(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=_(e),t.push.apply(t,e.getClientRects());return!1}Ip.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Up,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(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=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(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=_(n[0]),i=_(n[n.length-1]);var a=m(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||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=At(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=p(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:(f(t,!0,x,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(f(t,!0,S,a,r),a=v,b=v=null,t=a!==null)),t):!1}function Qp(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)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Up,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),Qp(e,n);return}if(r=_(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=_(a),Qp(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=_(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function $(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,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function tm(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,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(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`:nm(n),kt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(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[Dt])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=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(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 lm(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 um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(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 pm(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){bp(function(){bp(function(t){return e(t)})})}function hm(e,t,n){switch(t=up(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 gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&tp(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===mn&&(e.onclick=null),kt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kt(e)}var vm=new Map,ym=new Set;function bm(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 xm=B.d;B.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Rd();return e||t}function Cm(e){var t=jt(e);t!==null&&t.tag===5&&t.type===`form`?Ys(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=Qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),Pt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Qt(n.imageSizes)+`"]`)):i+=`[href="`+Qt(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[Ot]=!0,o.onload=o.onerror=function(){Ft(o)}),Pt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Qt(r)+`"][href="`+Qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),Pt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Nt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Pt(c),rp(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,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Nt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Pt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Nt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Pt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=be.current)?bm(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=Pm(n.href),t=Nt(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=Pm(n.href);var o=Nt(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(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.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},vm.set(e,o)),Lm(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=Rm(n),t=Nt(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 Pm(e){return`href="`+Qt(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ot]){r.loading=1;return}}else t=e.createElement(`link`),t[Ot]=!0,t.onload=t.onerror=Ft.bind(null,t),rp(t,`link`,n),Pt(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 Rm(e){return`[src="`+Qt(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Qt(n.href)+`"]`);if(r)return t.instance=r,Pt(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`),Pt(r),rp(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Pt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Pt(a),a):(r=n,(a=vm.get(o))&&(r=T({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Pt(a),rp(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,Vm(r,n.precedence,e));return t.instance}function Vm(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 Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,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[Dt]||a[bt]||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 Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(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 Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(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=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Pt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(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=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.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=nh.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 sh={$$typeof:N,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function ch(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=lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lt(0),this.hiddenUpdates=lt(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 lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ei(3,null,null,t),e.current=a,a.stateNode=e,t=Ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ao(a),e}function uh(e){return e?(e=wi,e):wi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=so(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=co(e,r,t),n!==null&&(Nd(n,e,t),lo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=xi(e,67108864);t!==null&&Nd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Ad();t=ht(t);var n=xi(e,t);n!==null&&Nd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=z.T;z.T=null;var a=B.p;try{B.p=2,yh(e,t,n,r)}finally{B.p=a,z.T=i}}function vh(e,t,n,r){var i=z.T;z.T=null;var a=B.p;try{B.p=8,yh(e,t,n,r)}finally{B.p=a,z.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=jt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=rt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Xe(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(Yu&6)&&(hd=Re()+500,Df(0,!1))}}break;case 31:case 13:s=xi(a,2),s!==null&&Nd(s,a,2),Rd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=gn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=At(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 xh=e,null}function Ch(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(ze()){case Be:return 2;case Ve:return 8;case He:case Ue:return 32;case We:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(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=jt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=At(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,vt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,vt(e.priority,function(){hh(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);hn=r,n.target.dispatchEvent(r),hn=null}else return t=jt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=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(Sh(r||n)===null)continue;break}var a=jt(n);a!==null&&(e.splice(t,3),t-=3,qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.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[xt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[xt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){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 Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,Ad(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Rd(),t[St]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=_t();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(i(527,Kh,`19.3.1`));B.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:z,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{qe=Jh.inject(qh),Je=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=gc,s=_c,c=vc;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=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[St]=t.current,Wf(e),new Wh(t)}})),xe=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=be()})),Se=ye(),Ce=xe(),we=`Revise the manuscript according to these notes the author marked on the compiled PDF.`,Te=` PDF text: "`,Ee=` Marked region: a figure, equation or other non-text area`,De=`
|
|
11
|
-
Note: `;function Oe(e){if(e.anchor)return e.anchor;let t=e.where.match(/^Round (\d+)\b/),n=[];for(let t of e.where.split(/ · |; /)){let e=t.match(/^(.+?)(?::| lines? )(\d+(?:[–-]\d+)?(?:,\s*\d+(?:[–-]\d+)?)*)$/);if(e)for(let t of e[2].split(/,\s*/)){let[r,i]=t.split(/[–-]/).map(Number);n.push({file:e[1],lines:[r,i??r]})}}return{sources:n,...t?{round:Number(t[1])}:{}}}function ke(e){if(!e.startsWith(we))return null;let t=[];for(let n of e.split(/\n\n(?=\d+\. )/).slice(1)){let e=n.match(/^\d+\. (.*)\n/);if(!e)return null;let r=n.slice(e[0].length);if(r.startsWith(" LaTeX source of the marked region:\n ```latex\n")){let e=r.match(/\n {3}```\n(?= {3}(?:PDF text: "|Marked region: ))/);if(!e)return null;r=r.slice(e.index+e[0].length)}let i=r.indexOf(De);if(i<0)return null;let a=r.slice(0,i);if(a!==Ee&&!(a.startsWith(Te)&&a.endsWith(`"`)))return null;let o=e[1].endsWith(` · Color group: Blue`),s=o?`blue`:u.find(t=>e[1].endsWith(` · Color group: ${g[t]}`)),c=s?e[1].slice(0,-` · Color group: ${o?`Blue`:g[s]}`.length):e[1];t.push({...s?{group:s}:{},where:c,quote:a===Ee?``:a.slice(14,-1),comment:r.slice(i+10).replace(/\n {3}/g,`
|
|
12
|
-
`)})}return t.length?t:null}var Ae=e=>e===`Continue this task using the decisions and comments from this review round. Preserve accepted changes and do not reintroduce rejected edits. Address any remaining revision requests; if no revision is needed, summarize the result.`||e===`Address the comments from this review round. Preserve accepted changes and do not reintroduce rejected edits.`,je=/\.(aux|log|out|toc|lof|lot|lol|fls|fdb_latexmk|synctex(?:\.gz)?|bbl|blg|bcf|run\.xml|nav|snm|vrb|xdv|dvi|idx|ilg|ind|glo|gls|glg|ist|thm|loa)$/;function Me(e){let t=e.slice(e.lastIndexOf(`/`)+1);if(t===`.DS_Store`)return`.DS_Store`;if(/(?:^|\/)_minted[^/]*\//.test(e))return`_minted*/`;let n=je.exec(t);return n?`*.${n[1]}`:null}function Ne({label:e,actions:t,children:n,className:r=`icon-button more-button`,menuClassName:i=``,align:a=`end`,disabled:o}){let s=(0,S.useId)(),c=(0,S.useRef)(null),l=(0,S.useRef)(null),[u,d]=(0,S.useState)(!1);(0,S.useEffect)(()=>{if(!u)return;let e=()=>l.current?.hidePopover(),t=t=>{t.target instanceof Node&&t.target.contains(c.current)&&!l.current?.contains(t.target)&&e()};return window.addEventListener(`resize`,e),document.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,e),document.removeEventListener(`scroll`,t,!0)}},[u]);function f(){let e=l.current,t=c.current.getBoundingClientRect();a===`start`&&(e.style.minWidth=`${t.width}px`);let n=a===`start`?t.left:t.right-e.offsetWidth;e.style.left=`${Math.max(8,Math.min(n,window.innerWidth-e.offsetWidth-8))}px`;let r=t.bottom+6,i=t.top-e.offsetHeight-6;e.style.top=`${r+e.offsetHeight>window.innerHeight-8&&i>=8?i:Math.max(8,Math.min(r,window.innerHeight-e.offsetHeight-8))}px`}function p(){return Array.from(l.current.querySelectorAll(`[role^="menuitem"]:not(:disabled)`))}function m(){l.current?.hidePopover()}function h(e=!1){l.current?.showPopover(),f(),d(!0);let t=p();(e?t[t.length-1]:t.find(e=>e.getAttribute(`aria-checked`)===`true`)||t[0])?.focus()}let g=t.some(e=>e.checked!==void 0);return(0,C.jsxs)(`span`,{className:`menu-anchor`,children:[(0,C.jsx)(`button`,{ref:c,type:`button`,className:r,"aria-label":e,title:e,disabled:o,"aria-haspopup":`menu`,"aria-expanded":u,popoverTarget:s,onClick:e=>{e.preventDefault(),l.current?.matches(`:popover-open`)?m():h()},onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),h(e.key===`ArrowUp`))},children:n||(0,C.jsx)(T,{name:`more`,size:18})}),(0,C.jsx)(`div`,{ref:l,id:s,popover:`auto`,role:`menu`,"aria-label":e,className:`action-menu `+i,onToggle:e=>{let t=e.nativeEvent.newState===`open`;d(t)},onKeyDown:e=>{if(e.key===`Tab`)m(),c.current?.focus();else if(e.stopPropagation(),e.key===`Escape`)e.preventDefault(),m(),c.current?.focus();else if([`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){e.preventDefault();let t=p(),n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}},children:t.map(e=>{let t=(0,C.jsxs)(C.Fragment,{children:[e.icon?(0,C.jsx)(T,{name:e.icon,size:16}):g&&(0,C.jsx)(`span`,{className:`menu-check`,children:e.checked&&(0,C.jsx)(T,{name:`check`,size:16})}),(0,C.jsxs)(`span`,{className:`menu-label`,children:[e.label,e.detail&&(0,C.jsx)(`small`,{className:`menu-detail`,"aria-hidden":`true`,children:e.detail})]}),e.hint&&(0,C.jsx)(`span`,{className:`menu-hint`,"aria-hidden":`true`,children:e.hint}),e.icon&&e.checked&&(0,C.jsx)(`span`,{className:`menu-check`,children:(0,C.jsx)(T,{name:`check`,size:16})})]}),n=e.href?(0,C.jsx)(`a`,{role:`menuitem`,title:e.title,href:e.href,target:`_blank`,rel:`noreferrer`,onClick:m,children:t},e.id||e.label):(0,C.jsx)(`button`,{type:`button`,title:e.title,role:e.checked===void 0?`menuitem`:`menuitemradio`,"aria-checked":e.checked,disabled:e.disabled,className:e.danger?`danger-text`:void 0,"data-indent":e.indent||void 0,style:e.indent?{paddingLeft:10+e.indent*14}:void 0,onClick:()=>{m(),c.current?.focus(),e.select?.()},children:t},e.id||e.label),r=e.edit?(0,C.jsxs)(`div`,{className:`menu-item-row`,children:[n,(0,C.jsx)(`button`,{type:`button`,role:`menuitem`,className:`icon-button paper-actions`,"aria-label":e.edit.label,title:e.edit.label,"aria-haspopup":`dialog`,onClick:()=>{m(),c.current?.focus(),e.edit?.select()},children:(0,C.jsx)(T,{name:`pencil`,size:15})})]},e.id||e.label):n;return e.divider?[(0,C.jsx)(`div`,{role:`separator`,className:`menu-separator`},e.label+`-divider`),r]:r})})]})}var Pe={polish:`spark`,proofread:`spellcheck`,shorten:`compress`,"check-math":`sigma`,consistency:`checklist`,"latex-warnings":`tool`,"reviewer-response":`notes`},Fe=e=>Pe[e]||`spark`,Ie=e=>!e.source||e.source===`builtin`?R(e.name):e.name,Le=e=>e.source===`builtin`?R(e.description):e.description,Re=e=>/^\/([\p{L}\p{M}\p{N}_-]*)$/u.exec(e)?.[1].toLowerCase()??null;function ze(e,t){let n=e=>[e.id,e.name,Ie(e)].map(e=>e.toLowerCase().replace(/\s+/g,`-`)),r=e.filter(e=>n(e).some(e=>e.startsWith(t))),i=e.filter(e=>!r.includes(e)&&(n(e).some(e=>e.includes(t))||[e.description,Le(e)].some(e=>e.toLowerCase().includes(t))));return[...r,...i]}function Be({id:e,skills:t,active:n,onPick:r,onActive:i}){return(0,C.jsx)(`div`,{className:`skill-menu`,role:`listbox`,id:e,"aria-label":R(`Skills`),children:t.length?t.map((t,a)=>(0,C.jsxs)(`div`,{role:`option`,id:`${e}-${a}`,title:Le(t),"aria-selected":a===n,className:`skill-option`+(a===n?` active`:``),onPointerDown:e=>{e.preventDefault(),r(t)},onPointerEnter:()=>i(a),children:[(0,C.jsxs)(`span`,{className:`skill-name`,children:[(0,C.jsx)(T,{name:Fe(t.id),size:14}),Ie(t)]}),t.source!==`builtin`&&(0,C.jsx)(`span`,{className:`skill-source`,children:t.source===`paper`?R(`This paper`):R(`Yours`)})]},t.id)):(0,C.jsx)(`p`,{className:`skill-empty`,children:R(`No matching skills`)})})}function Ve({skill:e,onRemove:t}){let n=Ie(e);return(0,C.jsxs)(`span`,{className:`skill-chip`,title:R(`Skill: {name}`,{name:n}),children:[(0,C.jsx)(T,{name:Fe(e.id),size:13}),n,t&&(0,C.jsx)(`button`,{type:`button`,"aria-label":R(`Remove the {name} skill`,{name:n}),onClick:t,children:(0,C.jsx)(T,{name:`close`,size:12})})]})}function He({skills:e,selected:t,onPick:n,disabled:r,onAttach:i}){return!e.length&&!i?null:(0,C.jsx)(Ne,{label:R(i?`Add files or skills`:`Add skill`),className:`icon-button composer-plus`,menuClassName:`skills-picker-menu`,align:`start`,disabled:r,actions:[...i?[{label:R(`Add files…`),icon:`attachment`,select:i}]:[],...e.map((e,r)=>({id:e.id,label:Ie(e),title:Le(e),icon:Fe(e.id),divider:!!(i&&r===0),checked:t?.id===e.id,select:()=>n(t?.id===e.id?null:e)}))],children:(0,C.jsx)(T,{name:`plus`,size:19})})}var Ue=e=>e?.unsent??[`accepted`,`rejected`,`commented`].reduce((t,n)=>t+(e?.counts?.[n]||0),0),We=class{key;storage;newId;text;sending=!1;sendingSource=null;revision=0;requestKeys;listeners=new Set;snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.snapshot;changed(){this.snapshot={text:this.text,sending:this.sending,sendingSource:this.sendingSource};for(let e of this.listeners)e()}constructor(e,t,n){this.key=e,this.storage=t,this.newId=n,this.text=t.getItem(e)||``,this.requestKeys={draft:n(),feedback:n()},this.snapshot={text:this.text,sending:this.sending,sendingSource:this.sendingSource}}edit(e){this.text=e,this.revision++,this.requestKeys.draft=this.newId(),this.storage.setItem(this.key,e),this.changed()}async submit(e,t,n,r=[]){let i=e===`draft`?this.text:``;if(this.sending||e===`draft`&&!i.trim()&&!n&&!r.length)return!1;let a=this.key+`:request`;if(e===`draft`){let e=JSON.stringify([i.trim(),n||``,r]),t={};try{t=JSON.parse(this.storage.getItem(a)||`{}`)}catch{}this.requestKeys.draft=t?.signature===e&&t.id?t.id:this.newId(),this.storage.setItem(a,JSON.stringify({signature:e,id:this.requestKeys.draft}))}this.sending=!0,this.sendingSource=e,this.changed();let o=this.revision,s=this.requestKeys[e],c=this.storage.getItem(a);try{if(await t({text:i.trim(),requestKey:s,...e===`feedback`?{feedback:!0}:{},...n?{skill:n}:{},...e===`draft`&&r.length?{attachments:r}:{}}),e===`draft`&&this.storage.getItem(a)===c&&this.storage.removeItem(a),e===`draft`&&this.revision===o){let e=this.storage.getItem(this.key);e===i||e===null?(this.text=``,this.storage.removeItem(this.key)):this.text=e}return(e===`feedback`||this.revision===o)&&(this.requestKeys[e]=this.newId()),!0}finally{this.sending=!1,this.sendingSource=null,this.changed()}}};function Ge(e){let t=(e.split(`
|
|
13
|
-
`).find(e=>e.trim())||``).replace(/^[\s#>*+-]+/,``).replace(/\s+/g,` `).trim().replace(/\.$/,``);if(!t)return`Untitled task`;if(t.length<=80)return t;let n=t.slice(0,80),r=n.lastIndexOf(` `);return(r>40?n.slice(0,r):n).replace(/[\s,.;:]+$/,``)+`…`}function Ke(e,t){return e.key!==`Enter`||e.isComposing||e.keyCode===229?!1:e.metaKey||e.ctrlKey||!t&&!e.shiftKey&&!e.altKey}var qe=class{key;storage;entries=[];error=``;requests=new Map;listeners=new Set;snapshot={entries:this.entries,files:[],blocked:!1,error:``};subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.snapshot;constructor(e,t){this.key=e,this.storage=t;try{let n=JSON.parse(t.getItem(e)||`[]`);Array.isArray(n)&&(this.entries=n.filter(e=>e&&typeof e.id==`string`&&typeof e.projectId==`string`&&typeof e.name==`string`&&typeof e.size==`number`&&typeof e.mime==`string`).slice(0,10).map(e=>({key:e.id,name:e.name,size:e.size,attachment:e,uploading:!1})))}catch{}this.changed()}changed(){let e=this.entries.flatMap(e=>e.attachment?[e.attachment]:[]);this.snapshot={entries:this.entries,files:e,blocked:this.entries.some(e=>e.uploading||!!e.error),error:this.error},e.length?this.storage.setItem(this.key,JSON.stringify(e)):this.storage.removeItem(this.key);for(let e of this.listeners)e()}async add(e,t){this.error=``;let n=[];for(let t of e){let e=this.entries.reduce((e,t)=>e+t.size,0);if(this.entries.length>=10){this.error=R(`Attach up to 10 files per message.`);break}if(!t.size){this.error=R(`The file “{name}” is empty.`,{name:t.name});continue}if(t.size>26214400){this.error=R(`Files must be 25 MB or smaller.`);continue}if([`image/png`,`image/jpeg`,`image/gif`,`image/webp`].includes(t.type)&&t.size>5242880){this.error=R(`Images must be 5 MB or smaller.`);continue}if(e+t.size>104857600){this.error=R(`Attachments must total 100 MB or less.`);continue}let r={key:crypto.randomUUID?.()||Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,`0`)).join(``),name:t.name,size:t.size,file:t,uploading:!0};this.entries=[...this.entries,r],n.push(r)}this.changed(),await Promise.all(n.map(e=>this.upload(e.key,t)))}async upload(e,t){let n=this.entries.find(t=>t.key===e);if(!n?.file||this.requests.has(e))return;let r=new AbortController;this.requests.set(e,r),this.entries=this.entries.map(t=>t.key===e?{...t,uploading:!0,error:void 0}:t),this.changed();try{let i=await t(n.file,r.signal);this.entries=this.entries.map(t=>t.key===e?{key:e,name:i.name,size:i.size,attachment:i,uploading:!1}:t)}catch(t){this.entries=this.entries.map(n=>n.key===e?{...n,uploading:!1,error:t instanceof Error?t.message:R(`Upload failed. Please retry.`)}:n)}finally{this.requests.delete(e),this.changed()}}remove(e){this.requests.get(e)?.abort(),this.entries=this.entries.filter(t=>t.key!==e),this.error=``,this.changed()}clear(e){let t=new Set(e.map(e=>e.id));this.entries=this.entries.filter(e=>!e.attachment||!t.has(e.attachment.id)),this.error=``,this.changed()}dispose(){for(let e of this.requests.values())e.abort();this.entries=[],this.error=``,this.changed()}},Je=new Map;function Ye(){for(let e of Je.values())e.dispose();Je.clear()}function Xe(e){let t=(0,S.useMemo)(()=>{let t=Je.get(e);return t||(t=new qe(e,D),Je.set(e,t)),t},[e]);return{draft:t,...(0,S.useSyncExternalStore)(t.subscribe,t.getSnapshot)}}var Ze=e=>`/api/projects/${encodeURIComponent(e.projectId)}/attachments/${encodeURIComponent(e.id)}`,Qe=e=>e<1048576?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;function $e({file:e}){return e?.mime.startsWith(`image/`)?(0,C.jsx)(`img`,{src:Ze(e),alt:``,loading:`lazy`}):(0,C.jsx)(T,{name:e?.mime===`application/pdf`?`pdf`:`paper`,size:20})}function et({draft:e,upload:t,discard:n,disabled:r}){let{entries:i,error:a}=(0,S.useSyncExternalStore)(e.subscribe,e.getSnapshot);return(0,C.jsxs)(C.Fragment,{children:[i.length>0&&(0,C.jsx)(`ul`,{className:`composer-attachments`,"aria-label":R(`Attachments`),children:i.map(i=>(0,C.jsxs)(`li`,{className:`attachment`+(i.error?` attachment-failed`:``),children:[(0,C.jsx)(`span`,{className:`attachment-icon`,children:i.uploading?(0,C.jsx)(`span`,{className:`spinner`}):(0,C.jsx)($e,{file:i.attachment})}),(0,C.jsxs)(`span`,{className:`attachment-info`,children:[(0,C.jsx)(`span`,{className:`attachment-name`,title:i.name,children:i.name}),(0,C.jsx)(`small`,{title:i.error,role:i.uploading?`status`:i.error?`alert`:void 0,children:i.uploading?R(`Uploading…`):i.error||Qe(i.size)})]}),i.error&&(0,C.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":R(`Retry uploading {name}`,{name:i.name}),disabled:r,onClick:()=>void e.upload(i.key,t),children:(0,C.jsx)(T,{name:`refresh`,size:14})}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":R(`Remove attachment {name}`,{name:i.name}),disabled:r,onClick:()=>{e.remove(i.key),i.attachment&&n(i.attachment)},children:(0,C.jsx)(T,{name:`close`,size:14})})]},i.key))}),a&&(0,C.jsx)(`p`,{className:`attachment-error`,role:`alert`,children:a})]})}function tt({files:e}){return e?.length?(0,C.jsx)(`ul`,{className:`message-attachments`,"aria-label":R(`Attachments`),children:e.map(e=>(0,C.jsx)(`li`,{children:(0,C.jsxs)(`a`,{className:`attachment`,href:Ze(e),target:`_blank`,rel:`noreferrer`,title:R(`Open attachment {name}`,{name:e.name}),children:[(0,C.jsx)(`span`,{className:`attachment-icon`,children:(0,C.jsx)($e,{file:e})}),(0,C.jsxs)(`span`,{className:`attachment-info`,children:[(0,C.jsx)(`span`,{className:`attachment-name`,children:e.name}),(0,C.jsx)(`small`,{children:Qe(e.size)})]}),(0,C.jsx)(T,{name:`external`,size:13})]})},e.id))}):null}var nt=e=>e.replace(/^Round\s+\d+(?:\s*·\s*|$)/i,``),rt=class{current=null;run(e,t,n){if(this.current?.key===e)return this.current.promise;this.cancel();let r=new AbortController,i=Promise.resolve().then(()=>t(r.signal)).then(e=>{r.signal.aborted||n(e)}).catch(e=>{if(!r.signal.aborted)throw e}).finally(()=>{this.current?.controller===r&&(this.current=null)});return this.current={key:e,controller:r,promise:i},i}cancel(){this.current?.controller.abort(),this.current=null}};function it(e){return e===`h2`||e===`h3`}var at=`.task-commit{width:100%;min-width:0;font:13px/1.5 var(--sans);color:var(--text);flex-direction:column;gap:6px;display:flex;container:task-commit/inline-size}.task-commit-compose{border:1px solid var(--line);background:var(--bg-subtle);border-radius:10px;min-width:0;transition:border-color .15s,background .15s}.task-commit-compose:focus-within{border-color:var(--line-hover);background:var(--bg)}.task-commit textarea{box-sizing:border-box;resize:none;width:100%;min-height:42px;max-height:132px;color:var(--text);font:14px/22px var(--sans);box-shadow:none;background:0 0;border:0;border-radius:10px;outline:none;margin:0;padding:11px 12px 5px;display:block}.task-commit textarea:focus{box-shadow:none;border:0;outline:none}.task-commit textarea::placeholder{color:var(--text-3)}.task-commit-toolbar{flex-wrap:wrap;align-items:center;gap:4px 8px;padding:6px 8px 8px 12px;display:flex}.task-commit .task-commit-branch{min-width:0;max-width:min(42%,260px);color:var(--text-3);font:11.5px/1.5 var(--mono,ui-monospace,monospace);align-items:center;gap:5px;display:inline-flex}.task-commit-branch svg{flex-shrink:0}.task-commit .task-commit-branch>span{text-overflow:ellipsis;white-space:nowrap;color:inherit;overflow:hidden}.task-commit-generate{width:28px;height:28px;color:var(--text-3);cursor:pointer;background:0 0;border:0;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;margin-left:auto;padding:0;display:inline-flex}.task-commit-generate:hover{background:var(--bg-hover);color:var(--text)}.task-commit .task-commit-generate[aria-busy=true]{opacity:1}.task-commit-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:4px;display:flex}.task-commit-actions button{min-height:30px;color:var(--text-2);font:500 12px/20px var(--sans);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:7px;justify-content:center;align-items:center;gap:7px;padding:4px 10px;transition:background .15s,color .15s;display:inline-flex}.task-commit-actions button:hover{background:var(--bg-hover);color:var(--text)}.task-commit-actions .task-commit-primary{background:var(--text);color:var(--bg);box-shadow:var(--shadow-xs);padding-inline:12px}.task-commit-actions .task-commit-primary:hover{background:var(--text-2);color:var(--bg)}.task-commit button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.task-commit button:disabled{opacity:.45;cursor:default}.task-commit .task-commit-hint{color:var(--text-3);padding-inline:2px;font-size:11px}.task-commit-error{color:var(--red);overflow-wrap:anywhere;margin:0;padding-inline:2px;font-size:12px}.task-commit-spinner{box-sizing:border-box;border:1.5px solid var(--accent-line);border-top-color:var(--accent);border-radius:50%;flex-shrink:0;width:15px;height:15px;animation:.8s linear infinite task-commit-spin;display:inline-block}@keyframes task-commit-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.task-commit-spinner{animation:none}.task-commit-compose,.task-commit button{transition:none}}.review-complete:has(.task-commit){border-radius:12px;gap:3px 8px;padding:12px 14px}.review-complete:has(.task-commit)>strong{align-items:center;gap:7px;font-size:12px;font-weight:600;display:inline-flex}.review-complete:has(.task-commit)>strong:before{content:"";background:var(--green);border-radius:50%;flex-shrink:0;width:6px;height:6px}.review-complete:has(.task-commit)>span{color:var(--text-3);font-size:12px}.review-complete-actions:has(.task-commit){width:100%;margin:8px 0 0}.task-delivery:has(.task-commit){align-items:stretch}@container task-commit (width<=460px){.task-commit-toolbar:has(.task-commit-alternative) .task-commit-actions{flex-basis:100%;padding-top:2px}.task-commit-toolbar:has(.task-commit-alternative) .task-commit-branch{max-width:calc(100% - 44px)}}@media (width<=520px){.task-commit textarea{font-size:16px;line-height:24px}.task-commit-actions button{min-height:36px}.task-commit-generate{width:32px;height:32px}}`;function ot(e){let t=[];for(let n of[...e].sort((e,t)=>e[1]-t[1]||e[0]-t[0])){let e=t.find(e=>Math.abs((e[1]+e[3])/2-(n[1]+n[3])/2)<Math.min(e[3]-e[1],n[3]-n[1])/2&&n[0]<=e[2]+.02);e?(e[0]=Math.min(e[0],n[0]),e[1]=Math.min(e[1],n[1]),e[2]=Math.max(e[2],n[2]),e[3]=Math.max(e[3],n[3])):t.push([...n])}return t}function st(e,t,n,r=1/0){let i=-1,a=r;return e.forEach((e,r)=>{if(!e)return;let[o,s,c,l]=e,u=4*Math.max(s-n,0,n-l)+Math.max(o-t,0,t-c);u<a&&(a=u,i=r)}),i}function ct(e,t){let n=e[t].line,r=t=>e[t]?.line===n&&!/\s/u.test(e[t].text),i=t,a=t;for(;r(i-1);)i--;for(;r(a+1);)a++;return[i,a]}function lt(e,t){let n=(e.ownerDocument??e).defaultView,r=()=>n.matchMedia(`(pointer: coarse)`).matches,i=e=>e instanceof n.Element?e:e?.parentElement,a=null,o=null,s=null;function c(e){let{units:n,line:r}=t.units(e),i=n.map((e,t)=>({text:e.textContent||``,line:r(e,t)}));return{units:n,words:i,boxes:n.map((e,t)=>{let n=e.getBoundingClientRect();return/\S/u.test(i[t].text)&&(n.width||n.height)?[n.left,n.top,n.right,n.bottom]:null})}}let l=()=>{a&&t.onSelect({target:a.target,units:a.units,from:a.from,to:a.to})},u=()=>{a=null,t.onClear()},d=e=>{if(clearTimeout(s?.timer),s=null,o=null,e.touches.length!==1||t.blocked()||!r())return;let n=i(e.target),{clientX:u,clientY:d}=e.touches[0],f=n?.closest(`.select-handle`);if(f&&a){Object.assign(a,c(a.target)),o=f.dataset.end;return}if(n?.closest(t.menu))return;let p=n?t.target(n):void 0;s={x:u,y:d,timer:setTimeout(()=>{if(s=null,p===void 0)return;let e=c(p),t=st(e.boxes,u,d,40);if(t<0)return;let n=ct(e.words,t);a={target:p,...e,anchor:n,from:n[0],to:n[1]},o=`extend`,l()},450)}},f=e=>{let t=e.touches[0];if(!t||(s&&Math.hypot(t.clientX-s.x,t.clientY-s.y)>10&&(clearTimeout(s.timer),s=null),!o||!a))return;e.preventDefault();let n=st(a.boxes,t.clientX,t.clientY);if(n<0)return;let[r,i]=ct(a.words,n);o===`extend`?(a.from=Math.min(a.anchor[0],r),a.to=Math.max(a.anchor[1],i)):o===`from`?a.from=Math.min(r,ct(a.words,a.to)[0]):a.to=Math.max(i,ct(a.words,a.from)[1]),l()},p=e=>{o?(o=null,e.cancelable&&e.preventDefault()):s&&(clearTimeout(s.timer),s=null,a&&!i(e.target)?.closest(t.menu)&&u())},m=()=>{clearTimeout(s?.timer),s=null,o=null},h=[[`touchstart`,d,{passive:!0}],[`touchmove`,f,{passive:!1}],[`touchend`,p,{passive:!1}],[`touchcancel`,m],[`contextmenu`,e=>{let n=i(e.target);r()&&n&&t.target(n)!==void 0&&e.preventDefault()}]];for(let[t,n,r]of h)e.addEventListener(t,n,r);return{active:()=>!!a,reset:()=>{a=null,o=null},stop:()=>{m(),a=null;for(let[t,n]of h)e.removeEventListener(t,n)}}}function ut(e,t){let n=(0,S.useRef)(e);n.current=e,(0,S.useEffect)(()=>{let e=[...new Set([document,...t?[t]:[]])],r=t=>{if(t.defaultPrevented||t.isComposing||t.repeat||t.altKey||t.shiftKey||!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!==`z`)return;let r=t.target;r?.isContentEditable||r?.closest?.(`input, textarea, select, [role="textbox"]`)||e.some(e=>e.querySelector(`dialog[open], [aria-modal="true"]`))||n.current()&&(t.preventDefault(),t.stopImmediatePropagation())};return e.forEach(e=>e.addEventListener(`keydown`,r,!0)),()=>e.forEach(e=>e.removeEventListener(`keydown`,r,!0))},[t])}var dt=()=>crypto.randomUUID?.()||Array.from(crypto.getRandomValues(new Uint8Array(20)),e=>e.toString(16).padStart(2,`0`)).join(``),ft=e=>Math.max(0,Math.min(1,e)),pt=([e,t,n,r])=>({left:`${e*100}%`,top:`${t*100}%`,width:`${(n-e)*100}%`,height:`${(r-t)*100}%`}),mt=e=>e?.nodeType===1?e:e?.parentElement;function ht(e){try{let t=JSON.parse(D.getItem(e)||`null`);if(t&&Array.isArray(t.notes)&&typeof t.requestKey==`string`)return t}catch{}return{notes:[],requestKey:dt(),editing:null}}function gt(e,t,n,r){let i=e.strip.closest(`.change`),a=e.strip.closest(`.before`)?`Before`:e.strip.closest(`.after`)?`After`:`Unchanged text`,o=i?.querySelector(`.change-number`),s=i?.querySelector(`.change-where`),c=[`Round ${e.round}`,`PDF page ${e.strip.dataset.page||`?`}`,a,o?.dataset.change?`Change ${o.dataset.change}`:o?.textContent,s?.dataset.location||s?.getAttribute(`title`)||s?.textContent].filter(Boolean).join(` · `);return{strip:e.key,round:e.round,where:c,quote:n,rects:t,region:r}}function _t(e,t){let n=e.strip.getBoundingClientRect(),r=Array.from(t.getClientRects()).filter(e=>e.width>0&&e.height>0).map(e=>[ft((e.left-n.left)/n.width),ft((e.top-n.top)/n.height),ft((e.right-n.left)/n.width),ft((e.bottom-n.top)/n.height)]),i=t.toString().replace(/\s+/g,` `).trim();return i&&r.length?gt(e,ot(r),i,!1):null}function vt({doc:e,layer:t,selection:n,group:r,onAdd:i}){let a=(0,S.useRef)(null);return(0,S.useLayoutEffect)(()=>{let r=()=>{let r=a.current;if(!r)return;let i=t.strip.getBoundingClientRect(),o=e.getElementById(`paper`)?.getBoundingClientRect()||e.body.getBoundingClientRect(),s=i.top+n.rects[0][1]*i.height,c=i.top+n.rects.at(-1)[3]*i.height,l=i.left+i.width*(Math.min(...n.rects.map(e=>e[0]))+Math.max(...n.rects.map(e=>e[2])))/2,u=r.offsetHeight,d=r.offsetWidth/2,f=s-u-22>=o.top+6;r.style.top=`${f?s-u-22:c+22}px`,r.style.left=`${Math.max(o.left+d+8,Math.min(o.right-d-8,l))}px`,r.style.visibility=c<o.top||s>o.bottom?`hidden`:``};r();let i=0,o=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(r)};return e.addEventListener(`scroll`,o,!0),e.defaultView?.addEventListener(`resize`,o),()=>{cancelAnimationFrame(i),e.removeEventListener(`scroll`,o,!0),e.defaultView?.removeEventListener(`resize`,o)}},[e,t,n]),(0,C.jsx)(`div`,{ref:a,className:`review-select-menu`,children:(0,C.jsx)(`button`,{type:`button`,"aria-label":r?R(`Add to {group}`,{group:ie(r)}):R(`Add note`),onClick:i,children:(0,C.jsx)(oe,{group:r})})})}function yt({doc:e,task:t,onSend:n}){let r=`papilot:review-notes:${t.id}`,[i,a]=(0,S.useState)(()=>ht(r)),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(null),f=(0,S.useRef)(u);f.current=u;let p=(0,S.useRef)([]),[m,h]=(0,S.useState)(!1),[g,v]=(0,S.useState)(()=>!!i.editing?.comment.trim()),[y,b]=(0,S.useState)(!1),[x,w]=(0,S.useState)(``),[E,O]=(0,S.useState)(null),k=(0,S.useRef)(null),A=(0,S.useRef)({draft:i,region:m,busy:y,open:g});A.current={draft:i,region:m,busy:y,open:g};let j=g&&!!i.editing,M=(0,S.useRef)(!1),N=(0,S.useRef)(null);ut(()=>{if(e&&(f.current||A.current.open)&&p.current.length&&!A.current.busy&&!A.current.draft.editing){let e=p.current.pop(),t=A.current.draft;return F({...t,notes:t.notes.filter(t=>t.id!==e),requestKey:dt()}),!0}return!e||!A.current.open||!A.current.draft.deleted?.length?!1:(A.current.busy||A.current.draft.editing||A.current.region||ue(),!0)},e),(0,S.useEffect)(()=>{if(!m||!e)return;let t=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),h(!1),O(null),k.current=null)};return e.addEventListener(`keydown`,t,!0),document.addEventListener(`keydown`,t,!0),()=>{e.removeEventListener(`keydown`,t,!0),document.removeEventListener(`keydown`,t,!0)}},[e,m]);function P(t){h(t),v(!1),N.current?.reset(),l(null),e?.defaultView?.focus()}function F(e){A.current.draft=e,D.setItem(r,JSON.stringify(e)),a(e)}(0,S.useEffect)(()=>{if(!e)return;let n=new Map,r=()=>{let r=!1,i=Array.from(e.querySelectorAll(`.pdf-strip`));for(let[e,t]of n)i.includes(e)||(t.element.remove(),n.delete(e),r=!0);i.forEach((i,a)=>{let o=i.querySelector(`img`)?.getAttribute(`src`)||``,s=Number(o.match(/\/files\/[^/]+\/(\d+)\//)?.[1]||t.review?.round||0),c=`${s}:${a}`,l=n.get(i);if(l?.key===c)return;l?.element.remove();let u=e.createElement(`div`);u.className=`review-note-layer`,i.append(u),n.set(i,{strip:i,element:u,key:c,round:s}),r=!0}),r&&(s([...n.values()]),N.current?.reset(),l(null))};r();let i=new MutationObserver(r);i.observe(e.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`src`]});let a,o=()=>{if(A.current.open&&A.current.draft.editing||A.current.region||A.current.busy||N.current?.active())return;let t=e.getSelection();if(!t?.rangeCount||t.isCollapsed){l(null);return}let r=t.getRangeAt(0),i=mt(r.startContainer)?.closest(`.pdf-strip`),a=i===mt(r.endContainer)?.closest(`.pdf-strip`)&&i?n.get(i):null;if(!a||!mt(r.startContainer)?.closest(`.pdf-text`)||!mt(r.endContainer)?.closest(`.pdf-text`)){l(null);return}let o=_t(a,r);return l(o),o},c=()=>{clearTimeout(a),a=setTimeout(o,100)};e.addEventListener(`selectionchange`,c);let u=!1,d=e=>{f.current&&e.pointerType!==`touch`&&e.target.closest(`.pdf-text`)&&setTimeout(()=>{if(u)return;let e=o();e&&f.current&&ee(e)},0)};return e.addEventListener(`pointerup`,d),N.current=lt(e,{target:e=>{let t=e.closest(`.pdf-text`)?.closest(`.pdf-strip`);return t?n.get(t):void 0},units:e=>({units:Array.from(e.strip.querySelectorAll(`.pdf-glyph`)),line:e=>e.parentElement}),blocked:()=>{let{draft:e,region:t,busy:n,open:r}=A.current;return!!(r&&e.editing)||t||n},menu:`.review-select-menu`,onSelect:({target:t,units:n,from:r,to:i})=>{let a=e.createRange();a.setStart(n[r],0),a.setEnd(n[i],n[i].childNodes.length);let o=_t(t,a);if(!o)return;let s=t.strip.getBoundingClientRect(),c=(e,t)=>{let n=e.getBoundingClientRect();return[ft((n[t]-s.left)/s.width),ft((n.top-s.top)/s.height),ft((n.bottom-s.top)/s.height)]};l({...o,handles:{from:c(n[r],`left`),to:c(n[i],`right`)}})},onClear:()=>l(null)}),()=>{u=!0,clearTimeout(a),i.disconnect(),N.current?.stop(),N.current=null,e.removeEventListener(`selectionchange`,c),e.removeEventListener(`pointerup`,d);for(let e of n.values())e.element.remove()}},[e,t.review?.round]);function I(e){d(e),N.current?.reset(),l(null),!e&&A.current.draft.notes.some(e=>e.group)&&v(!0)}(0,S.useEffect)(()=>{let t=e=>{e.key===`Escape`&&f.current&&I(null)};return e?.addEventListener(`keydown`,t),document.addEventListener(`keydown`,t),()=>{e?.removeEventListener(`keydown`,t),document.removeEventListener(`keydown`,t)}},[e]);function ee(t){let n=f.current,r=A.current.draft;if(!n||A.current.busy)return;let i={...t,group:n,comment:``,id:dt()};p.current.push(i.id),F({...r,notes:[...r.notes,i],requestKey:dt()}),N.current?.reset(),l(null),e?.getSelection()?.removeAllRanges()}function L({handles:t,...n}){if(f.current){ee(n);return}let r=A.current.draft;F({...r,editing:{...n,comment:r.editing?.id?``:r.editing?.comment||``}}),N.current?.reset(),l(null),h(!1),v(!0),e?.getSelection()?.removeAllRanges()}function te(e){F({...A.current.draft,editing:{...e}}),w(``),N.current?.reset(),l(null)}function ne(){let t=A.current.draft,n=t.editing?.id;F({...t,editing:null}),t.notes.length||v(!1),n&&requestAnimationFrame(()=>e?.querySelector(`[data-note="${n}"] .note-comment`)?.focus())}function ce(){let e=A.current.draft;e.editing&&!e.editing.comment.trim()&&F({...e,editing:null}),v(!1),h(!1)}function z(){let e=A.current.draft,t=e.editing;if(!t?.comment.trim()||y)return;let n={...t,comment:t.comment.trim(),id:t.id||dt()};F({...e,notes:t.id?e.notes.map(e=>e.id===n.id?n:e):[...e.notes,n],requestKey:dt()}),ne()}function B(e){p.current=[];let t=A.current.draft;F({...t,notes:t.notes.filter(t=>t.id!==e.id),deleted:[...t.deleted||[],{note:e,index:t.notes.indexOf(e)}],requestKey:dt()}),w(``)}function ue(){let t=A.current.draft,n=[...t.deleted||[]],r=n.pop();if(!r)return;let i=[...t.notes];i.splice(r.index,0,r.note),F({...t,notes:i,deleted:n,requestKey:dt()}),w(``),requestAnimationFrame(()=>e?.querySelector(`[data-note="${r.note.id}"] .note-comment`)?.focus())}async function de(){if(M.current||!i.notes.length||i.editing)return;M.current=!0,b(!0),w(``);let e=i;try{await n({requestKey:e.requestKey,text:e.instructions||``,notes:e.notes.map(e=>({...e.group?{group:e.group}:{},id:e.id,where:e.where+(e.region?` · Region in displayed strip: ${e.rects[0].map(e=>`${Math.round(e*100)}%`).join(`, `)}`:``),quote:e.quote,comment:e.comment,anchor:{...Oe(e),round:e.round}}))});let t=ht(r);t.requestKey===e.requestKey?F({notes:[],editing:null,requestKey:dt()}):a(t),v(!1),d(null),p.current=[]}catch(e){w(e instanceof Error?e.message:String(e))}finally{M.current=!1,b(!1)}}let fe=t.status===`uncertain`||t.status===`deleting`,pe=i.notes.some(e=>e.group);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(se,{value:u,onChange:I,disabled:y||j}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":R(`Mark region`),title:R(`Mark region`),"aria-pressed":m,disabled:!e||y||j,onClick:()=>P(!m),children:(0,C.jsx)(T,{name:`region`,size:16})}),e&&(0,Se.createPortal)((0,C.jsx)(`style`,{children:`.review-note-layer{z-index:3;pointer-events:none;font-family:var(--sans);position:absolute;inset:0}.review-note-mark,.review-note-box{pointer-events:none;background:#2563eb33;border-radius:2px;position:absolute}.review-note-box{background:#2563eb14;border:1.5px solid #2563eb}.review-region-capture{pointer-events:auto;cursor:crosshair;touch-action:none;position:absolute;inset:0}.review-note-tag,.review-add-note{pointer-events:auto;color:#fff;font:500 13px/1.4 var(--sans);cursor:pointer;background:#2563eb;border:0;border-radius:16px;padding:5px 10px;position:absolute;box-shadow:0 2px 8px #0002}.review-note-tag{min-width:24px;padding:3px 6px;left:8px}.review-add-note{white-space:nowrap;z-index:2;transform:translate(-50%,4px)}.review-notes-panel{z-index:20;box-sizing:border-box;border:1px solid var(--line);background:var(--bg);width:min(360px,100% - 32px);max-height:calc(100% - 80px);color:var(--text);box-shadow:var(--float);font:14px/1.5 var(--sans);border-radius:14px;padding:14px;position:fixed;bottom:16px;right:16px;overflow:auto}.review-notes-panel *{box-sizing:border-box}.review-notes-panel header,.review-notes-panel footer,.review-note-head{justify-content:space-between;align-items:center;gap:8px;display:flex}.review-notes-panel header{margin-bottom:10px}.review-notes-panel button{font:inherit;cursor:pointer;background:var(--bg-muted);color:var(--text-2);border:0;border-radius:7px;padding:5px 10px}.review-notes-panel button:disabled{opacity:.45;cursor:default}.review-notes-panel button:focus-visible,.review-add-note:focus-visible,.review-note-tag:focus-visible{outline-offset:2px;outline:2px solid #2563eb}.review-notes-panel button.primary{background:var(--primary);color:#fff;padding:7px 12px}.review-notes-panel footer{justify-content:flex-end;margin-top:10px}.review-notes-panel p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.review-notes-panel small{color:var(--text-2);overflow-wrap:anywhere}.review-notes-panel blockquote{border-left:2px solid var(--line);color:var(--text-2);max-height:110px;margin:8px 0;padding-left:10px;font-size:13px;overflow:auto}.review-notes-panel textarea{resize:vertical;border:1px solid var(--line-strong);width:100%;min-height:80px;font:14px/1.5 var(--sans);color:var(--text);background:var(--bg);border-radius:8px;padding:8px;display:block}.review-notes-panel textarea:focus{outline:2px solid var(--accent-line);border-color:#2563eb}.review-notes-panel ol{margin:0;padding:0;list-style:none}.review-notes-panel li+li{border-top:1px solid var(--line);margin-top:12px;padding-top:12px}.review-notes-panel button.review-note-location{text-align:left;color:var(--text-2);overflow-wrap:anywhere;background:0 0;padding:0;font-size:12px}.review-notes-panel .review-notes-error{color:var(--red)}.review-notes-empty{text-align:center;color:var(--text-2);padding:8px 0}.review-note-actions{grid-template-columns:1fr 1fr;gap:8px;margin-top:14px;display:grid}.review-note-actions button{flex-direction:column;align-items:center;gap:7px;min-height:68px;padding:10px 6px;display:flex}@media (pointer:coarse){.pdf-strip,.pdf-strip .pdf-text,.pdf-strip .pdf-glyph{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}}.select-handle{pointer-events:auto;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;background:#2563eb;width:2px;margin-left:-1px;position:absolute}.select-handle:before{content:"";position:absolute;inset:-16px -15px}.select-handle:after{content:"";background:#2563eb;border-radius:50%;width:12px;height:12px;position:absolute;left:-5px}.select-handle[data-end=from]:after{top:-11px}.select-handle[data-end=to]:after{bottom:-11px}.review-select-menu{z-index:19;font-family:var(--sans);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation;position:fixed;transform:translate(-50%)}.review-select-menu button{color:#fff;height:40px;font:500 15px/1 var(--sans);white-space:nowrap;cursor:pointer;background:#2563eb;border:0;border-radius:20px;padding:0 18px;box-shadow:0 4px 16px #00000040}:root[data-papilot-phone] .review-notes-panel{left:0;right:0;top:var(--papilot-review-bar-height,48px);width:auto;max-height:calc(100% - var(--papilot-review-bar-height,48px) - var(--keyboard,0px));border-width:0 0 1px;border-radius:0 0 16px 16px;padding:12px 14px 14px;bottom:auto}:root[data-papilot-phone] body:has(.review-notes-panel) .change-head .dock{display:none}:root[data-papilot-phone] .review-notes-panel header{margin-bottom:6px}:root[data-papilot-phone] .review-notes-panel form small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}:root[data-papilot-phone] .review-notes-panel form blockquote{-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:none;margin:6px 0 8px;display:-webkit-box;overflow:hidden}:root[data-papilot-phone] .review-notes-panel textarea{resize:none;min-height:76px;font-size:16px}:root[data-papilot-phone] .review-notes-panel button{min-height:40px}:root[data-papilot-phone] .review-notes-panel footer button{padding:0 16px}.note-quote{border-left:2px solid var(--line-strong);background:var(--bg-muted);border-radius:0 4px 4px 0;margin:4px 0 0;padding:4px 8px}.note-quote .note-quote-text{font:13px/1.5 var(--sans);color:var(--text-2);white-space:pre-wrap;overflow-wrap:anywhere;border:0;max-height:8em;margin:0;padding:0;overflow:auto}.note-body{margin-top:4px;padding:0 2px}.note-comment.note-comment{width:100%;color:var(--text);font:14px/1.5 var(--sans);text-align:left;cursor:text;background:0 0;border:0;border-radius:4px;align-items:flex-start;gap:8px;padding:2px 0;display:flex}.note-comment span{white-space:pre-wrap;overflow-wrap:anywhere;flex:1;min-width:0}.note-comment svg{color:var(--text-3,var(--text-2));opacity:0;flex:none;margin-top:4px;transition:opacity .15s}.note-comment:hover svg,.note-comment:focus-visible svg{opacity:1}.note-comment:focus-visible{outline:2px solid var(--primary);outline-offset:3px}.note-comment:disabled{cursor:default}@media (pointer:coarse){.note-comment svg{opacity:.6}.note-comment.note-comment{min-height:40px}}.group-picker{flex:none;align-items:center;gap:2px;display:inline-flex}.group-highlight{justify-content:center;width:20px;height:22px;display:flex;position:relative}.group-highlight:after{content:"";background:var(--text-3);opacity:.4;border-radius:2px;height:2px;position:absolute;bottom:0;left:3px;right:3px}.group-select[data-group] .group-highlight:after{background:var(--note-color);opacity:1}.group-palette{border:1px solid var(--line);border-radius:var(--r-lg);background:var(--bg);max-width:calc(100vw - 16px);color:var(--text);box-shadow:var(--float);font:13px/1.5 var(--sans);margin:0;padding:8px;position:fixed;inset:auto}.group-palette-label{color:var(--text-3);padding:3px 6px 7px;font-size:12px}.group-swatches{gap:4px;padding:0 2px 4px;display:flex}.group-swatch{border-radius:var(--r);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;width:32px;height:32px;padding:6px;display:flex}.group-swatch>span{background:var(--note-color);border-radius:50%;flex:none;width:20px;height:20px}.group-swatch:hover{background:var(--bg-hover)}.group-swatch[aria-checked=true]>span{outline:1.5px solid var(--note-color);outline-offset:3px}.group-individual{border-radius:var(--r);width:100%;color:var(--text-2);font:inherit;cursor:pointer;background:0 0;border:0;align-items:center;gap:8px;margin-top:9px;padding:7px 6px;display:flex;position:relative}.group-individual:before{content:"";border-top:1px solid var(--line);position:absolute;top:-5px;left:2px;right:2px}.group-individual>span{text-align:left;flex:1}.group-individual:hover{background:var(--bg-hover);color:var(--text)}.group-dot{background:var(--note-color);width:9px;height:9px;box-shadow:0 0 0 1px color-mix(in srgb,var(--note-color) 30%,transparent);border-radius:50%;flex:none;display:inline-block}.annotation-group{border:1px solid var(--line);border-left:2px solid var(--note-color);background:var(--bg);border-radius:10px;margin:3px 0}.annotation-group.active:not([data-selected]){border-color:var(--note-color)}.annotation-group[data-selected]{transition:background-color .15s,border-color .15s}.annotation-group[data-selected=true]{border-color:color-mix(in srgb,var(--note-color) 70%,var(--line));background:color-mix(in srgb,var(--note-color) 11%,var(--bg))}.annotation-group[data-selected=mixed]{border-color:color-mix(in srgb,var(--note-color) 55%,var(--line));background:color-mix(in srgb,var(--note-color) 4%,var(--bg));border-style:dashed}.annotation-group[data-selected=false]{border-color:var(--line);background:var(--bg)}.group-header{font:12px/1.5 var(--sans);color:var(--text-2);align-items:stretch;gap:2px;padding-right:4px;display:flex}.group-header strong{color:var(--text);margin-right:auto;font-weight:500}.group-disclosure{border-radius:6px;flex:none;justify-content:center;align-self:center;align-items:center;width:32px;height:32px;display:flex}.group-disclosure:hover{background:var(--bg-hover)}.group-disclosure[aria-expanded=true]>svg{transform:rotate(180deg)}.group-selection-toggle,.group-heading{text-align:left;min-width:0;min-height:36px;color:inherit;font:inherit;flex:1;align-items:center;gap:8px;padding:6px 10px;display:flex}.group-selection-toggle[aria-pressed=true]>strong{font-weight:600}.group-selection-toggle[aria-pressed=false]>strong{color:var(--text-3)}.group-selection-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:2px}.group-locations{max-height:240px;padding:0 10px 5px;overflow:auto}.group-instruction-input{margin:0 0 10px;position:relative}.group-instruction-input textarea{box-sizing:border-box;resize:none;border:1px solid var(--line-strong);background:var(--bg);width:100%;min-height:64px;max-height:160px;color:var(--text);font:14px/1.6 var(--sans);border-radius:10px;padding:11px 34px 11px 12px;transition:border-color .15s,box-shadow .15s;display:block;box-shadow:0 1px 2px #00000006}.group-instruction-input textarea:hover:not(:disabled){border-color:var(--line-hover)}.group-instruction-input textarea:focus{border-color:color-mix(in srgb,var(--note-color) 70%,var(--text-3));box-shadow:0 0 0 3px color-mix(in srgb,var(--note-color) 13%,transparent);outline:none}.group-instruction-input textarea::placeholder{color:var(--text-3)}.group-instruction-input>svg{color:var(--text-3);pointer-events:none;opacity:.7;transition:opacity .15s;position:absolute;top:15px;right:12px}.group-instruction-input:focus-within>svg{opacity:0}.group-instruction-sent{font:13px/1.5 var(--sans);white-space:pre-wrap;overflow-wrap:anywhere;color:var(--text);margin:2px 0 8px}@media (pointer:coarse){.group-instruction-input textarea{font-size:16px}.group-disclosure{width:44px;height:44px}.group-selection-toggle{min-height:44px}}.group-location{border-top:1px solid var(--line);font:12px/1.5 var(--sans);align-items:center;gap:6px;padding:4px 0 1px;display:flex}.notes-panel .group-location{border:1px solid var(--line);border-radius:6px;margin:4px 0;padding:6px 8px}.notes-panel>.annotation-group{flex:none}.notes-panel .group-locations{max-height:none;overflow:visible}.group-location-target{text-align:left;min-width:0;color:var(--text-2);cursor:pointer;background:0 0;border:0;flex:1}.group-location-target>span{color:var(--text-3);font-size:11px}.group-location blockquote{white-space:nowrap;text-overflow:ellipsis;color:var(--text);margin:1px 0 0;font-size:13px;overflow:hidden}.notes-panel .group-location blockquote{-webkit-line-clamp:3;white-space:normal;overflow-wrap:anywhere;-webkit-box-orient:vertical;display:-webkit-box}.group-locations .sent-notes{margin:0;padding:0}.group-locations .sent-notes>li{list-style:none}.notes-panel>.annotation-group[data-selected]{border:1px solid var(--line);background:var(--bg-subtle);box-shadow:var(--shadow-xs);border-radius:14px;margin:5px 0}.notes-panel>.annotation-group[data-selected=true]{border-color:color-mix(in srgb,var(--note-color) 25%,var(--line))}.notes-panel .group-header{color:var(--text-2);padding:4px 8px 4px 3px}.notes-panel .group-header strong,.notes-panel .group-selection-toggle[aria-pressed=true]>strong{color:var(--text-2);font-size:12px;font-weight:500}.notes-panel .group-header .group-dot{width:8px;height:8px;box-shadow:0 0 0 3px color-mix(in srgb,var(--note-color) 12%,transparent)}.notes-panel .group-disclosure{width:28px;height:28px;color:var(--text-3)}.notes-panel .group-locations{padding:0 12px 12px}.group-references{gap:6px;display:grid}.notes-panel .group-location.note-card{border:1px solid var(--line);background:var(--bg);border-radius:9px;align-items:flex-start;gap:8px;margin:0;padding:9px 8px}.notes-panel .group-location.note-card[data-selected=true]{border-color:color-mix(in srgb,var(--note-color) 65%,var(--line));background:color-mix(in srgb,var(--note-color) 16%,var(--bg))}.notes-panel .group-location.note-card:hover{border-color:var(--line-hover);background:var(--bg-hover)}.notes-panel .group-location.note-card[data-selected=true]:hover{border-color:var(--note-color);background:color-mix(in srgb,var(--note-color) 22%,var(--bg))}.notes-panel .group-location.note-card.active{box-shadow:inset 3px 0 0 var(--note-color)}.notes-panel .group-location .note-number{background:color-mix(in srgb,var(--text) 5%,transparent);min-width:20px;height:22px;color:var(--text-2);font-variant-numeric:tabular-nums;border-radius:5px;flex:none;padding:0 4px;font-size:11px}.notes-panel .group-location .note-number:hover:not(:disabled){background:var(--bg-active);color:var(--text)}.notes-panel .group-location-target blockquote{color:var(--text);-webkit-line-clamp:2;margin:0 0 3px;font-size:13px;line-height:1.5}.notes-panel .group-location-target>span{color:var(--text-2);overflow-wrap:anywhere;font-size:11px;line-height:1.5;display:block}.group-location-selected{background:var(--note-color);width:18px;height:18px;color:var(--note-ink);opacity:0;border-radius:50%;flex:none;justify-content:center;align-items:center;margin-top:2px;transition:opacity .15s;display:flex}.group-location[data-selected=true]>.group-location-selected{opacity:1}.notes-panel .group-location-remove{width:22px;height:22px;color:var(--text-3);opacity:0;transition:opacity .15s}.group-location:hover>.group-location-remove,.group-location:focus-within>.group-location-remove{opacity:1}@media (pointer:coarse){.notes-panel .group-disclosure{width:44px;height:44px}.notes-panel .group-location-remove{opacity:1;width:36px;height:36px}.notes-panel .group-location .note-number{min-width:32px;height:36px}.group-location-selected{margin-top:9px}}.note-mark[data-group]{background:color-mix(in srgb,var(--note-color) 26%,transparent)}.note-mark[data-group].active{background:color-mix(in srgb,var(--note-color) 42%,transparent)}.note-box[data-group]{border-color:var(--note-color);background:color-mix(in srgb,var(--note-color) 12%,transparent)}.note-tag[data-group]{background:var(--note-color);color:var(--note-ink)}.review-add-note,.review-select-menu>button{align-items:center;gap:6px;display:inline-flex}@media (width<=680px){.group-location>button{min-height:36px}.group-swatch{width:44px;height:44px}.group-individual{min-height:44px}}.review-note-mark[data-group]{background:color-mix(in srgb,var(--note-color) 26%,transparent)}.review-note-box[data-group]{border-color:var(--note-color);background:color-mix(in srgb,var(--note-color) 12%,transparent)}.review-note-tag[data-group]{background:var(--note-color);color:var(--note-ink)}`}),e.head),o.map(e=>(0,Se.createPortal)((0,C.jsxs)(S.Fragment,{children:[i.notes.filter(t=>t.strip===e.key).map(e=>(0,C.jsxs)(S.Fragment,{children:[e.rects.map((t,n)=>(0,C.jsx)(`div`,{className:e.region?`review-note-box`:`review-note-mark`,"data-group":e.group,style:{...pt(t),...ae(e.group)}},n)),(0,C.jsx)(`button`,{className:`review-note-tag`,"data-group":e.group,style:{top:`${e.rects[0][1]*100}%`,...ae(e.group)},title:e.group?R(`Annotation groups`):e.comment,"aria-label":R(`Review note: {comment}`,{comment:e.group?ie(e.group):e.comment}),onClick:()=>v(!0),children:i.notes.indexOf(e)+1})]},e.id)),j&&i.editing?.strip===e.key&&i.editing.rects.map((e,t)=>(0,C.jsx)(`div`,{className:i.editing.region?`review-note-box`:`review-note-mark`,style:pt(e)},t)),m&&(0,C.jsx)(`div`,{className:`review-region-capture`,onPointerDown:t=>{if(t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.setPointerCapture(t.pointerId);let n=e.strip.getBoundingClientRect(),r=ft((t.clientX-n.left)/n.width),i=ft((t.clientY-n.top)/n.height);k.current={layer:e,x:r,y:i},O({key:e.key,rect:[r,i,r,i]})},onPointerMove:e=>{let t=k.current;if(!t)return;let n=t.layer.strip.getBoundingClientRect(),r=ft((e.clientX-n.left)/n.width),i=ft((e.clientY-n.top)/n.height);O({key:t.layer.key,rect:[Math.min(t.x,r),Math.min(t.y,i),Math.max(t.x,r),Math.max(t.y,i)]})},onPointerUp:e=>{let t=k.current;if(k.current=null,O(null),!t)return;let n=t.layer.strip.getBoundingClientRect(),r=ft((e.clientX-n.left)/n.width),i=ft((e.clientY-n.top)/n.height),a=[Math.min(t.x,r),Math.min(t.y,i),Math.max(t.x,r),Math.max(t.y,i)];if((a[2]-a[0])*n.width<4||(a[3]-a[1])*n.height<4)return;let o=(t.layer.strip.querySelector(`.pdf-text`)?.textContent||``).replace(/\s+/g,` `).trim().slice(0,2e3);L(gt(t.layer,[a],o,!0))},onPointerCancel:()=>{k.current=null,O(null)}}),E?.key===e.key&&(0,C.jsx)(`div`,{className:`review-note-box`,style:pt(E.rect)}),c?.handles&&c.strip===e.key&&(0,C.jsxs)(C.Fragment,{children:[c.rects.map((e,t)=>(0,C.jsx)(`div`,{className:`review-note-mark`,style:pt(e)},t)),[`from`,`to`].map(e=>{let[t,n,r]=c.handles[e];return(0,C.jsx)(`span`,{className:`select-handle`,"data-end":e,style:{left:`${t*100}%`,top:`${n*100}%`,height:`${(r-n)*100}%`}},e)})]}),c?.strip===e.key&&!c.handles&&!j&&!y&&(0,C.jsx)(`button`,{className:`review-add-note`,"aria-label":u?R(`Add to {group}`,{group:ie(u)}):R(`Add note`),style:{left:`${Math.min(80,c.rects.at(-1)[2]*100)}%`,top:`${c.rects.at(-1)[3]*100}%`},onPointerDown:e=>e.preventDefault(),onClick:()=>L(c),children:(0,C.jsx)(oe,{group:u})})]}),e.element,e.key)),e&&c?.handles&&!j&&!y&&(()=>{let t=o.find(e=>e.key===c.strip);return t?(0,Se.createPortal)((0,C.jsx)(vt,{doc:e,layer:t,selection:c,group:u,onAdd:()=>L(c)}),e.body):null})(),e&&g&&!m&&(0,Se.createPortal)((0,C.jsxs)(`aside`,{className:`review-notes-panel`,"aria-label":R(`Review PDF notes`),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&!y&&(i.editing?.id?ne():ce())},children:[(0,C.jsxs)(`header`,{children:[(0,C.jsx)(`strong`,{children:pe?R(`PDF annotations`):i.notes.length?R(`Review notes ({n})`,{n:i.notes.length}):R(`Review notes`)}),(0,C.jsx)(`button`,{type:`button`,"aria-label":R(`Close review notes`),onClick:ce,children:`×`})]}),i.editing?(0,C.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),z()},children:[(0,C.jsx)(`small`,{children:nt(i.editing.where)}),(0,C.jsx)(me,{text:i.editing.quote}),(0,C.jsx)(he,{children:(0,C.jsx)(`textarea`,{autoFocus:!0,"aria-label":R(`Note for the agent`),rows:3,maxLength:4e3,placeholder:R(`What should change here?`),value:i.editing.comment,onChange:e=>F({...i,editing:{...i.editing,comment:e.target.value}}),onKeyDown:e=>{Ke(e.nativeEvent,window.matchMedia(`(pointer: coarse)`).matches)&&(e.preventDefault(),z())}})}),(0,C.jsxs)(`footer`,{children:[(0,C.jsx)(`button`,{type:`button`,onClick:ne,children:R(`Cancel`)}),(0,C.jsx)(`button`,{className:`primary`,disabled:!i.editing.comment.trim(),children:i.editing.id?R(`Save`):R(`Add note`)})]})]}):(0,C.jsxs)(C.Fragment,{children:[_(i.notes).map(({group:e,entries:t})=>(0,C.jsx)(le,{group:e,count:t.length,children:t.map(({note:e,index:t})=>(0,C.jsxs)(`div`,{className:`group-location`,children:[(0,C.jsxs)(`button`,{type:`button`,onClick:()=>{o.find(t=>t.key===e.strip)?.strip.scrollIntoView({block:`center`}),v(!1)},children:[(0,C.jsx)(`span`,{children:nt(e.where)}),(0,C.jsx)(`blockquote`,{children:e.quote||R(`Marked region`)})]}),(0,C.jsx)(`button`,{type:`button`,"aria-label":R(`Delete review note {n}`,{n:t+1}),disabled:y,onClick:()=>B(e),children:`×`})]},e.id))},e)),pe&&(0,C.jsx)(`textarea`,{"aria-label":R(`Instructions for color groups`),placeholder:R(`What should change in each color group?`),value:i.instructions||``,disabled:y,onChange:e=>F({...A.current.draft,instructions:e.target.value,requestKey:dt()})}),i.notes.length?(0,C.jsx)(`ol`,{children:i.notes.map((e,n)=>!e.group&&(0,C.jsxs)(`li`,{"data-note":e.id,children:[(0,C.jsxs)(`div`,{className:`review-note-head`,children:[(0,C.jsxs)(`button`,{className:`review-note-location`,onClick:()=>{o.find(t=>t.key===e.strip)?.strip.scrollIntoView({block:`center`}),v(!1)},children:[n+1,`. `,nt(e.where)]}),(0,C.jsx)(`button`,{type:`button`,"aria-label":R(`Delete review note {n}`,{n:n+1}),disabled:y,onClick:()=>B(e),children:`×`})]}),(0,C.jsx)(me,{text:e.quote}),(0,C.jsx)(he,{children:(0,C.jsxs)(`button`,{type:`button`,className:`note-comment`,"aria-label":R(`Edit note {n}: {comment}`,{n:n+1,comment:e.comment}),title:R(`Edit note`),disabled:y,onClick:()=>te(e),children:[(0,C.jsx)(`span`,{children:e.comment}),(0,C.jsx)(T,{name:`pencil`,size:13})]})}),e.round!==t.review?.round&&(0,C.jsx)(`small`,{children:R(`Marked on earlier changes.`)})]},e.id))}):(0,C.jsxs)(`div`,{className:`review-notes-empty`,children:[(0,C.jsx)(`p`,{children:R(`No notes yet`)}),(0,C.jsx)(`div`,{className:`review-note-actions`,children:(0,C.jsxs)(`button`,{type:`button`,onClick:()=>P(!0),children:[(0,C.jsx)(T,{name:`region`,size:16}),R(`Region note`)]})})]}),x&&(0,C.jsx)(`p`,{className:`review-notes-error`,role:`alert`,children:x}),fe&&(0,C.jsx)(`p`,{children:R(`Check the task status before sending notes.`)}),i.notes.length>0&&(0,C.jsx)(`footer`,{children:(0,C.jsx)(`button`,{className:`primary`,"aria-label":y?R(`Sending…`):pe?R(`Send annotations to the agent`):re(i.notes.length,`Send {n} note to the agent`,`Send {n} notes to the agent`),disabled:y||fe||pe&&!i.instructions?.trim()&&!i.notes.some(e=>e.comment.trim()),onClick:()=>void de(),children:y?R(`Sending…`):pe?R(`Send annotations`):re(i.notes.length,`Send {n} note`,`Send {n} notes`)})})]})]}),e.body)]})}var bt=`:root{--bg:#fff;--sidebar:#f9f9f9;--bg-subtle:#fafafa;--bg-muted:#f4f4f4;--bg-hover:#efefef;--bg-active:#e7e7e7;--canvas:#f3f3f3;--line:#e8e8e8;--line-strong:#d6d6d6;--text:#171717;--text-2:#525252;--text-3:#8a8a8a;--accent:#2563eb;--accent-hover:#1d4ed8;--accent-soft:#eff6ff;--accent-line:#bfdbfe;--primary:#2563eb;--primary-hover:#1d4ed8;--green:#15803d;--green-soft:#f0fdf4;--purple:#7c3aed;--purple-soft:#f5f3ff;--red:#dc2626;--red-soft:#fef2f2;--red-line:#fecaca;--amber-soft:#fffbeb;--amber-line:#fde68a;--amber-text:#92400e;--shadow-xs:0 1px 2px #0000000f;--shadow-sm:0 1px 2px #0000000d,0 3px 8px #0000000d;--float:0 2px 4px #0000000a,0 14px 36px #00000021;--ring:0 0 0 3px #2563eb2e;--line-hover:#c4c4c4;--danger:#dc2626;--danger-hover:#b91c1c;--scroll-thumb:#0000001f;--scroll-hover:#0003;--scroll-active:#00000057;--pdf-filter:none;--pdf-page:#fff;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}:root[data-theme=dark]{--bg:#26272b;--sidebar:#202124;--bg-subtle:#2a2b2f;--bg-muted:#303135;--bg-hover:#37383c;--bg-active:#404145;--canvas:#1e1f22;--line:#38393e;--line-strong:#4b4c52;--line-hover:#63646b;--text:#ececee;--text-2:#c2c3c9;--text-3:#9c9da5;--accent:#8ab4ff;--accent-hover:#b2ceff;--accent-soft:#2b3651;--accent-line:#445c85;--primary:#2563eb;--primary-hover:#1d4ed8;--green:#7bd5a0;--green-soft:#243a2f;--purple:#bfa1ff;--purple-soft:#372d48;--red:#ff9696;--red-soft:#46292e;--red-line:#733b45;--amber-soft:#3e3424;--amber-line:#6d5631;--amber-text:#eac584;--shadow-xs:0 1px 2px #0003;--shadow-sm:0 1px 2px #0000002e,0 3px 8px #0003;--float:0 2px 4px #0003,0 14px 36px #0006;--ring:0 0 0 3px #8ab4ff38;--scroll-thumb:#ffffff29;--scroll-hover:#ffffff40;--scroll-active:#ffffff61;--pdf-filter:invert(.84) hue-rotate(180deg);--pdf-page:#292929;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}`,xt=(0,S.createContext)(null),St=()=>(0,S.useContext)(xt);function Ct({task:e,items:t,read:n,openReview:r,openChat:i,children:a}){let[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(``),[m,h]=(0,S.useState)(null),[g,_]=(0,S.useState)(0),v=(0,S.useRef)(0),y=(0,S.useRef)({read:n,openReview:r,openChat:i});y.current={read:n,openReview:r,openChat:i};let b=t.filter(e=>e.type===`user`&&(e.meta?.notes?.length||ke(e.text))).map(e=>e.id).join(`,`),x=e?.id,w=(0,S.useCallback)(()=>{if(!x||!b)return;let e=++v.current;d(!0),l(!1),y.current.read(x).then(t=>{if(!Array.isArray(t.notes))throw Error(`Invalid note results`);v.current===e&&s(t.notes)}).catch(()=>{v.current===e&&l(!0)}).finally(()=>{v.current===e&&d(!1)})},[x,b]),T=JSON.stringify(e?.review?.counts);(0,S.useEffect)(()=>(w(),()=>{++v.current}),[w,e?.review?.round,e?.status,e?.updatedAt,T]),(0,S.useEffect)(()=>{s([]),h(null),p(``),l(!1)},[x]);let E={notes:o,loading:u,error:c,selected:f,reveal:g,focus:m,reload:w,showNote:e=>{p(e),_(e=>e+1),y.current.openChat(),requestAnimationFrame(()=>{let t=[...document.querySelectorAll(`[data-note-result]`)].find(t=>t.dataset.noteResult===e);t?.scrollIntoView({block:`center`}),t?.focus({preventScroll:!0})})},showChange(e,t){p(e),h(n=>({key:e,change:t,sequence:(n?.sequence||0)+1})),y.current.openReview()}};return(0,C.jsx)(xt.Provider,{value:E,children:a})}var wt=e=>({pending:R(`Pending review`),accepted:R(`Accepted`),rejected:R(`Rejected`),commented:R(`Revision requested`),mixed:R(`Partly reviewed`)})[e];function Tt({noteKey:e}){let t=St();if(!t)return null;let n=t.notes.find(t=>t.key===e);return t.error?e.endsWith(`:0`)?(0,C.jsxs)(`button`,{type:`button`,className:`note-result-retry`,onClick:t.reload,children:[(0,C.jsx)(T,{name:`refresh`,size:12}),R(`Retry linking changes`)]}):null:n?(0,C.jsx)(`div`,{className:`note-result-links`,children:n.changes.length?n.changes.map(n=>(0,C.jsxs)(`button`,{type:`button`,className:`note-result-link `+n.state,title:R(`View changes for this note`),onClick:()=>t.showChange(e,n),children:[(0,C.jsx)(T,{name:`diff`,size:13}),(0,C.jsx)(`span`,{children:R(`Change {n}`,{n:n.stop+1})}),(0,C.jsx)(`span`,{className:`note-result-decision`,children:wt(n.state)}),(0,C.jsx)(T,{name:`arrowRight`,size:12})]},`${n.round}:${n.stop}`)):(0,C.jsx)(`span`,{className:`note-result-status`,children:n.state===`waiting`?R(`Awaiting changes`):R(`No linked change`)})}):t.loading?(0,C.jsx)(`span`,{className:`note-result-status`,children:(0,C.jsx)(`span`,{className:`spinner`})}):null}function Et({doc:e,round:t}){let n=St(),r=(0,S.useRef)(n);r.current=n;let[i,a]=(0,S.useState)([]),o=(0,S.useRef)(null);return(0,S.useEffect)(()=>{if(!e||!n)return;let r=new Map,i=()=>{let i=Number(e.documentElement.dataset.papilotRound)||t,o=[];for(let t of e.querySelectorAll(`.change[data-stop]`)){let a=Number(t.dataset.stop),s=n.notes.filter(e=>e.changes.some(e=>e.round===i&&e.stop===a)),c=t.querySelector(`.change-head`);if(!s.length||!c)continue;let l=r.get(t);l?l.parentElement!==c&&c.append(l):(l=e.createElement(`span`),l.className=`papilot-note-links`,c.append(l),r.set(t,l)),o.push({element:t,slot:l,notes:s,stop:a,round:i})}for(let[e,t]of r)o.some(t=>t.element===e)||(t.remove(),r.delete(e));a(e=>e.length===o.length&&e.every((e,t)=>e.slot===o[t].slot&&e.element===o[t].element&&e.round===o[t].round&&e.notes.length===o[t].notes.length&&e.notes.every((e,n)=>e===o[t].notes[n]))?e:o)};i();let o=new MutationObserver(i);return o.observe(e.body,{childList:!0,subtree:!0}),e.defaultView?.addEventListener(`papilot:round`,i),()=>{o.disconnect(),e.defaultView?.removeEventListener(`papilot:round`,i),r.forEach((e,t)=>{e.remove(),t.classList.remove(`papilot-linked-change`)})}},[e,n?.notes,t]),(0,S.useEffect)(()=>{let t=n?.focus;for(let e of i)e.element.classList.toggle(`papilot-linked-change`,!!(t&&t.change.round===e.round&&t.change.stop===e.stop));if(!e||!t||o.current?.doc===e&&o.current.sequence===t.sequence)return;let r=i.find(e=>e.round===t.change.round&&e.stop===t.change.stop);r&&(r.element.click(),r.element.scrollIntoView({block:`center`}),r.element.focus({preventScroll:!0}),o.current={doc:e,sequence:t.sequence})},[e,i,n?.focus]),!e||!n?null:(0,C.jsxs)(C.Fragment,{children:[(0,Se.createPortal)((0,C.jsx)(`style`,{children:`
|
|
14
|
-
.papilot-note-links{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px;order:5}
|
|
15
|
-
.papilot-note-links button{display:inline-flex;align-items:center;gap:4px;padding:3px 7px;border:1px solid var(--line);border-radius:6px;background:var(--bg-muted);color:var(--text-2);font:12px/1.5 var(--sans);cursor:pointer}
|
|
16
|
-
.papilot-note-links button:hover,.papilot-note-links button:focus-visible{color:var(--primary);border-color:var(--primary)}
|
|
17
|
-
.papilot-linked-change{outline:2px solid var(--primary);outline-offset:-2px}
|
|
18
|
-
@media(max-width:680px){.papilot-note-links button{min-height:32px}}
|
|
19
|
-
`}),e.head),i.map(e=>(0,Se.createPortal)((0,C.jsx)(C.Fragment,{children:e.notes.map(e=>(0,C.jsxs)(`button`,{type:`button`,title:e.note.comment,"aria-label":R(`Show note {n}: {comment}`,{n:e.index+1,comment:e.note.comment}),onClick:t=>{t.stopPropagation(),r.current?.showNote(e.key)},children:[(0,C.jsx)(T,{name:`notes`,size:12}),R(`Note {n}`,{n:e.index+1})]},e.key))}),e.slot,`${e.round}:${e.stop}`))]})}var Dt=`latex-review:shortcuts`,Ot=`latex-review:shortcuts-changed`,kt={accept:[`a`],reject:[`r`],comment:[`c`],next:[`j`,`ArrowRight`],previous:[`k`,`ArrowLeft`],pending:[`n`],source:[`s`],undo:[`u`],help:[`?`]},At=Object.keys(kt);function jt(e){if(e.isComposing||[`Control`,`Meta`,`Alt`,`Shift`,`Dead`,`Unidentified`,`Process`].includes(e.key))return null;let t=e.key.length===1?e.key.toLowerCase():e.key;return[e.ctrlKey&&`Ctrl`,e.metaKey&&`Meta`,e.altKey&&`Alt`,e.shiftKey&&(/^[a-z]$/.test(t)||t.length>1)&&`Shift`,t].filter(Boolean).join(`+`)}function Mt(e){return/^(?:(?:Ctrl|Meta|Alt|Shift)\+)*(?:[a-z0-9?/,.;'\[\]`=\-]|Arrow(?:Left|Right|Up|Down))$/.test(e)}function Nt(e){return!Mt(e)||/^(?:Ctrl|Meta)\+(?:Shift\+)?[acflnpqrstuvwxz=\-]$/.test(e)||/^(?:Alt|Meta)\+Arrow(?:Left|Right)$/.test(e)}function Pt(e){let t=e&&typeof e==`object`?e:{};return Object.fromEntries(At.map(e=>{let n=t[e];return[e,Array.isArray(n)&&n.length<=4&&n.every(e=>typeof e==`string`&&!Nt(e))?[...new Set(n)]:[...kt[e]]]}))}function Ft(e){try{return Pt(JSON.parse(e||`{}`))}catch{return Pt({})}}function It(e){return e.split(`+`).map(e=>({Meta:`⌘`,Ctrl:`Ctrl`,Alt:`Alt`,Shift:`Shift`,ArrowRight:`→`,ArrowLeft:`←`,ArrowUp:`↑`,ArrowDown:`↓`})[e]||e.toUpperCase()).join(`+`)}var Lt=Ft(D.getItem(Dt)),V=new Set;function Rt(e){Lt=e,V.forEach(e=>e())}typeof window<`u`&&window.addEventListener(`storage`,e=>{(e.key===`latex-review:shortcuts`||e.key===null)&&Rt(Ft(D.getItem(Dt)))});function H(e){D.setItem(Dt,JSON.stringify(e)),Rt(e)}function zt(){return(0,S.useSyncExternalStore)(e=>(V.add(e),()=>{V.delete(e)}),()=>Lt)}var Bt=(e,t,n)=>`/review/${e.projectId}/?task=${e.name}${t?`&round=${t}${n===void 0?`&history=1`:`&change=${n}`}`:``}${L()===`en`?``:`&lang=${L()}`}`,Vt=e=>`/review/${e}/?changes=1${L()===`en`?``:`&lang=${L()}`}`;function U(e,t,n,r){if(!e||e.getElementById(`papilot-embed-style`))return;e.documentElement.style.setProperty(`--papilot-tools`,`${t}px`),e.documentElement.style.setProperty(`--papilot-lead`,`${n}px`);let i=e.createElement(`style`);i.id=`papilot-embed-style`,i.textContent=bt+`
|
|
20
|
-
:root{--sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","PingFang SC","Noto Sans SC",system-ui,sans-serif;--comment:var(--accent);--accept:var(--green);--reject:var(--red);--frame:var(--canvas);--bar:var(--bg);--muted:var(--text-3);--ink:var(--text);--head:var(--bg-subtle);font-size:14px}
|
|
21
|
-
.banner{border-radius:10px}
|
|
22
|
-
.source,.source-code,.composer textarea,.composer button,.unit-actions button,.toast,.change-map-tooltip,.review-mode,.review-mode select,.review-complete,.change.standalone{background:var(--bg);color:var(--text)}
|
|
23
|
-
.banner{background:var(--accent-soft);border-color:var(--accent-line)}.banner .details{background:var(--bg-subtle)}
|
|
24
|
-
.source-title{color:var(--text-2)}
|
|
25
|
-
.source-code del{background:var(--red-soft);color:var(--red)}
|
|
26
|
-
.source-code ins{background:var(--green-soft);color:var(--green)}
|
|
27
|
-
.remark{background:var(--accent-soft)}.histories,.caption{background:var(--bg-subtle);color:var(--text-2)}
|
|
28
|
-
.toast.error{background:var(--red-soft);color:var(--red)}
|
|
29
|
-
/* Papilot's commit step at the end of the completion card. */
|
|
30
|
-
.review-complete{align-items:center}
|
|
31
|
-
.review-complete-actions{flex-wrap:wrap;justify-content:flex-end;max-width:100%}
|
|
32
|
-
.review-complete-actions .commit-state{font-size:13px;color:var(--text-3)}
|
|
33
|
-
.review-complete-actions .commit-button{display:inline-flex;align-items:center;height:28px;padding:0 12px;border:1px solid var(--line-strong);border-radius:7px;background:var(--bg);color:var(--text);font:500 13px var(--sans);cursor:pointer;box-shadow:0 1px 2px rgb(0 0 0/.06)}
|
|
34
|
-
.review-complete-actions .commit-button:hover{background:var(--bg-subtle);border-color:var(--line-hover)}
|
|
35
|
-
.review-complete-actions .commit-button:focus-visible{outline:none;box-shadow:var(--ring)}
|
|
36
|
-
.review-complete-actions .commit-button{height:auto;min-height:30px;padding:5px 12px;white-space:nowrap}
|
|
37
|
-
.review-complete-actions .commit-button:disabled{opacity:.5;cursor:default}
|
|
38
|
-
:root[data-papilot-phone] .review-complete-actions{justify-content:flex-start;margin-left:0}
|
|
39
|
-
:root[data-papilot-phone] .review-complete-actions .commit-state{flex-basis:100%}
|
|
40
|
-
:root[data-papilot-phone] .review-complete-actions .commit-button{min-height:40px}
|
|
41
|
-
/* Page images follow the theme like the manuscript's PDF. They are
|
|
42
|
-
transparent: the sheet is the paper, and the before/after rows tint it. */
|
|
43
|
-
.pdf-strip{color-scheme:light}.pdf-strip img{filter:var(--pdf-filter)}.sheet{background:var(--pdf-page)}
|
|
44
|
-
:root[data-theme="dark"]{--before:#432c30;--after:#28392d}
|
|
45
|
-
.bar{display:flex;align-items:center;height:var(--papilot-bar-height,44px);min-height:var(--papilot-bar-height,44px);padding:0 max(14px,calc(var(--papilot-tools,0px) + 4px)) 0 calc(var(--papilot-lead,0px) + 14px);gap:12px;flex-wrap:nowrap;overflow:hidden}
|
|
46
|
-
.bar .overview-link,.bar .identity h1,.bar .identity span{display:none}
|
|
47
|
-
.bar .identity{flex:1;min-width:0;flex-direction:row;gap:6px}
|
|
48
|
-
.bar .identity span{font-size:13px;font-weight:600;color:var(--text-2);overflow:hidden;text-overflow:ellipsis}
|
|
49
|
-
.bar .meter{display:flex;order:initial;width:auto;font-size:13px}
|
|
50
|
-
.bar .bar-end{margin-left:0;gap:6px;flex-wrap:wrap;justify-content:flex-end;min-width:0}
|
|
51
|
-
.bar .ghost{font-size:13px;font-weight:500;height:28px;padding:0 10px;border-radius:7px}
|
|
52
|
-
.bar .ghost:hover{text-decoration:none;background:var(--bg-hover)}
|
|
53
|
-
.bar .accept-all,.bar .reject-all{display:inline-flex;align-items:center;gap:6px;border-color:var(--line-strong);background:var(--bg);color:var(--ink);box-shadow:0 1px 2px rgb(0 0 0/.06)}
|
|
54
|
-
.bar .accept-all:hover,.bar .reject-all:hover{background:var(--bg-subtle);border-color:var(--line-hover)}
|
|
55
|
-
.bar .ghost.round{display:none}
|
|
56
|
-
.bar .status{font-size:13px}
|
|
57
|
-
.sheet{border-radius:4px;box-shadow:0 1px 2px rgb(0 0 0/.06),0 8px 24px rgb(0 0 0/.08)}
|
|
58
|
-
.change-head{font-size:13px;background:var(--bg-subtle)}.link{font-size:13px}
|
|
59
|
-
/* The current change: a thin accent outline and a warm header, like a selected
|
|
60
|
-
row in the workspace, rather than a blue frame on a blue-grey header. */
|
|
61
|
-
.change.current{box-shadow:0 0 0 1px var(--accent-line),0 0 0 4px rgb(37 99 235/.07)}
|
|
62
|
-
.change.current .change-head{background:var(--bg-muted);color:var(--ink)}
|
|
63
|
-
.change-head .link{display:inline-flex;align-items:center;height:28px;padding:0 8px;border-radius:7px;color:var(--text-2);font-weight:500}
|
|
64
|
-
.change-head .link:hover{background:var(--bg-hover);color:var(--ink);text-decoration:none}
|
|
65
|
-
.change-head .link.active{background:var(--accent-soft);color:var(--accent);text-decoration:none}
|
|
66
|
-
/* Decision buttons are plain text actions like the rest of the header
|
|
67
|
-
(Copy reference, LaTeX, Undo): a coloured icon says what each does, and
|
|
68
|
-
hovering tints it green, red or blue. On phones the bar is a solid
|
|
69
|
-
toolbar at the bottom. */
|
|
70
|
-
:root{--icon-copy:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><rect x='8' y='8' width='12' height='12' rx='2'/><path d='M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2'/></svg>");--icon-check:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>");--icon-cross:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'><path d='M18 6 6 18M6 6l12 12'/></svg>");--icon-comment:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'><path d='M20 15a2 2 0 0 1-2 2H8l-4 4V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z'/></svg>")}
|
|
71
|
-
.change-head .actions .accept::before,.change-head .actions .reject::before,.change-head .actions .comment::before,.bar .accept-all::before,.bar .reject-all::before{content:"";flex:none;width:13px;height:13px;background:currentColor;-webkit-mask:var(--icon) center/contain no-repeat;mask:var(--icon) center/contain no-repeat}
|
|
72
|
-
.change-head .actions .accept,.bar .accept-all{--icon:var(--icon-check)}.change-head .actions .reject,.bar .reject-all{--icon:var(--icon-cross)}.change-head .actions .comment{--icon:var(--icon-comment)}
|
|
73
|
-
.change-head .actions .accept::before,.bar .accept-all::before{background:var(--accept)}.change-head .actions .reject::before,.bar .reject-all::before{background:var(--reject)}.change-head .actions .comment::before{background:var(--accent)}
|
|
74
|
-
.change-head .actions{gap:3px;padding:4px;background:var(--bg);border:1px solid var(--line-strong);border-radius:12px;box-shadow:0 1px 2px rgb(0 0 0/.06),0 4px 12px rgb(0 0 0/.06)}
|
|
75
|
-
.change-head .actions button{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:28px;padding:0 11px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:500;line-height:1;transition:background-color .15s,border-color .15s}
|
|
76
|
-
.change-head .actions .nav{width:28px;padding:0;font-size:19px;font-weight:400;color:var(--text-2)}
|
|
77
|
-
.change-head .actions .nav:hover:not(:disabled){background:var(--bg-hover)}
|
|
78
|
-
.change-head .actions .nav:disabled{color:var(--text-3);opacity:1}
|
|
79
|
-
.change-head .position{min-width:38px;font-size:12.5px;color:var(--text-2);font-variant-numeric:tabular-nums}
|
|
80
|
-
.change-head .actions .accept,.change-head .actions .reject,.change-head .actions .comment,.change-head .actions .skip{background:transparent;color:var(--ink)}
|
|
81
|
-
.change-head .actions .accept:hover:not(:disabled){background:var(--green-soft);color:var(--accept)}
|
|
82
|
-
.change-head .actions .reject:hover:not(:disabled){background:var(--red-soft);color:var(--reject)}
|
|
83
|
-
.change-head .actions .comment:hover:not(:disabled){background:var(--accent-soft);color:var(--accent)}
|
|
84
|
-
.change-head .actions .skip:hover{background:var(--bg-hover)}
|
|
85
|
-
.change-head .actions button:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
|
|
86
|
-
.change-head .complete{display:inline-flex;align-items:center;gap:6px;padding:0 8px;font-size:13px;font-weight:500;color:var(--accept)}
|
|
87
|
-
.change-head .complete::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
|
|
88
|
-
.change-head .actions .undo{margin-left:3px;padding:0 9px;font-weight:400;color:var(--text-2)}
|
|
89
|
-
.change-head .actions .undo:hover:not(:disabled){background:var(--bg-hover)}
|
|
90
|
-
.change-head .actions .undo:disabled{color:var(--text-3);opacity:1}
|
|
91
|
-
.change-head .actions .accept:disabled,.change-head .actions .reject:disabled,.change-head .actions .comment:disabled{opacity:.4}
|
|
92
|
-
/* Uncommitted changes: Stage is the check, Unstage a minus and Revert an
|
|
93
|
-
arrow back. The last revert is undone from the bar. */
|
|
94
|
-
:root{--icon-minus:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'><path d='M5 12h14'/></svg>");--icon-revert:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M9 14 4 9l5-5'/><path d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/></svg>")}
|
|
95
|
-
.change-head .actions .unstage::before{content:"";flex:none;width:13px;height:13px;background:var(--text-2);-webkit-mask:var(--icon-minus) center/contain no-repeat;mask:var(--icon-minus) center/contain no-repeat}
|
|
96
|
-
[data-mode=changes] .change-head .actions .reject{--icon:var(--icon-revert)}
|
|
97
|
-
.change-head .actions .unstage{background:transparent;color:var(--ink)}
|
|
98
|
-
.change-head .actions .unstage:hover:not(:disabled){background:var(--bg-hover)}
|
|
99
|
-
.change-head .actions .unstage:disabled{opacity:.4}
|
|
100
|
-
.unit-actions .unstage{color:var(--text-2)}
|
|
101
|
-
.bar .ghost.undo{flex-shrink:0;white-space:nowrap}
|
|
102
|
-
/* A narrow desktop pane keeps the actions with its change. Wrapping
|
|
103
|
-
the header preserves its tools without switching to a phone dock. */
|
|
104
|
-
.change-head{flex-wrap:wrap;align-items:center;gap:4px 6px;padding:5px 8px 5px 12px;min-height:40px}
|
|
105
|
-
.change-head .dock,.change-head .actions{display:contents}
|
|
106
|
-
.change-head .actions>.nav:first-child{order:1}.change-head .change-number{order:2}.change-head .actions>.nav:not(:first-child){order:3}
|
|
107
|
-
.change-head .change-where{order:4;flex:1 1 100px;min-width:0;margin-left:4px}
|
|
108
|
-
.change-head .change-kind,.change-head .badge{order:5}
|
|
109
|
-
.change-head .actions>*{order:6}
|
|
110
|
-
.change-head .link{order:7}
|
|
111
|
-
:root:not([data-papilot-phone]) .change-head .position,:root:not([data-papilot-phone]) .change-head .complete{display:none}
|
|
112
|
-
.change-head .actions .undo:disabled{display:none}
|
|
113
|
-
.change-head .actions .nav{width:28px;height:28px;font-size:18px}
|
|
114
|
-
.change-head .copy-reference{width:28px;padding:0;justify-content:center;font-size:0}
|
|
115
|
-
.change-head .copy-reference::before{content:"";width:15px;height:15px;background:currentColor;-webkit-mask:var(--icon-copy) center/contain no-repeat;mask:var(--icon-copy) center/contain no-repeat}
|
|
116
|
-
@media(max-width:680px){
|
|
117
|
-
:root:not([data-papilot-phone]){
|
|
118
|
-
.change-head .dock{display:flex;order:8;flex:1 0 100%;margin:0}
|
|
119
|
-
.change-head .actions{display:flex;width:100%;flex-wrap:wrap;gap:3px;padding:0;border:0;border-radius:0;background:none;box-shadow:none}
|
|
120
|
-
.change-head .position{display:inline;order:2;min-width:30px}
|
|
121
|
-
.change-head .actions>.nav:not(:first-child){margin-right:auto}
|
|
122
|
-
.change-head .actions button{padding:0 6px;font-size:12.5px}
|
|
123
|
-
.change-head .actions .nav{padding:0;font-size:18px}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
#paper{--paper-top:14px;padding-top:14px}
|
|
127
|
-
.review-body>#paper{padding-right:34px}
|
|
128
|
-
.change-map{top:10px;bottom:10px;right:8px;width:14px;border:0;border-radius:0;background:none;box-shadow:none}
|
|
129
|
-
.change-map::before{content:"";position:absolute;top:0;bottom:0;left:50%;width:2px;margin-left:-1px;border-radius:2px;background:var(--line)}
|
|
130
|
-
.change-map-viewport{left:50%;right:auto;width:4px;margin-left:-2px;border:0;border-radius:999px;background:var(--scroll-thumb);transition:width .15s,margin .15s,background-color .15s}
|
|
131
|
-
.change-map:hover .change-map-viewport,.change-map-viewport:active{width:6px;margin-left:-3px;background:var(--scroll-hover)}
|
|
132
|
-
.change-map-mark{--mark:var(--text-3);left:50%;width:4px;min-height:3px;margin-left:-2px;border-radius:999px;transition:width .15s,margin .15s}
|
|
133
|
-
.change-map-mark[aria-current]{outline:0;width:6px;margin-left:-3px;box-shadow:0 0 0 2px var(--frame)}
|
|
134
|
-
.change-map:hover .change-map-mark{width:6px;margin-left:-3px}
|
|
135
|
-
.change-map .change-map-mark:hover{outline:0;width:8px;margin-left:-4px;box-shadow:0 0 0 2px var(--frame)}
|
|
136
|
-
.change-map-mark:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
|
|
137
|
-
::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background:transparent}
|
|
138
|
-
::-webkit-scrollbar-thumb{background-color:var(--scroll-thumb);border:3px solid transparent;border-radius:999px;background-clip:padding-box}
|
|
139
|
-
::-webkit-scrollbar-thumb:hover{background-color:var(--scroll-active);border-width:2px}
|
|
140
|
-
@supports not selector(::-webkit-scrollbar){*{scrollbar-width:thin;scrollbar-color:var(--scroll-hover) transparent}}
|
|
141
|
-
.part-title{font-size:15px;margin:6px 0 10px}
|
|
142
|
-
.side .pdf-strip,.context .pdf-strip{max-width:none}
|
|
143
|
-
/* Only the host window, never an iframe's width, selects the phone
|
|
144
|
-
layout. Navigation and position stay alongside the decisions. */
|
|
145
|
-
:root[data-papilot-phone]{
|
|
146
|
-
.bar{gap:8px}.bar .ghost:not(.history){min-height:36px;font-size:12px}
|
|
147
|
-
.review-body>#paper{padding-left:8px;padding-right:24px;padding-bottom:132px}
|
|
148
|
-
.change-map{right:4px;width:12px}
|
|
149
|
-
.side.before::after,.side.after::after{content:none}
|
|
150
|
-
.change-head{padding:4px 6px 4px 10px;gap:6px}
|
|
151
|
-
.change-head .link{min-height:36px;padding:0 6px}
|
|
152
|
-
.change-head .dock{display:flex;position:fixed;z-index:6;left:8px;right:8px;bottom:8px;margin:0}
|
|
153
|
-
.change-head .actions{display:flex;width:100%;flex-wrap:wrap;justify-content:center;gap:4px;padding:5px;border-radius:12px;border-color:var(--line-strong);box-shadow:0 2px 4px rgb(0 0 0/.05),0 6px 20px rgb(0 0 0/.12)}
|
|
154
|
-
.change-head .actions>*{order:initial!important}
|
|
155
|
-
.change-head .actions button{flex:1 1 auto;min-width:0;height:44px;gap:5px;padding:0 6px;border-radius:8px;font-size:13px}
|
|
156
|
-
.change-head .actions .nav{flex:0 0 32px;width:32px;min-width:32px;height:44px;padding:0}
|
|
157
|
-
.change-head .position{min-width:30px;font-size:11.5px}
|
|
158
|
-
.change-head .actions .undo{flex:0 0 auto;margin-left:0;padding:0 6px;font-size:13px}
|
|
159
|
-
@media(max-width:360px){
|
|
160
|
-
.change-head .actions:has(.nav){display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
|
|
161
|
-
.change-head .actions .nav{width:100%;min-width:0;grid-row:1}
|
|
162
|
-
.change-head .actions>.nav:first-child{grid-column:1}
|
|
163
|
-
.change-head .actions>.nav:not(:first-child){grid-column:3}
|
|
164
|
-
.change-head .position{grid-row:1;grid-column:2;justify-self:center}
|
|
165
|
-
.change-head .actions button:not(.nav){grid-row:2}
|
|
166
|
-
}
|
|
167
|
-
.composer{left:0!important;right:0!important;width:auto!important;max-width:none;top:var(--papilot-review-bar-height,48px);bottom:auto;transform:none;max-height:calc(100% - var(--papilot-review-bar-height,48px) - var(--keyboard,0px));overflow:auto;border-width:0 0 1px;border-radius:0 0 16px 16px}
|
|
168
|
-
#root:has(>.composer) .change-head .dock{display:none}
|
|
169
|
-
.composer textarea{font-size:16px;min-height:76px;max-height:min(140px,30vh);resize:none}.composer button{min-height:44px}
|
|
170
|
-
.composer-row{justify-content:flex-end;gap:8px}.composer-row .muted{display:none}
|
|
171
|
-
.side .pdf-strip,.context .pdf-strip{width:calc(100% * var(--pdf-crop-scale,1));margin-left:calc(-100% * var(--pdf-crop-scale,1) * var(--pdf-crop-shift,0))}
|
|
172
|
-
.side,.context{overflow-x:clip}
|
|
173
|
-
}
|
|
174
|
-
/* History shares the PDF tools' size. Shortcut settings live in Papilot. */
|
|
175
|
-
.bar .ghost.history{display:inline-flex;align-items:center;justify-content:center;width:var(--papilot-button-size,30px);height:var(--papilot-button-size,30px);min-height:0;padding:0;font-size:0}
|
|
176
|
-
.bar .history::before{content:"";width:16px;height:16px;background:currentColor;-webkit-mask:var(--icon-history) center/contain no-repeat;mask:var(--icon-history) center/contain no-repeat}
|
|
177
|
-
/* Reserve the outer tools' row when there is too little room. Keep
|
|
178
|
-
progress, batch counts and history; shorten only the batch labels. */
|
|
179
|
-
.bar{container:review-bar/inline-size;height:auto;gap:8px}
|
|
180
|
-
.bar .accept-all,.bar .reject-all{flex-shrink:0;white-space:nowrap}
|
|
181
|
-
.bar .batch-count{margin-left:0;background:var(--bg-muted);color:var(--text-2)}
|
|
182
|
-
:root[data-papilot-toolbar-stacked] .bar{padding:calc(var(--papilot-bar-height,44px) + 4px) 8px 4px;min-height:calc(var(--papilot-bar-height,44px) + 44px)}
|
|
183
|
-
:root[data-papilot-toolbar-stacked] .bar .identity{display:none}
|
|
184
|
-
:root[data-papilot-toolbar-stacked] .bar .bar-end{margin-left:auto}
|
|
185
|
-
@container review-bar (max-width:340px){.bar .batch-label{display:none}.bar .accept-all,.bar .reject-all{padding:0 8px}.bar .bar-end{gap:4px}}
|
|
186
|
-
:root{--icon-history:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12a9 9 0 1 0 2.6-6.4L3 8'/><path d='M3 3v5h5M12 7v5l3 2'/></svg>")}
|
|
187
|
-
`,e.documentElement.dataset.theme=window.document.documentElement.dataset.theme,i.textContent+=at,e.head.append(i)}function Ht(e){let t=1,n=0;for(let r of e.querySelectorAll(`.pdf-strip`)){let e=r.getBoundingClientRect();if(e.width)for(let i of r.querySelectorAll(`.pdf-text-line`)){let r=i.firstElementChild?.getBoundingClientRect(),a=i.lastElementChild?.getBoundingClientRect();r?.width&&a?.width&&(t=Math.min(t,(r.left-e.left)/e.width),n=Math.max(n,(a.right-e.left)/e.width))}}let r=e.documentElement.style,i=n-t+.04;n<=t||i>=.95?(r.removeProperty(`--pdf-crop-scale`),r.removeProperty(`--pdf-crop-shift`)):(r.setProperty(`--pdf-crop-scale`,(1/i).toFixed(4)),r.setProperty(`--pdf-crop-shift`,Math.max(0,t-.02).toFixed(4)))}function Ut({task:e,changesOf:t,tools:n,lead:r,completion:i,onSendNotes:a,onDecided:o}){let s=zt(),c=St(),l=(0,S.useRef)(c);l.current=c;let u=e?c?.focus?.change.round:void 0,d=u===e?.review?.round?c?.focus?.change.stop:void 0,f=e?c?.focus?.sequence:void 0,[p,m]=(0,S.useState)(null),h=(0,S.useRef)(null),g=(0,S.useRef)(null),_=(0,S.useRef)(null),v=(0,S.useRef)(null),[y,b]=(0,S.useState)(0),[x,w]=(0,S.useState)(0),T=(0,S.useRef)(o);T.current=o;let E=(0,S.useRef)(null),D=(0,S.useRef)(null),[O,k]=(0,S.useState)(0),[A,j]=(0,S.useState)(`loading`),M=ne().language;(0,S.useEffect)(()=>{let e=p?.defaultView;e&&e.dispatchEvent(new CustomEvent(Ot,{detail:s}))},[p,s]),(0,S.useEffect)(()=>{let e=p?.defaultView;if(!e)return;let t=e=>{e.preventDefault(),window.dispatchEvent(new Event(`papilot:open-shortcuts`))};return e.addEventListener(`latex-review:help`,t),()=>e.removeEventListener(`latex-review:help`,t)},[p]),(0,S.useEffect)(()=>{j(`loading`);let e=setTimeout(()=>j(e=>e===`loading`?`slow`:e),15e3);return()=>{clearTimeout(e),E.current?.disconnect(),D.current?.disconnect()}},[O,M,u,f]),(0,S.useEffect)(()=>{let e=g.current;if(!e)return;let t=new ResizeObserver(()=>b(Math.ceil(e.offsetWidth)));return t.observe(e),()=>t.disconnect()},[!!n]),(0,S.useEffect)(()=>{let e=_.current;if(!e){w(0);return}let t=new ResizeObserver(()=>w(Math.ceil(e.offsetWidth)));return t.observe(e),()=>t.disconnect()},[!!r]),(0,S.useEffect)(()=>{if(!p||!h.current||!v.current)return;let e=p.documentElement,t=p.querySelector(`.bar`),n=window.matchMedia(`(max-width: 520px)`),r=()=>{e.toggleAttribute(`data-papilot-phone`,n.matches),e.style.setProperty(`--papilot-tools`,`${y}px`),e.style.setProperty(`--papilot-lead`,`${x}px`),e.style.setProperty(`--papilot-bar-height`,`${v.current.offsetHeight}px`),e.toggleAttribute(`data-papilot-toolbar-stacked`,h.current.clientWidth-y-x<220);let r=g.current?.querySelector(`.icon-button`);r&&e.style.setProperty(`--papilot-button-size`,`${r.offsetWidth}px`),t&&e.style.setProperty(`--papilot-review-bar-height`,`${t.offsetHeight}px`)},i=new ResizeObserver(r);return i.observe(h.current),i.observe(v.current),t&&i.observe(t),n.addEventListener(`change`,r),r(),()=>{i.disconnect(),n.removeEventListener(`change`,r)}},[y,x,p]);function N(){E.current?.disconnect();try{let e=h.current?.contentDocument;if(!e||!e.getElementById(`root`)&&!e.getElementById(`paper`)){j(`error`);return}U(e,y,x,!!t),m(e),h.current?.contentWindow?.addEventListener(`latex-review:decided`,()=>{T.current?.(),l.current?.reload()});let n=e.getElementById(`root`);e.addEventListener(`scroll`,t=>{let r=t.target===e?e.scrollingElement:t.target===n?n:null;r&&(r.scrollTop||r.scrollLeft)&&r.scrollTo(0,0)},!0);let r;D.current?.disconnect(),D.current=new MutationObserver(()=>{clearTimeout(r),r=setTimeout(()=>Ht(e),150)}),D.current.observe(e.body,{childList:!0,subtree:!0});let i=()=>{let n=e.getElementById(`paper`);n&&(n.querySelector(`[role="alert"]`)?j(`error`):(t||!n.querySelector(`.waiting`))&&(j(`ready`),E.current?.disconnect(),Ht(e)))};E.current=new MutationObserver(i),E.current.observe(e.body,{childList:!0,subtree:!0}),i()}catch{j(`error`)}}(0,S.useEffect)(()=>{if(!p)return;let e=window.document.documentElement,t=()=>{p.documentElement.dataset.theme=e.dataset.theme};t();let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:[`data-theme`]}),()=>n.disconnect()},[p]),(0,S.useEffect)(()=>{let e=window.visualViewport;if(!p||!e)return;let t=()=>{let t=h.current?.getBoundingClientRect();t&&p.documentElement.style.setProperty(`--keyboard`,`${Math.max(0,Math.round(t.bottom-e.offsetTop-e.height))}px`)};return t(),e.addEventListener(`resize`,t),e.addEventListener(`scroll`,t),window.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t),e.removeEventListener(`scroll`,t),window.removeEventListener(`resize`,t)}},[p]);let P=A===`ready`,[F,I]=(0,S.useState)(null);return(0,S.useEffect)(()=>{if(!p||!P){I(null);return}let e=()=>I(p.querySelector(`.review-complete-actions`));e();let t=new MutationObserver(e);return t.observe(p.body,{childList:!0,subtree:!0}),()=>t.disconnect()},[p,P]),(0,C.jsxs)(`div`,{className:`review-viewport`+(P?``:` review-pending`),"aria-busy":!P,children:[(0,C.jsx)(`iframe`,{ref:h,title:e?R(`{title} PDF change review`,{title:e.title}):R(`Uncommitted changes in the PDF`),src:e?Bt(e,u,d):Vt(t),onLoad:N,onError:()=>j(`error`),className:`review-frame`,"aria-hidden":!P,tabIndex:P?0:-1},`${O}:${M}:${u||``}:${f||``}`),e&&P&&(0,C.jsx)(Et,{doc:p,round:u||e.review?.round||0}),(0,C.jsxs)(`div`,{ref:v,className:`review-host-bar`,children:[r&&(0,C.jsx)(`div`,{ref:_,className:`review-lead`,children:r}),(0,C.jsxs)(`div`,{ref:g,className:`review-tools`,children:[e&&a&&(0,C.jsx)(yt,{doc:P?p:null,task:e,onSend:a}),n]})]}),F&&i?(0,Se.createPortal)(i,F):null,!P&&(0,C.jsxs)(`div`,{className:`review-loading`,children:[(0,C.jsx)(`p`,{role:A===`error`?`alert`:`status`,children:R(A===`error`?`The PDF review could not be loaded.`:A===`slow`?`The PDF review is taking longer than expected.`:`Loading PDF review…`)}),A!==`loading`&&(0,C.jsx)(`button`,{className:`button secondary`,onClick:()=>{j(`loading`),k(e=>e+1)},children:R(`Reload review`)})]})]})}function Wt(e){if(e.key!==`Tab`)return;let t=Array.from(e.currentTarget.querySelectorAll(`a[href], button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), summary, [tabindex="0"]`)).filter(e=>e.getClientRects().length>0&&!e.closest(`[inert]`)),n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}function Gt({task:e,submit:t,onClose:n,onDeleted:r,refresh:i}){let a=(0,S.useRef)(null),o=(0,S.useRef)(!1),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``),d=[`running`,`waiting_input`,`queued`].includes(e.status)?R(`Pause this task before deleting it.`):e.status===`building`?R(`Wait for the PDF build to finish before deleting this task.`):e.status===`uncertain`?R(`Check task status before deleting this task.`):``;(0,S.useEffect)(()=>{let e=document.activeElement,t=a.current;return t.showModal(),t.querySelector(`[data-cancel]`)?.focus(),()=>{t.close(),e?.isConnected&&e.getClientRects().length&&!e.closest(`[inert]`)?e.focus():Array.from(document.querySelectorAll(`.sidebar .new-task, .sidebar-toggle`)).find(e=>e.getClientRects().length&&!e.closest(`[inert]`))?.focus()}},[]);async function f(){if(!(o.current||d)){o.current=!0,c(!0),u(``);try{await t(),r()}catch(e){u(e instanceof Error?e.message:String(e)),i()}finally{o.current=!1,c(!1)}}}return(0,C.jsx)(`dialog`,{ref:a,className:`modal-backdrop`,"aria-labelledby":`delete-title`,"aria-describedby":`delete-description`,onKeyDown:Wt,onCancel:e=>{e.preventDefault(),s||n()},onClick:e=>{e.target===e.currentTarget&&!s&&n()},children:(0,C.jsxs)(`section`,{className:`modal delete-dialog`,children:[(0,C.jsx)(`h2`,{id:`delete-title`,children:R(`Delete task?`)}),(0,C.jsx)(`p`,{className:`delete-task-name`,children:e.title}),(0,C.jsx)(`p`,{id:`delete-description`,children:R(`This permanently removes the task from Papilot, including its conversation, worktree, and PDF review files. Unaccepted edits and saved comments will be discarded, and review decisions can no longer be undone.`)}),(0,C.jsx)(`p`,{children:R(`Accepted changes in your manuscript stay in place. Other tasks are not affected.`)}),e.status===`deleting`&&(0,C.jsx)(`p`,{className:`muted`,children:R(`Deletion has already started. Retry to confirm the cleanup and remove the task.`)}),d&&(0,C.jsx)(`p`,{className:`inline-error`,role:`status`,children:d}),l&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:l}),(0,C.jsxs)(`div`,{className:`button-row`,children:[(0,C.jsx)(`button`,{"data-cancel":!0,className:`button secondary`,disabled:s,onClick:n,children:R(`Cancel`)}),(0,C.jsx)(`button`,{className:`button danger`,disabled:s||!!d,onClick:()=>void f(),children:s?R(`Deleting…`):e.status===`deleting`?R(`Retry deletion`):R(`Delete task`)})]})]})})}var Kt=e=>[`installing`,`waiting`,`restarting`].includes(e.phase);function qt({api:e,version:t}){let[n,r]=(0,S.useState)(null),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(``),u=(0,S.useRef)(t),d=(0,S.useRef)(!1),f=(0,S.useRef)(null),p=(0,S.useRef)(n);if(p.current=n,(0,S.useEffect)(()=>{let t=!1,n=!1,i,a=async()=>{if(!n){n=!0;try{let n=await e(`/updates`);if(t||!n?.currentVersion)return;r(n),n.phase===`updated`&&n.currentVersion!==u.current&&!d.current&&(d.current=!0,location.reload())}catch{}finally{n=!1,t||(i=setTimeout(a,p.current&&Kt(p.current)?2e3:3e4))}}};a();let o=()=>{clearTimeout(i),a()};return window.addEventListener(`online`,o),window.addEventListener(`focus`,o),()=>{t=!0,clearTimeout(i),window.removeEventListener(`online`,o),window.removeEventListener(`focus`,o)}},[e,n?.phase]),(0,S.useEffect)(()=>{if(!i)return;let e=document.activeElement,t=f.current;return t.showModal(),()=>{t.close(),e?.isConnected&&e.focus()}},[i]),!n)return null;let m=Kt(n),h=n.latestVersion&&n.latestVersion!==n.currentVersion;if(!i&&!m&&n.phase!==`failed`&&(!h||n.phase===`idle`))return null;let g=n.phase===`installing`?R(`Updating…`):n.phase===`waiting`?R(`Update ready`):n.phase===`restarting`?R(`Restarting…`):n.phase===`failed`?R(`Update failed`):R(`New version`);async function _(){if(n&&!o){s(!0),l(``);try{r(await e(`/updates/install`,{version:n.latestVersion}))}catch(e){l(e instanceof Error?e.message:R(`Could not start the update. Please retry.`))}finally{s(!1)}}}return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`button`,{type:`button`,className:`update-badge`+(n.phase===`failed`?` failed`:``),"aria-haspopup":`dialog`,title:R(`Papilot {version}`,{version:n.latestVersion||n.currentVersion}),onClick:()=>a(!0),children:[m?(0,C.jsx)(`span`,{className:`spinner`}):(0,C.jsx)(T,{name:n.phase===`failed`?`alert`:`arrowUp`,size:13}),(0,C.jsx)(`span`,{children:g})]}),i&&(0,C.jsxs)(`dialog`,{ref:f,className:`update-dialog`,"aria-labelledby":`update-title`,onCancel:e=>{e.preventDefault(),a(!1)},onKeyDown:Wt,onClick:e=>{e.target===e.currentTarget&&a(!1)},children:[(0,C.jsxs)(`div`,{className:`update-heading`,children:[(0,C.jsx)(`h2`,{id:`update-title`,children:R(`Update Papilot`)}),(0,C.jsx)(`button`,{className:`icon-button`,"aria-label":R(`Close`),onClick:()=>a(!1),children:(0,C.jsx)(T,{name:`close`,size:16})})]}),(0,C.jsxs)(`p`,{className:`update-versions`,children:[(0,C.jsx)(`span`,{children:n.currentVersion}),(0,C.jsx)(T,{name:`arrowRight`,size:14}),(0,C.jsx)(`strong`,{children:n.latestVersion||n.currentVersion})]}),(0,C.jsx)(`p`,{role:`status`,children:n.phase===`installing`?R(`Downloading and checking the new version…`):n.phase===`waiting`?R(`The update is ready. Waiting for tasks and PDF builds to finish before restarting.`):n.phase===`restarting`?R(`Restarting Papilot. This page will reconnect automatically; your drafts are kept.`):n.phase===`failed`?R(`The update did not finish. Your current version is still available. You can retry here.`):R(`Install the new version and restart automatically when tasks are idle. Your papers, tasks and settings stay in place.`)}),!n.canUpdate&&(0,C.jsx)(`p`,{className:`inline-error`,children:R(`Papilot cannot find npm on this computer. Updates are unavailable until npm is installed.`)}),(c||n.error)&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:c||n.error}),(0,C.jsxs)(`div`,{className:`update-actions`,children:[(0,C.jsx)(`button`,{className:`button ghost`,onClick:()=>a(!1),children:R(m?`Close`:`Later`)}),!m&&(0,C.jsx)(`button`,{className:`button primary`,disabled:o||!n.canUpdate||!h,onClick:()=>void _(),children:o?R(`Updating…`):n.phase===`failed`?R(`Retry update`):R(`Update to {version}`,{version:n.latestVersion||``})})]})]})]})}function Jt({paper:e,canManage:t,save:n,remove:r,onClose:i}){let a=(0,S.useRef)(null),o=(0,S.useRef)(!1),[s,c]=(0,S.useState)({name:e.name,path:e.path}),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(``);(0,S.useEffect)(()=>{let e=a.current;e.showModal();let t=e.querySelector(`[name="name"]`);return t?.focus(),t?.select(),()=>{e.close(),document.querySelector(`.project-switcher, .add-project, .sidebar-toggle`)?.focus()}},[]),(0,S.useEffect)(()=>{l&&a.current?.querySelector(`[data-cancel]`)?.focus()},[l]);function h(){d||(l?(u(!1),m(``),requestAnimationFrame(()=>a.current?.querySelector(`[data-remove]`)?.focus())):i())}async function g(){if(!o.current){o.current=!0,f(!0),m(``);try{l?await r():await n({name:s.name.trim().replace(/\s+/g,` `),path:s.path.trim()}),i()}catch(e){m(e instanceof Error?e.message:String(e))}finally{o.current=!1,f(!1)}}}return(0,C.jsx)(`dialog`,{ref:a,className:`modal-backdrop`,"aria-labelledby":`paper-dialog-title`,onKeyDown:Wt,onCancel:e=>{e.preventDefault(),h()},onClick:e=>{e.target===e.currentTarget&&h()},children:(0,C.jsxs)(`section`,{className:`modal paper-dialog`,children:[(0,C.jsx)(`button`,{className:`modal-close icon-button`,"aria-label":R(`Close`),disabled:d,onClick:i,children:(0,C.jsx)(T,{name:`close`})}),(0,C.jsx)(`h2`,{id:`paper-dialog-title`,children:R(l?`Remove paper?`:`Edit paper`)}),l?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`p`,{className:`paper-dialog-name`,children:e.name}),(0,C.jsx)(`p`,{children:R(`Remove this paper and its tasks, conversations and notes from Papilot?`)}),(0,C.jsx)(`p`,{children:R(`Files on disk, Git history and task worktrees will stay in place.`)})]}):(0,C.jsx)(`p`,{className:`modal-description`,children:R(`LaTeX Git repository · Requires a commit and latexmk`)}),(0,C.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),g()},children:[!l&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`label`,{children:[R(`Repository path`),(0,C.jsx)(`input`,{name:`path`,value:s.path,onChange:e=>c({...s,path:e.target.value}),required:!0,maxLength:4e3,disabled:d||!t,spellCheck:!1,autoComplete:`off`})]}),(0,C.jsxs)(`label`,{children:[R(`Paper name`),(0,C.jsx)(`input`,{name:`name`,value:s.name,onChange:e=>c({...s,name:e.target.value}),required:!0,maxLength:120,disabled:d,autoComplete:`off`})]})]}),p&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:p}),(0,C.jsxs)(`div`,{className:`button-row paper-dialog-actions`,children:[!l&&t&&(0,C.jsxs)(`button`,{type:`button`,"data-remove":!0,className:`button ghost danger-text paper-remove`,disabled:d,onClick:()=>{m(``),u(!0)},children:[(0,C.jsx)(T,{name:`trash`,size:15}),R(`Remove paper`)]}),(0,C.jsx)(`button`,{type:`button`,"data-cancel":!0,className:`button secondary`,disabled:d,onClick:h,children:R(`Cancel`)}),(0,C.jsx)(`button`,{className:`button `+(l?`danger`:`primary`),type:`submit`,disabled:d||!l&&(!s.name.trim()||!s.path.trim()),children:R(d?l?`Removing…`:`Saving…`:l?`Remove from Papilot`:`Save`)})]})]})]})})}function Yt({status:e,label:t,disabled:n,className:r=``,onCompile:i}){let a=(0,S.useRef)(!1),[o,s]=(0,S.useState)(!1),c=o?`building`:e,l=R(c===`building`?`Compiling the PDF…`:c===`failed`?`Compilation failed. Click to retry.`:c===`ready`?`PDF compiled successfully.`:`Compilation status unavailable.`);async function u(){if(!(a.current||n||c===`building`)){a.current=!0,s(!0);try{await i()}finally{a.current=!1,s(!1)}}}return(0,C.jsx)(`button`,{type:`button`,className:`icon-button compile-button ${r}`,"data-state":c,"aria-label":t,"aria-description":l,title:`${t} · ${l}`,"aria-busy":c===`building`,disabled:n||c===`building`,onClick:()=>void u(),children:c===`building`?(0,C.jsx)(`span`,{className:`spinner`,"aria-hidden":`true`}):(0,C.jsx)(T,{name:`compile`,size:24})})}var Xt=`papilot:paper-import`,Zt=e=>e.split(`/`).some(e=>[`.git`,`__macosx`,`.ds_store`,`node_modules`,`.papilot`].includes(e.toLowerCase())||e.startsWith(`._`));function Qt(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(Error(R(`Could not read the selected file.`))),r.onload=()=>t(String(r.result).split(`,`)[1]),r.readAsDataURL(e)})}function $t({api:e,agent:t,canRepair:n,onDone:r,onClose:i}){let a=(0,S.useRef)(null),o=(0,S.useRef)(null),s=(0,S.useRef)(null),c=(0,S.useRef)(!1),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)({name:``,path:``,main:``,engine:`pdflatex`}),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(!1),y=l?.phase===`building`||l?.phase===`repairing`,b=p||y;function x(e){u(e),f(t=>({...t,name:e.name,main:e.main,engine:e.engine})),D.setItem(Xt,e.id)}(0,S.useEffect)(()=>{let t=a.current,n=document.activeElement;t.showModal(),o.current?.setAttribute(`webkitdirectory`,``),t.querySelector(`[data-choose-folder]`)?.focus();let r=D.getItem(Xt),i=!0;return r&&(m(!0),e(`/imports/`+r).then(e=>{i&&x(e)},()=>D.removeItem(Xt)).finally(()=>{i&&m(!1)})),()=>{i=!1,t.close(),n?.isConnected&&n.focus()}},[]),(0,S.useEffect)(()=>{if(!l||!y)return;let t=!0,n;async function r(){try{let n=await e(`/imports/`+l.id);t&&(x(n),g(``))}catch(e){t&&g(e.message)}t&&(n=setTimeout(r,1e3))}return n=setTimeout(r,500),()=>{t=!1,clearTimeout(n)}},[l?.id,y]);async function w(e){if(!c.current){c.current=!0,m(!0),g(``);try{await e()}catch(e){g(e instanceof Error?e.message:String(e))}finally{c.current=!1,m(!1)}}}async function E(t){x(t),t.main&&!t.error&&t.phase===`choose`&&x(await e(`/imports/${t.id}/build`,{main:t.main,engine:t.engine,name:t.name}))}async function O(t,n){await w(async()=>{let r=t.filter(e=>!Zt(e.webkitRelativePath||e.name));if(!r.length||r.length>5e3||r.reduce((e,t)=>e+t.size,0)>67108864)throw Error(R(`Choose up to 5,000 files, totaling less than 64 MB.`));if(n&&(r.length!==1||!/\.zip$/i.test(r[0].name)))throw Error(R(`Drop one LaTeX ZIP file.`));let i=n?r[0].name.replace(/\.zip$/i,``):(r[0].webkitRelativePath||r[0].name).split(`/`)[0];await E(await e(`/imports`,n?{zip:await Qt(r[0]),name:i.slice(0,120)}:{files:await Promise.all(r.map(async e=>({path:e.webkitRelativePath||e.name,data:await Qt(e)}))),name:i.slice(0,120)},void 0,12e4))})}let k=(n=!1)=>w(async()=>x(await e(`/imports/${l.id}/${n?`repair`:`build`}`,{name:d.name,main:d.main,engine:d.engine,agent:t}))),A=()=>w(async()=>{let t=await e(`/imports/${l.id}/finish`,{});D.removeItem(Xt),await r(t)}),j=l?.error||``,M=/not found|ENOENT|not installed/i.test(j)&&/latexmk|pdflatex|xelatex|lualatex/i.test(j)?R(`Install TeX Live or MacTeX with latexmk on the computer running Papilot, then retry.`):/fontspec|Unicode character|xeCJK/i.test(j)?R(`This paper may need XeLaTeX. Change the engine below and retry.`):/not found|missing|cannot find/i.test(j)?R(`A package, font or source file may be missing. Check the details below, restore the missing file or ask for help.`):R(`Check the main file and engine, or ask the assistant to fix compilation. You can also edit the saved files and retry.`);function N(){p||i()}return(0,C.jsx)(`dialog`,{ref:a,className:`modal-backdrop`,"aria-labelledby":`import-title`,onKeyDown:Wt,onCancel:e=>{e.preventDefault(),N()},onClick:e=>{e.target===e.currentTarget&&N()},children:(0,C.jsxs)(`section`,{className:`modal import-dialog`,children:[(0,C.jsx)(`button`,{className:`modal-close icon-button`,"aria-label":R(`Close`),disabled:p,onClick:N,children:(0,C.jsx)(T,{name:`close`})}),(0,C.jsx)(`h2`,{id:`import-title`,children:R(`Add a paper`)}),(0,C.jsx)(`p`,{className:`modal-description`,children:R(`Bring your LaTeX files. Papilot prepares version history and checks compilation.`)}),l?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`ol`,{className:`import-steps`,"aria-label":R(`Import progress`),children:[(0,C.jsx)(`li`,{className:`done`,children:R(`Files received`)}),(0,C.jsx)(`li`,{className:l.versioned?`done`:``,children:R(`Version history`)}),(0,C.jsx)(`li`,{className:l.phase===`ready`?`done`:``,children:R(`PDF compilation`)})]}),(0,C.jsxs)(`p`,{className:`import-location`,children:[R(`Saved folder`),(0,C.jsx)(`br`,{}),(0,C.jsx)(`code`,{children:l.path})]}),(0,C.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),k()},children:[(0,C.jsxs)(`label`,{children:[R(`Paper name`),(0,C.jsx)(`input`,{required:!0,maxLength:120,value:d.name,disabled:b,onChange:e=>f({...d,name:e.target.value})})]}),(0,C.jsxs)(`div`,{className:`import-settings`,children:[(0,C.jsxs)(`label`,{children:[R(`Main TeX file`),(0,C.jsxs)(`select`,{"aria-label":R(`Main TeX file`),value:d.main,disabled:b,onChange:e=>f({...d,main:e.target.value}),children:[(0,C.jsx)(`option`,{value:``,children:R(`Choose a main file`)}),l.candidates.map(e=>(0,C.jsx)(`option`,{children:e},e))]})]}),(0,C.jsxs)(`label`,{children:[R(`LaTeX engine`),(0,C.jsxs)(`select`,{"aria-label":R(`LaTeX engine`),value:d.engine,disabled:b,onChange:e=>f({...d,engine:e.target.value}),children:[(0,C.jsx)(`option`,{value:`pdflatex`,children:`pdfLaTeX`}),(0,C.jsx)(`option`,{value:`xelatex`,children:`XeLaTeX`}),(0,C.jsx)(`option`,{value:`lualatex`,children:`LuaLaTeX`})]})]})]}),!l.candidates.length&&(0,C.jsx)(`p`,{role:`alert`,children:R(`No TeX files found. Choose a folder or ZIP containing the LaTeX source.`)}),l.candidates.length>1&&l.phase===`choose`&&(0,C.jsx)(`p`,{children:R(`Several TeX files were found. Check the selected main document before continuing.`)}),y&&(0,C.jsxs)(`p`,{className:`import-status`,role:`status`,children:[(0,C.jsx)(`span`,{className:`spinner`}),l.phase===`repairing`?R(`The assistant is fixing compilation…`):R(`Preparing version history and compiling the PDF…`)]}),l.phase===`ready`&&(0,C.jsx)(`p`,{className:`import-success`,role:`status`,children:R(`Your paper compiled successfully. It is ready for editing.`)}),(j||l.phase===`failed`)&&(0,C.jsxs)(`div`,{className:`import-problem`,role:`alert`,children:[(0,C.jsx)(`strong`,{children:R(`The paper needs a little help`)}),(0,C.jsx)(`p`,{children:M}),(0,C.jsxs)(`details`,{children:[(0,C.jsx)(`summary`,{children:R(`Compilation details`)}),(0,C.jsx)(`pre`,{children:j})]})]}),l.summary&&(0,C.jsxs)(`div`,{className:`import-summary`,children:[(0,C.jsx)(`strong`,{children:R(`Repair summary`)}),(0,C.jsx)(`p`,{children:l.summary}),(0,C.jsx)(`p`,{children:R(`Repairs are saved as uncommitted changes. Review them in the paper’s file changes.`)})]}),(0,C.jsxs)(`div`,{className:`button-row import-actions`,children:[l.phase===`failed`&&(0,C.jsx)(`button`,{type:`button`,className:`button secondary`,disabled:b||!n||!d.main,onClick:()=>void k(!0),children:R(`Help fix compilation`)}),(0,C.jsx)(`button`,{className:`button secondary`,disabled:b||!d.main||!d.name.trim(),type:`submit`,children:l.phase===`choose`?R(`Prepare and compile`):R(`Retry compilation`)}),l.versioned&&!y&&(0,C.jsx)(`button`,{type:`button`,className:`button primary`,disabled:p||d.main!==l.main||d.engine!==l.engine||d.name!==l.name,onClick:()=>void A(),children:l.phase===`ready`?R(`Open paper`):R(`Add and fix later`)})]}),l.phase===`failed`&&!n&&(0,C.jsx)(`p`,{className:`modal-description`,children:R(`Connect an assistant in Settings to help repair this paper.`)})]})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`import-drop`+(_?` dragging`:``),onDragOver:e=>{e.preventDefault(),v(!0)},onDragLeave:()=>v(!1),onDrop:e=>{e.preventDefault(),v(!1),b||O(Array.from(e.dataTransfer.files),!0)},children:[(0,C.jsx)(T,{name:`file`,size:28}),(0,C.jsx)(`strong`,{children:R(`Drop a LaTeX ZIP here`)}),(0,C.jsx)(`span`,{children:R(`Up to 64 MB · Folders and ZIPs are copied into Papilot`)}),(0,C.jsxs)(`div`,{className:`button-row`,children:[(0,C.jsx)(`button`,{"data-choose-folder":!0,className:`button secondary`,disabled:b,onClick:()=>o.current?.click(),children:R(`Choose folder`)}),(0,C.jsx)(`button`,{className:`button secondary`,disabled:b,onClick:()=>s.current?.click(),children:R(`Choose ZIP`)})]})]}),(0,C.jsx)(`input`,{hidden:!0,webkitdirectory:``,ref:o,type:`file`,multiple:!0,"aria-label":R(`Choose folder`),onChange:e=>{O(Array.from(e.target.files||[]),!1),e.target.value=``}}),(0,C.jsx)(`input`,{hidden:!0,ref:s,type:`file`,accept:`.zip,application/zip`,"aria-label":R(`Choose ZIP`),onChange:e=>{O(Array.from(e.target.files||[]),!0),e.target.value=``}}),(0,C.jsxs)(`details`,{className:`import-path`,children:[(0,C.jsx)(`summary`,{children:R(`Use a folder on this computer`)}),(0,C.jsx)(`p`,{children:R(`Use the original files on the computer running Papilot.`)}),(0,C.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),w(async()=>E(await e(`/imports`,{path:d.path})))},children:[(0,C.jsxs)(`label`,{children:[R(`Folder path`),(0,C.jsx)(`input`,{value:d.path,required:!0,disabled:b,maxLength:4e3,onChange:e=>f({...d,path:e.target.value}),placeholder:R(`/Users/you/papers/my-paper`),spellCheck:!1})]}),(0,C.jsx)(`button`,{className:`button secondary`,disabled:b,children:R(`Read folder`)})]})]}),p&&(0,C.jsx)(`p`,{role:`status`,children:R(`Reading paper files…`)})]}),h&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:h}),(0,C.jsxs)(`div`,{className:`button-row import-footer`,children:[l&&!y&&(0,C.jsx)(`button`,{type:`button`,className:`button ghost`,disabled:p,onClick:()=>{D.removeItem(Xt),u(null),g(``)},children:R(`Choose different files`)}),(0,C.jsx)(`button`,{className:`button secondary`,disabled:p,onClick:N,children:R(l?`Continue later`:`Cancel`)})]})]})})}var en=`papilot:theme`;function tn(e){return e===`light`||e===`dark`?e:`system`}function nn(){let[e,t]=(0,S.useState)(()=>tn(D.getItem(en))),[n,r]=(0,S.useState)(()=>matchMedia(`(prefers-color-scheme: dark)`).matches),i=e===`system`?n?`dark`:`light`:e;return(0,S.useEffect)(()=>{let e=matchMedia(`(prefers-color-scheme: dark)`),n=()=>r(e.matches),i=e=>{(e.key===en||e.key===null)&&t(tn(D.getItem(en)))};return n(),e.addEventListener(`change`,n),window.addEventListener(`storage`,i),()=>{e.removeEventListener(`change`,n),window.removeEventListener(`storage`,i)}},[]),(0,S.useLayoutEffect)(()=>{document.documentElement.dataset.theme=i,document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,i===`dark`?`#26272b`:`#ffffff`)},[i]),{theme:e,resolved:i,setTheme:e=>{D.setItem(en,e),t(e)}}}function rn({label:e,value:t,options:n,onChange:r,disabled:i,icon:a,className:o=``}){return(0,C.jsxs)(`label`,{className:`chip-select `+o,title:e,children:[a&&(0,C.jsx)(T,{name:a,size:14}),(0,C.jsx)(`span`,{className:`chip-value`,children:n.find(e=>e.value===t)?.label??t}),(0,C.jsx)(`select`,{"aria-label":e,disabled:i,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,C.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})}var an=`papilot:notifications`;function on(){let e=D.getItem(an)===`on`;return typeof window>`u`||!(`Notification`in window)?{on:e,permission:`unsupported`}:window.isSecureContext?{on:e,permission:Notification.permission}:{on:e,permission:`insecure`}}var sn=on(),cn=new Set;function ln(){let e=on();(e.on!==sn.on||e.permission!==sn.permission)&&(sn=e,cn.forEach(e=>e()))}typeof window<`u`&&(window.addEventListener(`storage`,e=>{(e.key===an||e.key===null)&&ln()}),window.addEventListener(`focus`,ln));var un=()=>sn,dn=()=>sn.on&&sn.permission===`granted`;function fn(e){return cn.add(e),()=>{cn.delete(e)}}function pn(){return(0,S.useSyncExternalStore)(fn,un)}async function mn(e){e&&sn.permission==="default"&&await Notification.requestPermission(),e?D.setItem(an,`on`):D.removeItem(an),ln()}var hn={codex:`Codex`,claude:`Claude`,antigravity:`Antigravity`};function gn(e,t){let n=[];for(let r of t.tasks){let i=e.tasks.find(e=>e.id===r.id);if(!i)continue;let a=hn[r.agent||`codex`]||`Codex`,o=t.requests.filter(t=>t.taskId===r.id&&!e.requests.some(e=>e.id===t.id));if(o.length){let e=o.some(e=>e.method.endsWith(`requestUserInput`));n.push({taskId:r.id,title:R(e?`{agent} needs your input`:`{agent} is waiting for your approval`,{agent:a}),body:r.title})}else if(i.status===`building`&&r.status===`reviewing`){let e=r.review?.counts?.pending||0;n.push({taskId:r.id,title:e?re(e,`Review ready · {n} change to decide`,`Review ready · {n} changes to decide`):R(`{agent} finished`,{agent:a}),body:r.title})}else r.status!==i.status&&(r.status===`failed`||r.status===`uncertain`||r.status===`interrupted`&&r.error)&&n.push({taskId:r.id,title:R(`A task needs attention`),body:_n(r,r.title)})}return n}function _n(e,t){let n=e.error?.split(`
|
|
188
|
-
`).find(e=>e.trim())?.trim();return n?`${t}\n${n.slice(0,160)}`:t}function vn(e,t){if(dn())try{let n=new Notification(e.title,{body:e.body,tag:`papilot:`+e.taskId,renotify:!0,icon:`/favicon.png`});n.onclick=()=>{window.focus(),t(e.taskId),n.close()}}catch{}}function yn(){try{return new Notification(R(`Notifications are on`),{body:R(`Papilot will tell you here when a task needs you.`),tag:`papilot:test`,icon:`/favicon.png`}),!0}catch{return!1}}function bn(){let e=zt(),[t,n]=(0,S.useState)(null),[r,i]=(0,S.useState)(``),a={accept:[R(`Accept change`),R(`Accept the current proposal. In Changes, stage or unstage it.`)],reject:[R(`Reject change`),R(`Reject the current proposal. In Changes, revert it.`)],comment:[R(`Request a revision`),R(`Write feedback on the current proposed change.`)],next:[R(`Next change`),R(`Move to the next visible change.`)],previous:[R(`Previous change`),R(`Move to the previous visible change.`)],pending:[R(`Next undecided change`),R(`Jump to the next change that still needs a decision.`)],source:[R(`Show LaTeX source`),R(`Show or hide the source for the current change.`)],undo:[R(`Undo review decision`),R(`Undo the last review decision or revert.`)],help:[R(`Keyboard shortcuts`),R(`Open these shortcut settings.`)]};return(0,C.jsxs)(`div`,{className:`shortcut-settings`,children:[(0,C.jsx)(`p`,{className:`shortcut-intro`,children:R(`Review shortcuts work while the PDF review is focused. They pause while you type or select text. Changes are saved in this browser.`)}),(0,C.jsx)(`p`,{className:`shortcut-instructions`,id:`shortcut-instructions`,children:R(`Click a key to change it, then press the new shortcut. Escape cancels; Backspace clears it.`)}),r&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:r}),(0,C.jsx)(`div`,{className:`shortcut-list`,children:At.map(r=>(0,C.jsxs)(`div`,{className:`shortcut-row`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`span`,{id:`shortcut-${r}`,className:`settings-name`,children:a[r][0]}),(0,C.jsx)(`p`,{children:a[r][1]})]}),(0,C.jsx)(`button`,{type:`button`,className:`shortcut-key`+(t===r?` recording`:``),"aria-label":R(`Change shortcut: {action}`,{action:a[r][0]}),"aria-describedby":`shortcut-instructions`,onClick:()=>{n(r),i(``)},onBlur:()=>n(null),onKeyDown:o=>{if(t!==r)return;if(o.key===`Tab`){n(null);return}if(o.preventDefault(),o.stopPropagation(),o.key===`Escape`){n(null),i(``);return}let s=jt(o.nativeEvent);if(!s)return;let c=o.key===`Backspace`&&!o.ctrlKey&&!o.metaKey&&!o.altKey&&!o.shiftKey;if(!c&&Nt(s)){i(R(`This key is reserved for the browser or text editing. Choose another shortcut.`));return}let l=At.find(t=>t!==r&&e[t].includes(s));!c&&l?i(R(`Already used for {action}. Choose another shortcut.`,{action:a[l][0]})):(H({...e,[r]:c?[]:[s]}),n(null),i(``))},children:(0,C.jsx)(`kbd`,{children:t===r?R(`Press a key…`):e[r].map(It).join(` / `)||R(`Not assigned`)})})]},r))}),(0,C.jsx)(`button`,{type:`button`,className:`button secondary compact`,disabled:JSON.stringify(e)===JSON.stringify(kt),onClick:()=>{H(Pt({})),n(null),i(``)},children:R(`Restore default shortcuts`)}),(0,C.jsxs)(`div`,{className:`shortcut-system`,children:[(0,C.jsx)(`h3`,{children:R(`Standard shortcuts`)}),(0,C.jsx)(`p`,{children:R(`These keep the usual browser and text-editing behavior.`)}),(0,C.jsxs)(`dl`,{children:[(0,C.jsx)(`dt`,{children:(0,C.jsx)(`kbd`,{children:`⌘ / Ctrl + C`})}),(0,C.jsx)(`dd`,{children:R(`Copy selected PDF text`)}),(0,C.jsx)(`dt`,{children:(0,C.jsx)(`kbd`,{children:`⌘ / Ctrl + Z`})}),(0,C.jsx)(`dd`,{children:R(`Undo typing, a deleted note, or the last review decision, depending on focus.`)}),(0,C.jsx)(`dt`,{children:(0,C.jsx)(`kbd`,{children:`⌘ / Ctrl + Enter`})}),(0,C.jsx)(`dd`,{children:R(`Send the review comment being written.`)}),(0,C.jsx)(`dt`,{children:(0,C.jsx)(`kbd`,{children:`Esc`})}),(0,C.jsx)(`dd`,{children:R(`Close the current editor or cancel region selection.`)})]})]})]})}var xn={version:`0.7.0`,repository:`https://github.com/cu1ch3n/papilot`,issues:`https://github.com/cu1ch3n/papilot/issues`,license:`MIT`,licenseText:`MIT License
|
|
189
|
-
|
|
190
|
-
Copyright (c) 2026 Cui Chen
|
|
191
|
-
|
|
192
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
193
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
194
|
-
in the Software without restriction, including without limitation the rights
|
|
195
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
196
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
197
|
-
furnished to do so, subject to the following conditions:
|
|
198
|
-
|
|
199
|
-
The above copyright notice and this permission notice shall be included in all
|
|
200
|
-
copies or substantial portions of the Software.
|
|
201
|
-
|
|
202
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
203
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
204
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
205
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
206
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
207
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
208
|
-
SOFTWARE.`},Sn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20fill='none'%3e%3crect%20x='18'%20y='48'%20width='14'%20height='10'%20fill='%23F0F4F8'%20stroke='%23000000'%20stroke-width='2'/%3e%3crect%20x='32'%20y='48'%20width='14'%20height='10'%20fill='%23C6D5E5'%20stroke='%23000000'%20stroke-width='2'/%3e%3cpath%20d='M32%206L12%2034L18%2048H32V6Z'%20fill='%23FFFFFF'/%3e%3cpath%20d='M32%206L52%2034L46%2048H32V6Z'%20fill='%23356AA0'/%3e%3cpath%20d='M32%206L52%2034L46%2048H18L12%2034L32%206Z'%20stroke='%23000000'%20stroke-width='2'%20stroke-linejoin='miter'%20stroke-miterlimit='2'/%3e%3cpath%20d='M32%206V20'%20stroke='%23000000'%20stroke-width='2'/%3e%3cpath%20d='M32%2020Q35%2031%2046%2034Q35%2037%2032%2048Q29%2037%2018%2034Q29%2031%2032%2020Z'%20fill='%23FFFFFF'%20stroke='%23000000'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Cn=`modulepreload`,wn=function(e){return`/`+e},Tn={},En=function(e){return e.pathname.endsWith(`.css`)},Dn=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},On=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=wn(t,n);let r=s(t),i=En(r);return Dn(Tn,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Cn,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function kn({href:e,icon:t,title:n,detail:r}){return(0,C.jsxs)(`a`,{className:`settings-navigation-row settings-resource`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,C.jsx)(T,{name:t,size:18}),(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`strong`,{children:n}),r&&(0,C.jsx)(`small`,{children:r})]}),(0,C.jsx)(T,{name:`external`,size:14}),(0,C.jsx)(`span`,{className:`sr-only`,children:R(`Opens in a new tab`)})]})}function An({onLicenses:e}){return(0,C.jsxs)(`div`,{className:`about-settings`,children:[(0,C.jsxs)(`div`,{className:`settings-product`,children:[(0,C.jsx)(`img`,{src:Sn,width:`52`,height:`52`,alt:``}),(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`div`,{className:`settings-product-name`,children:[`Papilot `,(0,C.jsxs)(`span`,{className:`settings-version`,children:[`v`,xn.version]})]}),(0,C.jsx)(`p`,{children:R(`A workspace for your papers.`)})]})]}),(0,C.jsx)(`p`,{className:`settings-about-intro`,children:R(`Read, annotate, and revise your papers with AI, all in one place.`)}),(0,C.jsxs)(`div`,{className:`settings-resources`,children:[(0,C.jsx)(kn,{href:xn.repository,icon:`github`,title:R(`GitHub repository`),detail:new URL(xn.repository).pathname.slice(1)}),(0,C.jsx)(kn,{href:xn.issues,icon:`chat`,title:R(`Feedback & issues`),detail:R(`Report a bug or suggest an improvement.`)}),(0,C.jsx)(kn,{href:`${xn.repository}/blob/main/docs/guide.md`,icon:`paper`,title:R(`User guide`),detail:R(`Get started and make Papilot your own.`)}),(0,C.jsx)(kn,{href:`${xn.repository}/blob/main/CHANGELOG.md`,icon:`restore`,title:R(`Changelog`),detail:R(`See what changed in each release.`)}),(0,C.jsx)(kn,{href:`${xn.repository}/blob/main/CONTRIBUTING.md`,icon:`people`,title:R(`Contribute`),detail:R(`Help improve Papilot with code, docs, and ideas.`)})]}),(0,C.jsx)(`h3`,{className:`settings-section-title`,children:R(`Licenses & acknowledgments`)}),(0,C.jsxs)(`details`,{className:`settings-project-license`,children:[(0,C.jsxs)(`summary`,{children:[(0,C.jsx)(`span`,{children:R(`Papilot license`)}),(0,C.jsx)(`span`,{className:`settings-license-badge`,children:xn.license}),(0,C.jsx)(T,{name:`chevronDown`,size:15})]}),(0,C.jsx)(`pre`,{tabIndex:0,"aria-label":R(`Papilot license`),children:xn.licenseText})]}),(0,C.jsxs)(`button`,{type:`button`,className:`settings-navigation-row settings-resource`,"data-settings-page":`licenses`,onClick:e,children:[(0,C.jsx)(T,{name:`code`,size:18}),(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`strong`,{children:R(`Third-party licenses`)}),(0,C.jsx)(`small`,{children:R(`Libraries, fonts, and the people behind them.`)})]}),(0,C.jsx)(T,{name:`chevronRight`,size:15})]}),(0,C.jsx)(`p`,{className:`settings-credit`,children:R(`Made by Cui Chen and the Papilot contributors.`)})]})}function jn(){let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(``);(0,S.useEffect)(()=>{let e=!0;return r(!1),On(()=>import(`./_virtual_papilot-licenses-BWIsfrQh.js`).then(n=>{e&&t(n.default)},()=>{e&&r(!0)}),[]),()=>{e=!1}},[i]);let c=o.trim().toLowerCase(),l=e?.filter(e=>`${e.name} ${e.version} ${e.license}`.toLowerCase().includes(c)),u;return u=n?(0,C.jsxs)(`div`,{role:`alert`,className:`settings-license-error`,children:[(0,C.jsx)(`p`,{children:R(`Could not load the license notices.`)}),(0,C.jsx)(`button`,{className:`button secondary`,onClick:()=>a(e=>e+1),children:R(`Retry`)})]}):l?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`p`,{role:`status`,className:`settings-license-count`,children:R(`{shown} of {total} components`,{shown:l.length,total:e.length})}),l.length?(0,C.jsx)(`div`,{className:`settings-license-list`,children:l.map(e=>(0,C.jsxs)(`details`,{className:`settings-license-item`,children:[(0,C.jsxs)(`summary`,{children:[(0,C.jsxs)(`span`,{className:`settings-license-component`,children:[(0,C.jsx)(`strong`,{children:e.name}),e.version&&(0,C.jsxs)(`small`,{children:[`v`,e.version]})]}),(0,C.jsx)(`span`,{className:`settings-license-badge`,children:e.license||R(`See license notice`)}),(0,C.jsx)(T,{name:`chevronDown`,size:15})]}),(0,C.jsxs)(`div`,{className:`settings-license-body`,children:[(0,C.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[R(`Component source`),(0,C.jsx)(T,{name:`external`,size:13}),(0,C.jsx)(`span`,{className:`sr-only`,children:R(`Opens in a new tab`)})]}),e.notices.length?e.notices.map(t=>(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h4`,{children:t.name}),(0,C.jsx)(`pre`,{tabIndex:0,"aria-label":`${e.name} — ${t.name}`,children:t.text})]},t.name)):(0,C.jsx)(`p`,{className:`muted`,children:R(`License text is not included in this package. See the component source for its terms.`)})]})]},`${e.name}@${e.version}`))}):(0,C.jsx)(`p`,{className:`settings-license-empty`,children:R(`No components match your search.`)})]}):(0,C.jsx)(`p`,{role:`status`,className:`muted`,children:R(`Loading license notices…`)}),(0,C.jsxs)(`div`,{className:`license-settings`,children:[(0,C.jsx)(`p`,{className:`settings-about-intro`,children:R(`Libraries and fonts used by Papilot and its review engine. Each component is covered by its own license.`)}),(0,C.jsxs)(`label`,{className:`settings-license-search`,children:[(0,C.jsx)(T,{name:`search`,size:17}),(0,C.jsx)(`input`,{type:`search`,value:o,onChange:e=>s(e.target.value),placeholder:R(`Search components or licenses…`),"aria-label":R(`Search components or licenses`)})]}),u]})}function Mn(e,t,n){return JSON.stringify({app:`Papilot`,version:e.version,checkedAt:new Date(e.checkedAt).toISOString(),platform:e.platform,arch:e.arch,node:e.node,serverConnected:t,agents:Object.fromEntries([`codex`,`claude`,`antigravity`].map(e=>[e,n[e]?{connected:n[e].connected,authenticated:n[e].authenticated,models:n[e].models.length}:null])),ok:e.ok,checks:e.checks.map(({id:e,ok:t,severity:n})=>({id:e,ok:t,severity:n}))},null,2)}function Nn(){return{node:`Node.js`,dependencies:R(`Application dependencies`),frontend:R(`Application interface`),"review-engine":R(`Review engine`),data:R(`Data folder`),git:`Git`,latexmk:`latexmk`,synctex:`SyncTeX`,"tex-engines":R(`LaTeX engines`),"agent.codex":R(`Codex configuration`),"agent.claude":R(`Claude configuration`),"agent.antigravity":R(`Antigravity configuration`),agents:R(`Agent configuration`),project:R(`Paper configuration`),"project.git":R(`Paper repository`),"project.head":R(`Initial commit`),"project.main":R(`Main document`),"project.engine":R(`Paper compiler`),"project.worktrees":R(`Task folders`),remote:R(`Remote access`),accounts:R(`Collaborator access`),server:R(`Local server`),service:R(`Background service`),"service.tools":R(`Service tools`),"service.data":R(`Service data folder`)}}function Pn({online:e,runtimes:t,project:n,check:r}){let[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)(!0),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(0),[f,p]=(0,S.useState)(!1),[m,h]=(0,S.useState)(!1),g=(0,S.useRef)(null);(0,S.useEffect)(()=>{let e=new AbortController;return s(!0),l(!1),a(null),p(!1),h(!1),r(n?.id,e.signal).then(t=>{e.signal.aborted||a(t)},()=>{e.signal.aborted||l(!0)}).finally(()=>{e.signal.aborted||s(!1)}),()=>e.abort()},[u,n?.id,r]),(0,S.useEffect)(()=>{m&&(g.current?.focus(),g.current?.select())},[m]),(0,S.useEffect)(()=>{if(f){let e=setTimeout(()=>p(!1),2e3);return()=>clearTimeout(e)}},[f]);let _=i?Mn(i,e,t):``;async function v(){try{await navigator.clipboard.writeText(_),p(!0),h(!1)}catch{h(!0)}}let y=i?.checks.filter(e=>!e.ok&&e.severity===`error`).length||0,b=i?.checks.filter(e=>!e.ok&&e.severity===`warn`).length||0,x=Nn();return(0,C.jsxs)(`div`,{className:`diagnostics-settings`,children:[(0,C.jsx)(`p`,{className:`settings-about-intro`,children:R(`Inspect agent connections and check the environment used to build your papers.`)}),(0,C.jsx)(`h3`,{className:`settings-section-title`,children:R(`Live connections`)}),(0,C.jsxs)(`div`,{className:`diagnostic-connections`,children:[(0,C.jsxs)(`div`,{className:`diagnostic-connection`,children:[(0,C.jsx)(`span`,{children:R(`Papilot server`)}),(0,C.jsxs)(`span`,{className:`diagnostic-state ${e?`ok`:`error`}`,children:[(0,C.jsx)(`i`,{}),R(e?`Connected`:`Disconnected`)]})]}),[`codex`,`claude`,`antigravity`].map(n=>{let r=t[n],i=e&&r?.connected&&r.authenticated;return(0,C.jsxs)(`div`,{className:`diagnostic-connection`,children:[(0,C.jsx)(`span`,{children:n===`codex`?`Codex`:n===`claude`?`Claude`:`Antigravity`}),(0,C.jsxs)(`span`,{className:`diagnostic-state ${i?`ok`:`warn`}`,children:[(0,C.jsx)(`i`,{}),!e||!r?R(`Unknown`):i?R(`Ready`):r.connected?R(`Sign-in required`):R(`Unavailable`)]})]},n)})]}),(0,C.jsx)(`h3`,{className:`settings-section-title`,children:R(`Environment checks`)}),(0,C.jsx)(`p`,{className:`diagnostic-context`,children:n?R(`Includes the configuration for “{paper}”.`,{paper:n.name}):R(`Open a paper to also check its repository and compiler configuration.`)}),(0,C.jsxs)(`div`,{className:`diagnostic-actions`,children:[(0,C.jsxs)(`button`,{type:`button`,className:`button secondary compact`,disabled:o||!e,onClick:()=>d(e=>e+1),children:[(0,C.jsx)(T,{name:`refresh`,size:14}),R(o?`Checking…`:`Check again`)]}),(0,C.jsxs)(`button`,{type:`button`,className:`button secondary compact`,disabled:!i||o,onClick:()=>void v(),children:[(0,C.jsx)(T,{name:f?`check`:`copy`,size:14}),R(f?`Copied`:`Copy diagnostic summary`)]})]}),o&&(0,C.jsx)(`p`,{role:`status`,className:`diagnostic-progress`,children:R(`Checking tools and configuration. This may take a few seconds…`)}),c&&(0,C.jsx)(`div`,{className:`diagnostic-failure`,role:`alert`,children:R(`Could not complete the environment checks. Check the connection and try again.`)}),i&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{role:`status`,className:`diagnostic-result ${y?`error`:b?`warn`:`ok`}`,children:[(0,C.jsx)(T,{name:y||b?`alert`:`check`,size:17}),(0,C.jsx)(`span`,{children:y||b?R(`Errors: {errors} · Warnings: {warnings}`,{errors:y,warnings:b}):R(`Environment checks passed`)})]}),(0,C.jsxs)(`p`,{className:`diagnostic-metadata`,children:[`Papilot `,i.version,` · `,i.platform,` `,i.arch,` · Node.js `,i.node,(0,C.jsx)(`br`,{}),R(`Checked at {time}`,{time:new Date(i.checkedAt).toLocaleTimeString(te())})]}),(0,C.jsx)(`p`,{className:`diagnostic-context`,children:R(`Agent configuration checks do not send editing requests. Only the agents you use need to be configured.`)}),(0,C.jsx)(`div`,{className:`diagnostic-checks`,children:i.checks.map(e=>(0,C.jsxs)(`details`,{className:`diagnostic-check`,open:!e.ok,children:[(0,C.jsxs)(`summary`,{children:[(0,C.jsx)(T,{name:e.ok?`check`:`alert`,size:15}),(0,C.jsx)(`span`,{children:x[e.id]||e.id}),(0,C.jsx)(`small`,{className:`diagnostic-state ${e.ok?`ok`:e.severity===`error`?`error`:`warn`}`,children:e.ok?R(`Passed`):e.severity===`error`?R(`Needs attention`):R(`Warning`)}),(0,C.jsx)(T,{name:`chevronDown`,size:14})]}),(0,C.jsxs)(`div`,{className:`diagnostic-detail`,children:[(0,C.jsx)(`p`,{children:e.detail}),e.fix&&(0,C.jsxs)(`p`,{className:`diagnostic-fix`,children:[(0,C.jsx)(`strong`,{children:R(`Suggested fix`)}),e.fix]})]})]},e.id))}),(0,C.jsx)(`p`,{className:`diagnostic-sharing`,children:R(`The copied summary includes versions and check results, without account names, paths, or paper contents.`)})]}),m&&(0,C.jsxs)(`label`,{className:`diagnostic-copy`,children:[(0,C.jsx)(`span`,{role:`status`,children:R(`Automatic copy is unavailable. Copy the selected summary below.`)}),(0,C.jsx)(`textarea`,{ref:g,readOnly:!0,value:_,"aria-label":R(`Diagnostic summary`)})]})]})}function Fn(){}function In(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Ln(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Rn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bn={};function Vn(e,t){return((t||Bn).jsx?zn:Rn).test(e)}var Hn=/[ \t\n\f\r]/g;function Un(e){return typeof e==`object`?e.type===`text`&&Wn(e.value):Wn(e)}function Wn(e){return e.replace(Hn,``)===``}var Gn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Gn.prototype.normal={},Gn.prototype.property={},Gn.prototype.space=void 0;function Kn(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Gn(n,r,t)}function qn(e){return e.toLowerCase()}var Jn=class{constructor(e,t){this.attribute=t,this.property=e}};Jn.prototype.attribute=``,Jn.prototype.booleanish=!1,Jn.prototype.boolean=!1,Jn.prototype.commaOrSpaceSeparated=!1,Jn.prototype.commaSeparated=!1,Jn.prototype.defined=!1,Jn.prototype.mustUseProperty=!1,Jn.prototype.number=!1,Jn.prototype.overloadedBoolean=!1,Jn.prototype.property=``,Jn.prototype.spaceSeparated=!1,Jn.prototype.space=void 0;var Yn=s({boolean:()=>W,booleanish:()=>Zn,commaOrSpaceSeparated:()=>tr,commaSeparated:()=>er,number:()=>G,overloadedBoolean:()=>Qn,spaceSeparated:()=>$n}),Xn=0,W=nr(),Zn=nr(),Qn=nr(),G=nr(),$n=nr(),er=nr(),tr=nr();function nr(){return 2**++Xn}var rr=Object.keys(Yn),ir=class extends Jn{constructor(e,t,n,r){let i=-1;if(super(e,t),ar(this,`space`,r),typeof n==`number`)for(;++i<rr.length;){let e=rr[i];ar(this,rr[i],(n&Yn[e])===Yn[e])}}};ir.prototype.defined=!0;function ar(e,t,n){n&&(e[t]=n)}function or(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ir(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[qn(r)]=r,n[qn(a.attribute)]=r}return new Gn(t,n,e.space)}var sr=or({properties:{ariaActiveDescendant:null,ariaAtomic:Zn,ariaAutoComplete:null,ariaBusy:Zn,ariaChecked:Zn,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:$n,ariaCurrent:null,ariaDescribedBy:$n,ariaDetails:null,ariaDisabled:Zn,ariaDropEffect:$n,ariaErrorMessage:null,ariaExpanded:Zn,ariaFlowTo:$n,ariaGrabbed:Zn,ariaHasPopup:null,ariaHidden:Zn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$n,ariaLevel:G,ariaLive:null,ariaModal:Zn,ariaMultiLine:Zn,ariaMultiSelectable:Zn,ariaOrientation:null,ariaOwns:$n,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:Zn,ariaReadOnly:Zn,ariaRelevant:null,ariaRequired:Zn,ariaRoleDescription:$n,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:Zn,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function cr(e,t){return t in e?e[t]:t}function lr(e,t){return cr(e,t.toLowerCase())}var ur=or({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:er,acceptCharset:$n,accessKey:$n,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alpha:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:$n,autoFocus:W,autoPlay:W,blocking:$n,capture:null,charSet:null,checked:W,cite:null,className:$n,closedBy:null,colorSpace:null,cols:G,colSpan:G,command:null,commandFor:null,content:null,contentEditable:Zn,controls:W,controlsList:$n,coords:G|er,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:Qn,draggable:Zn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:$n,height:G,hidden:Qn,high:G,href:null,hrefLang:null,htmlFor:$n,httpEquiv:$n,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:$n,itemRef:$n,itemScope:W,itemType:$n,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:W,optimum:G,pattern:null,ping:$n,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:$n,required:W,reversed:W,rows:G,rowSpan:G,sandbox:$n,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootCustomElementRegistry:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shadowRootSerializable:W,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:Zn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:Zn,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$n,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:Zn,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:W,disablePictureInPicture:W,disableRemotePlayback:W,exportParts:er,part:$n,prefix:null,property:null,results:G,security:null,unselectable:null},space:`html`,transform:lr}),dr=or({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:tr,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:$n,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:er,g2:er,glyphName:er,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:tr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$n,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:tr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:tr,rev:tr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:tr,requiredFeatures:tr,requiredFonts:tr,requiredFormats:tr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:tr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:tr,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:tr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:cr}),fr=or({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),pr=or({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:lr}),mr=or({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),hr={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},gr=/[A-Z]/g,_r=/-[a-z]/g,vr=/^data[-\w.:]+$/i;function yr(e,t){let n=qn(t),r=t,i=Jn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&vr.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(_r,xr);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!_r.test(e)){let n=e.replace(gr,br);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ir}return new i(r,t)}function br(e){return`-`+e.toLowerCase()}function xr(e){return e.charAt(1).toUpperCase()}var Sr=Kn([sr,ur,fr,pr,mr],`html`),Cr=Kn([sr,dr,fr,pr,mr],`svg`);function wr(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Tr(e){return e.join(` `).trim()}var Er=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
209
|
-
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Dr=o(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(Er());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),Or=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),kr=o(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Dr()),i=Or();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),Ar=Mr(`end`),jr=Mr(`start`);function Mr(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Nr(e){let t=jr(e),n=Ar(e);if(t&&n)return{start:t,end:n}}function Pr(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Ir(e.position):`start`in e||`end`in e?Ir(e):`line`in e||`column`in e?Fr(e):``}function Fr(e){return Lr(e&&e.line)+`:`+Lr(e&&e.column)}function Ir(e){return Fr(e&&e.start)+`-`+Fr(e&&e.end)}function Lr(e){return e&&typeof e==`number`?e:1}var Rr=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Pr(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Rr.prototype.file=``,Rr.prototype.name=``,Rr.prototype.reason=``,Rr.prototype.message=``,Rr.prototype.stack=``,Rr.prototype.column=void 0,Rr.prototype.line=void 0,Rr.prototype.ancestors=void 0,Rr.prototype.cause=void 0,Rr.prototype.fatal=void 0,Rr.prototype.place=void 0,Rr.prototype.ruleId=void 0,Rr.prototype.source=void 0;var zr=l(kr(),1),Br={}.hasOwnProperty,Vr=new Map,Hr=/[A-Z]/g,Ur=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Wr=new Set([`td`,`th`]),Gr=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Kr(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=ri(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=ni(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Cr:Sr,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=qr(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function qr(e,t,n){if(t.type===`element`)return Jr(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Yr(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Zr(e,t,n);if(t.type===`mdxjsEsm`)return Xr(e,t);if(t.type===`root`)return Qr(e,t,n);if(t.type===`text`)return $r(e,t)}function Jr(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Cr,e.schema=i),e.ancestors.push(t);let a=li(e,t.tagName,!1),o=ii(e,t),s=oi(e,t);return Ur.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Un(e)})),ei(e,o,a,t),ti(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Yr(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ui(e,t.position)}function Xr(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ui(e,t.position)}function Zr(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Cr,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:li(e,t.name,!0),o=ai(e,t),s=oi(e,t);return ei(e,o,a,t),ti(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Qr(e,t,n){let r={};return ti(r,oi(e,t)),e.create(t,e.Fragment,r,n)}function $r(e,t){return t.value}function ei(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ti(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ni(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function ri(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=jr(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function ii(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Br.call(t.properties,i)){let a=si(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Wr.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ai(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ui(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else ui(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function oi(e,t){let n=[],r=-1,i=e.passKeys?new Map:Vr;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=qr(e,a,o);s!==void 0&&n.push(s)}return n}function si(e,t,n){let r=yr(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ln(n):Tr(n)),r.property===`style`){let t=typeof n==`object`?n:ci(e,String(n));return e.stylePropertyNameCase===`css`&&(t=di(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?hr[r.property]||r.property:r.attribute,n]}}function ci(e,t){try{return(0,zr.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Rr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Gr+`#cannot-parse-style-attribute`,r}}function li(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Vn(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Vn(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Br.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);ui(e)}function ui(e,t){let n=new Rr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Gr+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function di(e){let t={},n;for(n in e)Br.call(e,n)&&(t[fi(n)]=e[n]);return t}function fi(e){let t=e.replace(Hr,pi);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function pi(e){return`-`+e.toLowerCase()}var mi={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},hi={};function gi(e,t){let n=t||hi;return _i(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function _i(e,t,n){if(yi(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return vi(e.children,t,n)}return Array.isArray(e)?vi(e,t,n):``}function vi(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=_i(e[i],t,n);return r.join(``)}function yi(e){return!!(e&&typeof e==`object`)}var bi=document.createElement(`i`);function xi(e){let t=`&`+e+`;`;bi.innerHTML=t;let n=bi.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Si(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Ci(e,t){return e.length>0?(Si(e,e.length,0,t),e):t}var wi={}.hasOwnProperty;function Ti(e){let t={},n=-1;for(;++n<e.length;)Ei(t,e[n]);return t}function Ei(e,t){let n;for(n in t){let r=(wi.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){wi.call(r,a)||(r[a]=[]);let e=i[a];Di(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Di(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Si(e,0,0,r)}function Oi(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function ki(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Ai=Bi(/[A-Za-z]/),ji=Bi(/[\dA-Za-z]/),Mi=Bi(/[#-'*+\--9=?A-Z^-~]/);function Ni(e){return e!==null&&(e<32||e===127)}var Pi=Bi(/\d/),Fi=Bi(/[\dA-Fa-f]/),Ii=Bi(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function Li(e){return e!==null&&(e<0||e===32)}function q(e){return e===-2||e===-1||e===32}var Ri=Bi(/\p{P}|\p{S}/u),zi=Bi(/\s/);function Bi(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Vi(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&ji(e.charCodeAt(n+1))&&ji(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function J(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return q(r)?(e.enter(n),s(r)):t(r)}function s(r){return q(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Hi(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&q(t)?(e.enter(r),c(t)):l(t)}function c(t){return q(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Ui={tokenize:Wi};function Wi(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return K(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Gi=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Ki(this,e,t,n,!1)}addBefore(e,t,n){Ki(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Ki(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var qi={tokenize:Yi},Ji={tokenize:Y};function Yi(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Gi;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ji,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Ji,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return K(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Gi;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Y(e,t,n){return J(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Xi(e){if(e===null||Li(e)||zi(e))return 1;if(Ri(e))return 2}function Zi(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Qi={name:`attention`,resolveAll:$i,tokenize:ea};function $i(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};ta(o,-a),ta(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=Ci(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=Ci(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=Ci(r,Zi(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=Ci(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=Ci(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),Si(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ea(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Xi(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Xi(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function ta(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var na={name:`autolink`,tokenize:ra};function ra(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Ai(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||ji(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||ji(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Ni(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Mi(t)?(e.consume(t),l):n(t)}function u(e){return ji(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||ji(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ia={partial:!0,tokenize:aa};function aa(e,t,n){return r;function r(t){return q(t)?J(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||K(e)?t(e):n(e)}}var oa={continuation:{tokenize:ca},exit:la,name:`blockQuote`,tokenize:sa};function sa(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return q(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ca(e,t,n){let r=this;return i;function i(t){return q(t)?J(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(oa,t,n)(r)}}function la(e){e.exit(`blockQuote`)}var ua={name:`characterEscape`,tokenize:da};function da(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ii(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var fa={name:`characterReference`,tokenize:pa};function pa(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=ji,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Fi,u):(e.enter(`characterReferenceValue`),a=7,o=Pi,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===ji&&!xi(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var ma={partial:!0,tokenize:ha};function ha(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var ga={concrete:!0,name:`codeFenced`,tokenize:_a};function _a(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),q(t)?J(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||K(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ma,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),J(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||K(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&q(t)?J(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||K(t)?e.check(ma,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||K(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),q(t)?J(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),q(t)?J(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||K(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var va={name:`codeIndented`,tokenize:ba},ya={partial:!0,tokenize:xa};function ba(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Hi(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):K(t)?e.attempt(ya,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||K(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function xa(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):K(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Hi(e,t,a,`linePrefix`,4,4)(o)}function a(e){return K(e)?i(e):n(e)}}var Sa={name:`codeText`,previous:wa,resolve:Ca,tokenize:Ta};function Ca(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function wa(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ta(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||K(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Ea=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Da(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Da(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Da(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Da(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Da(this.left,t.reverse())}}}};function Da(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Oa(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Ea(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,ka(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Si(e,0,1/0,u.slice(0)),!l}function ka(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Aa={resolve:Ma,tokenize:Na},ja={partial:!0,tokenize:Pa};function Ma(e){return Oa(e),e}function Na(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):K(t)?e.check(ja,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Pa(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,a,`linePrefix`)}function a(i){if(i===null||K(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Fa(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Ni(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||K(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Li(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Ni(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Ia(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):K(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||K(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!q(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function La(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||K(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Ra(e,t){let n;return r;function r(i){return K(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):q(i)?J(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var za={name:`definition`,tokenize:Va},Ba={partial:!0,tokenize:Ha};function Va(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ia.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=ki(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Li(t)?Ra(e,l)(t):l(t)}function l(t){return Fa(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Ba,d,d)(t)}function d(t){return q(t)?J(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||K(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ha(e,t,n){return r;function r(t){return Li(t)?Ra(e,i)(t):n(t)}function i(t){return La(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return q(t)?J(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||K(e)?t(e):n(e)}}var Ua={name:`hardBreakEscape`,tokenize:Wa};function Wa(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return K(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ga={name:`headingAtx`,resolve:Ka,tokenize:qa};function Ka(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};Si(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function qa(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Li(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||K(n)?(e.exit(`atxHeading`),t(n)):q(n)?J(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Li(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Ja=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Ya=[`pre`,`script`,`style`,`textarea`],Xa={concrete:!0,name:`htmlFlow`,resolveTo:Qa,tokenize:$a},Za={partial:!0,tokenize:eo};function Qa(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function $a(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):Ai(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Ai(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Ai(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Li(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Ya.includes(l)?(i=1,r.interrupt?t(s):O(s)):Ja.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||ji(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return q(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Ai(t)?(e.consume(t),b):q(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||ji(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):q(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):q(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||K(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Li(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||q(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||K(t)?O(t):q(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),ee):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):K(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Za,L,k)(t)):t===null||K(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(ma,A,L)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||K(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Ya.includes(n)?(e.consume(t),ee):O(t)}return Ai(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),ee):t===45&&i===2?(e.consume(t),I):O(t)}function ee(t){return t===null||K(t)?(e.exit(`htmlFlowData`),L(t)):(e.consume(t),ee)}function L(n){return e.exit(`htmlFlow`),t(n)}}function eo(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ia,t,n)}}var to={name:`htmlText`,tokenize:no};function no(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Ai(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Ai(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):K(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):K(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):K(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):K(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Ai(t)?(e.consume(t),S):n(t)}function S(t){return t===45||ji(t)?(e.consume(t),S):C(t)}function C(t){return K(t)?(o=C,N(t)):q(t)?(e.consume(t),C):M(t)}function w(t){return t===45||ji(t)?(e.consume(t),w):t===47||t===62||Li(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Ai(t)?(e.consume(t),E):K(t)?(o=T,N(t)):q(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||ji(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):K(t)?(o=D,N(t)):q(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):K(t)?(o=O,N(t)):q(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):K(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Li(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Li(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return q(t)?J(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var ro={name:`labelEnd`,resolveAll:so,resolveTo:co,tokenize:lo},io={tokenize:uo},ao={tokenize:fo},oo={tokenize:po};function so(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Si(e,0,e.length,n),e}function co(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=Ci(o,e.slice(i+1,i+r+3)),o=Ci(o,[[`enter`,l,t]]),o=Ci(o,Zi(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=Ci(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=Ci(o,e.slice(a+1)),o=Ci(o,[[`exit`,s,t]]),Si(e,i,e.length,o),e}function lo(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(ki(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(io,u,o?u:d)(t):t===91?e.attempt(ao,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(oo,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function uo(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Li(t)?Ra(e,a)(t):a(t)}function a(t){return t===41?u(t):Fa(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Li(t)?Ra(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?La(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Li(t)?Ra(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function fo(e,t,n){let r=this;return i;function i(t){return Ia.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(ki(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function po(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var mo={name:`labelStartImage`,resolveAll:ro.resolveAll,tokenize:ho};function ho(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var go={name:`labelStartLink`,resolveAll:ro.resolveAll,tokenize:_o};function _o(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var vo={name:`lineEnding`,tokenize:yo};function yo(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}}var bo={name:`thematicBreak`,tokenize:xo};function xo(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||K(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),q(t)?J(e,s,`whitespace`)(t):s(t))}}var So={continuation:{tokenize:Eo},exit:Oo,name:`list`,tokenize:To},Co={partial:!0,tokenize:ko},wo={partial:!0,tokenize:Do};function To(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Pi(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(bo,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Pi(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ia,r.interrupt?n:u,e.attempt(Co,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return q(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Eo(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ia,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!q(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(wo,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(So,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Do(e,t,n){let r=this;return J(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Oo(e){e.exit(this.containerState.type)}function ko(e,t,n){let r=this;return J(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!q(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Ao={name:`setextUnderline`,resolveTo:jo,tokenize:Mo};function jo(e,t){let n=new Gi,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function Mo(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),q(t)?J(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||K(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var No={tokenize:X};function X(e){let t=this,n=e.attempt(ia,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Aa,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Po={resolveAll:Ro()},Fo=Lo(`string`),Io=Lo(`text`);function Lo(e){return{resolveAll:Ro(e===`text`?zo:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Ro(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function zo(e,t){let n=new Gi,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Bo=s({attentionMarkers:()=>Jo,contentInitial:()=>Ho,disable:()=>Yo,document:()=>Vo,flow:()=>Wo,flowInitial:()=>Uo,insideSpan:()=>qo,string:()=>Go,text:()=>Ko}),Vo={42:So,43:So,45:So,48:So,49:So,50:So,51:So,52:So,53:So,54:So,55:So,56:So,57:So,62:oa},Ho={91:za},Uo={[-2]:va,[-1]:va,32:va},Wo={35:Ga,42:bo,45:[Ao,bo],60:Xa,61:Ao,95:bo,96:ga,126:ga},Go={38:fa,92:ua},Ko={[-5]:vo,[-4]:vo,[-3]:vo,33:mo,38:fa,42:Qi,60:[na,to],91:go,92:[Ua,ua],93:ro,95:Qi,96:Sa},qo={null:[Qi,Po]},Jo={null:[42,95]},Yo={null:[]};function Xo(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Ci(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Zi(a,l.events,l),l.events):[]}function f(e,t){return Qo(p(e),t)}function p(e){return Zo(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){K(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Si(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Zo(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Qo(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
210
|
-
`;break;case-3:o=`\r
|
|
211
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function $o(e){let t={constructs:Ti([Bo,...(e||{}).extensions||[]]),content:n(Ui),defined:[],document:n(qi),flow:n(No),lazy:{},string:n(Fo),text:n(Io)};return t;function n(e){return n;function n(n){return Xo(t,e,n)}}}function es(e){for(;!Oa(e););return e}var ts=/[\0\t\n\r]/g;function ns(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){ts.lastIndex=c;let n=ts.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var rs=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function is(e){return e.replace(rs,as)}function as(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Oi(n.slice(t?2:1),t?16:10)}return xi(n)||e}var os={}.hasOwnProperty;function ss(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),cs(n)(es($o(n).document().write(ns()(e,t,!0))))}function cs(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(he),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(de),blockQuote:o(ce),characterEscape:E,characterReference:E,codeFenced:o(le),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(le,s),codeText:o(z,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(B),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ue),hardBreakEscape:o(fe),hardBreakTrailing:o(fe),htmlFlow:o(pe,s),htmlFlowData:E,htmlText:o(pe,s),htmlTextData:E,image:o(me),label:s,link:o(he),listItem:o(_e),listItemValue:p,listOrdered:o(ge,f),listUnordered:o(ge),paragraph:o(ve),reference:ne,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(de),strong:o(ye),thematicBreak:o(xe)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:se,autolinkProtocol:oe,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ie,characterReference:ae,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:I,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:R,resourceDestinationString:ee,resourceTitleString:L,resource:te,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};us(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),os.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||fs).call(o,void 0,e[0])}for(r.position={start:ls(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ls(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ls(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Pr({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||fs).call(this,e,r[0])),n.position.end=ls(e.end)}function d(){return gi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ki(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=be(),n.position={start:ls(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ls(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=ls(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=is(t),n.identifier=ki(t).toLowerCase()}function I(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function te(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function R(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ki(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function re(e){this.data.characterReferenceType=e.type}function ie(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Oi(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=xi(t);let i=this.stack[this.stack.length-1];i.value+=r}function ae(e){let t=this.stack.pop();t.position.end=ls(e.end)}function oe(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function se(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ce(){return{type:`blockquote`,children:[],position:void 0}}function le(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function z(){return{type:`inlineCode`,value:``,position:void 0}}function B(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function ue(){return{type:`emphasis`,children:[],position:void 0}}function de(){return{type:`heading`,depth:0,children:[],position:void 0}}function fe(){return{type:`break`,position:void 0}}function pe(){return{type:`html`,value:``,position:void 0}}function me(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function he(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function ge(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function _e(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function ve(){return{type:`paragraph`,children:[],position:void 0}}function ye(){return{type:`strong`,children:[],position:void 0}}function be(){return{type:`text`,value:``,position:void 0}}function xe(){return{type:`thematicBreak`,position:void 0}}}function ls(e){return{line:e.line,column:e.column,offset:e.offset}}function us(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?us(e,r):ds(e,r)}}function ds(e,t){let n;for(n in t)if(os.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function fs(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Pr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Pr({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Pr({start:t.start,end:t.end})+`) is still open`)}function ps(e){let t=this;t.parser=n;function n(n){return ss(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function ms(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function hs(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
212
|
-
`}]}function gs(e,t){let n=t.value?t.value+`
|
|
213
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function _s(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vs(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ys(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Vi(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function bs(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xs(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ss(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Cs(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ss(e,t);let i={src:Vi(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function ws(e,t){let n={src:Vi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Ts(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Es(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ss(e,t);let i={href:Vi(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ds(e,t){let n={href:Vi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Os(e,t,n){let r=e.all(t),i=n?ks(n):As(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
214
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
215
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function ks(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=As(n[r])}return t}function As(e){return e.spread??e.children.length>1}function js(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Ms(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ns(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ps(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fs(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=jr(t.children[1]),o=Ar(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Is(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Ls(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Rs=9,zs=32;function Bs(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Vs(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Vs(t.slice(i),i>0,!1)),a.join(``)}function Vs(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Rs||t===zs;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Rs||t===zs;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Hs(e,t){let n={type:`text`,value:Bs(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Us(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Ws={blockquote:ms,break:hs,code:gs,delete:_s,emphasis:vs,footnoteReference:ys,heading:bs,html:xs,imageReference:Cs,image:ws,inlineCode:Ts,linkReference:Es,link:Ds,listItem:Os,list:js,paragraph:Ms,root:Ns,strong:Ps,table:Fs,tableCell:Ls,tableRow:Is,text:Hs,thematicBreak:Us,toml:Gs,yaml:Gs,definition:Gs,footnoteDefinition:Gs};function Gs(){}var{defineProperty:Ks}=Object,qs=typeof self==`object`?self:globalThis,Js=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new qs[e](t)},Ys=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Ks(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof qs[e]==`function`?Js(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Js(a,o),i)};return r},Xs=e=>Ys(new Map,e)(0),Zs=``,{toString:Qs}={},{keys:$s,is:ec}=Object,tc=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Qs.call(e).slice(8,-1);switch(n){case`Array`:return[1,Zs];case`Object`:return[2,Zs];case`Date`:return[3,Zs];case`RegExp`:return[4,Zs];case`Map`:return[5,Zs];case`Set`:return[6,Zs];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},nc=([e,t])=>e===0&&(t===`function`||t===`symbol`),rc=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=tc(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&ec(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of $s(o))(e||!nc(tc(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Zs:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(nc(tc(n))||nc(tc(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!nc(tc(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},ic=(e,{json:t,lossy:n}={})=>{let r=[];return rc(!(t||n),!!t,new Map,r)(e),r},ac=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Xs(ic(e,t)):structuredClone(e):(e,t)=>Xs(ic(e,t));function oc(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function sc(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function cc(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||oc,r=e.options.footnoteBackLabel||sc,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Vi(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...ac(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
216
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
217
|
-
`}]}}var lc=(function(e){if(e==null)return mc;if(typeof e==`function`)return pc(e);if(typeof e==`object`)return Array.isArray(e)?uc(e):dc(e);if(typeof e==`string`)return fc(e);throw Error(`Expected function, string, or object as test`)});function uc(e){let t=[],n=-1;for(;++n<e.length;)t[n]=lc(e[n]);return pc(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function dc(e){let t=e;return pc(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function fc(e){return pc(t);function t(t){return t&&t.type===e}}function pc(e){return t;function t(t,n,r){return!!(hc(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function mc(){return!0}function hc(e){return typeof e==`object`&&!!e&&`type`in e}function gc(e){return e}var _c=[],vc=`skip`;function yc(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(o.enter!==null&&o.enter!==void 0){if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor")}if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=lc(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+gc(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=_c;if(s&&r&&(o=bc(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=t.children[e],i=d(n,e,r)();if(i[0]===!1)return i;e=typeof i[1]==`number`?i[1]:e+u}}}if(c&&r){let r=bc(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function bc(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?_c:[e]}function xc(e,t,n,r){let i,a,o;typeof n==`function`||n&&typeof n==`object`?(i=t,a=n,o=r):(a=t,o=n),typeof a==`function`?yc(e,i,Cc(a),o):yc(e,i,Sc(a),o)}function Sc(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?Cc(e.enter):e.enter,exit:typeof e.exit==`function`?Cc(e.exit):e.exit}}function Cc(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}var wc={}.hasOwnProperty,Tc={};function Ec(e,t){let n=t||Tc,r=new Map,i=new Map,a={all:s,applyData:Oc,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Ws,...n.handlers},one:o,options:n,patch:Dc,wrap:Ac};return xc(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(wc.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=ac(n);return r.children=a.all(e),r}return ac(e)}return(a.options.unknownHandler||kc)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=jc(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=jc(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Dc(e,t){e.position&&(t.position=Nr(e))}function Oc(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,ac(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function kc(e,t){let n=t.data||{},r=`value`in t&&!(wc.call(n,`hProperties`)||wc.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ac(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
218
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
219
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
220
|
-
`}),n}function jc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Mc(e,t){let n=Ec(e,t),r=n.one(e,void 0),i=cc(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
221
|
-
`},i)),a}function Nc(e,t){return e&&`run`in e?async function(n,r){let i=Mc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Mc(n,{file:r,...e||t})}}function Pc(e){if(e)throw e}var Fc=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Ic(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Lc(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Rc(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Rc(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var zc={basename:Bc,dirname:Vc,extname:Hc,join:Uc,sep:`/`};function Bc(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Kc(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Vc(e){if(Kc(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Hc(e){Kc(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Uc(...e){let t=-1,n;for(;++t<e.length;)Kc(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Wc(n)}function Wc(e){Kc(e);let t=e.codePointAt(0)===47,n=Gc(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Gc(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Kc(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var qc={cwd:Jc};function Jc(){return`/`}function Yc(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Xc(e){if(typeof e==`string`)e=new URL(e);else if(!Yc(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Zc(e)}function Zc(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Qc=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],$c=class{constructor(e){let t;t=e?Yc(e)?{path:e}:typeof e==`string`||rl(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:qc.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Qc.length;){let e=Qc[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Qc.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?zc.basename(this.path):void 0}set basename(e){tl(e,`basename`),el(e,`basename`),this.path=zc.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?zc.dirname(this.path):void 0}set dirname(e){nl(this.basename,`dirname`),this.path=zc.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?zc.extname(this.path):void 0}set extname(e){if(el(e,`extname`),nl(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=zc.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Yc(e)&&(e=Xc(e)),tl(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?zc.basename(this.path,this.extname):void 0}set stem(e){tl(e,`stem`),el(e,`stem`),this.path=zc.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Rr(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function el(e,t){if(e&&e.includes(zc.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+zc.sep+"`")}function tl(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function nl(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function rl(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var il=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),al=l(Fc(),1),ol={}.hasOwnProperty,sl=new class e extends il{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Lc()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,al.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(ul(`data`,this.frozen),this.namespace[e]=t,this):ol.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ul(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=pl(e),n=this.parser||this.Parser;return cl(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),cl(`process`,this.parser||this.Parser),ll(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=pl(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);hl(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),cl(`processSync`,this.parser||this.Parser),ll(`processSync`,this.compiler||this.Compiler),this.process(e,r),fl(`processSync`,`process`,t),n;function r(e,r){t=!0,Pc(e),n=r}}run(e,t,n){dl(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=pl(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),fl(`runSync`,`run`,n),r;function i(e,t){Pc(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=pl(t),r=this.compiler||this.Compiler;return ll(`stringify`,r),dl(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(ul(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,al.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Ic(o)&&Ic(r)&&(r=(0,al.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function cl(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function ll(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function ul(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function dl(e){if(!Ic(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function fl(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function pl(e){return ml(e)?e:new $c(e)}function ml(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function hl(e){return typeof e==`string`||gl(e)}function gl(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var _l=[],vl={allowDangerousHtml:!0},yl=/^(https?|ircs?|mailto|xmpp)$/i,bl=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function xl(e){let t=Sl(e),n=Cl(e);return wl(t.runSync(t.parse(n),n),e)}function Sl(e){let t=e.rehypePlugins||_l,n=e.remarkPlugins||_l,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vl}:vl;return sl().use(ps).use(n).use(Nc,r).use(t)}function Cl(e){let t=e.children||``,n=new $c;return typeof t==`string`?n.value=t:``+t,n}function wl(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Tl;for(let e of bl)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return xc(e,l),Kr(e,{Fragment:C.Fragment,components:i,ignoreInvalidStyle:!0,jsx:C.jsx,jsxs:C.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in mi)if(Object.hasOwn(mi,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=mi[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Tl(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||yl.test(e.slice(0,t))?e:``}function El(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Dl(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Ol(e,t,n){let r=lc((n||{}).ignore||[]),i=kl(t),a=-1;for(;++a<i.length;)yc(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return vc}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i===!1)o.lastIndex=n+1;else{if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function kl(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Al(e[0]),jl(e[1])])}return t}function Al(e){return typeof e==`string`?new RegExp(Dl(e),`g`):e}function jl(e){return typeof e==`function`?e:function(){return e}}var Ml=`phrasing`,Nl=[`autolink`,`link`,`image`,`label`];function Pl(){return{transforms:[Hl],enter:{literalAutolink:Il,literalAutolinkEmail:Ll,literalAutolinkHttp:Ll,literalAutolinkWww:Ll},exit:{literalAutolink:Vl,literalAutolinkEmail:Bl,literalAutolinkHttp:Rl,literalAutolinkWww:zl}}}function Fl(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Ml,notInConstruct:Nl},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Ml,notInConstruct:Nl},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Ml,notInConstruct:Nl}]}}function Il(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Ll(e){this.config.enter.autolinkProtocol.call(this,e)}function Rl(e){this.config.exit.autolinkProtocol.call(this,e)}function zl(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Bl(e){this.config.exit.autolinkEmail.call(this,e)}function Vl(e){this.exit(e)}function Hl(e){Ol(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ul],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Wl]],{ignore:[`link`,`linkReference`]})}function Ul(e,t,n,r,i){let a=``;if(!ql(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Gl(n)))return!1;let o=Kl(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Wl(e,t,n,r){return!ql(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Gl(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Kl(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=El(e,`(`),a=El(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function ql(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||zi(n)||Ri(n))&&(!t||n!==47)}ru.peek=nu;function Jl(){this.buffer()}function Yl(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Xl(){this.buffer()}function Zl(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Ql(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ki(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $l(e){this.exit(e)}function eu(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ki(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tu(e){this.exit(e)}function nu(){return`[`}function ru(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function iu(){return{enter:{gfmFootnoteCallString:Jl,gfmFootnoteCall:Yl,gfmFootnoteDefinitionLabelString:Xl,gfmFootnoteDefinition:Zl},exit:{gfmFootnoteCallString:Ql,gfmFootnoteCall:$l,gfmFootnoteDefinitionLabelString:eu,gfmFootnoteDefinition:tu}}}function au(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ru},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
222
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?su:ou))),s(),o}}function ou(e,t,n){return t===0?e:su(e,t,n)}function su(e,t,n){return(n?``:` `)+e}var cu=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];pu.attention=mu,pu.peek=hu;function lu(){return{canContainEols:[`delete`],enter:{strikethrough:du},exit:{strikethrough:fu}}}function uu(){return{handlers:{delete:pu},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:cu}]}}function du(e){this.enter({type:`delete`,children:[],position:void 0},e)}function fu(e){this.exit(e)}function pu(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function mu(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function hu(){return`~`}function gu(e){return e.length}function _u(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||gu,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=vu(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=yu(r[d]);else{let e=yu(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding===!1||n.alignDelimiters===!1&&i===``||n.delimiterStart===!1&&!d||r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
223
|
-
`)}function vu(e){return e==null?``:String(e)}function yu(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var bu=lc([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function xu(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Su);return i(),o}function Su(e,t,n){return`>`+(n?``:` `)+e}function Cu(e,t){return wu(e,t.inConstruct,!0)&&!wu(e,t.notInConstruct,!1)}function wu(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Tu(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
224
|
-
`&&!e.before&&!e.after&&Cu(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
225
|
-
`}function Eu(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Du(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function Ou(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ku(e,t,n,r){let i=Ou(n),a=e.value||``;if(Du(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Au);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(Eu(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
|
|
226
|
-
`,encode:["`"],...o.current()})),t()}return u+=o.move(`
|
|
227
|
-
`),a&&(u+=o.move(a+`
|
|
228
|
-
`)),u+=o.move(s),c(),u}function Au(e,t,n){return(n?``:` `)+e}function ju(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Mu(e,t,n,r){let i=ju(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
229
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Nu(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Pu(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function Fu(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function Iu(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Lu(e,t,n){let r=Xi(e),i=Xi(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Ru(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let t=e.charCodeAt(2);return t===45?2:t===91?5:Ai(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!Ai(a))return;for(;a===45||ji(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&Ya.includes(o)?1:Ja.includes(o)?6:7}var zu=new Map([[`*`,!1],[`_`,!0]]);function Bu(e,t,n){let r=new Set;for(let i of e){let e=n.get(i);if(e&&i.attention&&t.some(e=>e.attention===i.attention))for(let t of e.tokens)r.add(t.attention)}let i=[];for(let t of e)t.attention&&r.delete(t.attention)&&i.push(t.attention);return i.reverse(),i}function Vu(e,t,n){let r=[],i=new Map,a=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let s=e[o].value.charAt(0),c=zu.get(s),l=o+1;for(;l<e.length&&e[l].attention&&e[l].value.charAt(0)===s;)l++;let u=o?e[o-1].value:t,d=Xi(u.charCodeAt(u.length-1)),f=Xi((l<e.length?e[l].value:n).charCodeAt(0)),p=!f||f===2&&!!d,m=!d||d===2&&!!f,h={tokens:e.slice(o,l),markers:[],start:0,end:0,open:c?p&&(!!d||!m):p,close:c?m&&(!!f||!p):m,split:c!==void 0};for(let e of h.tokens){i.set(e,[...h.tokens]),a.set(e,h);let t=e.value.length;for(;t--;)h.markers.push(e)}h.end=h.markers.length,r.push(h),o=l}for(Wu(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:Bu(e,t,a),index:o}}}function Hu(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?Pu(n.value):Fu(n.value),i=Iu(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let e=n.value.slice(0,n.value.length-r.length),t=0;for(;e.charCodeAt(e.length-1-t)===92;)t++;t%2&&(e+=`\\`),n.value=e+i}}function Uu(e,t,n,r,i){for(let a of n.attention){let o=t.get(a)||a.sequences[0];for(let s of a.sequences){if(s===o)continue;let c=new Map(t);c.set(a,s);let l=Ju(e,c,r,i),u=Vu(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function Wu(e,t){let n=new Map;for(let r of e){let e=r.tokens[0].value.charAt(0),i=n.get(e);i||(i=[],n.set(e,i));let a=r.close?i.length:0;for(;a--&&r.start<r.end;){let e=i[a],n=e.end-e.start,o=r.end-r.start;if(r.split?(e.close||r.open)&&o%3&&!((n+o)%3):n!==e.markers.length||n!==o)continue;let s=r.split?n>1&&o>1?2:1:o,c=e.markers.slice(e.end-s,e.end),l=r.markers.slice(r.start,r.start+s),u=c[0],d=l[0];if(u===c[s-1]&&u.value.length===s&&d===l[s-1]&&d.value.length===s&&u.attention===d.attention)t.delete(u),t.delete(d);else{let e=[...new Set([...c,...l])];for(let n of e){let r=t.get(n);r&&r.push(...e)}}e.end-=s,r.start+=s,e.start===e.end&&i.splice(a,1),a=i.length}r.open&&r.start<r.end&&i.push(r)}}function Gu(e,t,n){if(t.length===0)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!Ii(i.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let e of n)r.push(i.repeat(e))}return r}function Ku(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before;r.push(-1);let c=t.createTracker(n);for(;++o<i.length;){let l=i[o],u;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),u=n?Pu(n(i[o+1],e,t,{before:``,after:``,...c.current()})):``}else u=n.after;let d=a[a.length-1];typeof d==`string`&&(s===`\r`||s===`
|
|
230
|
-
`)&&l.type===`html`&&Ru(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(Yu(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=qu(l,f.attention,t,c);a.push(e),s=Fu(e.sequences[0])}else{let n=t.handle(l,e,t,{...c.current(),after:u,before:s});if(!n)continue;c.move(n),a.push(n),s=Fu(n)}}return r.pop(),a}function qu(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=Gu(e.type,a,o),c=s[0],l=n.enter(i);r.move(c);let u=Ku(e,n,{...r.current(),before:c,after:c});return r.move(Yu(u,c,c)),r.move(c),l(),{children:u,sequences:s}}function Ju(e,t,n,r){let i=[],a,o=Fu(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===Pu(n)&&Hu([e],!0),a=void 0,i.push(e),e.value&&(o=Fu(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=Pu(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=Ju(n.children,t,c,c),m=p.length>0?p[0].value:``,h=Lu(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&Hu(p,!0);let g=p.length>0?Fu(p[p.length-1].value):``,_=Lu(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&Hu(p,!1),h.outside&&d!==`
|
|
231
|
-
`&&d!==`\r`&&Hu(i,!1),_.outside&&(a=f),i.push({value:c,attention:n},...p,{value:c,attention:n}),o=c.charAt(c.length-1)}return i}function Yu(e,t,n){let r=new Map,i=Ju(e,r,t,n),a=i,o=Vu(a,t,n);for(;o;){let s=Uu(e,r,o,t,n);if(!s){a=i;break}r=s.chosen,a=s.tokens,o=s.mistake}let s=``;for(let e of a)s+=e.value;return s}Xu.attention=Z,Xu.peek=Zu;function Xu(e,t,n,r){let i=n.enter(`phrasing`),a=Yu([qu(e,Z,n,n.createTracker(r))],r.before,r.after);return i(),a}function Z(e,t){return{construct:`emphasis`,markers:Nu(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Zu(e,t,n){return n.options.emphasis||`*`}function Qu(e,t){let n=!1;return xc(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&gi(e)&&(t.options.setext||n))}function $u(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Qu(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
232
|
-
`,after:`
|
|
233
|
-
`});return r(),t(),o+`
|
|
234
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
235
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
236
|
-
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=Iu(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ed.peek=td;function ed(e){return e.value||``}function td(){return`<`}nd.peek=rd;function nd(e,t,n,r){let i=ju(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function rd(){return`!`}id.peek=ad;function id(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ad(){return`!`}od.peek=sd;function od(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function sd(){return"`"}function cd(e,t){let n=gi(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}ld.peek=ud;function ld(e,t,n,r){let i=ju(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(cd(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`),u=n.containerPhrasing(e,{before:l,after:`](`,...o.current()});l+=o.move(u),c(),l+=o.move(`](`);let d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!d&&(f===`
|
|
237
|
-
`||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:typeof p==`string`?` `:`)`,...o.current()}))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function ud(e,t,n){return cd(e,n)?`<`:`[`}dd.peek=fd;function dd(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function fd(){return`[`}function pd(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function md(e){let t=pd(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function hd(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function gd(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _d(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?hd(n):pd(n),s=e.ordered?o===`.`?`)`:`.`:md(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),gd(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function vd(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function yd(e,t,n,r){let i=vd(n),a=n.bulletCurrent||pd(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function bd(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function xd(e,t,n,r){if(!e.children.some(function(e){return bu(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function Sd(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Cd.attention=wd,Cd.peek=Td;function Cd(e,t,n,r){let i=n.enter(`phrasing`),a=Yu([qu(e,wd,n,n.createTracker(r))],r.before,r.after);return i(),a}function wd(e,t){return{construct:`strong`,markers:Sd(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function Td(e,t,n){return n.options.strong||`*`}function Ed(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function Dd(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Od(e,t,n){let r=(gd(n)+(n.options.ruleSpaces?` `:``)).repeat(Dd(n));return n.options.ruleSpaces?r.slice(0,-1):r}var kd={blockquote:xu,break:Tu,code:ku,definition:Mu,emphasis:Xu,hardBreak:Tu,heading:$u,html:ed,image:nd,imageReference:id,inlineCode:od,link:ld,linkReference:dd,list:_d,listItem:yd,paragraph:bd,root:xd,strong:Cd,text:Ed,thematicBreak:Od};function Ad(){return{enter:{table:jd,tableData:Fd,tableHeader:Fd,tableRow:Nd},exit:{codeText:Id,table:Md,tableData:Pd,tableHeader:Pd,tableRow:Pd}}}function jd(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Md(e){this.exit(e),this.data.inTable=void 0}function Nd(e){this.enter({type:`tableRow`,children:[]},e)}function Pd(e){this.exit(e)}function Fd(e){this.enter({type:`tableCell`,children:[]},e)}function Id(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ld));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ld(e,t){return t===`|`?t:e}function Rd(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
238
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
239
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return _u(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=kd.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function zd(){return{exit:{taskListCheckValueChecked:Vd,taskListCheckValueUnchecked:Vd,paragraph:Hd}}}function Bd(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Ud}}}function Vd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Hd(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Ud(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=kd.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Wd(){return[Pl(),iu(),lu(),Ad(),zd()]}function Gd(e){return{extensions:[Fl(),au(e),uu(),Rd(e),Bd()]}}var Kd={tokenize:sf,partial:!0},qd={tokenize:cf,partial:!0},Jd={tokenize:lf,partial:!0},Yd={tokenize:uf,partial:!0},Xd={tokenize:df,partial:!0},Zd={name:`wwwAutolink`,tokenize:af,previous:ff},Qd={name:`protocolAutolink`,tokenize:of,previous:pf},$d={name:`emailAutolink`,tokenize:rf,previous:mf},ef={};function tf(){return{text:ef}}for(var nf=48;nf<123;)ef[nf]=$d,nf++,nf===58?nf=65:nf===91&&(nf=97);ef[43]=$d,ef[45]=$d,ef[46]=$d,ef[95]=$d,ef[72]=[$d,Qd],ef[104]=[$d,Qd],ef[87]=[$d,Zd],ef[119]=[$d,Zd];function rf(e,t,n){let r=this,i,a;return o;function o(t){return!hf(t)||!mf.call(r,r.previous)||gf(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return hf(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Xd,u,l)(t):t===45||t===95||ji(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Ai(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function af(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!ff.call(r,r.previous)||gf(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Kd,e.attempt(qd,e.attempt(Jd,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function of(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&pf.call(r,r.previous)&&!gf(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Ai(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Ni(t)||Li(t)||zi(t)||Ri(t)?n(t):e.attempt(qd,e.attempt(Jd,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function sf(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function cf(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Yd,c,s)(t):t===null||Li(t)||zi(t)||t!==45&&Ri(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function lf(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Yd,t,a)(o):o===null||Li(o)||zi(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function uf(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Li(o)||zi(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Li(e)||zi(e)?t(e):r(e)}function a(e){return Ai(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Ai(t)?(e.consume(t),o):n(t)}}function df(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return ji(e)?n(e):t(e)}}function ff(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Li(e)}function pf(e){return!Ai(e)}function mf(e){return!(e===47||hf(e))}function hf(e){return e===43||e===45||e===46||e===95||ji(e)}function gf(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var _f={tokenize:Tf,partial:!0};function vf(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Sf,continuation:{tokenize:Cf},exit:wf}},text:{91:{name:`gfmFootnoteCall`,tokenize:xf},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:yf,resolveTo:bf}}}}function yf(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=ki(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function bf(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function xf(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Li(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ki(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Li(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Sf(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Li(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ki(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Li(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),J(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Cf(e,t,n){return e.check(ia,t,e.attempt(_f,t,n))}function wf(e){e.exit(`gfmFootnoteDefinition`)}function Tf(e,t,n){let r=this;return J(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Ef(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Si(o,o.length,0,Zi(s,e.slice(r+1,n),t)),Si(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Si(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Xi(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Xi(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Df=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){Of(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Of(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function kf(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Af(){return{flow:{null:{name:`table`,tokenize:jf,resolveAll:Mf}}}}function jf(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):q(t)?J(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Li(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,q(t)?J(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return q(t)?J(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return q(t)?J(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):q(n)?J(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Li(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Mf(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Df;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Pf(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Nf(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Nf(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Nf(f,t,o,i,n,d)):(o[0]=o[1],d=Nf(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Pf(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=kf(t.events,n))}return e}function Nf(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Ff(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Ff(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Ff(t.events,n[2]),a=Ff(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Ff(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Pf(e,t,n,r,i){let a=[],o=Ff(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Ff(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var If={name:`tasklistCheck`,tokenize:Rf};function Lf(){return{text:{91:If}}}function Rf(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Li(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):q(r)?e.check({tokenize:zf},t,n)(r):n(r)}}function zf(e,t,n){return J(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Bf(e){return Ti([tf(),vf(),Ef(e),Af(),Lf()])}var Vf={};function Q(e){let t=this,n=e||Vf,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Bf(n)),a.push(Wd()),o.push(Gd(n))}function Hf({path:e,children:t}){let[n,r]=(0,S.useState)(!1);async function i(){let t=e;try{t=decodeURI(e)}catch{}let n=!1;try{await navigator.clipboard.writeText(t),n=!0}catch{let e=document.createElement(`textarea`);e.value=t,e.style.position=`fixed`,e.style.opacity=`0`,document.body.append(e),e.select();try{n=document.execCommand(`copy`)}finally{e.remove()}}r(n)}return(0,C.jsx)(`button`,{type:`button`,className:`file-reference`,title:e,"aria-label":n?R(`Copied path`):R(`Copy path: {path}`,{path:e}),onClick:()=>void i(),children:t})}var Uf=/(```[\s\S]*?(?:```|$)|~~~[\s\S]*?(?:~~~|$)|`[^`\n]+`)/,Wf=e=>e.split(Uf).some((e,t)=>t%2==0&&/\$|\\\(|\\\[/.test(e));function Gf(e){return e.split(Uf).map((e,t)=>t%2?e:qf(e.replace(/(^|\n)([ \t]*)\\\[((?:(?!\\\]|\n[ \t]*\n)[\s\S])+?)\\\][ \t]*(?=\n|$)/g,(e,t,n,r)=>`${t}${n}$$\n${Kf(r,n)}\n${n}$$`).replace(/(?<!\\)\\\[((?:(?!\\\])[^\n])+?)\\\]/g,(e,t)=>`$$${t.trim()}$$`).replace(/(?<!\\)\\\(((?:(?!\\\))[^\n])+?)\\\)/g,(e,t)=>`$${t.trim()}$`))).join(``)}function Kf(e,t){let n=e.split(`
|
|
240
|
-
`);return n[0].trim()?n[0]=t+n[0].trim():n.shift(),n.length>1&&!n[n.length-1].trim()?n.pop():n[n.length-1]=n[n.length-1].trimEnd(),n.join(`
|
|
241
|
-
`)}function qf(e){let t=``;for(let n=0;n<e.length;){if(e[n]===`\\`){t+=e.slice(n,n+2),n+=2;continue}if(e[n]!==`$`){t+=e[n++];continue}if(e[n+1]===`$`){let r=e.indexOf(`$$`,n+2);t+=e.slice(n,r<0?n+2:r+2),n=r<0?n+2:r+2;continue}let r=-1;if(/\S/.test(e[n+1]||``))for(let t=n+1;t<e.length;t++)if(e[t]===`\\`)t++;else{if(e.startsWith(`
|
|
242
|
-
|
|
243
|
-
`,t))break;if(e[t]===`$`){e[t+1]!==`$`&&/\S/.test(e[t-1])&&!/\d/.test(e[t+1]||``)&&(r=t);break}}r<0?(t+=`\\$`,n++):(t+=e.slice(n,r+1),n=r+1)}return t}var Jf=null,Yf=null;function Xf(e){let[t,n]=(0,S.useState)(Jf);return(0,S.useEffect)(()=>{if(!e||t)return;let r=!0;return Yf??=On(()=>import(`./math-BsEl3u6P.js`).then(e=>Jf=e.math),__vite__mapDeps([0,1])),Yf.then(e=>{r&&n(e)},()=>{Yf=null}),()=>{r=!1}},[e,t]),e?t:null}function Zf({text:e,math:t}){return(0,C.jsx)(xl,{remarkPlugins:[Q,...t?.remark||[]],rehypePlugins:t?.rehype,urlTransform:e=>/^(?:https?:\/\/|mailto:|#)/i.test(e)||!/^[a-z][a-z\d+.-]*:/i.test(e)&&!e.startsWith(`//`)?e:``,components:{h1:({children:e})=>(0,C.jsx)(`h3`,{children:e}),h2:({children:e})=>(0,C.jsx)(`h4`,{children:e}),h3:({children:e})=>(0,C.jsx)(`h5`,{children:e}),h4:({children:e})=>(0,C.jsx)(`h6`,{children:e}),h5:({children:e})=>(0,C.jsx)(`h6`,{children:e}),a:({href:e,children:t,title:n})=>e?/^(?:https?:\/\/|mailto:)/i.test(e)?(0,C.jsx)(`a`,{href:e,title:n,target:`_blank`,rel:`noreferrer`,children:t}):e.startsWith(`#`)?(0,C.jsx)(`a`,{href:e,children:t}):(0,C.jsx)(Hf,{path:e,children:t}):(0,C.jsx)(C.Fragment,{children:t}),table:({children:e})=>(0,C.jsx)(`div`,{className:`markdown-table`,children:(0,C.jsx)(`table`,{children:e})}),pre:({children:e})=>(0,C.jsx)(`pre`,{tabIndex:0,children:e}),img:({alt:e})=>(0,C.jsx)(`span`,{children:e})},children:t?Gf(e):e})}function Qf({text:e}){return(0,C.jsx)(Zf,{text:e,math:Xf(Wf(e))})}var $f=e=>`${e.source}/${e.id}`,ep=e=>R(e===`builtin`?`Built-in`:e===`user`?`Global`:`This paper`),tp=e=>e.replace(/^\uFEFF/,``).replace(/\r\n?/g,`
|
|
244
|
-
`).replace(/^---\n[\s\S]*?\n---(?:\n|$)/,``).trim();function np(e){let t=e instanceof Error?e.message:String(e);switch(t){case`This skill changed on disk. Reload it before saving.`:return R(`This skill changed on disk. Reload it before saving.`);case`This skill changed on disk. Reload it before deleting.`:return R(`This skill changed on disk. Reload it before deleting.`);case`A skill with this ID already exists in this location.`:return R(`A skill with this ID already exists in this location.`);case`This skill no longer exists. Refresh the list.`:return R(`This skill no longer exists. Refresh the list.`);case`This skill was removed on disk. Reload the list before saving.`:return R(`This skill was removed on disk. Reload the list before saving.`);case`The skill must contain instructions.`:return R(`The skill must contain instructions.`);case`Skill content must contain 1–20,000 characters.`:return R(`Skill content must contain 1–20,000 characters.`);default:return t}}function rp({project:e,api:t,onChanged:n,onClose:r,onBack:i,controls:a}){let o=(0,S.useRef)(null),s=(0,S.useRef)(0),c=(0,S.useRef)(!0),l=(0,S.useRef)(!1),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(``),[g,_]=(0,S.useState)(`all`),[v,y]=(0,S.useState)(!1),[b,x]=(0,S.useState)(!1),[w,E]=(0,S.useState)(``),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)(null),F=e?`?projectId=${encodeURIComponent(e.id)}`:``,I=!(!f||f.saved&&f.content===f.saved.content),ee=f?.source===`builtin`;(0,S.useEffect)(()=>(c.current=!0,ne(),()=>{c.current=!1,s.current++}),[]),(0,S.useEffect)(()=>{if(!I)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[I]),(0,S.useEffect)(()=>{(N||j)&&o.current?.querySelector(`[data-keep-editing]`)?.focus()},[N,j]),(0,S.useImperativeHandle)(a,()=>({cancel:oe}));function L(e){v||(I?P({proceed:e}):(M(!1),e()))}async function te(e){let n=++s.current;x(!0),E(``),O(!1),M(!1),p(null);try{let r=await t(`/skills/${$f(e)}${F}`);c.current&&n===s.current&&(p({...r,saved:r}),A(r.source===`builtin`))}catch(e){c.current&&n===s.current&&E(np(e))}finally{c.current&&n===s.current&&x(!1)}}async function ne(){let e=++s.current;x(!0),E(``),p(null),O(!1),M(!1);try{let n=await t(`/skills${F}`);if(!c.current||e!==s.current)return;d(n),x(!1),n.skills[0]&&!window.matchMedia(`(max-width: 680px)`).matches&&te(n.skills[0])}catch(t){c.current&&e===s.current&&(E(np(t)),x(!1))}}function re(e){s.current++,x(!1),E(``),O(!1),A(!1),h(``),_(`all`),M(!1);let t=e?.id||``;if(e){let n=1;for(;u?.skills.some(e=>e.source===`user`&&e.id===t);)t=`${e.id.slice(0,37)}-copy${n++>1?n-1:``}`}p({id:t,source:`user`,content:e?.content||`---\nname: ${R(`New skill`)}\ndescription: \n---\n\n`}),requestAnimationFrame(()=>o.current?.querySelector(`[name="skill-id"]`)?.focus())}function ie(e){p(t=>t?{...t,...e}:null),O(!1),M(!1)}async function ae(r=!1){if(f&&!l.current){l.current=!0,y(!0),E(``),O(!1);try{let i=await t(`/skills/${$f(f)}${r?`/remove`:``}`,{projectId:e?.id,content:f.content,revision:f.saved?.revision});if(n(),!c.current)return;M(!1),r?(p(null),await ne()):(p({...i,saved:i}),O(!0),d(await t(`/skills${F}`)))}catch(e){c.current&&E(np(e))}finally{l.current=!1,c.current&&y(!1)}}}function oe(){v||(N?P(null):j?M(!1):L(r))}let se=(u?.skills||[]).filter(e=>(g===`all`||e.source===g)&&`${e.id} ${Ie(e)} ${Le(e)}`.toLocaleLowerCase().includes(m.trim().toLocaleLowerCase())),ce=f?tp(f.content):``;return(0,C.jsxs)(`div`,{ref:o,className:`skill-library`+(f||b||w?` has-editor`:``),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),I&&!ee&&ce&&!v&&!N&&!j&&ae())},children:[(0,C.jsxs)(`header`,{className:`skill-library-header`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`button`,{className:`skill-library-settings-back`,disabled:v,onClick:()=>L(i),children:[(0,C.jsx)(T,{name:`chevronLeft`,size:14}),R(`Settings`)]}),(0,C.jsx)(`span`,{className:`skill-library-breadcrumb`,"aria-hidden":`true`,children:`/`}),(0,C.jsx)(`h2`,{id:`settings-title`,tabIndex:-1,children:R(`Skills`)})]}),(0,C.jsx)(`button`,{className:`icon-button`,"aria-label":R(`Close`),disabled:v,onClick:()=>L(r),children:(0,C.jsx)(T,{name:`close`,size:18})})]}),(0,C.jsxs)(`div`,{className:`skill-library-layout`,inert:!!(N||j),children:[(0,C.jsxs)(`aside`,{className:`skill-library-sidebar`,children:[(0,C.jsxs)(`div`,{className:`skill-library-tools`,children:[(0,C.jsxs)(`div`,{className:`skill-library-search`,children:[(0,C.jsx)(T,{name:`search`,size:14}),(0,C.jsx)(`input`,{type:`search`,"aria-label":R(`Search skills`),placeholder:R(`Search skills`),value:m,onChange:e=>h(e.target.value)})]}),(0,C.jsx)(`button`,{className:`icon-button`,"aria-label":R(`Refresh skills`),title:R(`Refresh skills`),disabled:v||b,onClick:()=>L(()=>void ne()),children:(0,C.jsx)(T,{name:`refresh`,size:14})}),(0,C.jsx)(`button`,{className:`icon-button`,"aria-label":R(`New skill`),title:R(`New skill`),disabled:!u||v,onClick:()=>L(()=>re()),children:(0,C.jsx)(T,{name:`plus`,size:17})})]}),(0,C.jsxs)(`div`,{className:`skill-library-filter`,role:`group`,"aria-label":R(`Skill scope`),children:[(0,C.jsx)(`button`,{"aria-pressed":g===`all`,onClick:()=>_(`all`),children:R(`All`)}),(0,C.jsx)(`button`,{"aria-pressed":g===`user`,onClick:()=>_(`user`),children:R(`Global`)}),e&&(0,C.jsx)(`button`,{"aria-pressed":g===`paper`,onClick:()=>_(`paper`),children:R(`This paper`)}),(0,C.jsx)(`button`,{"aria-pressed":g===`builtin`,onClick:()=>_(`builtin`),children:R(`Built-in`)})]}),(0,C.jsxs)(`nav`,{className:`skill-library-list`,"aria-label":R(`Skills`),children:[se.map(e=>(0,C.jsxs)(`button`,{className:`skill-library-item`+(f?.saved&&$f(f)===$f(e)?` active`:``),"aria-current":f?.saved&&$f(f)===$f(e)?`true`:void 0,disabled:v,onClick:()=>{f?.saved&&$f(f)===$f(e)||L(()=>void te(e))},children:[(0,C.jsx)(T,{name:Fe(e.id),size:16}),(0,C.jsxs)(`span`,{children:[(0,C.jsxs)(`span`,{className:`skill-library-item-title`,children:[(0,C.jsx)(`strong`,{children:Ie(e)}),(0,C.jsx)(`span`,{className:`skill-library-source`,children:ep(e.source)})]}),(0,C.jsxs)(`small`,{title:Le(e),children:[e.active?null:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`skill-library-overridden`,children:R(`Overridden`)}),` · `]}),Le(e)||`/${e.id}`]})]})]},$f(e))),u&&!se.length&&(0,C.jsx)(`p`,{className:`skill-library-empty`,children:R(`No matching skills`)})]})]}),(0,C.jsxs)(`div`,{className:`skill-library-detail`,children:[(0,C.jsxs)(`button`,{className:`skill-library-back`,onClick:()=>L(()=>{s.current++,p(null),x(!1)}),children:[(0,C.jsx)(T,{name:`chevronLeft`,size:15}),R(`All skills`)]}),b?(0,C.jsx)(`p`,{className:`skill-library-empty`,role:`status`,children:R(`Loading skills…`)}):f?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`skill-library-editor-heading`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h3`,{children:f.saved?Ie(f.saved):R(`New skill`)}),(0,C.jsxs)(`span`,{children:[ep(f.source),f.source===`paper`&&e?` · ${e.name}`:``]})]}),(0,C.jsxs)(`button`,{className:`button secondary compact`,disabled:v,onClick:()=>L(()=>re(f)),children:[(0,C.jsx)(T,{name:`copy`,size:14}),R(`Copy and edit`)]})]}),!f.saved&&(0,C.jsxs)(`div`,{className:`skill-library-new-fields`,children:[(0,C.jsxs)(`label`,{children:[R(`Skill ID`),(0,C.jsx)(`input`,{name:`skill-id`,value:f.id,placeholder:`my-skill`,pattern:`[a-z0-9][a-z0-9-]{0,47}`,maxLength:48,disabled:v,onChange:e=>ie({id:e.target.value}),spellCheck:!1})]}),(0,C.jsxs)(`label`,{children:[R(`Save to`),(0,C.jsxs)(`select`,{value:f.source,disabled:v,onChange:e=>ie({source:e.target.value}),children:[(0,C.jsx)(`option`,{value:`user`,children:R(`Global`)}),e&&(0,C.jsx)(`option`,{value:`paper`,children:R(`This paper`)})]})]}),(0,C.jsx)(`p`,{children:R(`Use lowercase letters, numbers and hyphens. This is also the / command name.`)})]}),ee?(0,C.jsx)(`p`,{className:`skill-library-notice`,children:R(`Copy this built-in skill to customize it for all papers or this paper.`)}):(0,C.jsxs)(`div`,{className:`skill-library-edit-tools`,children:[(0,C.jsx)(`span`,{children:R(`Skill content (Markdown)`)}),(0,C.jsxs)(`div`,{className:`segmented`,role:`group`,"aria-label":R(`Skill content view`),children:[(0,C.jsxs)(`button`,{"aria-pressed":!k,onClick:()=>A(!1),children:[(0,C.jsx)(T,{name:`pencil`,size:13}),R(`Edit`)]}),(0,C.jsx)(`button`,{"aria-pressed":k,onClick:()=>A(!0),children:R(`Preview`)})]})]}),k?(0,C.jsx)(`div`,{className:`skill-library-preview`,children:(0,C.jsx)(Qf,{text:ce})}):(0,C.jsx)(`textarea`,{className:`skill-library-content`,"aria-label":R(`Skill content (Markdown)`),value:f.content,onChange:e=>ie({content:e.target.value}),disabled:v,maxLength:2e4,spellCheck:!1}),f.saved&&!f.saved.active&&(0,C.jsx)(`p`,{className:`skill-library-notice`,children:R(`A skill with the same ID takes priority here: this paper, then global, then built-in.`)}),(0,C.jsxs)(`footer`,{className:`skill-library-editor-actions`,children:[f.saved&&!ee&&(0,C.jsxs)(`button`,{className:`button ghost danger-text compact`,disabled:v,onClick:()=>M(!0),children:[(0,C.jsx)(T,{name:`trash`,size:14}),R(`Delete skill`)]}),(0,C.jsx)(`span`,{role:`status`,children:D?R(`Saved`):I?R(`Unsaved changes`):``}),!ee&&(0,C.jsx)(`button`,{className:`button primary compact`,disabled:v||!I||!ce||!/^[a-z0-9][a-z0-9-]{0,47}$/.test(f.id),onClick:()=>void ae(),children:R(v?`Saving…`:`Save`)})]})]}):!w&&(0,C.jsx)(`p`,{className:`skill-library-empty`,children:R(`Select a skill or create your own.`)}),w&&(0,C.jsxs)(`p`,{className:`inline-error`,role:`alert`,children:[w,(0,C.jsx)(`button`,{className:`button secondary compact`,disabled:v,onClick:()=>L(()=>void ne()),children:R(`Refresh skills`)})]})]})]}),(N||j)&&(0,C.jsxs)(`div`,{className:`skill-library-confirm`,role:`alert`,children:[(0,C.jsx)(`p`,{children:R(N?`Discard unsaved skill changes?`:`Delete this skill? Only its Markdown file is removed; supporting files stay in place.`)}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`button`,{"data-keep-editing":!0,className:`button secondary compact`,disabled:v,onClick:()=>{P(null),M(!1)},children:R(`Keep editing`)}),(0,C.jsx)(`button`,{className:`button danger compact`,disabled:v,onClick:()=>{if(N){let{proceed:e}=N;P(null),M(!1),e()}else ae(!0)},children:R(N?`Discard changes`:`Delete skill`)})]})]})]})}function ip({theme:e,onTheme:t,onClose:n,onPeople:r,onSignOut:i,accountName:a,diagnostics:o,skills:s,initialPage:c=`general`}){let l=(0,S.useRef)(null),u=(0,S.useRef)(null),{choice:d}=ne(),f=pn(),[p,m]=(0,S.useState)(c),h=(0,S.useRef)(c),[g,_]=(0,S.useState)(!1),[v,y]=(0,S.useState)(``);(0,S.useEffect)(()=>{let e=document.activeElement,t=l.current;return t.showModal(),t.querySelector(`input:checked`)?.focus(),()=>{t.close(),e?.isConnected&&e.getClientRects().length&&e.focus()}},[]),(0,S.useEffect)(()=>{if(h.current===p)return;let e=h.current;h.current=p;let t=l.current;t.querySelector(`.settings-dialog`).scrollTop=0,((p===`general`||p===`about`&&e===`licenses`?t.querySelector(`[data-settings-page="${e}"]`):null)||t.querySelector(`#settings-title`))?.focus()},[p]);let b=f.permission===`granted`,x=f.on&&b,w=f.permission===`unsupported`?R(`This browser cannot show notifications.`):f.permission===`insecure`?R(`Browsers show notifications only on HTTPS or localhost. Open Papilot at a secure address to use them.`):f.permission===`denied`?R(`Notifications are blocked for this site. Allow them in the browser’s site settings, then turn them on here.`):``;async function E(e){_(!0),y(``);try{await mn(e)}finally{_(!1)}}let D=k.find(e=>e.id===M()).name,O=()=>{p===`skills`?u.current?.cancel():n()};return(0,C.jsx)(`dialog`,{ref:l,className:`modal-backdrop`,"aria-labelledby":`settings-title`,onKeyDown:Wt,onCancel:e=>{e.preventDefault(),O()},onClick:e=>{e.target===e.currentTarget&&O()},children:(0,C.jsx)(`section`,{className:`modal settings-dialog`+(p===`skills`?` settings-skills`:``),children:p===`skills`&&s?(0,C.jsx)(rp,{...s,controls:u,onBack:()=>m(`general`),onClose:n}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`button`,{className:`modal-close icon-button`,"aria-label":R(`Close`),onClick:n,children:(0,C.jsx)(T,{name:`close`})}),p!==`general`&&(0,C.jsxs)(`button`,{type:`button`,className:`settings-back`,onClick:()=>m(p===`licenses`?`about`:`general`),children:[(0,C.jsx)(T,{name:`chevronLeft`,size:14}),R(p===`licenses`?`About Papilot`:`Settings`)]}),(0,C.jsx)(`h2`,{id:`settings-title`,tabIndex:-1,children:R(p===`shortcuts`?`Keyboard shortcuts`:p===`about`?`About Papilot`:p===`licenses`?`Third-party licenses`:p===`diagnostics`?`Runtime & diagnostics`:`Settings`)}),p===`shortcuts`?(0,C.jsx)(bn,{}):p===`about`?(0,C.jsx)(An,{onLicenses:()=>m(`licenses`)}):p===`licenses`?(0,C.jsx)(jn,{}):p===`diagnostics`&&o?(0,C.jsx)(Pn,{...o}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`h3`,{className:`settings-section-title settings-preferences-title`,children:R(`Preferences`)}),(0,C.jsxs)(`div`,{className:`settings-row`,children:[(0,C.jsx)(`span`,{className:`settings-name`,id:`settings-appearance`,children:R(`Appearance`)}),(0,C.jsx)(`div`,{className:`segmented`,role:`radiogroup`,"aria-labelledby":`settings-appearance`,children:[`light`,`dark`,`system`].map(n=>(0,C.jsxs)(`label`,{className:e===n?`checked`:void 0,children:[(0,C.jsx)(`input`,{type:`radio`,name:`theme`,value:n,checked:e===n,onChange:()=>t(n)}),(0,C.jsx)(T,{name:n===`light`?`sun`:n===`dark`?`moon`:`monitor`,size:15}),R(n===`light`?`Light`:n===`dark`?`Dark`:`System`)]},n))})]}),(0,C.jsxs)(`div`,{className:`settings-row`,children:[(0,C.jsx)(`span`,{className:`settings-name`,children:R(`Language`)}),(0,C.jsx)(rn,{label:R(`Language`),value:d,onChange:e=>ee(e),options:[{value:`system`,label:R(`Browser default ({language})`,{language:D})},...k.map(e=>({value:e.id,label:e.name}))]})]}),(0,C.jsxs)(`div`,{className:`settings-row settings-notifications`,children:[(0,C.jsxs)(`div`,{className:`settings-text`,children:[(0,C.jsx)(`label`,{className:`settings-name`,htmlFor:`settings-notify`,children:R(`Notifications`)}),(0,C.jsx)(`p`,{id:`settings-notify-detail`,children:w||R(`Notify me when a task needs my reply, its review is ready, or it stops with an error, while Papilot is in the background.`)})]}),(0,C.jsx)(`input`,{id:`settings-notify`,type:`checkbox`,role:`switch`,className:`switch`,"aria-describedby":`settings-notify-detail`,checked:x,disabled:g||!!w&&!x,onChange:e=>void E(e.target.checked)})]}),x&&(0,C.jsxs)(`div`,{className:`settings-test`,children:[(0,C.jsxs)(`button`,{type:`button`,className:`button secondary compact`,onClick:()=>y(yn()?`sent`:`failed`),children:[(0,C.jsx)(T,{name:`bell`,size:14}),R(`Send a test notification`)]}),v&&(0,C.jsx)(`span`,{role:`status`,children:R(v===`sent`?`Sent. If nothing appeared, allow notifications for this browser in your system settings.`:`This browser could not show the notification.`)})]}),(0,C.jsxs)(`div`,{className:`settings-navigation`,children:[s&&(0,C.jsxs)(`button`,{type:`button`,className:`settings-navigation-row`,"data-settings-page":`skills`,onClick:()=>m(`skills`),children:[(0,C.jsx)(T,{name:`spark`,size:17}),(0,C.jsx)(`span`,{children:R(`Skills`)}),(0,C.jsx)(T,{name:`chevronRight`,size:15})]}),(0,C.jsxs)(`button`,{type:`button`,className:`settings-navigation-row`,"data-settings-page":`shortcuts`,onClick:()=>m(`shortcuts`),children:[(0,C.jsx)(T,{name:`keyboard`,size:17}),(0,C.jsx)(`span`,{children:R(`Keyboard shortcuts`)}),(0,C.jsx)(T,{name:`chevronRight`,size:15})]}),r&&(0,C.jsxs)(`button`,{type:`button`,className:`settings-navigation-row`,"aria-haspopup":`dialog`,onClick:r,children:[(0,C.jsx)(T,{name:`people`,size:17}),(0,C.jsx)(`span`,{children:R(`People`)}),(0,C.jsx)(T,{name:`chevronRight`,size:15})]}),o&&(0,C.jsxs)(`button`,{type:`button`,className:`settings-navigation-row`,"data-settings-page":`diagnostics`,onClick:()=>m(`diagnostics`),children:[(0,C.jsx)(T,{name:`monitor`,size:17}),(0,C.jsx)(`span`,{children:R(`Runtime & diagnostics`)}),(0,C.jsx)(T,{name:`chevronRight`,size:15})]}),(0,C.jsxs)(`button`,{type:`button`,className:`settings-navigation-row`,"data-settings-page":`about`,onClick:()=>m(`about`),children:[(0,C.jsx)(T,{name:`info`,size:17}),(0,C.jsx)(`span`,{children:R(`About Papilot`)}),(0,C.jsxs)(`small`,{children:[`v`,xn.version]}),(0,C.jsx)(T,{name:`chevronRight`,size:15})]}),i&&(0,C.jsxs)(`button`,{type:`button`,className:`settings-navigation-row`,onClick:i,children:[(0,C.jsx)(T,{name:`signOut`,size:17}),(0,C.jsx)(`span`,{children:R(`Sign out`)}),a&&(0,C.jsx)(`small`,{children:a})]})]}),(0,C.jsxs)(`footer`,{className:`settings-footer`,children:[(0,C.jsxs)(`span`,{children:[`Papilot · `,xn.license]}),(0,C.jsxs)(`a`,{href:xn.repository,target:`_blank`,rel:`noopener noreferrer`,children:[(0,C.jsx)(T,{name:`github`,size:15}),`GitHub`,(0,C.jsx)(T,{name:`external`,size:12}),(0,C.jsx)(`span`,{className:`sr-only`,children:R(`Opens in a new tab`)})]})]})]})]})})})}function ap({branch:e,files:t,staged:n,remote:r,agent:i,generate:a,commit:o,onClose:s}){let c=(0,S.useRef)(null),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(``),[p,m]=(0,S.useState)(``),h=(0,S.useRef)(!1);async function g(e){f(`writing`),m(``);try{let t=await a(e);h.current||u(t)}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(e=>e===`writing`?``:e)}}(0,S.useEffect)(()=>{let e=document.activeElement,t=c.current;return t.showModal(),t.querySelector(`textarea`)?.focus(),g(!1),()=>{t.close(),e?.isConnected&&e.getClientRects().length&&e.focus()}},[]);async function _(e){if(!d&&l.trim()){f(e?`push`:`commit`),m(``);try{await o(l.trim(),e)}catch(e){m(e instanceof Error?e.message:String(e)),f(``)}}}let v=()=>{d!==`commit`&&d!==`push`&&s()};return(0,C.jsx)(`dialog`,{ref:c,className:`modal-backdrop`,"aria-labelledby":`commit-title`,onKeyDown:Wt,onCancel:e=>{e.preventDefault(),v()},onClick:e=>{e.target===e.currentTarget&&v()},children:(0,C.jsxs)(`section`,{className:`modal commit-dialog`,children:[(0,C.jsx)(`button`,{className:`modal-close icon-button`,"aria-label":R(`Close`),onClick:v,children:(0,C.jsx)(T,{name:`close`})}),(0,C.jsx)(`h2`,{id:`commit-title`,children:e?R(`Commit to {branch}`,{branch:e}):R(`Commit`)}),(0,C.jsx)(`p`,{className:`modal-description`,children:n?re(t.length,`What is staged, in {n} file:`,`What is staged, in {n} files:`):re(t.length,`What this task accepted, in {n} file:`,`What this task accepted, in {n} files:`)}),(0,C.jsx)(`ul`,{className:`commit-files`,children:t.map(e=>(0,C.jsx)(`li`,{children:(0,C.jsx)(`code`,{children:e})},e))}),(0,C.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_(!1)},children:[(0,C.jsxs)(`div`,{className:`git-message-box`,children:[(0,C.jsx)(`textarea`,{"aria-label":R(`Commit message`),rows:3,value:l,readOnly:d===`commit`||d===`push`,placeholder:d===`writing`?R(`{agent} is writing a commit message…`,{agent:i}):R(`Commit message`),onChange:e=>{h.current=!0,u(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!e.nativeEvent.isComposing&&(e.preventDefault(),_(!1))}}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button git-generate`,"aria-label":R(`Generate commit message`),title:R(`Write a commit message for the chosen files with {agent}`,{agent:i}),disabled:!!d,onClick:()=>{h.current=!1,g(!0)},children:d===`writing`?(0,C.jsx)(`span`,{className:`spinner`}):(0,C.jsx)(T,{name:`spark`,size:15})})]}),p&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:p}),(0,C.jsxs)(`div`,{className:`button-row`,children:[(0,C.jsx)(`button`,{type:`button`,className:`button secondary`,disabled:d===`commit`||d===`push`,onClick:v,children:R(`Cancel`)}),r&&(0,C.jsx)(`button`,{type:`button`,className:`button secondary`,disabled:!!d||!l.trim(),onClick:()=>void _(!0),children:R(d===`push`?`Committing and pushing…`:`Commit and push`)}),(0,C.jsx)(`button`,{className:`button primary`,disabled:!!d||!l.trim(),children:R(d===`commit`?`Committing…`:`Commit`)})]})]})]})})}function op({draft:e,branch:t,isolated:n,remote:r,apply:i,disabled:a,agent:o,generate:s,commit:c}){let l=(0,S.useSyncExternalStore)(e.subscribe,e.getSnapshot);(0,S.useEffect)(()=>{s&&e.write(s)},[e,!!s]);let u=(0,S.useRef)(null),d=()=>{let e=u.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,132)}px`)};if((0,S.useLayoutEffect)(d,[l.message,!!s,l.result]),(0,S.useEffect)(()=>{let e=u.current;if(!e)return;let t=e.clientWidth,n=new ResizeObserver(()=>{e.clientWidth!==t&&(t=e.clientWidth,d())});return n.observe(e),()=>n.disconnect()},[!!s,l.result]),l.result)return(0,C.jsx)(`span`,{className:`commit-state`,role:`status`,children:l.result});let f=a||!!l.busy,p=(t=!1)=>{f||e.submit(t?`push`:`commit`,e=>c(e,t))};return(0,C.jsxs)(`form`,{className:`task-commit`,"aria-label":R(`Save accepted changes`),onSubmit:e=>{e.preventDefault(),p()},children:[(0,C.jsxs)(`div`,{className:`task-commit-compose`,children:[s&&(0,C.jsx)(`textarea`,{ref:u,"aria-label":R(`Commit message`),"aria-busy":l.writing,rows:1,value:l.message,readOnly:f,placeholder:l.writing?R(`{agent} is writing a commit message…`,{agent:o}):R(`Commit message`),onChange:t=>e.edit(t.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!e.nativeEvent.isComposing&&(e.preventDefault(),p())}}),(0,C.jsxs)(`div`,{className:`task-commit-toolbar`,children:[s&&(0,C.jsxs)(`span`,{className:`task-commit-branch`,title:t?R(`Commit to {branch}`,{branch:t}):R(`Commit`),children:[(0,C.jsx)(T,{name:`branch`,size:13}),(0,C.jsx)(`span`,{children:t||R(`Commit`)})]}),s&&(0,C.jsx)(`button`,{type:`button`,className:`task-commit-generate`,"aria-label":R(`Generate commit message`),"aria-busy":l.writing,title:R(`Write a commit message for the chosen files with {agent}`,{agent:o}),disabled:f||l.writing,onClick:()=>void e.write(s,!0),children:l.writing?(0,C.jsx)(`span`,{className:`task-commit-spinner`,"aria-hidden":`true`}):(0,C.jsx)(T,{name:`spark`,size:15})}),(0,C.jsxs)(`div`,{className:`task-commit-actions`,children:[i&&(0,C.jsx)(`button`,{type:`button`,className:`task-commit-alternative`,disabled:f,onClick:()=>void e.submit(`apply`,i),children:l.busy===`apply`?R(`Applying…`):R(`Apply to working directory`)}),s&&(0,C.jsxs)(C.Fragment,{children:[r&&(0,C.jsx)(`button`,{type:`button`,className:`task-commit-alternative`,disabled:f||!l.message.trim(),onClick:()=>p(!0),children:l.busy===`push`?R(`Committing and pushing…`):R(`Commit and push`)}),(0,C.jsxs)(`button`,{className:`task-commit-primary`,"aria-label":n?R(`Commit to task branch`):void 0,disabled:f||!l.message.trim(),children:[l.busy===`commit`?R(`Committing…`):R(`Commit`),(0,C.jsx)(T,{name:`arrowRight`,size:14})]})]})]})]})]}),l.writing&&(0,C.jsx)(`span`,{className:`task-commit-hint`,role:`status`,children:R(`{agent} is writing a commit message…`,{agent:o})}),l.error&&(0,C.jsx)(`p`,{className:`task-commit-error`,role:`alert`,children:l.error})]})}var sp=class{state={message:``,writing:!1,busy:``,error:``,result:``};revision=0;generation=0;requested=!1;listeners=new Set;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;update(e){this.state={...this.state,...e};for(let e of this.listeners)e()}edit(e){this.revision++,this.update({message:e})}async write(e,t=!1){if(this.state.busy||this.state.result||this.state.writing||!t&&this.requested)return;this.requested=!0;let n=++this.generation,r=this.revision;this.update({writing:!0,error:``});try{let i=await e(t);n===this.generation&&r===this.revision&&this.update({message:i})}catch(e){n===this.generation&&this.update({error:e instanceof Error?e.message:String(e)})}finally{n===this.generation&&this.update({writing:!1})}}async submit(e,t){if(!(this.state.busy||this.state.result||e!==`apply`&&!this.state.message.trim())){this.generation++,this.update({busy:e,writing:!1,error:``});try{this.update({result:await t(this.state.message.trim())})}catch(e){this.update({error:e instanceof Error?e.message:String(e)})}finally{this.update({busy:``})}}}};function cp(e){let t=[],n=1;return{rows:e.map(e=>{let r=t.includes(e.hash);r||t.push(e.hash);let i=[...t],a=i.indexOf(e.hash),o=i.filter(t=>t!==e.hash);for(let[t,n]of e.parents.entries())o.includes(n)||o.splice(Math.min(a+t,o.length),0,n);let s=i.flatMap((t,n)=>t===e.hash?[]:[{from:n,to:o.indexOf(t),parent:!1}]);return s.push(...e.parents.map(e=>({from:a,to:o.indexOf(e),parent:!0}))),n=Math.max(n,i.length,o.length),t=o,{commit:e,lane:a,incoming:r,edges:s}}),lanes:n}}function lp({status:e}){let t=e.merging?.conflicts.length??e.files.filter(e=>e.status===`U`).length,n=e.files.filter(e=>e.staged&&e.status!==`U`).length,r=e.files.filter(e=>e.unstaged&&e.status!==`?`).length,i=e.files.filter(e=>e.status===`?`).length;return(0,C.jsxs)(`span`,{className:`git-status-counts`,children:[!e.files.length&&(0,C.jsxs)(`span`,{className:`is-clean`,children:[(0,C.jsx)(T,{name:`check`,size:12}),R(`clean`)]}),t>0&&(0,C.jsx)(`span`,{className:`has-conflicts`,children:R(`{n} conflicts`,{n:t})}),n>0&&(0,C.jsx)(`span`,{children:R(`{n} staged`,{n})}),r>0&&(0,C.jsx)(`span`,{children:R(`{n} unstaged`,{n:r})}),i>0&&(0,C.jsx)(`span`,{children:R(`{n} untracked`,{n:i})}),e.merging&&(0,C.jsx)(`span`,{className:`has-conflicts`,children:R(`Merge in progress`)})]})}var up=e=>e.branch||(e.bare?R(`Bare repository`):R(`detached HEAD`)),dp=[`var(--accent)`,`var(--green)`,`var(--graph-purple)`,`var(--amber-text)`,`var(--graph-pink)`];function fp({git:e,load:t,tasks:n,onOpenTask:r,taskStatus:i}){let[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(``),[l,u]=(0,S.useState)(!0),[d,f]=(0,S.useState)(0),[p,m]=(0,S.useState)(``),[h,g]=(0,S.useState)(``),_=JSON.stringify([e.head?.hash,e.branch,e.ahead,e.behind,e.files,e.merging]);(0,S.useEffect)(()=>{let e=new AbortController,n;async function r(){if(document.hidden)n=setTimeout(r,1e4);else{u(!0);try{let n=await t(e.signal);e.signal.aborted||(o(n),c(``))}catch(t){e.signal.aborted||c(t instanceof Error?t.message:String(t))}finally{e.signal.aborted||(u(!1),n=setTimeout(r,1e4))}}}return r(),()=>{e.abort(),clearTimeout(n)}},[t,_,d]);let v=a?.worktrees||[],y=new Map(n.map(e=>[e.id,e])),b=e=>e.taskId?y.get(e.taskId):void 0,x=e=>b(e)?.title||(e.current?R(`Manuscript`):up(e)),w=v.find(e=>e.path===p)||v.find(e=>e.current),E=cp(a?.commits||[]),D=20+E.lanes*16;return(0,C.jsxs)(`div`,{className:`git-repository`,children:[(0,C.jsxs)(`section`,{"aria-label":R(`Worktrees`),children:[(0,C.jsxs)(`div`,{className:`git-overview-heading`,children:[(0,C.jsxs)(`h3`,{children:[(0,C.jsx)(T,{name:`branch`,size:14}),R(`Worktrees`),a&&(0,C.jsx)(`span`,{className:`count`,children:v.length})]}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":R(`Refresh worktrees and history`),title:R(`Refresh worktrees and history`),disabled:l,onClick:()=>f(e=>e+1),children:l?(0,C.jsx)(`span`,{className:`spinner`}):(0,C.jsx)(T,{name:`refresh`,size:14})})]}),s&&(0,C.jsxs)(`p`,{className:`inline-error git-overview-note`,role:`alert`,children:[R(`Could not refresh the repository.`),a&&(0,C.jsxs)(C.Fragment,{children:[` `,R(`Showing the last update.`)]}),` `,(0,C.jsx)(`span`,{children:s}),(0,C.jsx)(`button`,{type:`button`,className:`button ghost compact`,onClick:()=>f(e=>e+1),children:R(`Retry`)})]}),!a&&!s&&(0,C.jsx)(`p`,{className:`git-overview-note`,role:`status`,children:R(`Reading worktrees and history…`)}),(0,C.jsx)(`ul`,{className:`git-worktrees`,children:v.map(t=>{let n=t.current?e:t.status,a=h===t.path,o=b(t);return(0,C.jsxs)(`li`,{className:`git-worktree`+(t.path===w?.path?` selected`:``),"data-task-id":o?.id,children:[(0,C.jsxs)(`div`,{className:`git-worktree-row`,children:[(0,C.jsxs)(`button`,{type:`button`,className:`git-worktree-button`,"aria-expanded":a,onClick:()=>{m(t.path),g(a?``:t.path)},children:[(0,C.jsxs)(`span`,{className:`git-worktree-title`,children:[(0,C.jsx)(T,{name:a?`chevronDown`:`chevronRight`,size:12}),(0,C.jsx)(`strong`,{title:x(t),children:x(t)}),o?.archivedAt&&(0,C.jsx)(`span`,{title:R(`Archived task`),"aria-label":R(`Archived task`),children:(0,C.jsx)(T,{name:`archive`,size:12})}),t.current&&(0,C.jsx)(`span`,{className:`git-current-badge`,children:R(`Current`)}),o&&i(o)]}),(0,C.jsxs)(`span`,{className:`git-worktree-meta`,children:[n?(0,C.jsx)(lp,{status:n}):(0,C.jsx)(`span`,{className:`git-worktree-unavailable`,children:t.bare?R(`Bare repository`):R(`Status unavailable`)}),n?.upstream&&(n.ahead>0||n.behind>0)&&(0,C.jsxs)(`span`,{className:`git-worktree-sync`,title:R(`Compared with {upstream}`,{upstream:n.upstream}),children:[`↑`,n.ahead,` ↓`,n.behind]}),t.locked!==void 0&&(0,C.jsx)(`span`,{className:`git-worktree-flag`,title:t.locked,children:R(`Locked`)}),t.prunable!==void 0&&(0,C.jsx)(`span`,{className:`git-worktree-flag`,title:t.prunable,children:R(`Missing worktree`)})]})]}),o&&(0,C.jsx)(`button`,{type:`button`,className:`icon-button git-open-task`,"aria-label":R(`Open task: {title}`,{title:o.title}),title:R(`Open task: {title}`,{title:o.title}),onClick:()=>r(o.id),children:(0,C.jsx)(T,{name:`arrowRight`,size:14})})]}),a&&(0,C.jsxs)(`div`,{className:`git-worktree-detail`,children:[(0,C.jsxs)(`p`,{className:`git-worktree-branch`,children:[(0,C.jsx)(T,{name:`branch`,size:12}),(0,C.jsx)(`code`,{children:up(t)}),t.head&&(0,C.jsx)(`code`,{children:t.head.slice(0,7)}),!o&&!t.current&&(0,C.jsx)(`span`,{children:R(`No linked task`)})]}),(0,C.jsx)(`p`,{className:`git-worktree-path`,children:t.path}),n?.head&&(0,C.jsx)(`p`,{children:n.head.subject}),n?.upstream?(0,C.jsxs)(`p`,{className:`git-worktree-tracking`,children:[(0,C.jsx)(`code`,{children:n.upstream}),(0,C.jsx)(`span`,{children:R(`{ahead} ahead · {behind} behind`,{ahead:n.ahead,behind:n.behind})})]}):n&&(0,C.jsx)(`p`,{children:R(`No upstream branch`)}),t.error&&(0,C.jsx)(`p`,{className:`inline-error`,children:R(`Could not read this worktree.`)}),t.locked&&(0,C.jsxs)(`p`,{children:[R(`Locked`),`: `,t.locked]}),t.prunable&&(0,C.jsxs)(`p`,{children:[R(`Missing worktree`),`: `,t.prunable]}),n&&n.files.length>0&&(0,C.jsx)(`ul`,{className:`git-worktree-files`,"aria-label":R(`Changed files in {branch}`,{branch:x(t)}),children:n.files.map(e=>(0,C.jsxs)(`li`,{children:[(0,C.jsx)(`code`,{className:e.status===`U`?`has-conflicts`:``,children:e.status===`?`?`?`:e.status}),(0,C.jsx)(`span`,{children:e.path}),e.staged&&(0,C.jsx)(`small`,{children:R(`Staged`)})]},e.path))})]})]},t.path)})}),a&&v.length===1&&(0,C.jsx)(`p`,{className:`git-overview-note`,children:R(`No other worktrees in this repository.`)})]}),(0,C.jsxs)(`section`,{className:`git-history`,"aria-label":R(`Commit graph`),children:[(0,C.jsxs)(`div`,{className:`git-overview-heading`,children:[(0,C.jsxs)(`h3`,{title:R(`Branches and worktrees at each commit. Select a worktree to highlight its HEAD.`),children:[(0,C.jsx)(T,{name:`commit`,size:14}),R(`Commit graph`)]}),(0,C.jsx)(`span`,{children:R(`Newest first`)})]}),a&&!E.rows.length&&(0,C.jsx)(`p`,{className:`git-overview-note`,children:R(`No commits yet`)}),E.rows.length>0&&(0,C.jsxs)(C.Fragment,{children:[w?.head&&!E.rows.some(e=>e.commit.hash===w.head)&&(0,C.jsx)(`p`,{className:`git-overview-note`,children:R(`This worktree’s HEAD is outside the displayed history.`)}),(0,C.jsx)(`div`,{className:`git-graph-scroll`,children:(0,C.jsx)(`ol`,{className:`git-graph-list`,style:{minWidth:D+220},children:E.rows.map(e=>{let{commit:t,lane:n}=e,r=v.filter(e=>e.head===t.hash),i=w?.head===t.hash,a=e=>12+e*16,o=t.refs.filter(e=>!r.some(t=>b(t)&&t.branch===e));return(0,C.jsxs)(`li`,{className:`git-graph-row`+(i?` highlighted`:``),"data-commit":t.hash,children:[(0,C.jsxs)(`div`,{className:`git-graph-rail`,style:{width:D},"aria-hidden":`true`,children:[(0,C.jsxs)(`svg`,{viewBox:`0 0 ${D} 100`,preserveAspectRatio:`none`,className:`git-graph-lines`,children:[e.edges.filter(e=>!e.parent).map((e,t)=>(0,C.jsx)(`path`,{d:`M ${a(e.from)} 0 L ${a(e.from)} 50 C ${a(e.from)} 75 ${a(e.to)} 75 ${a(e.to)} 100`,stroke:dp[e.to%dp.length]},`through`+t)),e.incoming&&(0,C.jsx)(`path`,{d:`M ${a(n)} 0 V 50`,stroke:dp[n%dp.length]}),e.edges.filter(e=>e.parent).map((e,t)=>(0,C.jsx)(`path`,{d:`M ${a(n)} 50 C ${a(n)} 75 ${a(e.to)} 75 ${a(e.to)} 100`,stroke:dp[e.to%dp.length]},`parent`+t))]}),(0,C.jsx)(`span`,{className:`git-graph-dot`+(t.parents.length>1?` merge`:``),style:{left:a(n),background:dp[n%dp.length]}})]}),(0,C.jsxs)(`div`,{className:`git-graph-content`,children:[(0,C.jsxs)(`div`,{className:`git-graph-subject`,children:[(0,C.jsx)(`p`,{title:`${t.subject}\n${t.author} · ${new Date(t.date).toLocaleString(te())}`,children:t.subject}),(0,C.jsx)(`code`,{title:t.hash,children:t.hash.slice(0,7)})]}),(r.length>0||o.length>0)&&(0,C.jsxs)(`div`,{className:`git-graph-refs`,children:[r.map(e=>(0,C.jsxs)(`button`,{type:`button`,className:`git-graph-ref worktree-ref`+(e.current?` current-ref`:``),title:`${x(e)}\n${up(e)}\n${e.path}`,onClick:()=>{m(e.path),g(e.path)},children:[(0,C.jsx)(T,{name:b(e)?`chat`:`branch`,size:10}),(0,C.jsx)(`span`,{children:x(e)})]},e.path)),o.map(e=>(0,C.jsx)(`span`,{className:`git-graph-ref`,title:e,children:e},e))]})]})]},t.hash)})})}),(0,C.jsx)(`p`,{className:`git-overview-note git-history-end`,children:a?.truncated?R(`Showing the latest {n} commits. Older history is not shown.`,{n:E.rows.length}):re(E.rows.length,`{n} commit`,`{n} commits`)})]})]})]})}function pp({api:e,projects:t,ago:n,onClose:r}){let i=(0,S.useRef)(null),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(``),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)({}),[p,m]=(0,S.useState)(``),[h,g]=(0,S.useState)(``),[_,v]=(0,S.useState)([]);(0,S.useEffect)(()=>{let t=document.activeElement,n=i.current;return n.showModal(),y(`load`,()=>e(`/people`)),()=>{n.close(),t?.isConnected&&t.getClientRects().length&&t.focus()}},[]);async function y(e,t){u(e),c(``);try{let e=await t();e&&o(e)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(``)}}let b=()=>y(`invite`,async()=>{let t=await e(`/people`,{name:h.trim(),projects:_});return f(e=>({...e,[t.id]:t.link})),g(``),v([]),e(`/people`)}),x=t=>y(`link:`+t.id,async()=>{let{link:n}=await e(`/people/${t.id}/invite`,{});f(e=>({...e,[t.id]:n}))}),w=(t,n,r)=>{let i=r?[...t.projects,n]:t.projects.filter(e=>e!==n);return o(e=>e&&{...e,people:e.people.map(e=>e.id===t.id?{...e,projects:i}:e)}),y(`share:`+t.id,()=>e(`/people/${t.id}/share`,{projects:i}).catch(async t=>{throw o(await e(`/people`)),t}))},E=(t,n)=>y(`device:`+n.id,()=>e(`/people/${t.id}/devices/${n.id}/remove`,{})),D=t=>y(`remove:`+t.id,()=>e(`/people/${t.id}/remove`,{})),O=t=>y(`sign-out:`+t.id,()=>e(`/people/${t.id}/sign-out`,{})),k=()=>{l&&l!==`load`||r()},A=(e,n,r,i)=>(0,C.jsxs)(`fieldset`,{className:`people-papers`,disabled:r,children:[(0,C.jsx)(`legend`,{children:i}),t.map(t=>(0,C.jsxs)(`label`,{className:`checkbox`,children:[(0,C.jsx)(`input`,{type:`checkbox`,checked:e.includes(t.id),onChange:e=>n(t.id,e.target.checked)}),t.name]},t.id))]});return(0,C.jsx)(`dialog`,{ref:i,className:`modal-backdrop`,"aria-labelledby":`people-title`,onKeyDown:Wt,onCancel:e=>{e.preventDefault(),k()},onClick:e=>{e.target===e.currentTarget&&k()},children:(0,C.jsxs)(`section`,{className:`modal people-dialog`,children:[(0,C.jsx)(`button`,{className:`modal-close icon-button`,"aria-label":R(`Close`),onClick:k,children:(0,C.jsx)(T,{name:`close`})}),(0,C.jsx)(`h2`,{id:`people-title`,children:R(`People`)}),(0,C.jsx)(`p`,{className:`modal-description`,children:R(`People you invite sign in with a passkey at the public address and can do everything you can in the papers you share with them, including approving the commands agents run on this host and pushing with its Git credentials.`)}),(0,C.jsxs)(`p`,{className:`people-warning`,children:[(0,C.jsx)(T,{name:`alert`,size:15}),(0,C.jsx)(`span`,{children:R(`Agents and builds can read any file on this host, including your other papers. Invite only people you would trust with access to it.`)})]}),a&&!a.origin&&(0,C.jsx)(`p`,{className:`people-setup`,children:R(`To invite people, give Papilot a public HTTPS address: set PAPILOT_ACCOUNT_ORIGIN and forward it to this host, as the Collaborators section of the guide describes.`)}),a?.origin&&(0,C.jsxs)(`form`,{className:`people-invite`,onSubmit:e=>{e.preventDefault(),h.trim()&&b()},children:[(0,C.jsxs)(`label`,{children:[R(`Invite someone`),(0,C.jsx)(`input`,{value:h,maxLength:80,onChange:e=>g(e.target.value),placeholder:R(`Their name, as others will see it`),autoComplete:`off`})]}),A(_,(e,t)=>v(n=>t?[...n,e]:n.filter(t=>t!==e)),l===`invite`,R(`Papers they can open`)),(0,C.jsx)(`div`,{className:`button-row`,children:(0,C.jsx)(`button`,{className:`button primary`,disabled:!h.trim()||!!l,children:R(l===`invite`?`Creating…`:`Create invite link`)})})]}),s&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:s}),!a&&l===`load`&&(0,C.jsx)(`p`,{className:`muted`,role:`status`,children:R(`Loading people…`)}),(0,C.jsx)(`ul`,{className:`people-list`,children:a?.people.map(e=>{let t=e.role===`owner`,r=e.devices.filter(e=>e.kind===`session`);return(0,C.jsxs)(`li`,{className:`person`,children:[(0,C.jsxs)(`div`,{className:`person-head`,children:[(0,C.jsx)(`strong`,{children:t?R(`{name} (you)`,{name:e.name}):e.name}),(0,C.jsx)(`span`,{className:`muted`,children:t?R(`Owner`):e.joined?e.lastSeenAt?R(`Last active {time}`,{time:n(e.lastSeenAt)}):R(`Joined`):R(`Invited, not joined yet`)})]}),!t&&A(e.projects,(t,n)=>void w(e,t,n),l===`share:`+e.id,R(`Papers {name} can open`,{name:e.name})),d[e.id]&&(0,C.jsxs)(`div`,{className:`invite-link`,children:[(0,C.jsx)(`input`,{readOnly:!0,"aria-label":R(`Invite link for {name}`,{name:e.name}),value:d[e.id],onFocus:e=>e.currentTarget.select()}),(0,C.jsxs)(`button`,{type:`button`,className:`button secondary compact`,onClick:()=>void navigator.clipboard?.writeText(d[e.id]),children:[(0,C.jsx)(T,{name:`copy`,size:14}),R(`Copy`)]}),(0,C.jsx)(`small`,{className:`muted`,children:t?R(`Open it on the device you want to sign in from. It works once, within 15 minutes.`):R(`Send it to {name} yourself. It works once, within 7 days.`,{name:e.name})})]}),e.devices.length>0&&(0,C.jsx)(`ul`,{className:`device-list`,children:e.devices.map(t=>(0,C.jsxs)(`li`,{children:[(0,C.jsx)(T,{name:t.kind===`passkey`?`key`:`monitor`,size:14}),(0,C.jsx)(`span`,{children:t.kind===`passkey`?R(`Passkey · {label}`,{label:t.label}):R(`Signed in · {label}`,{label:t.label})}),(0,C.jsx)(`span`,{className:`muted`,children:t.lastUsedAt?R(`used {time}`,{time:n(t.lastUsedAt)}):R(`added {time}`,{time:n(t.createdAt)})}),(0,C.jsx)(`button`,{type:`button`,className:`button secondary compact`,disabled:!!l,"aria-label":R(`Remove {device}`,{device:t.label}),onClick:()=>void E(e,t),children:R(`Remove`)})]},t.id))}),a.origin&&(0,C.jsxs)(`div`,{className:`person-actions`,children:[(0,C.jsx)(`button`,{type:`button`,className:`button secondary compact`,disabled:!!l,onClick:()=>void x(e),children:t?R(`Sign in from anywhere`):e.joined?R(`Invite link for a new device`):R(`New invite link`)}),r.length>0&&(0,C.jsx)(`button`,{type:`button`,className:`button secondary compact`,disabled:!!l,onClick:()=>void O(e),children:R(`Sign out everywhere`)}),!t&&(p===e.id?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`button`,{type:`button`,className:`button danger compact`,disabled:!!l,onClick:()=>{m(``),D(e)},children:R(`Remove {name}`,{name:e.name})}),(0,C.jsx)(`button`,{type:`button`,className:`button secondary compact`,onClick:()=>m(``),children:R(`Cancel`)})]}):(0,C.jsx)(`button`,{type:`button`,className:`button secondary compact`,disabled:!!l,onClick:()=>m(e.id),children:R(`Remove…`)}))]})]},e.id)})})]})})}function mp(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function hp(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function gp(){return _p.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var _p={stubThis:e=>e};function vp(e){let{id:t}=e;return{...e,id:hp(t),transports:e.transports,type:e.type}}function yp(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var bp=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function xp({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new bp({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new bp({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new bp({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new bp({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new bp({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new bp({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new bp({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new bp({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!yp(t))return new bp({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new bp({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new bp({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new bp({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var Sp=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},Cp=[`cross-platform`,`platform`];function wp(e){if(e&&!(Cp.indexOf(e)<0))return e}async function Tp(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!gp())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:hp(t.challenge),user:{...t.user,id:hp(t.user.id)},excludeCredentials:t.excludeCredentials?.map(vp)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=Sp.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw xp({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){Ep(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=mp(e))}catch(e){Ep(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=mp(c.getAuthenticatorData())}catch(e){Ep(`getAuthenticatorData()`,e)}return{id:o,rawId:mp(s),response:{attestationObject:mp(c.attestationObject),clientDataJSON:mp(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:wp(a.authenticatorAttachment)}}function Ep(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function Dp(){if(!gp())return Op.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?Op.stubThis(new Promise(e=>e(!1))):Op.stubThis(e.isConditionalMediationAvailable())}var Op={stubThis:e=>e};function kp({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new bp({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new bp({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!yp(t))return new bp({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new bp({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new bp({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function Ap(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!gp())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(vp));let a={...t,challenge:hp(t.challenge),allowCredentials:i},o={};if(n){if(!await Dp())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=Sp.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw kp({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=mp(u.userHandle)),{id:c,rawId:mp(l),response:{authenticatorData:mp(u.authenticatorData),clientDataJSON:mp(u.clientDataJSON),signature:mp(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:wp(s.authenticatorAttachment)}}var jp=e=>e instanceof Error&&(e.name===`NotAllowedError`||e.name===`AbortError`),Mp=e=>e instanceof Error?e.message:String(e);function Np({api:e,onSignedIn:t}){let[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(``);async function o(){r(!0),a(``);try{await e(`/auth/verify`,{response:await Ap({optionsJSON:await e(`/auth/options`,{})})}),t()}catch(e){a(jp(e)?R(`Signing in was cancelled. Try again when you are ready.`):Mp(e))}finally{r(!1)}}return(0,C.jsx)(`div`,{className:`home sign-in`,children:(0,C.jsxs)(`div`,{className:`home-inner`,children:[(0,C.jsx)(`img`,{className:`home-logo`,src:Sn,alt:``}),(0,C.jsx)(`h1`,{children:R(`Sign in to Papilot`)}),gp()?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`p`,{className:`home-copy`,children:R(`Use the passkey you created from your invite link.`)}),(0,C.jsxs)(`button`,{className:`button primary`,disabled:n,"aria-busy":n,onClick:()=>void o(),children:[(0,C.jsx)(T,{name:`key`,size:16}),R(n?`Waiting for your passkey…`:`Sign in with a passkey`)]})]}):(0,C.jsx)(`p`,{className:`home-copy`,children:R(`This browser cannot use passkeys. Open this page in a current version of Safari, Chrome, Edge or Firefox.`)}),i&&(0,C.jsx)(`p`,{className:`inline-error home-error`,role:`alert`,children:i}),(0,C.jsx)(`p`,{className:`home-copy muted sign-in-help`,children:R(`No passkey on this device? Ask the person who invited you for a new invite link.`)})]})})}function Pp({api:e,onDone:t}){let[n]=(0,S.useState)(()=>location.hash.slice(1)),[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(!1),[s,c]=(0,S.useState)(``);(0,S.useEffect)(()=>{history.replaceState(null,``,`/invite`),n?e(`/auth/invite`,{token:n}).then(i,e=>c(Mp(e))):c(R(`This invite link is incomplete. Copy the whole link and open it again.`))},[]);async function l(){o(!0),c(``);try{let r=await Tp({optionsJSON:await e(`/auth/invite/options`,{token:n})});await e(`/auth/invite/verify`,{token:n,response:r}),history.replaceState(null,``,`/`),t()}catch(e){c(jp(e)?R(`Creating the passkey was cancelled. The link still works; try again when you are ready.`):Mp(e))}finally{o(!1)}}let u=r?.papers.join(R(`, `))||``;return(0,C.jsx)(`div`,{className:`home sign-in`,children:(0,C.jsxs)(`div`,{className:`home-inner`,children:[(0,C.jsx)(`img`,{className:`home-logo`,src:Sn,alt:``}),(0,C.jsx)(`h1`,{children:r?.adding?R(`Add a passkey`):R(`Join Papilot`)}),r&&(0,C.jsx)(`p`,{className:`home-copy`,children:r.owner?R(`Create a passkey to sign in to your Papilot from anywhere.`):r.adding?R(`Create a passkey on this device to sign in as {name}.`,{name:r.name}):u?R(`{inviter} invited you to work on {papers}. You will appear as {name}.`,{inviter:r.inviter,papers:u,name:r.name}):R(`{inviter} invited you to Papilot. You will appear as {name}.`,{inviter:r.inviter,name:r.name})}),r&&(gp()?(0,C.jsxs)(`button`,{className:`button primary`,disabled:a,"aria-busy":a,onClick:()=>void l(),children:[(0,C.jsx)(T,{name:`key`,size:16}),R(a?`Waiting for your passkey…`:`Create a passkey`)]}):(0,C.jsx)(`p`,{className:`home-copy`,children:R(`This browser cannot use passkeys. Open this page in a current version of Safari, Chrome, Edge or Firefox.`)})),!r&&!s&&(0,C.jsx)(`p`,{className:`home-copy`,role:`status`,children:(0,C.jsx)(`span`,{className:`spinner`})}),s&&(0,C.jsx)(`p`,{className:`inline-error home-error`,role:`alert`,children:s}),r&&(0,C.jsx)(`p`,{className:`home-copy muted sign-in-help`,children:R(`A passkey signs you in with Face ID, Touch ID, Windows Hello or your phone. Papilot never sees a password.`)})]})})}var Fp=!1,Ip=new Set;function Lp(e){if(Fp!==e){Fp=e;for(let e of Ip)e()}}var Rp=()=>Fp;function zp(){return(0,S.useSyncExternalStore)(e=>(Ip.add(e),()=>Ip.delete(e)),()=>Fp)}function Bp(){Ye();try{for(let e of Object.keys(localStorage))(e.startsWith(`papilot:`)||e.startsWith(`latex-review:`))&&e!==`papilot:theme`&&e!==`papilot:language`&&D.removeItem(e)}catch{}}var Vp=e=>e.charAt(0).toUpperCase()+e.slice(1);function Hp({model:e,effort:t,fast:n}){return(0,C.jsxs)(`span`,{className:`agent-model-label`,children:[(0,C.jsx)(`span`,{className:`agent-model-name`,children:e}),t&&(0,C.jsx)(`small`,{children:Vp(t)}),n&&(0,C.jsx)(T,{name:`bolt`,size:13})]})}function Up({name:e,runtime:t,reconnecting:n,onReconnect:r}){if(!t||t.connected&&t.authenticated)return null;let i=t.error||``,a=i.split(/:\s|\.\s/)[0],o=i?a.length<=120?a:R(`{agent} is unavailable`,{agent:e}):R(`Connecting to {agent}…`,{agent:e});return(0,C.jsxs)(`div`,{className:`agent-connection`,children:[(0,C.jsxs)(`div`,{className:`agent-connection-message`,role:`status`,children:[(0,C.jsx)(T,{name:`alert`,size:15}),(0,C.jsx)(`span`,{children:o})]}),i&&i!==o&&(0,C.jsxs)(`details`,{children:[(0,C.jsx)(`summary`,{children:R(`Connection details`)}),(0,C.jsx)(`p`,{children:i})]}),(0,C.jsxs)(`button`,{type:`button`,disabled:n,onClick:r,children:[(0,C.jsx)(T,{name:`refresh`,size:12}),R(n?`Connecting…`:`Reconnect`)]})]})}function Wp({efforts:e,value:t,fallback:n,onChange:r}){let i=e.find(e=>e===t)||e.find(e=>e===n),a=i?e.indexOf(i):Math.floor((e.length-1)/2),o=e.length>1?a/(e.length-1):1,s=i?Vp(i):R(`Model default`),c=t=>`calc(15px + ${e.length>1?t/(e.length-1):1} * (100% - 30px))`;return(0,C.jsxs)(`div`,{className:`agent-effort`,children:[(0,C.jsxs)(`div`,{className:`effort-head`,children:[(0,C.jsx)(`span`,{children:R(`Reasoning effort`)}),(0,C.jsx)(`strong`,{children:s})]}),(0,C.jsxs)(`div`,{className:`effort-track`+(i?``:` unset`),children:[(0,C.jsx)(`span`,{className:`effort-fill`,style:{width:`calc(30px + ${o} * (100% - 30px))`}}),e.map((e,t)=>t!==a&&(0,C.jsx)(`span`,{className:`effort-stop`+(i&&t<a?` on`:``),style:{left:c(t)}},e)),(0,C.jsx)(`input`,{type:`range`,min:0,max:e.length-1,step:1,value:a,"aria-label":R(`Reasoning effort`),"aria-valuetext":s,disabled:e.length<2,onChange:t=>r(e[Number(t.target.value)])})]}),(0,C.jsxs)(`div`,{className:`effort-scale`,children:[(0,C.jsx)(`span`,{children:Vp(e[0])}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>r(``),disabled:!t,children:R(`Model default`)}),(0,C.jsx)(`span`,{children:Vp(e[e.length-1])})]})]})}function Gp({agents:e,agent:t,models:n,model:r,effort:i,fast:a,runtime:o,reconnecting:s,onReconnect:c,onAgent:l,onChange:u,disabled:d}){let f=(0,S.useId)(),p=(0,S.useRef)(null),m=(0,S.useRef)(null),[h,g]=(0,S.useState)(!1),_=n.find(e=>e.id===r)||n.find(e=>e.isDefault),v=_?.name||r||e.find(e=>e.value===t)?.label||R(`Default model`),y=i||_?.defaultEffort,b=t===`codex`?_?.fastMode:void 0,x=o&&(!o.connected||!o.authenticated),w=e.find(e=>e.value===t)?.label||t,E=[v,y?Vp(y):``,b&&a?R(`Fast`):``].filter(Boolean).join(` · `);function D(){let e=m.current,t=p.current.getBoundingClientRect();e.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-e.offsetWidth-8))}px`;let n=t.bottom+6,r=t.top-e.offsetHeight-6;e.style.top=`${Math.max(8,Math.min(n+e.offsetHeight>window.innerHeight-8&&r>=8?r:n,window.innerHeight-e.offsetHeight-8))}px`}(0,S.useLayoutEffect)(()=>{h&&D()},[h,t,r,_]),(0,S.useEffect)(()=>{if(!h)return;let e=()=>m.current?.hidePopover(),t=t=>{t.target instanceof Node&&t.target.contains(p.current)&&!m.current?.contains(t.target)&&e()},n=new ResizeObserver(()=>{m.current?.matches(`:popover-open`)&&D()});return m.current&&n.observe(m.current),window.addEventListener(`resize`,e),document.addEventListener(`scroll`,t,!0),()=>{n.disconnect(),window.removeEventListener(`resize`,e),document.removeEventListener(`scroll`,t,!0)}},[h]),(0,S.useEffect)(()=>{d&&m.current?.hidePopover()},[d]);function O(){m.current?.showPopover(),D(),g(!0),m.current?.querySelector(`[role="radio"][aria-checked="true"]`)?.focus()}return(0,C.jsxs)(`span`,{className:`agent-picker`,children:[(0,C.jsxs)(`button`,{ref:p,type:`button`,className:`agent-picker-trigger`,"aria-label":R(`Agent settings`),title:E+(x?` · ${R(`{agent} is unavailable`,{agent:w})}`:``),"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":f,disabled:d,onClick:()=>m.current?.matches(`:popover-open`)?m.current.hidePopover():O(),onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),O())},children:[(0,C.jsx)(Hp,{model:v,effort:y,fast:!!(b&&a)}),(0,C.jsx)(T,{name:`chevronDown`,size:13}),x&&(0,C.jsx)(`span`,{className:`agent-status-mark`,children:(0,C.jsx)(T,{name:`alert`,size:13})})]}),(0,C.jsxs)(`div`,{ref:m,id:f,popover:`auto`,role:`dialog`,"aria-label":R(`Agent settings`),className:`agent-picker-panel`,onToggle:e=>{let t=e.nativeEvent.newState===`open`;g(t),t||document.activeElement&&document.activeElement!==document.body&&!m.current?.contains(document.activeElement)||p.current?.focus()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),m.current?.hidePopover(),p.current?.focus())},children:[(0,C.jsx)(`div`,{className:`agent-choices-label`,children:R(`Agent`)}),(0,C.jsx)(`div`,{className:`agent-choices`,role:`radiogroup`,"aria-label":R(`Agent`),onKeyDown:n=>{let r=n.key===`ArrowRight`||n.key===`ArrowDown`?1:n.key===`ArrowLeft`||n.key===`ArrowUp`?-1:0;if(!r&&n.key!==`Home`&&n.key!==`End`)return;n.preventDefault();let i=n.key===`Home`?0:n.key===`End`?e.length-1:(e.findIndex(e=>e.value===t)+r+e.length)%e.length;l(e[i].value),n.currentTarget.querySelectorAll(`[role="radio"]`)[i]?.focus()},children:e.map(e=>(0,C.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e.value===t,tabIndex:e.value===t?0:-1,title:e.label+(e.unavailable?R(` · unavailable`):``),onClick:()=>l(e.value),children:[e.label,e.unavailable&&(0,C.jsx)(`i`,{"aria-hidden":`true`})]},e.value))}),(0,C.jsx)(Up,{name:w,runtime:o,reconnecting:s,onReconnect:c},t),(0,C.jsxs)(`label`,{className:`agent-setting`,children:[(0,C.jsx)(`span`,{children:R(`Model`)}),(0,C.jsxs)(`select`,{"aria-label":R(`Model`),value:r,onChange:e=>u({model:e.target.value}),children:[(0,C.jsx)(`option`,{value:``,children:R(`Default model`)}),n.map(e=>(0,C.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),_?.efforts.length?(0,C.jsx)(Wp,{efforts:_.efforts,value:i,fallback:_.defaultEffort,onChange:e=>u({effort:e})}):null,b&&(0,C.jsxs)(`label`,{className:`agent-fast`,children:[(0,C.jsxs)(`span`,{children:[(0,C.jsxs)(`strong`,{children:[(0,C.jsx)(T,{name:`bolt`,size:14}),R(`Fast mode`)]}),(0,C.jsx)(`small`,{children:b.description||R(`Faster responses; may use more of your limit.`)})]}),(0,C.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-label":R(`Fast mode`),checked:a,onChange:e=>u({fast:e.target.checked})})]})]})]})}var Kp={pro:`Pro`,plus:`Plus`,team:`Team`,business:`Business`,enterprise:`Enterprise`,edu:`Edu`,free:`Free`,go:`Go`};function qp(e){return e===10080?R(`Weekly limit`):e===1440?R(`Daily limit`):e&&e%1440==0?R(`{n}-day limit`,{n:e/1440}):e&&e%60==0?R(`{n}-hour limit`,{n:e/60}):e?R(`{n}-minute limit`,{n:e}):R(`Usage limit`)}function Jp(e,t=Date.now()){let n=e-t;if(n<=6e4)return R(`resets now`);if(n<864e5){let e=Math.floor(n/36e5),t=Math.round(n%36e5/6e4);return e?R(`resets in {hours} h {minutes} min`,{hours:e,minutes:t}):R(`resets in {minutes} min`,{minutes:t})}let r=new Date(e);return R(`resets {time}`,{time:n<5184e5?r.toLocaleString(te(),{weekday:`short`,hour:`numeric`,minute:`2-digit`}):r.toLocaleDateString(te(),{month:`short`,day:`numeric`})})}function Yp({window:e,reached:t}){let n=Math.round(e.usedPercent),r=qp(e.minutes);return(0,C.jsxs)(`div`,{className:`usage-limit `+(t||n>=90?`critical`:n>=75?`warning`:``),children:[(0,C.jsx)(`span`,{className:`usage-name`,children:r}),(0,C.jsx)(`span`,{className:`usage-bar`,role:`meter`,"aria-label":R(`{name} used`,{name:r}),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,"aria-valuetext":R(`{used}% used`,{used:n}),children:(0,C.jsx)(`span`,{style:{width:`${n}%`}})}),(0,C.jsx)(`span`,{className:`usage-value`,children:t&&n>=100?R(`Limit reached`):R(`{used}% used`,{used:n})}),e.resetsAt&&(0,C.jsx)(`span`,{className:`usage-reset`,children:Jp(e.resetsAt)})]})}function Xp({usage:e,agent:t=`Codex`}){let n=e.credits,r=e.windows.reduce((e,t)=>!e||t.usedPercent>e.usedPercent?t:e,void 0),i=r?Math.round(r.usedPercent):0,a=e.reached||i>=90?`critical`:i>=75?`warning`:``,o=n?n.unlimited?R(`Unlimited credits`):n.balance===null?R(`Credits available`):R(`{n} credits`,{n:Math.floor(n.balance).toLocaleString(te())}):``;return(0,C.jsx)(`section`,{className:`usage`,"aria-label":R(`{agent} usage`,{agent:t}),children:(0,C.jsxs)(`details`,{children:[(0,C.jsxs)(`summary`,{className:a,"aria-label":R(`{agent} usage details`,{agent:t}),children:[(0,C.jsxs)(`span`,{className:`usage-account`,children:[t,e.plan&&(0,C.jsx)(`span`,{className:`usage-plan`,children:Kp[e.plan]||e.plan})]}),(0,C.jsxs)(`span`,{className:`usage-overview`,title:r?qp(r.minutes):void 0,children:[r&&(0,C.jsx)(`span`,{className:`usage-bar`,"aria-hidden":`true`,children:(0,C.jsx)(`span`,{style:{width:`${i}%`}})}),(0,C.jsx)(`span`,{className:`usage-value`,children:e.reached?R(`Limit reached`):r?R(`{used}% used`,{used:i}):o})]}),(0,C.jsx)(T,{name:`chevronDown`,size:13})]}),(0,C.jsxs)(`div`,{className:`usage-details`,children:[e.windows.map((t,n)=>(0,C.jsx)(Yp,{window:t,reached:e.reached},n)),n&&(0,C.jsx)(`span`,{className:`usage-credits`,children:o})]})]},t)})}function Zp(e,t,n,r,i,a){let[o,s]=(0,S.useState)(()=>{let t=Number(D.getItem(e));return Number.isFinite(t)&&t>0?t:0}),c=(0,S.useRef)(null),l=(0,S.useRef)(null),[u,d]=(0,S.useState)({current:300,max:300}),f=()=>{l.current=null,document.body.classList.remove(`resizing`)};(0,S.useEffect)(()=>{o?D.setItem(e,String(o)):D.removeItem(e)},[e,o]),(0,S.useLayoutEffect)(()=>{let e=c.current?.parentElement,t=e?.querySelector(n);if(!i||!e||!t)return;let r=new ResizeObserver(()=>d({current:Math.round(t.getBoundingClientRect().width),max:Math.max(300,Math.floor(e.getBoundingClientRect().width-360))}));return r.observe(e),r.observe(t),()=>{r.disconnect(),f()}},[i,n]);let p=e=>Math.round(Math.max(300,Math.min(e,u.max))),m=()=>c.current?.parentElement?.querySelector(n)?.getBoundingClientRect().width??u.current,h=e=>{s(e),a?.()};return{style:o?{[t]:`${o}px`}:void 0,resizer:i&&(0,C.jsx)(`div`,{ref:c,className:`panel-resizer manuscript-resizer`,role:`separator`,"aria-orientation":`vertical`,"aria-label":r,"aria-valuenow":u.current,"aria-valuemin":300,"aria-valuemax":u.max,tabIndex:0,title:R(`Drag to resize · Double-click to reset`),onPointerDown:e=>{e.button!==0||l.current||(e.preventDefault(),e.currentTarget.focus(),l.current={x:e.clientX,width:m()},e.currentTarget.setPointerCapture(e.pointerId),document.body.classList.add(`resizing`))},onPointerMove:e=>{l.current&&h(p(l.current.width+l.current.x-e.clientX))},onPointerUp:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),f()},onPointerCancel:f,onLostPointerCapture:f,onDoubleClick:()=>h(0),onKeyDown:e=>{if(e.key===`Enter`){e.preventDefault(),h(0);return}let t=m(),n=e.key===`ArrowLeft`?t+24:e.key===`ArrowRight`?t-24:e.key===`Home`?u.max:e.key===`End`?300:null;n!==null&&(e.preventDefault(),h(p(n)))}})}}var Qp=(0,S.lazy)(()=>On(()=>import(`./pdf-view-Cz9_vK5U.js`).then(e=>({default:e.PdfView})),[])),$p=``,em=()=>crypto.randomUUID?.()||Array.from(crypto.getRandomValues(new Uint8Array(20)),e=>e.toString(16).padStart(2,`0`)).join(``);async function $(e,t,n,r=t===void 0?15e3:3e4){let i=AbortSignal.timeout(r);try{let r=await fetch(`/api`+e,{method:t===void 0?`GET`:`POST`,headers:{"Content-Type":t instanceof File?`application/octet-stream`:`application/json`,"X-Papilot-Token":$p,...t instanceof File?{"X-Papilot-Filename":encodeURIComponent(t.name)}:{}},...t===void 0?{}:{body:t instanceof File?t:JSON.stringify(t)},signal:n?AbortSignal.any([n,i]):i});if(r.status===401&&(!e.startsWith(`/auth/`)||e===`/auth/logout`))throw Lp(!0),Error(R(`Sign in to continue.`));let a=await r.json();if(!r.ok)throw Error(a.error||R(`Request failed. Please try again.`));return a}catch(e){throw i.aborted?Error(R(t===void 0?`The connection is taking too long. Check your network and try again.`:`The request timed out and may still be processing. Check the task status before retrying.`)):e}}var tm=(e,t,n)=>$(`/projects/${e}/attachments`,t,n,12e4),nm=(e,t)=>$(`/diagnostics`,{projectId:e},t,6e4),rm=[`codex`,`claude`,`antigravity`],im={codex:`Codex`,claude:`Claude`,antigravity:`Antigravity`},am=e=>im[e.agent||`codex`]||`Codex`,om=e=>e.status===`reviewing`&&e.review?.round===null&&e.review.state!==`build_failed`&&!e.review.counts.pending,sm=()=>({idle:R(`Ready`),queued:R(`Queued`),waiting_input:R(`Needs your reply`),building:R(`Preparing task results`),reviewing:R(`Ready for review`),interrupted:R(`Paused`),failed:R(`Needs attention`),uncertain:R(`Check task status`),deleting:R(`Deleting task`)}),cm=[`running`,`waiting_input`,`queued`];function lm({task:e}){let t=om(e),n=e.status===`reviewing`&&e.review?.state===`done`;return(0,C.jsxs)(`span`,{className:`status ${e.status}${n||t?` done`:``}`,children:[(0,C.jsx)(`i`,{}),t?R(`Completed`):n?R(`Review complete`):e.status===`running`?R(`{agent} is working`,{agent:am(e)}):sm()[e.status]||e.status]})}function um(e){return new Date(e).toLocaleTimeString(te(),{hour:`2-digit`,minute:`2-digit`})}function dm(e){let t=Math.floor((Date.now()-e)/6e4);return t<1?R(`now`):t<60?R(`{n}m`,{n:t}):t<1440?R(`{n}h`,{n:Math.floor(t/60)}):t<10080?R(`{n}d`,{n:Math.floor(t/1440)}):new Date(e).toLocaleDateString(te(),{month:`short`,day:`numeric`})}var fm=e=>Date.now()-e<6e4?R(`just now`):R(`{time} ago`,{time:dm(e)}),pm=()=>window.matchMedia(`(pointer: coarse)`).matches;function mm(e){let[t,n]=(0,S.useState)(()=>window.matchMedia(e).matches);return(0,S.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function hm({label:e,value:t,placeholder:n,onChange:r,onSubmit:i,readOnly:a,autoFocus:o,inputRef:s,footer:c,action:l,large:u,skills:d,skill:f,onSkill:p,attachments:m,upload:h,filesDisabled:g,imageHint:_}){let v=(0,S.useRef)(null),y=s||v,b=(0,S.useRef)(null),x=(0,S.useRef)(0),[w,T]=(0,S.useState)(!1),E=!(!m||!h||a||g);function D(e){E&&e.length&&(m.add(e,h),y.current?.focus())}let O=(0,S.useId)(),[k,A]=(0,S.useState)(null),[j,M]=(0,S.useState)(0),N=d?.length&&p&&!a?Re(t):null,P=N!==null&&k!==t,F=P?ze(d,N):[];(0,S.useEffect)(()=>M(0),[N]),(0,S.useEffect)(()=>{k!==null&&t!==k&&A(null)},[t,k]),(0,S.useLayoutEffect)(()=>{let e=y.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)},[y,t]),(0,S.useEffect)(()=>{o&&!pm()&&y.current?.focus()},[o,y]);function I(e){p?.(e),r(``),y.current?.focus()}function ee(e){if(P&&!e.nativeEvent.isComposing&&e.keyCode!==229){if((e.key===`ArrowDown`||e.key===`ArrowUp`)&&F.length){e.preventDefault(),M(t=>(t+(e.key===`ArrowDown`?1:F.length-1))%F.length);return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey&&F.length){e.preventDefault(),I(F[Math.min(j,F.length-1)]);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),A(t);return}}e.key===`Backspace`&&f&&p&&!t&&!a?(e.preventDefault(),p(null)):Ke(e.nativeEvent,pm())&&(e.preventDefault(),i())}return(0,C.jsxs)(`form`,{className:`composer`+(u?` large`:``)+(w?` dragging`:``),onDragEnter:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),E&&++x.current===1&&T(!0))},onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=E?`copy`:`none`)},onDragLeave:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),--x.current<=0&&(x.current=0,T(!1)))},onDrop:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),x.current=0,T(!1),D(Array.from(e.dataTransfer.files)))},onPaste:e=>{let n=Array.from(e.clipboardData.files);if(n.length){e.preventDefault(),D(n);let i=e.clipboardData.getData(`text/plain`);if(E&&i&&y.current){let e=y.current;r(t.slice(0,e.selectionStart)+i+t.slice(e.selectionEnd))}}},onSubmit:e=>{e.preventDefault(),i()},onPointerDown:e=>{e.target===e.currentTarget&&(e.preventDefault(),y.current?.focus())},children:[m&&h&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`input`,{ref:b,type:`file`,multiple:!0,hidden:!0,"aria-label":R(`Choose attachments`),disabled:!E,onChange:e=>{D(Array.from(e.target.files||[])),e.target.value=``}}),(0,C.jsx)(et,{draft:m,upload:h,discard:e=>{$(`/projects/${e.projectId}/attachments/${e.id}/discard`,{}).catch(()=>{})},disabled:a||g})]}),w&&(0,C.jsx)(`div`,{className:`attachment-drop-hint`,children:R(`Drop files to attach`)}),_&&(0,C.jsx)(`p`,{className:`attachment-agent-hint`,children:R(`Antigravity opens images through its file tools. For direct image input, choose Codex or Claude.`)}),P&&(0,C.jsx)(Be,{id:O,skills:F,active:j,onActive:M,onPick:I}),f&&(0,C.jsx)(`div`,{className:`composer-skill`,children:(0,C.jsx)(Ve,{skill:f,onRemove:p&&!a?()=>{p(null),y.current?.focus()}:void 0})}),(0,C.jsx)(`textarea`,{ref:y,rows:1,"aria-label":e,maxLength:2e4,placeholder:f?f.source!==`builtin`&&f.hint||R(`Details (optional)`):n,value:t,readOnly:a,onChange:e=>r(e.target.value),onKeyDown:ee,...p&&d?.length?{"aria-autocomplete":`list`,"aria-controls":P?O:void 0,"aria-activedescendant":P&&F.length?`${O}-${Math.min(j,F.length-1)}`:void 0}:{}}),(0,C.jsxs)(`div`,{className:`composer-footer`,children:[typeof c==`function`?c(()=>b.current?.click()):c,l]})]})}function gm({request:e,agent:t,answerDrafts:n,onDone:r}){let[i,a]=(0,S.useState)(()=>n.get(e.id)||{});function o(t){n.set(e.id,t),a(t)}let[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``),d=e.method.endsWith(`requestUserInput`)&&e.params.questions||[];async function f(t){c(!0),u(``);try{await $(`/requests/`+e.id,{decision:t,answers:i}),n.delete(e.id),r()}catch(e){u(e.message)}finally{c(!1)}}return(0,C.jsxs)(`div`,{className:`request-card`,children:[(0,C.jsxs)(`h3`,{children:[(0,C.jsx)(T,{name:d.length?`chat`:`alert`,size:16}),d.length?R(`{agent} needs your input`,{agent:t}):R(`Approve this action`)]}),d.map(e=>(0,C.jsxs)(`fieldset`,{className:`question`,children:[(0,C.jsx)(`legend`,{children:e.question||e.header}),e.options?.length>0&&(0,C.jsx)(`div`,{className:`answer-options`,children:e.options.map(t=>(0,C.jsxs)(`button`,{type:`button`,disabled:s,"aria-pressed":i[e.id]===t.label,className:i[e.id]===t.label?`selected`:``,onClick:()=>o({...i,[e.id]:t.label}),children:[t.label,t.description&&(0,C.jsx)(`small`,{children:t.description})]},t.label))}),(0,C.jsx)(`input`,{disabled:s,"aria-label":e.question||e.header,placeholder:R(`Or type your own answer`),value:i[e.id]||``,onChange:t=>o({...i,[e.id]:t.target.value})})]},e.id)),!d.length&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`p`,{children:e.params.reason||R(`{agent} is requesting permission for this action.`,{agent:t})}),(0,C.jsx)(`pre`,{children:e.params.command||(e.params.permissions?JSON.stringify(e.params.permissions,null,2):e.params.grantRoot||R(`Apply file changes`))})]}),l&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:l}),(0,C.jsxs)(`div`,{className:`button-row`,children:[!d.length&&(0,C.jsx)(`button`,{disabled:s,className:`button secondary`,onClick:()=>void f(`decline`),children:R(`Decline`)}),(0,C.jsx)(`button`,{disabled:s||d.some(e=>!i[e.id]?.trim()),className:`button primary`,onClick:()=>void f(d.length?void 0:`accept`),children:s?R(`Submitting…`):d.length?R(`Reply to {agent}`,{agent:t}):R(`Allow this action`)})]})]})}function _m({text:e}){let[t,n]=(0,S.useState)(!1);(0,S.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>n(!1),1600);return()=>clearTimeout(e)},[t]);async function r(){try{await navigator.clipboard.writeText(e)}catch{let t=document.createElement(`textarea`);t.value=e,t.readOnly=!0,t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select(),document.execCommand(`copy`),t.remove()}n(!0)}return(0,C.jsxs)(`button`,{type:`button`,className:`message-action`,"aria-label":R(t?`Copied`:`Copy message`),onClick:()=>void r(),children:[(0,C.jsx)(T,{name:t?`check`:`copy`,size:14}),(0,C.jsx)(`span`,{children:R(t?`Copied`:`Copy`)})]})}var vm=e=>e.match(/^\/bin\/(?:ba|z)?sh -lc (['"])([\s\S]*)\1$/)?.[2]??e,ym=(e,t)=>t&&e.startsWith(t+`/`)?e.slice(t.length+1):e,bm=(e,t)=>e.text.split(`
|
|
245
|
-
`).filter(Boolean).map(e=>ym(e,t)),xm=e=>e.status===`inProgress`?`running`:e.status&&e.status!==`completed`?`failed`:``,Sm=(0,S.createContext)(null);function Cm(e){let t=(0,S.useContext)(Sm),n=!t||(e?e.id===t.id:t.role===`owner`);return{mine:n,name:n?``:e?.name||t?.owner||``}}var wm=(e,t)=>e.mine?R(`You, {time}`,{time:um(t)}):R(`{name}, {time}`,{name:e.name,time:um(t)}),Tm=({sender:e})=>e.mine?null:(0,C.jsx)(`div`,{className:`message-author`,children:e.name});function Em({item:e,notes:t}){let n=Cm(e.meta?.author),r=St(),i=(t,n)=>(0,C.jsxs)(`li`,{"data-note-result":`${e.id}:${n}`,tabIndex:-1,className:r?.selected===`${e.id}:${n}`?`linked-note-selected`:``,children:[(0,C.jsxs)(`span`,{className:`sent-note-where`,children:[(0,C.jsx)(`span`,{className:`sent-note-number`,"aria-hidden":`true`,children:n+1}),(0,C.jsx)(`span`,{className:`sent-note-location`,children:nt(t.where)})]}),t.quote?(0,C.jsx)(`blockquote`,{children:t.quote}):(0,C.jsx)(`span`,{className:`sent-note-region`,children:R(`Marked region`)}),t.comment&&(0,C.jsx)(`p`,{children:t.comment}),(0,C.jsx)(Tt,{noteKey:`${e.id}:${n}`})]},n);return(0,C.jsxs)(`article`,{className:`message user notes-message`,"aria-label":wm(n,e.createdAt),children:[(0,C.jsx)(Tm,{sender:n}),(0,C.jsxs)(`div`,{className:`message-body`,title:um(e.createdAt),children:[e.meta?.skill&&(0,C.jsx)(Ve,{skill:e.meta.skill}),e.meta?.notes&&e.text&&(0,C.jsx)(`p`,{className:`notes-request`,children:e.text}),(0,C.jsxs)(`div`,{className:`sent-notes-head`,children:[(0,C.jsx)(T,{name:`notes`,size:14}),t.some(e=>e.group)?R(`PDF annotations`):re(t.length,`Note on the PDF`,`{n} notes on the PDF`)]}),_(t).map(({group:t,entries:n})=>(0,C.jsxs)(le,{group:t,count:n.length,active:n.some(({index:t})=>r?.selected===`${e.id}:${t}`),children:[e.meta?.groupInstructions?.[t]&&(0,C.jsx)(`p`,{className:`group-instruction-sent`,children:e.meta.groupInstructions[t]}),(0,C.jsx)(`ol`,{className:`sent-notes`,children:n.map(({note:e,index:t})=>i(e,t))})]},t)),(0,C.jsx)(`ol`,{className:`sent-notes`,children:t.map((e,t)=>!e.group&&i(e,t))}),(0,C.jsx)(tt,{files:e.meta?.attachments})]})]})}function Dm({feedback:e}){let t=[e.accepted&&[`accepted`,R(`{n} accepted`,{n:e.accepted})],e.rejected&&[`rejected`,R(`{n} rejected`,{n:e.rejected})],e.comments.length&&[`commented`,re(e.comments.length,`{n} comment`,`{n} comments`)],e.undone&&[`undone`,R(`{n} undone`,{n:e.undone})],e.buildError&&[`failed`,R(`build error`)]].filter(Boolean);return(0,C.jsxs)(C.Fragment,{children:[t.length>0&&(0,C.jsx)(`div`,{className:`feedback-counts`,children:t.map(([e,t])=>(0,C.jsx)(`span`,{className:e,children:t},e))}),e.comments.length>0&&(0,C.jsx)(`ol`,{className:`sent-notes`,children:e.comments.map((e,t)=>(0,C.jsxs)(`li`,{children:[(0,C.jsx)(`span`,{className:`sent-note-where`,children:nt(e.where)}),(0,C.jsx)(`p`,{children:e.text})]},t))})]})}function Om({item:e,agent:t}){let n=Cm(e.meta?.author),r=e.meta?.notes||ke(e.text);if(r)return(0,C.jsx)(Em,{item:e,notes:r});let{skill:i,feedback:a,sendsFeedback:o,build:s}=e.meta||{};return s?(0,C.jsx)(`article`,{className:`message user notes-message build-message`,"aria-label":R(`Papilot sent the build error to {agent}, {time}`,{agent:t,time:um(e.createdAt)}),children:(0,C.jsxs)(`div`,{className:`message-body`,title:um(e.createdAt),children:[(0,C.jsxs)(`div`,{className:`sent-notes-head`,children:[(0,C.jsx)(T,{name:`alert`,size:14}),R(`Build failed · sent to {agent}`,{agent:t})]}),(0,C.jsx)(`p`,{className:`build-error`,children:[s.error,...s.details].join(`
|
|
246
|
-
`)})]})}):o||Ae(e.text)?(0,C.jsxs)(`article`,{className:`message user notes-message`,"aria-label":n.mine?R(`You sent review feedback, {time}`,{time:um(e.createdAt)}):R(`{name} sent review feedback, {time}`,{name:n.name,time:um(e.createdAt)}),children:[(0,C.jsx)(Tm,{sender:n}),(0,C.jsxs)(`div`,{className:`message-body`,title:um(e.createdAt),children:[(0,C.jsxs)(`div`,{className:`sent-notes-head`,children:[(0,C.jsx)(T,{name:`paper`,size:14}),R(`Review feedback`)]}),a&&(0,C.jsx)(Dm,{feedback:a})]})]}):(0,C.jsxs)(`article`,{className:`message user`,"aria-label":wm(n,e.createdAt),children:[(0,C.jsx)(Tm,{sender:n}),(0,C.jsxs)(`div`,{className:`message-body`,title:um(e.createdAt),children:[i&&(0,C.jsx)(Ve,{skill:i}),i&&e.text?`
|
|
247
|
-
`:``,e.text,(0,C.jsx)(tt,{files:e.meta?.attachments}),a&&(0,C.jsxs)(`details`,{className:`feedback-attachment`,children:[(0,C.jsxs)(`summary`,{children:[(0,C.jsx)(T,{name:`paper`,size:13}),R(`With review feedback`)]}),(0,C.jsx)(Dm,{feedback:a})]})]})]})}function km({item:e,agent:t,root:n}){if(e.type===`user`)return(0,C.jsx)(Om,{item:e,agent:t});if(e.type===`assistant`)return(0,C.jsxs)(`article`,{className:`message assistant`,"aria-label":`${t}, ${um(e.createdAt)}`,children:[(0,C.jsx)(`div`,{className:`message-body markdown`,children:(0,C.jsx)(Qf,{text:e.text})}),(0,C.jsxs)(`div`,{className:`message-actions`,children:[(0,C.jsx)(_m,{text:e.text}),(0,C.jsx)(`time`,{dateTime:new Date(e.createdAt).toISOString(),children:um(e.createdAt)})]})]});let r=e.type===`files`?bm(e,n):[],i=e.type===`command`?vm(e.text)||R(`Run command`):e.type===`files`?r.length===1?R(`Edited {file}`,{file:r[0]}):R(`Edited {n} files`,{n:r.length}):e.text||R(`Run tool`),a=e.type===`files`?r.join(`
|
|
248
|
-
`):e.detail,o=xm(e);return(0,C.jsxs)(`details`,{className:`tool-item `+o,children:[(0,C.jsxs)(`summary`,{children:[(0,C.jsx)(T,{name:e.type===`command`?`terminal`:e.type===`files`?`diff`:`tool`,size:14}),(0,C.jsx)(`span`,{className:`tool-label`,children:i}),o===`running`?(0,C.jsx)(`span`,{className:`spinner`,"aria-label":R(`Running`)}):o&&(0,C.jsx)(`span`,{className:`tool-status`,children:e.status===`declined`?R(`Declined`):R(`Failed`)})]}),a&&(0,C.jsx)(`pre`,{children:a})]})}function Am({items:e,agent:t,root:n}){let r=e.filter(e=>e.type===`command`).length,i=e.filter(e=>e.type===`files`),a=[...new Set(i.flatMap(e=>bm(e,n)))],o=e.length-r-i.length,s=e.some(e=>xm(e)===`running`),c=e.filter(e=>xm(e)===`failed`).length,l=[r?re(r,`ran {n} command`,`ran {n} commands`):``,a.length?a.length===1?R(`edited {file}`,{file:a[0]}):R(`edited {n} files`,{n:a.length}):``,o?re(o,`used {n} tool`,`used {n} tools`):``].filter(Boolean).join(R(`, `));return(0,C.jsxs)(`details`,{className:`tool-group`,children:[(0,C.jsxs)(`summary`,{children:[(0,C.jsx)(T,{name:r?`terminal`:a.length?`diff`:`tool`,size:14}),(0,C.jsx)(`span`,{className:`tool-group-label`,children:l[0].toUpperCase()+l.slice(1)}),s?(0,C.jsx)(`span`,{className:`spinner`,"aria-label":R(`Running`)}):c?(0,C.jsx)(`span`,{className:`tool-status`,children:R(`{n} failed`,{n:c})}):null,(0,C.jsx)(T,{name:`chevronDown`,size:13})]}),(0,C.jsx)(`div`,{className:`tool-group-items`,children:e.map(e=>(0,C.jsx)(km,{item:e,agent:t,root:n},e.id))})]})}function jm(e){let t=[];for(let n of e){let e=n.type!==`user`&&n.type!==`assistant`,r=t[t.length-1];e&&r&&r[0].type!==`user`&&r[0].type!==`assistant`?r.push(n):t.push([n])}return t}function Mm({task:e,models:t,skills:n,composer:r,answerDrafts:i,items:a,loading:o,loadError:s,retry:c,requests:l,refresh:u,reportError:d,pause:f,pausing:p,openReview:m,feedback:h,connection:g,tools:_,lead:v}){let y=(0,S.useRef)(null),{text:b,sending:x,sendingSource:w}=(0,S.useSyncExternalStore)(r.subscribe,r.getSnapshot),E=Xe(`papilot:files:${(0,S.useContext)(Sm)?.id||`owner`}:task:${e.id}`),[D,O]=(0,S.useState)(null);(0,S.useEffect)(()=>O(e=>e&&n.find(t=>t.id===e.id)||null),[n]);let k=(0,S.useRef)(null),A=(0,S.useRef)(!0),[j,M]=(0,S.useState)(!0),N=St();(0,S.useLayoutEffect)(()=>{N?.selected&&(A.current=!1,M(!1))},[N?.selected,N?.reveal]);function P(){A.current=!0,M(!0),k.current&&(k.current.scrollTop=k.current.scrollHeight)}(0,S.useEffect)(()=>{A.current&&P()},[a,l]),(0,S.useEffect)(()=>{if(!k.current)return;let e=new ResizeObserver(()=>{A.current&&P()});return e.observe(k.current),()=>e.disconnect()},[]);async function F(t){if(r.sending||[`uncertain`,`deleting`].includes(e.status)||t===`draft`&&E.draft.getSnapshot().blocked)return;let n=t===`draft`?D:null,i=t===`draft`?E.draft.getSnapshot().files:[],a=r.submit(t,t=>$(`/tasks/`+e.id+`/messages`,t),n?.id,i.map(e=>e.id));try{await a&&(E.draft.clear(i),A.current=!0,n&&O(e=>e===n?null:e),u())}catch(e){d(e)}}let I=cm.includes(e.status),ee=[`uncertain`,`deleting`].includes(e.status),L=Ue(e.review),te=e.status===`deleting`?R(`This task is being deleted`):e.status===`uncertain`?R(`Check task status before sending`):w===`feedback`?R(`Sending feedback…`):x?R(`Sending…`):L?re(L,`{n} review update will be sent with this message`,`{n} review updates will be sent with this message`):I?R(`{agent} is working · new instructions run next`,{agent:am(e)}):``,ne=t.find(t=>t.id===e.model)||(e.model?void 0:t.find(e=>e.isDefault)),ie=ne?.name||e.model||R(`Default model`);return(0,C.jsxs)(`section`,{id:`conversation-panel`,className:`activity-panel`,"aria-label":R(`{agent} conversation`,{agent:am(e)}),children:[(0,C.jsxs)(`div`,{className:`panel-heading`,children:[v,_&&(0,C.jsx)(`div`,{className:`panel-tools`,children:_})]}),(0,C.jsxs)(`div`,{className:`conversation-history`,children:[(0,C.jsx)(`div`,{className:`messages`,ref:k,onScroll:()=>{if(k.current){let e=k.current;A.current=e.scrollHeight-e.scrollTop-e.clientHeight<90,M(A.current)}},children:(0,C.jsxs)(`div`,{className:`thread`,children:[o&&(0,C.jsx)(`p`,{className:`muted`,role:`status`,children:R(`Loading conversation…`)}),s&&(0,C.jsxs)(`div`,{className:`conversation-error`,role:`alert`,children:[(0,C.jsx)(`p`,{children:s}),(0,C.jsx)(`button`,{className:`button secondary compact`,onClick:c,children:R(`Retry conversation`)})]}),jm(a).map(t=>t.length>1?(0,C.jsx)(Am,{items:t,agent:am(e),root:e.worktree},t[0].id):(0,C.jsx)(km,{item:t[0],agent:am(e),root:e.worktree},t[0].id)),l.map(t=>(0,C.jsx)(gm,{request:t,agent:am(e),answerDrafts:i,onDone:u},t.id)),e.status===`running`&&(0,C.jsxs)(`div`,{className:`working`,children:[(0,C.jsxs)(`span`,{className:`working-dots`,children:[(0,C.jsx)(`i`,{}),(0,C.jsx)(`i`,{}),(0,C.jsx)(`i`,{})]}),R(`{agent} is working on this task`,{agent:am(e)})]}),e.status===`queued`&&(0,C.jsx)(`p`,{className:`muted`,children:R(`Task saved. Waiting for an available {agent} session.`,{agent:am(e)})}),m&&e.status===`reviewing`&&e.review?.counts?.pending?(0,C.jsxs)(`div`,{className:`review-ready`,children:[(0,C.jsx)(T,{name:`paper`,size:16}),(0,C.jsx)(`span`,{children:re(e.review.counts.pending,`{n} change to review`,`{n} changes to review`)}),(0,C.jsx)(`button`,{className:`button secondary compact`,onClick:m,children:R(`Open review`)})]}):null,h,e.error&&(0,C.jsxs)(`div`,{className:`task-error`,children:[(0,C.jsx)(T,{name:`alert`,size:16}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`strong`,{children:R(`This step needs attention`)}),(0,C.jsx)(`p`,{children:e.error})]})]})]})}),!j&&(0,C.jsxs)(`button`,{className:`jump-latest`,onClick:P,children:[(0,C.jsx)(T,{name:`arrowDown`,size:14}),R(`Latest messages`)]})]}),(0,C.jsxs)(`div`,{className:`composer-wrap`,children:[g,(0,C.jsx)(hm,{attachments:E.draft,upload:(t,n)=>tm(e.projectId,t,n),filesDisabled:x||ee,imageHint:e.agent===`antigravity`&&E.files.some(e=>e.mime.startsWith(`image/`)),inputRef:y,label:R(`Instructions for {agent}`,{agent:am(e)}),value:b,onChange:e=>r.edit(e),onSubmit:()=>void F(`draft`),placeholder:R(I?`Queue instructions for the next turn…`:`Ask a question or request changes…`),skills:n,skill:D,onSkill:O,footer:t=>(0,C.jsxs)(`div`,{className:`composer-options`,children:[(0,C.jsx)(He,{onAttach:t,skills:n,selected:D,disabled:x||ee,onPick:e=>{O(e),y.current?.focus()}}),(0,C.jsx)(`span`,{className:`composer-model`,title:`${am(e)} · ${e.model?ie:ne?R(`the default model on this host ({model})`,{model:ne.name}):R(`the default model on this host`)}`,children:(0,C.jsx)(Hp,{model:ie,effort:e.effort||ne?.defaultEffort,fast:!!(e.serviceTier&&e.serviceTier!=="default")})})]}),action:(0,C.jsxs)(`div`,{className:`composer-actions`,children:[I&&(0,C.jsx)(`button`,{type:`button`,className:`send-button stop`,"aria-label":R(`Pause task`),title:R(`Pause {agent}`,{agent:am(e)}),disabled:p,"aria-busy":p,onClick:f,children:(0,C.jsx)(T,{name:`stop`,size:18})}),(!I||b.trim()||D||E.entries.length||x)&&(0,C.jsx)(`button`,{"aria-label":R(`Send instructions`),title:R(`Send (Enter) · New line (Shift+Enter)`),disabled:!b.trim()&&!D&&!E.files.length||E.blocked||x||ee,className:`send-button`,type:`submit`,children:(0,C.jsx)(T,{name:`arrowUp`,size:18})})]})}),te&&(0,C.jsx)(`p`,{className:`composer-hint`,role:`status`,children:te})]})]})}function Nm(e,t){if(e.deferred)return e.status===`reviewing`&&!e.pendingReview&&!e.review?.counts?.pending&&e.review?.files||[];if(!Array.isArray(t?.files)||t.merging||e.status!==`reviewing`||e.review?.counts?.pending)return[];let n=new Set(t.files.map(e=>e.path));return(e.review?.files||[]).filter(e=>n.has(e))}function Pm({task:e,composer:t,refresh:n,reportError:r,onSent:i,card:a}){let{sending:o,sendingSource:s}=(0,S.useSyncExternalStore)(t.subscribe,t.getSnapshot),c=Ue(e.review),l=e.review?.comments??c,u=e.status===`reviewing`&&!e.review?.counts?.pending,d=c||l;if(!(l>0||u&&c>0&&!e.review?.counts?.accepted)||e.status===`deleting`)return null;async function f(){if(e.status!==`uncertain`)try{await t.submit(`feedback`,t=>$(`/tasks/`+e.id+`/messages`,t))&&(n(),i())}catch(e){r(e)}}return(0,C.jsxs)(`div`,{className:`review-feedback`+(a?` card`:``),children:[(0,C.jsxs)(`span`,{children:[(0,C.jsx)(T,{name:`chat`,size:15}),re(d,`{n} review update not sent yet`,`{n} review updates not sent yet`)]}),(0,C.jsxs)(`button`,{className:`button primary compact`,title:R(`Send your review decisions and comments to the agent`),disabled:o||e.status===`uncertain`,onClick:()=>void f(),children:[R(s===`feedback`?`Sending feedback…`:`Send feedback`),(0,C.jsx)(T,{name:`arrowRight`,size:14})]})]})}function Fm(e){let t=e.split(`/`).filter(Boolean);return(t.length>2?`…/`:`/`)+t.slice(-2).join(`/`)}function Im(e){if(!Array.isArray(e?.files))return``;let t=[e.ahead?`↑${e.ahead}`:``,e.behind?`↓${e.behind}`:``].filter(Boolean).join(` `);return[e.branch||R(`detached`),e.files.length?R(`{n} changed`,{n:e.files.length}):R(`clean`),t].filter(Boolean).join(` · `)}var Lm=e=>e.status===`?`&&!!Me(e.path),Rm=()=>({M:R(`Modified`),A:R(`Added`),D:R(`Deleted`),R:R(`Renamed`),C:R(`Copied`),U:R(`Conflict`),"?":R(`Untracked`),T:R(`Type changed`)});function zm({diff:e}){let t=e.diff.split(`
|
|
249
|
-
`),n=t.findIndex(e=>e.startsWith(`@@`)),r=n<0?t.filter(e=>e.startsWith(`Binary`)):t.slice(n,n+3e3);return r.length?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`pre`,{className:`git-diff`,children:r.map((e,t)=>(0,C.jsxs)(`span`,{className:e.startsWith(`@@`)?`hunk`:e[0]===`+`?`add`:e[0]===`-`?`del`:e.startsWith(`\\`)?`note`:void 0,children:[e.startsWith(` `)?`\xA0`+e.slice(1):e||` `,`
|
|
250
|
-
`]},t))}),(e.truncated||t.length-n>3e3)&&(0,C.jsx)(`p`,{className:`git-diff-note`,children:R(`The diff is too long to show in full.`)})]}):(0,C.jsx)(`p`,{className:`git-diff-note`,children:R(`No textual changes.`)})}function Bm({projectId:e,git:t,onStatus:n,writer:r,tasks:i,onOpenTask:a}){let o=(0,S.useCallback)(t=>$(`/projects/${e}/git/overview`,void 0,t,6e4),[e]),s=`papilot:commit:${e}`,[c,l]=(0,S.useState)(()=>D.getItem(s)||``),[u,d]=(0,S.useState)(``),[f,p]=(0,S.useState)(``),[m,h]=(0,S.useState)(``),[g,_]=(0,S.useState)(null),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(null),w=t?.files||[],E=w.find(e=>e.path===v);if((0,S.useEffect)(()=>{if(!E){x(null);return}let t=!0;return x(e=>e?.path===v?e:{path:v,result:null,error:``}),$(`/projects/${e}/git/diff?path=${encodeURIComponent(v)}`).then(e=>{t&&x({path:v,result:e,error:``})},e=>{t&&x({path:v,result:null,error:e instanceof Error?e.message:String(e)})}),()=>{t=!1}},[e,v,E?.status,E?.lines?.join()]),!t||!Array.isArray(t.files))return(0,C.jsx)(`section`,{className:`git-panel`,"aria-label":R(`Git status`),children:(0,C.jsx)(`p`,{className:`git-clean`,children:R(`Reading Git status…`)})});let O=w.filter(e=>e.staged),k=O.length?O:w.filter(e=>!Lm(e)),A=(t,n)=>{t.length&&P(`stage`,()=>$(`/projects/${e}/git/stage`,{paths:t,stage:n}),()=>``)},j=w.reduce((e,t)=>e+(t.lines?.[0]||0),0),M=w.reduce((e,t)=>e+(t.lines?.[1]||0),0),N=e=>{l(e),e?D.setItem(s,e):D.removeItem(s)};async function P(e,t,r){if(!u){d(e),p(``),h(``);try{let e=await t();n(e.git),h(r(e))}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(``)}}}let F=()=>{let t=c.trim();t&&k.length&&P(`commit`,()=>$(`/projects/${e}/git/commit`,O.length?{message:t,staged:!0}:{message:t,paths:k.map(e=>e.path)}),e=>(N(``),R(`Committed {hash}.`,{hash:e.commit??``})))};async function I(){if(!u&&k.length){d(`message`),p(``),h(``);try{N((await $(`/projects/${e}/git/message`,{paths:k.map(e=>e.path),staged:O.length>0,agent:r.agent,fresh:!!c.trim()},void 0,13e4)).message)}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(``)}}}let ee=w.filter(Lm),L=[...new Set(ee.map(e=>Me(e.path)))],ne=()=>void P(`ignore`,()=>$(`/projects/${e}/git/ignore`,{paths:ee.map(e=>e.path)}),()=>re(L.length,`Added {n} pattern to .gitignore.`,`Added {n} patterns to .gitignore.`)),ie=n=>void P(n,()=>$(`/projects/${e}/git/${n}`,{},void 0,13e4),e=>n===`fetch`?e.git.behind?re(e.git.behind,`{n} new commit on {upstream}.`,`{n} new commits on {upstream}.`,{upstream:e.git.upstream??``}):R(`Up to date with the remote.`):n===`pull`?R(`Pulled the latest commits.`):n===`merge`?e.git.merging?R(`The merge stopped at conflicts.`):R(`Merged {upstream}.`,{upstream:t.upstream??``}):e.git.upstream?R(`Pushed to {upstream}.`,{upstream:e.git.upstream}):R(`Pushed to the remote.`)),ae=!t.upstream&&t.remote&&t.branch,oe=t.merging,se=!!(t.upstream&&t.ahead>0&&t.behind>0&&!oe);return(0,C.jsxs)(`section`,{className:`git-panel`,"aria-label":R(`Git status`),"aria-busy":!!u,children:[(0,C.jsxs)(`div`,{className:`git-current`,role:`group`,"aria-label":R(`Current worktree`),children:[(0,C.jsxs)(`div`,{className:`git-branch`,children:[(0,C.jsxs)(`div`,{className:`git-current-info`,children:[(0,C.jsxs)(`span`,{className:`git-current-ref`,title:t.branch||R(`detached HEAD`),children:[(0,C.jsx)(T,{name:`branch`,size:14}),(0,C.jsx)(`code`,{children:t.branch||R(`detached HEAD`)})]}),(0,C.jsx)(lp,{status:t}),t.upstream?(0,C.jsx)(`span`,{className:`git-sync`,title:`${R(`Tracking`)} ${t.upstream}`,children:t.ahead||t.behind?(0,C.jsxs)(C.Fragment,{children:[t.ahead>0&&(0,C.jsxs)(`span`,{children:[`↑`,t.ahead]}),t.behind>0&&(0,C.jsxs)(`span`,{children:[`↓`,t.behind]})]}):R(`up to date`)}):(0,C.jsx)(`span`,{className:`git-no-upstream`,children:R(`No upstream branch`)})]}),t.remote&&(0,C.jsxs)(`span`,{className:`git-remote`,children:[!oe&&t.upstream&&t.behind>0&&(se?(0,C.jsx)(`button`,{type:`button`,className:`button secondary compact`,title:R(`{branch} and {upstream} have both changed. Merge brings in the remote commits.`,{branch:t.branch??``,upstream:t.upstream}),disabled:!!u,onClick:()=>ie(`merge`),children:R(u===`merge`?`Merging…`:`Merge`)}):(0,C.jsx)(`button`,{type:`button`,className:`button secondary compact`,disabled:!!u,onClick:()=>ie(`pull`),children:R(u===`pull`?`Pulling…`:`Pull`)})),!oe&&(t.upstream?t.ahead>0:ae)&&(0,C.jsx)(`button`,{type:`button`,className:`button secondary compact`,disabled:!!u,onClick:()=>ie(`push`),children:u===`push`?R(`Pushing…`):t.upstream?R(`Push`):R(`Publish branch`)}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":R(`Fetch from the remote`),title:R(`Fetch from the remote`),disabled:!!u,onClick:()=>ie(`fetch`),children:u===`fetch`?(0,C.jsx)(`span`,{className:`spinner`}):(0,C.jsx)(T,{name:`refresh`,size:15})})]})]}),t.head&&(0,C.jsxs)(`div`,{className:`git-commit`,title:`${t.head.subject}\n${t.head.hash} · ${new Date(t.head.date).toLocaleString(te())}`,children:[(0,C.jsx)(T,{name:`commit`,size:14}),(0,C.jsx)(`span`,{className:`git-commit-subject`,children:t.head.subject}),(0,C.jsx)(`code`,{children:t.head.hash}),(0,C.jsx)(`span`,{className:`git-commit-time`,children:fm(t.head.date)})]})]}),f&&(0,C.jsx)(`p`,{className:`inline-error git-message`,role:`alert`,children:f}),m&&!f&&(0,C.jsxs)(`p`,{className:`git-message git-notice`,role:`status`,children:[(0,C.jsx)(T,{name:`check`,size:14}),m]}),oe&&(0,C.jsxs)(`div`,{className:`git-merge`+(oe.conflicts.length?``:` resolved`),role:`group`,"aria-label":R(`Merge in progress`),children:[(0,C.jsxs)(`p`,{children:[(0,C.jsx)(`strong`,{children:oe.conflicts.length?re(oe.conflicts.length,`Merging: {n} file has conflicts`,`Merging: {n} files have conflicts`):R(`Merging: no conflicts left`)}),(0,C.jsx)(`span`,{children:oe.message})]}),g&&(0,C.jsx)(`div`,{className:`git-merge-summary markdown`,"aria-label":R(`{agent} on the merge`,{agent:g.agent}),children:(0,C.jsx)(Qf,{text:g.summary})}),(0,C.jsxs)(`div`,{className:`button-row`,children:[(0,C.jsx)(`button`,{type:`button`,className:`button secondary compact`,disabled:!!u,onClick:()=>void P(`abort`,()=>$(`/projects/${e}/git/abort`,{}),()=>(_(null),R(`The merge was abandoned.`))),children:R(u===`abort`?`Aborting…`:`Abort merge`)}),oe.conflicts.length?(0,C.jsx)(`button`,{type:`button`,className:`button primary compact`,disabled:!!u,onClick:()=>void P(`resolve`,()=>$(`/projects/${e}/git/resolve`,{agent:r.agent,model:r.model||void 0},void 0,62e4),e=>(_({agent:im[e.agent],summary:e.summary}),e.remaining.length?re(e.remaining.length,`{n} file still has conflicts.`,`{n} files still have conflicts.`):R(`Conflicts resolved. Read the diffs, then commit the merge.`))),children:u===`resolve`?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`spinner`}),R(`{agent} is resolving…`,{agent:im[r.agent]})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(T,{name:`spark`,size:14}),R(`Resolve with {agent}`,{agent:im[r.agent]})]})}):(0,C.jsx)(`button`,{type:`button`,className:`button primary compact`,disabled:!!u,onClick:()=>void P(`finish`,()=>$(`/projects/${e}/git/finish`,{}),e=>(_(null),R(`Committed {hash}.`,{hash:e.commit}))),children:R(u===`finish`?`Committing…`:`Commit merge`)})]})]}),(0,C.jsxs)(`h3`,{className:`git-section`,children:[w.length>0&&!oe&&(0,C.jsx)(`input`,{type:`checkbox`,"aria-label":R(`Stage all changes`),title:R(`Stage or unstage every change`),disabled:!!u,checked:O.length===w.length&&!w.some(e=>e.unstaged),ref:e=>{e&&(e.indeterminate=O.length>0&&(O.length<w.length||w.some(e=>e.unstaged)))},onChange:e=>A(e.target.checked?w.filter(e=>!Lm(e)||e.staged).map(e=>e.path):O.map(e=>e.path),e.target.checked)}),(0,C.jsx)(`span`,{children:R(`Uncommitted changes`)}),w.length>0&&(0,C.jsx)(`span`,{className:`count`,children:w.length}),j||M?(0,C.jsxs)(`span`,{className:`git-total`,children:[(0,C.jsxs)(`ins`,{children:[`+`,j]}),` `,(0,C.jsxs)(`del`,{children:[`−`,M]})]}):null]}),w.length?(0,C.jsxs)(C.Fragment,{children:[ee.length>0&&!oe&&(0,C.jsxs)(`div`,{className:`git-ignore`,title:R(`Untracked build output. Add to .gitignore adds:`)+`
|
|
251
|
-
`+L.join(`
|
|
252
|
-
`),children:[(0,C.jsx)(`span`,{children:re(ee.length,`{n} build file`,`{n} build files`)}),(0,C.jsx)(`button`,{type:`button`,className:`button ghost compact`,disabled:!!u,onClick:ne,children:R(u===`ignore`?`Adding…`:`Add to .gitignore`)})]}),!oe&&(0,C.jsxs)(`form`,{className:`git-commit-form`,onSubmit:e=>{e.preventDefault(),F()},children:[(0,C.jsxs)(`div`,{className:`git-message-box`,children:[(0,C.jsx)(`textarea`,{"aria-label":R(`Commit message`),placeholder:u===`message`?R(`{agent} is writing a commit message…`,{agent:im[r.agent]}):R(`Commit message`),rows:1,value:c,readOnly:u===`commit`||u===`message`,onChange:e=>N(e.target.value),onKeyDown:e=>{Ke(e.nativeEvent,pm())&&(e.preventDefault(),F())}}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button git-generate`,"aria-label":R(`Generate commit message`),title:R(`Write a commit message for the chosen files with {agent}`,{agent:im[r.agent]}),disabled:!!u||!k.length,onClick:()=>void I(),children:u===`message`?(0,C.jsx)(`span`,{className:`spinner`}):(0,C.jsx)(T,{name:`spark`,size:15})})]}),(0,C.jsx)(`button`,{className:`button primary`,disabled:!!u||!c.trim()||!k.length,children:u===`commit`?R(`Committing…`):O.length?re(O.length,`Commit staged changes in 1 file`,`Commit staged changes in {n} files`):k.length===w.length?re(w.length,`Commit 1 file`,`Commit all {n} files`):R(`Commit {chosen} of {n} files`,{chosen:k.length,n:w.length})})]}),(0,C.jsx)(`ul`,{className:`git-files`,children:w.map(e=>{let t=e.status===`U`&&oe&&!oe.conflicts.includes(e.path)?`M`:e.status,n=e.path.lastIndexOf(`/`),r=t===`?`?`U`:t===`U`?`!`:t,i=v===e.path;return(0,C.jsxs)(`li`,{className:i?`open`:void 0,children:[(0,C.jsxs)(`div`,{className:`git-row`,children:[!oe&&(0,C.jsx)(`input`,{type:`checkbox`,"aria-label":R(`Stage {path}`,{path:e.path}),title:e.staged?e.unstaged?R(`Partly staged`):R(`Staged`):R(`Not staged`),disabled:!!u,checked:e.staged&&!e.unstaged,ref:t=>{t&&(t.indeterminate=e.staged&&e.unstaged)},onChange:t=>A([e.path],t.target.checked)}),(0,C.jsxs)(`button`,{type:`button`,className:`git-file`,"aria-expanded":i,title:`${Rm()[e.status]||e.status}: ${e.from?`${e.from} → `:``}${e.path}`,onClick:()=>y(i?``:e.path),children:[(0,C.jsx)(`span`,{className:`git-name`,children:e.path.slice(n+1)}),n>0&&(0,C.jsx)(`span`,{className:`git-dir`,children:e.path.slice(0,n)})]}),e.lines&&(0,C.jsxs)(`span`,{className:`git-lines`,children:[(0,C.jsxs)(`ins`,{children:[`+`,e.lines[0]]}),` `,(0,C.jsxs)(`del`,{children:[`−`,e.lines[1]]})]}),(0,C.jsx)(`span`,{className:`git-code s-`+(t===`?`?`u`:t===`U`?`conflict`:t.toLowerCase()),"aria-label":Rm()[t]||t,children:r})]}),i&&(0,C.jsx)(`div`,{className:`git-diff-wrap`,"aria-label":R(`Changes in {path}`,{path:e.path}),role:`region`,children:b?.path===e.path&&b.result?(0,C.jsx)(zm,{diff:b.result}):b?.error?(0,C.jsx)(`p`,{className:`inline-error`,children:b.error}):(0,C.jsx)(`p`,{className:`git-diff-note`,children:R(`Loading the diff…`)})})]},e.path)})})]}):(0,C.jsxs)(`p`,{className:`git-clean`,children:[(0,C.jsx)(T,{name:`check`,size:15}),R(`No uncommitted changes`)]}),(0,C.jsx)(fp,{git:t,load:o,tasks:i,onOpenTask:a,taskStatus:e=>(0,C.jsx)(lm,{task:e})})]})}function Vm(e){return R(`Page {n}`,{n:e.page+1})+(e.source?` · ${e.source.file}:${e.source.lines[0]}${e.source.lines[1]===e.source.lines[0]?``:`–${e.source.lines[1]}`}`:``)}function Hm(){return(0,C.jsxs)(`small`,{className:`note-placement-warning`,title:R(`The position in the new PDF could not be confirmed. The original text and note are kept.`),children:[(0,C.jsx)(T,{name:`alert`,size:12}),R(`Position needs confirmation`)]})}function Um({notes:e,currentKey:t,active:n,actions:r,onShow:i,onAnnotate:a}){let o=(0,S.useRef)(null),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(``),p=l||r.sending,m=r.onEditing;(0,S.useEffect)(()=>(m(!!s||l),()=>m(!1)),[s,l,m]),(0,S.useEffect)(()=>{n&&o.current?.querySelector(`[data-note="${n}"]`)?.scrollIntoView({block:`nearest`})},[n]);let h=e=>o.current?.querySelector(`[data-note="${e}"] .note-edit-trigger`)?.focus();async function g(e){if(!p){u(!0),f(``);try{await e()}catch(e){f(e instanceof Error?e.message:String(e))}finally{u(!1)}}}function v(e){c(null),requestAnimationFrame(()=>h(e))}function y(e){s?.comment.trim()&&g(async()=>{await r.edit(e,s.comment.trim()),v(e.id)})}let b=r.selection.selected.length,x=p||!!s,w=e=>{x||r.selection.set([e.id],!r.selection.has(e.id))},E=(e,t)=>{e.target.closest(`button,a,input,textarea,select,form`)||e.detail>1||document.getSelection()?.isCollapsed===!1||w(t)},D=(e,t)=>(0,C.jsx)(`button`,{type:`button`,className:`note-card-select`,"aria-label":R(`Include note {n} in this task`,{n:t+1}),"aria-pressed":r.selection.has(e.id),disabled:x,onClick:()=>w(e)});return(0,C.jsxs)(`section`,{ref:o,className:`notes-panel`,"aria-label":R(`PDF notes`),children:[(0,C.jsxs)(`div`,{className:`draft-notes-head`,children:[e.length>0&&(0,C.jsxs)(`div`,{className:`note-selection-head`,children:[(0,C.jsx)(`span`,{children:R(`Notes to send: {selected} / {total}`,{selected:b,total:e.length})}),(0,C.jsx)(`button`,{type:`button`,className:`note-select-all`,"aria-label":R(`Select all notes for this task`),"aria-pressed":b===e.length?!0:b?`mixed`:!1,disabled:x,onClick:()=>r.selection.set(e.map(e=>e.id),b!==e.length),children:b===e.length?R(`Clear selection`):R(`Select all`)})]}),(0,C.jsxs)(`div`,{className:`note-entry-actions`,children:[(0,C.jsxs)(`button`,{type:`button`,className:`button ghost compact`,disabled:!t||p||!!s,onClick:()=>a(!0),children:[(0,C.jsx)(T,{name:`region`,size:14}),R(`Region note`)]}),(0,C.jsx)(`span`,{className:`note-entry-hint`,children:R(`or select text to annotate`)})]})]}),e.length>0&&(0,C.jsx)(`p`,{className:`note-selection-hint`,children:R(`Click cards to choose which highlighted notes to send.`)}),t&&e.some(e=>e.key!==t)&&(0,C.jsx)(`p`,{className:`note-placement-summary`,role:`status`,children:R(`Some note positions need confirmation. Their original text and comments are kept.`)}),_(e).map(({group:e,entries:a})=>{let o=a.filter(({note:e})=>r.selection.has(e.id)).length;return(0,C.jsxs)(le,{group:e,count:a.length,active:r.group===e||a.some(({note:e})=>e.id===n),selection:{count:o,disabled:x,toggle:()=>r.selection.set(a.map(({note:e})=>e.id),o!==a.length)},children:[(0,C.jsx)(ce,{group:e,value:r.instructions.get(e),disabled:p,onChange:t=>r.instructions.set(e,t)}),(0,C.jsx)(`div`,{className:`group-references`,children:a.map(({note:e,index:a})=>(0,C.jsxs)(`div`,{className:`group-location note-card`+(e.id===n?` active`:``),"data-note":e.id,"data-selected":r.selection.has(e.id),onClick:t=>E(t,e),children:[D(e,a),(0,C.jsx)(`button`,{type:`button`,className:`note-number`,"aria-label":R(`Show note {n} on the page`,{n:a+1}),disabled:e.key!==t,onClick:()=>i(e),children:a+1}),(0,C.jsxs)(`div`,{className:`group-location-target`,children:[(0,C.jsx)(`blockquote`,{children:e.quote||R(`Marked region`)}),(0,C.jsx)(`span`,{children:Vm(e)}),e.key!==t&&(0,C.jsx)(Hm,{})]}),(0,C.jsx)(`span`,{className:`group-location-selected`,"aria-hidden":`true`,children:(0,C.jsx)(T,{name:`check`,size:13})}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button group-location-remove`,"aria-label":R(`Delete note {n}`,{n:a+1}),disabled:p,onClick:()=>void g(()=>r.remove(e)),children:(0,C.jsx)(T,{name:`close`,size:13})})]},e.id))})]},e)}),e.some(e=>!e.group)&&(0,C.jsx)(`ol`,{className:`note-list`,children:e.map((e,a)=>!e.group&&(0,C.jsxs)(`li`,{"data-note":e.id,"data-selected":r.selection.has(e.id),className:`note-card `+(n===e.id?`active `:``)+(e.key===t?``:`stale`),onClick:t=>E(t,e),children:[D(e,a),(0,C.jsxs)(`div`,{className:`note-head`,children:[(0,C.jsx)(`button`,{type:`button`,className:`note-number`,"aria-label":R(`Show note {n} on the page`,{n:a+1}),disabled:e.key!==t,onClick:()=>i(e),children:a+1}),(0,C.jsxs)(`span`,{className:`note-where`,children:[Vm(e),e.author?` · `+R(`from {name}`,{name:e.author.name}):``]}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button note-edit-trigger`,"aria-label":R(`Edit note {n}: {comment}`,{n:a+1,comment:e.comment}),title:R(`Edit note`),disabled:x,onClick:()=>{f(``),c({id:e.id,comment:e.comment})},children:(0,C.jsx)(T,{name:`pencil`,size:13})}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":R(`Delete note {n}`,{n:a+1}),title:R(`Delete note`),disabled:p||!!s,onClick:()=>void g(async()=>{await r.remove(e)}),children:(0,C.jsx)(T,{name:`close`,size:14})})]}),(0,C.jsx)(me,{text:e.quote}),(0,C.jsx)(he,{children:s?.id===e.id?(0,C.jsxs)(`form`,{className:`note-edit`,onSubmit:t=>{t.preventDefault(),y(e)},children:[(0,C.jsx)(`textarea`,{autoFocus:!0,"aria-label":R(`Edit note {n}`,{n:a+1}),value:s.comment,rows:3,maxLength:4e3,disabled:p,onChange:t=>c({id:e.id,comment:t.target.value}),onKeyDown:t=>{t.key===`Escape`&&!p?(t.preventDefault(),t.stopPropagation(),f(``),v(e.id)):Ke(t.nativeEvent,pm())&&(t.preventDefault(),y(e))}}),(0,C.jsxs)(`div`,{className:`button-row`,children:[(0,C.jsx)(`button`,{type:`button`,className:`button ghost compact`,disabled:p,onClick:()=>{f(``),v(e.id)},children:R(`Cancel`)}),(0,C.jsx)(`button`,{className:`button primary compact`,disabled:p||!s.comment.trim(),children:R(l?`Saving…`:`Save`)})]})]}):(0,C.jsx)(`p`,{className:`note-comment-text`,children:e.comment})}),e.key!==t&&(0,C.jsx)(Hm,{})]},e.id))}),d&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:d})]})}function Wm({task:e,busy:t,onBuild:n}){let r=om(e),i=R(r?`No manuscript changes`:`PDF comparison`),a=R(r?`This task did not change the manuscript. Read the answer in the chat.`:`Only manuscript changes need a PDF comparison. Answers to questions are in the chat.`);return e.status===`building`?(i=R(`Preparing task results…`),a=R(`Checking for manuscript changes. A PDF comparison is generated only when needed.`)):e.status===`running`||e.status===`queued`?(i=e.status===`running`?R(`{agent} is working`,{agent:am(e)}):R(`Queued`),a=R(`If the task changes the manuscript, a PDF comparison will appear here. Otherwise, read the answer in the chat.`)):e.status===`waiting_input`?(i=R(`Needs your reply`),a=R(`Reply in the chat to continue. A PDF comparison is needed only if the manuscript changes.`)):e.status===`uncertain`&&(i=R(`Check task status`),a=R(`Confirm whether the task is still running before generating a PDF comparison.`)),(0,C.jsxs)(`div`,{className:`review-placeholder`,children:[(0,C.jsx)(`div`,{className:`placeholder-icon`,children:e.status===`building`?(0,C.jsx)(`span`,{className:`spinner large`}):(0,C.jsx)(T,{name:r?`chat`:`diff`,size:22})}),(0,C.jsx)(`h2`,{children:i}),(0,C.jsx)(`p`,{children:a}),!r&&[`idle`,`interrupted`,`failed`,`reviewing`].includes(e.status)&&(0,C.jsx)(`button`,{type:`button`,className:`button secondary`,disabled:t,onClick:n,children:R(`Generate PDF comparison`)})]})}function Gm({mode:e,onMode:t}){return(0,C.jsxs)(`div`,{className:`pdf-modes`,role:`group`,"aria-label":R(`Show`),children:[(0,C.jsxs)(`button`,{type:`button`,"aria-label":`PDF`,title:`PDF`,"aria-pressed":e===`pdf`,onClick:()=>t(`pdf`),children:[(0,C.jsx)(T,{name:`paper`,size:15}),(0,C.jsx)(`span`,{children:`PDF`})]}),(0,C.jsxs)(`button`,{type:`button`,"aria-label":R(`Changes`),"aria-pressed":e===`changes`,title:R(`What changed since the last commit, to stage, revert and commit change by change`),onClick:()=>t(`changes`),children:[(0,C.jsx)(T,{name:`diff`,size:15}),(0,C.jsx)(`span`,{children:R(`Changes`)})]})]})}function Km({project:e,data:t,error:n,view:r,setView:i,region:a,setRegion:o,active:s,setActive:c,actions:l,newTask:u,tools:d,openPdf:f,navigation:p,onGit:m,writer:h,reportError:g,tasks:_,onOpenTask:v}){let y=t?.build,b=t?.annotations||[],x=t?.git,w=(0,S.useRef)(null),[E,O]=(0,S.useState)(()=>D.getItem(`papilot:manuscript-panel`)===`hidden`),k=mm(`(min-width: 681px)`),A=k&&E,j=mm(`(min-width: 901px)`),M=(0,S.useId)(),N=(0,S.useRef)(null),P=Zp(`papilot:manuscript-width`,`--manuscript-width`,`.manuscript-side`,R(`Resize manuscript panel`),j&&!A,()=>w.current?.fitWidth());(0,S.useEffect)(()=>{D.setItem(`papilot:manuscript-panel`,E?`hidden`:`visible`)},[E]);let F=k&&(0,C.jsx)(`button`,{ref:N,type:`button`,className:`icon-button manuscript-panel-toggle`,"aria-label":R(A?`Expand manuscript panel`:`Collapse manuscript panel`),title:R(A?`Expand manuscript panel`:`Collapse manuscript panel`),"aria-expanded":!A,"aria-controls":M,onClick:()=>{O(e=>!e),w.current?.fitWidth(),requestAnimationFrame(()=>N.current?.focus())},children:(0,C.jsx)(T,{name:A?`panelExpand`:`panelCollapse`,size:18})}),I=(0,C.jsxs)(C.Fragment,{children:[d,A&&F,(A||!j)&&f]}),[ee,L]=(0,S.useState)(`pdf`),[te,ne]=(0,S.useState)(!1),ie=(0,C.jsxs)(C.Fragment,{children:[p,(0,C.jsx)(Gm,{mode:ee,onMode:L})]}),ae=Array.isArray(x?.files)&&!x.merging?x.files.filter(e=>e.staged).map(e=>e.path):[],oe=()=>void $(`/projects/${e.id}/git`).then(m,()=>void 0),se=e=>ae.length>0&&(e?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`commit-state`,children:re(ae.length,`{n} file staged`,`{n} files staged`)}),(0,C.jsx)(`button`,{type:`button`,className:`commit-button`,onClick:()=>ne(!0),children:R(`Commit…`)})]}):(0,C.jsxs)(`button`,{type:`button`,className:`button ghost compact commit-staged`,title:R(`Commit what is staged`),onClick:()=>ne(!0),children:[(0,C.jsx)(T,{name:`commit`,size:14}),(0,C.jsx)(`span`,{children:R(`Commit…`)})]})),[ce,le]=(0,S.useState)([]),[z,B]=(0,S.useState)(-1),ue=b.map((e,t)=>({note:e,number:t+1})),de=()=>window.matchMedia(`(max-width: 680px)`).matches,fe=r===`pdf`?`task`:r;function pe(e){de()&&i(`pdf`),requestAnimationFrame(()=>w.current?.goTo(e))}function me(e){e.key===y?.key&&(c(e.id),de()&&i(`pdf`),requestAnimationFrame(()=>w.current?.goToNote(e)))}function he(e){L(`pdf`),o(e),de()&&i(`pdf`),!de()&&ee===`pdf`?w.current?.focus():requestAnimationFrame(()=>w.current?.focus())}return(0,C.jsxs)(`div`,{className:`manuscript show-`+r+(A?` panel-collapsed`:``),style:P.style,children:[P.resizer,ee===`changes`?(0,C.jsx)(`section`,{className:`manuscript-pages`,"aria-label":R(`Uncommitted changes in the PDF`),children:(0,C.jsx)(Ut,{changesOf:e.id,lead:ie,tools:(0,C.jsxs)(C.Fragment,{children:[se(!1),I]}),completion:se(!0),onDecided:oe},`changes:`+e.id)}):(0,C.jsxs)(`section`,{className:`manuscript-pages`,"aria-label":R(`PDF preview`),"aria-busy":!y||y.status===`building`,children:[!y?.key&&(0,C.jsxs)(`div`,{className:`manuscript-lead`,children:[ie,I]}),n&&(0,C.jsx)(`div`,{className:`manuscript-note error`,role:`alert`,children:n}),y?.status===`failed`&&(0,C.jsxs)(`div`,{className:`manuscript-note error`,role:`alert`,children:[(0,C.jsx)(`strong`,{children:R(`The manuscript did not compile.`)}),(0,C.jsx)(`pre`,{children:y.error})]}),y?.key?(0,C.jsx)(S.Suspense,{fallback:(0,C.jsx)(`div`,{className:`review-loading`,children:(0,C.jsx)(`p`,{role:`status`,children:R(`Opening the PDF…`)})}),children:(0,C.jsx)(Qp,{ref:w,url:`/api/projects/${e.id}/manuscript.pdf?key=${y.key}`,words:`/api/projects/${e.id}/manuscript/words?key=${y.key}`,notes:ue.filter(e=>e.note.key===y.key),active:s,region:a,setRegion:o,group:l.group,onGroupChange:l.setGroup,markingDisabled:l.sending,onCreate:l.add,onSelect:e=>{c(e.id),de()||(i(`task`),O(!1),w.current?.fitWidth())},outline:ce,section:z,onOutline:le,onSection:B,lead:ie,tools:I})}):!n&&y?.status!==`failed`&&(0,C.jsxs)(`div`,{className:`review-placeholder`,children:[(0,C.jsx)(`div`,{className:`placeholder-icon`,children:(0,C.jsx)(`span`,{className:`spinner large`})}),(0,C.jsx)(`h2`,{children:R(`Compiling the PDF…`)})]})]}),(0,C.jsxs)(`aside`,{id:M,className:`manuscript-side`,"aria-label":R(`Manuscript panels`),hidden:A,children:[(0,C.jsxs)(`div`,{className:`manuscript-side-header`,children:[!A&&F,(0,C.jsxs)(`div`,{className:`side-tabs`,role:`tablist`,"aria-label":R(`Manuscript panels`),children:[(0,C.jsxs)(`button`,{role:`tab`,"aria-selected":fe===`task`,onClick:()=>i(`task`),children:[(0,C.jsx)(T,{name:`compose`,size:14}),R(`New task`),b.length>0&&(0,C.jsx)(`span`,{className:`count`,"aria-hidden":`true`,children:b.length})]}),(0,C.jsxs)(`button`,{role:`tab`,"aria-selected":fe===`contents`,onClick:()=>i(`contents`),children:[(0,C.jsx)(T,{name:`list`,size:14}),R(`Contents`)]}),(0,C.jsxs)(`button`,{role:`tab`,"aria-selected":fe===`git`,onClick:()=>i(`git`),children:[(0,C.jsx)(T,{name:`branch`,size:14}),`Git`,t?.git?.files?.length?(0,C.jsx)(`span`,{className:`count`,children:t.git.files.length}):null]})]}),!A&&j&&f]}),fe===`task`?u((0,C.jsx)(Um,{notes:b,currentKey:y?.key,active:s,actions:l,onShow:me,onAnnotate:he},e.id)):fe===`contents`?(0,C.jsx)(`nav`,{className:`contents-panel`,"aria-label":R(`PDF contents`),children:ce.length?(0,C.jsx)(`ol`,{children:ce.map((e,t)=>(0,C.jsx)(`li`,{children:(0,C.jsxs)(`button`,{type:`button`,"aria-current":t===z?`location`:void 0,style:{paddingLeft:12+Math.min(e.level,4)*14},onClick:()=>pe(e),children:[(0,C.jsx)(`span`,{children:e.title}),(0,C.jsx)(`span`,{className:`contents-page`,children:e.page})]})},t))}):(0,C.jsx)(`p`,{className:`muted`,children:y?.key?R(`This PDF has no bookmarks.`):R(`Contents will appear when the PDF is ready.`)})}):(0,C.jsx)(Bm,{projectId:e.id,git:t?.git||null,onStatus:m,writer:h,tasks:_,onOpenTask:v},e.id+e.path)]}),te&&(0,C.jsx)(ap,{branch:x?.branch??null,files:ae,staged:!0,remote:!!x?.remote,agent:im[h.agent],onClose:()=>ne(!1),generate:t=>$(`/projects/${e.id}/git/message`,{paths:ae,staged:!0,agent:h.agent,fresh:t},void 0,13e4).then(e=>e.message),commit:async(t,n)=>{let r=await $(`/projects/${e.id}/git/commit`,{message:t,staged:!0,push:n},void 0,13e4);m(r.git),ne(!1),r.pushError&&g(r.pushError)}})]})}function qm(){let[e,t]=(0,S.useState)(null),[n]=(0,S.useState)(()=>D.getItem(`papilot:task`)),[r,i]=(0,S.useState)(n||``),[a,o]=(0,S.useState)(()=>D.getItem(`papilot:project`)||``),[s,c]=(0,S.useState)({taskId:``,items:[]}),[l,u]=(0,S.useState)(!1),[f,p]=(0,S.useState)({taskId:``,message:``}),h=(0,S.useRef)(null),g=(0,S.useRef)(new Map),_=(0,S.useRef)(new Map),v=(0,S.useRef)(new Map),[y]=(0,S.useState)(()=>new rt),[b]=(0,S.useState)(()=>new rt),[x,w]=(0,S.useState)(!0),[E,O]=(0,S.useState)(``),[k,A]=(0,S.useState)(``),j=(0,S.useRef)(null),[M,N]=(0,S.useState)(null),[P,F]=(0,S.useState)(null),I=(0,S.useRef)(new Map),[ee,L]=(0,S.useState)({}),te=(0,S.useRef)(em()),ie=(0,S.useRef)(null),[ae,oe]=(0,S.useState)(()=>D.getItem(`papilot:new-task`)||``),[se,ce]=(0,S.useState)(null),[le,z]=(0,S.useState)({projectId:``,list:[]}),[B,de]=(0,S.useState)(0),[fe,me]=(0,S.useState)(()=>{let e=D.getItem(`papilot:agent`);return e===`claude`||e===`antigravity`?e:`codex`}),[he,ge]=(0,S.useState)(()=>Object.fromEntries(rm.map(e=>[e,{model:D.getItem(`papilot:model:${e}`)??(e===`codex`?D.getItem(`papilot:model`):null)??``,effort:D.getItem(`papilot:effort:${e}`)??(e===`codex`?D.getItem(`papilot:effort`):null)??``,fast:D.getItem(`papilot:fast:${e}`)===`true`}]))),[_e,ve]=(0,S.useState)(!1),[ye,be]=(0,S.useState)(``),[xe,Ce]=(0,S.useState)(null);(0,S.useEffect)(()=>{if(!xe)return;let e=setTimeout(()=>Ce(null),2600);return()=>clearTimeout(e)},[xe]);let[we,Te]=(0,S.useState)(!1),Ee=(0,S.useRef)(new Set),[De,Oe]=(0,S.useState)(new Set),[ke,Ae]=(0,S.useState)(()=>D.getItem(`papilot:sidebar`)!==`hidden`),[je,Me]=(0,S.useState)(()=>{let e=D.getItem(`papilot:layout`);return e===`review`||e===`conversation`?e:`split`}),Pe=mm(`(max-width: 900px)`),Fe=mm(`(max-width: 680px)`),[Le,Re]=(0,S.useState)(`review`),ze=(0,S.useRef)(null),[Be,Ve]=(0,S.useState)(``),[Ue,Ke]=(0,S.useState)(``),[qe,Je]=(0,S.useState)(!1),Ye=(0,S.useRef)(``);(0,S.useEffect)(()=>{!Be&&Ye.current&&(document.querySelector(`.task-row[data-task="${Ye.current}"] .task-link`)?.focus(),Ye.current=``)},[Be]);let[Ze,Qe]=(0,S.useState)(null),[$e,et]=(0,S.useState)(()=>window.matchMedia(`(max-width: 680px)`).matches?`pdf`:`task`),[tt,nt]=(0,S.useState)(!1),[at,ot]=(0,S.useState)(``),[st,ct]=(0,S.useState)(null),[lt,dt]=(0,S.useState)(0),ft=(0,S.useRef)([]),pt=(0,S.useRef)(!1);(0,S.useEffect)(()=>{ct(null),ft.current=[]},[a]);let[mt,ht]=(0,S.useState)(!1),[gt,_t]=(0,S.useState)({projectId:``,data:null,error:``}),vt=(0,S.useRef)(0),yt=(0,S.useRef)(new Set),[bt,xt]=(0,S.useState)(new Set),[St,wt]=(0,S.useState)({projectId:``,status:null}),[Tt,Et]=(0,S.useState)(()=>Number(D.getItem(`papilot:chat-width`))||0),Dt=nn(),{language:Ot}=ne(),[kt,At]=(0,S.useState)(!1),[jt,Mt]=(0,S.useState)(!1);(0,S.useEffect)(()=>{let e=()=>At(`shortcuts`);return window.addEventListener(`papilot:open-shortcuts`,e),()=>window.removeEventListener(`papilot:open-shortcuts`,e)},[]);let Nt=(0,S.useRef)(r);Nt.current=r;let Pt=(0,S.useRef)(!1);(0,S.useEffect)(()=>{if(!Pe||!we)return;let e=document.activeElement,t=j.current;return(t?.querySelector(`[aria-current="page"]`)||t?.querySelector(`button`))?.focus(),()=>{e?.isConnected&&e.getClientRects().length&&e.focus()}},[Pe,we]),(0,S.useEffect)(()=>{Te(!1)},[Pe]),(0,S.useEffect)(()=>{D.setItem(`papilot:sidebar`,ke?`visible`:`hidden`)},[ke]),(0,S.useEffect)(()=>{D.setItem(`papilot:layout`,je)},[je]),(0,S.useEffect)(()=>{Tt?D.setItem(`papilot:chat-width`,String(Tt)):D.removeItem(`papilot:chat-width`)},[Tt]),(0,S.useEffect)(()=>{ae?D.setItem(`papilot:new-task`,ae):D.removeItem(`papilot:new-task`)},[ae]),(0,S.useEffect)(()=>{let e=window.visualViewport,t=()=>{let t=document.documentElement.style;e&&window.matchMedia(`(max-width: 680px)`).matches&&e.scale===1?(t.setProperty(`--viewport-height`,`${e.height}px`),t.setProperty(`--viewport-top`,`${e.offsetTop}px`)):(t.removeProperty(`--viewport-height`),t.removeProperty(`--viewport-top`))};return t(),e?.addEventListener(`resize`,t),e?.addEventListener(`scroll`,t),window.addEventListener(`resize`,t),()=>{e?.removeEventListener(`resize`,t),e?.removeEventListener(`scroll`,t),window.removeEventListener(`resize`,t),document.documentElement.style.removeProperty(`--viewport-height`),document.documentElement.style.removeProperty(`--viewport-top`)}},[]);let Ft=(0,S.useCallback)(e=>O(e instanceof Error?e.message:String(e)),[]),It=(0,S.useCallback)(async e=>{Nt.current===e&&!g.current.has(e)&&u(!0);try{await b.run(e,t=>$(`/tasks/`+e+`/items`,void 0,t),t=>{g.current.delete(e),g.current.set(e,t.items),g.current.size>8&&g.current.delete(g.current.keys().next().value),Nt.current===e&&(c({taskId:e,items:t.items}),p({taskId:e,message:``}))})}catch(t){Nt.current===e&&p({taskId:e,message:t instanceof Error?t.message:String(t)})}finally{Nt.current===e&&u(!1)}},[b]),Lt=(0,S.useCallback)(async(e=!1)=>{try{e&&y.cancel(),await y.run(`state`,e=>$(`/state`,void 0,e),e=>{let r=Nt.current,a=h.current,s=a?.tasks.find(t=>t.id===r&&!e.tasks.some(e=>e.id===r));if(s&&o(s.projectId),$p=e.csrf,h.current=e,t(e),w(!0),A(``),a&&dn()&&(document.hidden||!document.hasFocus()))for(let t of gn(a,e))vn(t,e=>{i(e),Te(!1)});for(let t of _.current.keys())e.tasks.some(e=>e.id===t)||(_.current.delete(t),g.current.delete(t),D.removeItem(`papilot:draft:`+t));N(t=>t&&!e.tasks.some(e=>e.id===t.id)?null:t),Qe(t=>t&&!e.projects.some(e=>e.id===t.id)?null:t);for(let t of v.current.keys())e.requests.some(e=>e.id===t)||v.current.delete(t);r&&!e.tasks.some(e=>e.id===r)&&i(``),Pt.current||(Pt.current=!0,n===null&&!r&&i(e.tasks.filter(e=>!e.archivedAt).at(-1)?.id||``))});let r=Nt.current;!document.hidden&&r&&h.current?.tasks.some(e=>e.id===r)&&await It(r)}catch(e){w(!1),A(e instanceof Error?e.message:String(e))}},[y,It,n]);(0,S.useEffect)(()=>{let e=0,t,n,r=performance.getEntriesByType(`navigation`)[0]?.nextHopProtocol||``;function i(){let i=++e;if(clearTimeout(t),n?.close(),n=void 0,document.hidden&&!dn()||!navigator.onLine){y.cancel(),b.cancel(),navigator.onLine||(w(!1),A(R(`You are offline. Your draft is kept in this browser.`)));return}it(r)&&(n=new EventSource(`/api/events`),n.addEventListener(`change`,()=>{i===e&&Lt()}));async function a(){if(await Lt(),i!==e)return;let r=h.current?.tasks.some(e=>[`running`,`waiting_input`,`queued`,`building`].includes(e.status));t=setTimeout(()=>void a(),n?.readyState===EventSource.OPEN?1e4:document.hidden?5e3:r?1e3:2500)}a()}i(),document.addEventListener(`visibilitychange`,i),window.addEventListener(`online`,i),window.addEventListener(`offline`,i);let a=fn(i);return()=>{e++,clearTimeout(t),n?.close(),y.cancel(),b.cancel(),a(),document.removeEventListener(`visibilitychange`,i),window.removeEventListener(`online`,i),window.removeEventListener(`offline`,i)}},[Lt,y,b]),(0,S.useEffect)(()=>(D.setItem(`papilot:task`,r),c({taskId:r,items:g.current.get(r)||[]}),u(!(!r||g.current.has(r))),r&&h.current?.tasks.some(e=>e.id===r)&&It(r),()=>b.cancel()),[r,It,b]);let V=e?.tasks.find(e=>e.id===r);V&&!_.current.has(V.id)&&_.current.set(V.id,new We(`papilot:draft:`+V.id,D,em));let Rt=V?.status!==`deleting`&&V?.review?.round?`/api/tasks/${V.id}/pdf?round=${V.review.round}`:``,H=e?.projects.find(e=>e.id===(V?.projectId||a))||e?.projects[0];(0,S.useEffect)(()=>{if(!e)return;let t=H?.id||``;o(t),D.setItem(`papilot:project`,t)},[H?.id,!!e]),(0,S.useEffect)(()=>{Ke(``),Je(!1)},[H?.id]),(0,S.useEffect)(()=>{V&&Je(!!V.archivedAt)},[V?.id]);let zt=e?.viewer,Vt=!zt||zt.role===`owner`,U=Xe(`papilot:files:${zt?.id||`owner`}:new:${H?.id||a}`);async function Ht(){try{await $(`/auth/logout`,{})}catch(e){if(!Rp()){Ft(e);return}}Bp(),Lp(!0)}let Kt=(e?.tasks.filter(e=>!H||e.projectId===H.id)||[]).filter(e=>!!e.archivedAt===qe),Xt=Ue.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean),Zt=Kt.filter(e=>{let t=`${e.title}\n${e.instructions}`.toLocaleLowerCase();return Xt.every(e=>t.includes(e))}),Qt=e?.tasks.filter(e=>[`running`,`waiting_input`,`building`].includes(e.status)).length||0;function en(){F(`project`)}let tn=e?.runtimes||(e?{codex:e.runtime}:{}),rn=e=>!(!tn[e]?.error||tn[e]?.connected&&tn[e]?.authenticated),an=tn[fe]?.models||[],on=he[fe],sn=an.length&&!an.some(e=>e.id===on.model)?``:on.model,cn=an.find(e=>e.id===sn)||an.find(e=>e.isDefault),ln={agent:fe,model:sn,effort:cn&&!cn.efforts.includes(on.effort)?``:on.effort,serviceTier:fe===`codex`?on.fast&&cn?.fastMode?cn.fastMode.serviceTier:`default`:void 0},un=e=>{ge(t=>({...t,[fe]:{...t[fe],...e}}));for(let[t,n]of Object.entries(e))D.setItem(`papilot:${t}:${fe}`,String(n))},pn=e=>(0,C.jsx)(Gp,{disabled:e,agent:fe,model:ln.model,effort:ln.effort,fast:on.fast,models:an,agents:rm.map(e=>({value:e,label:im[e],unavailable:rn(e)})),runtime:tn[fe],reconnecting:De.has(`/reconnect`),onReconnect:()=>void hn(`/reconnect`),onAgent:e=>{me(e),D.setItem(`papilot:agent`,e)},onChange:un});async function mn(){let e=ae.trim(),n=H?.id||a,r=se,i=In.selected,o=U.draft.getSnapshot().files,s=Ln.forNotes(i);if(!e&&!r&&!o.length&&!i.some(e=>e.comment.trim())&&!Object.keys(s).length||!e&&!r&&m(i,s).length>0||U.draft.getSnapshot().blocked||_e||lt||mt||!n)return;let c=ie.current,l=new Set(i.map(e=>e.id)),u=c?.closest(`form`)?.contains(document.activeElement);ve(!0),be(``);try{let a={projectId:n,title:r?(e?`${Ie(r)}: ${Ge(e)}`:Ie(r)).slice(0,120):e?Ge(e):i.length===1?Ge(i[0].comment||i[0].group&&s[d(i[0].group)]||``):i.length?R(`Address {n} PDF notes`,{n:i.length}):o[0].name.slice(0,120),instructions:e,...r?{skill:r.id}:{},...i.length?{annotations:[...l]}:{},...Object.keys(s).length?{groupInstructions:s}:{},...o.length?{attachments:o.map(e=>e.id)}:{},agent:ln.agent,model:ln.model,effort:ln.effort,serviceTier:ln.serviceTier},f=JSON.stringify([n,e,r?.id||``,[...l],s,o.map(e=>e.id)]),p={};try{p=JSON.parse(D.getItem(`papilot:new-task-request`)||`{}`)}catch{}te.current=p?.signature===f&&p.id?p.id:em(),D.setItem(`papilot:new-task-request`,JSON.stringify({signature:f,id:te.current}));let m=await $(`/tasks`,{...a,id:te.current});if(D.removeItem(`papilot:new-task-request`),U.draft.clear(o),te.current=em(),oe(``),ce(null),Ke(``),Je(!1),y.cancel(),h.current){let e={...h.current,tasks:[...h.current.tasks.filter(e=>e.id!==m.id),m]};h.current=e,t(e)}Ce({id:m.id,title:m.title}),++vt.current,_t(e=>e.projectId===n&&e.data?{...e,data:{...e.data,annotations:(e.data.annotations||[]).filter(e=>!l.has(e.id))}}:e),In.reset(n),Ln.sent(n,i,Fn),ot(e=>l.has(e)?``:e),ct(null),ft.current=ft.current.filter(e=>!l.has(e.note.id)),u&&c?.isConnected&&(document.activeElement===document.body||c.closest(`form`)?.contains(document.activeElement))&&c.focus({preventScroll:!0}),Fn.length&&On(n),await Lt(!0)}catch(e){be(e instanceof Error?e.message:String(e))}finally{ve(!1)}}async function hn(e,t={}){let n=e.startsWith(`/tasks/`)?e.split(`/`).slice(0,3).join(`/`):e;if(!Ee.current.has(n)){Ee.current.add(n),Oe(new Set(Ee.current));try{return await $(e,t),await Lt(!0),!0}catch(e){Ft(e)}finally{Ee.current.delete(n),Oe(new Set(Ee.current))}}}let _n=!!(V&&De.has(`/tasks/`+V.id));async function yn(e){let t=!e.archivedAt;await hn(`/tasks/`+e.id+`/archive`,{archived:t})&&(t&&Nt.current===e.id&&(o(e.projectId),i(``)),t||Je(!1),requestAnimationFrame(()=>document.querySelector(`.task-search input`)?.focus()))}let bn=Pe?we:ke;(0,S.useLayoutEffect)(()=>{xe&&bn&&j.current?.querySelector(`.task-list`)?.scrollTo({top:0})},[xe,bn]);function xn(e){let n=h.current?.tasks.find(t=>t.id===e);n&&o(n.projectId),D.removeItem(`papilot:draft:`+e),_.current.delete(e),g.current.delete(e),N(null),Nt.current===e&&i(``),t(t=>t&&{...t,tasks:t.tasks.filter(t=>t.id!==e),requests:t.requests.filter(t=>t.taskId!==e)}),Lt(!0),requestAnimationFrame(()=>document.querySelector(bn?`.sidebar .manuscript-link`:`.main .sidebar-toggle`)?.focus())}function Cn(){Pe?Te(!1):(Ae(!1),requestAnimationFrame(()=>document.querySelector(`.main .sidebar-toggle`)?.focus()))}async function wn(e,n){let r=n.trim().replace(/\s+/g,` `).slice(0,120);if(Ve(``),r&&r!==e.title){t(t=>t&&{...t,tasks:t.tasks.map(t=>t.id===e.id?{...t,title:r}:t)});try{await $(`/tasks/`+e.id+`/rename`,{title:r})}catch(e){Ft(e)}await Lt(!0)}}function Tn(e){if(e.button!==0)return;e.preventDefault();let t=e.currentTarget,n=t.parentElement.getBoundingClientRect();t.setPointerCapture(e.pointerId),document.body.classList.add(`resizing`);let r=e=>Et(Math.round(Math.min(Math.max(n.right-e.clientX,300),n.width-360))),i=()=>{document.body.classList.remove(`resizing`),t.removeEventListener(`pointermove`,r),t.removeEventListener(`lostpointercapture`,i)};t.addEventListener(`pointermove`,r),t.addEventListener(`lostpointercapture`,i)}function En(e){let t=e.currentTarget.parentElement.querySelector(`.activity-panel`)?.offsetWidth||400,n=e.currentTarget.parentElement.offsetWidth-360,r=e.key===`ArrowLeft`?t+24:e.key===`ArrowRight`?t-24:e.key===`Home`?n:e.key===`End`?300:null;e.key===`Enter`?(e.preventDefault(),Et(0)):r!==null&&(e.preventDefault(),Et(Math.min(Math.max(r,300),n)))}let Dn=!V&&!!H,On=(0,S.useCallback)(async(e,t=!1)=>{if(yt.current.has(e))return;let n=++vt.current;t&&(yt.current.add(e),xt(new Set(yt.current)));try{let r=await $(`/projects/${e}/manuscript`,t?{}:void 0);if(n!==vt.current)return;_t({projectId:e,data:r,error:``}),wt({projectId:e,status:r.git})}catch(t){n===vt.current&&_t(n=>({projectId:e,data:n.projectId===e?n.data:null,error:t instanceof Error?t.message:String(t)}))}finally{t&&(yt.current.delete(e),xt(new Set(yt.current)))}},[]),kn=gt.projectId===H?.id&>.data?.build.status===`building`;(0,S.useEffect)(()=>{if(!Dn||!H)return;On(H.id);let e=()=>void On(H.id);return window.addEventListener(`focus`,e),()=>{++vt.current,window.removeEventListener(`focus`,e)}},[Dn,H?.id,H?.path,On]),(0,S.useEffect)(()=>{if(!Dn||!H)return;let e=kn?1500:15e3,t=!1,n,r=async()=>{await On(H.id),t||(n=setTimeout(()=>void r(),e))};return n=setTimeout(()=>void r(),e),()=>{t=!0,clearTimeout(n)}},[Dn,H?.id,kn,On]);let An=(e?.tasks||[]).filter(e=>e.projectId===H?.id).map(e=>`${e.review?.files?.join()}:${e.review?.counts?.accepted}`).join(`|`);(0,S.useEffect)(()=>{if(!H||Dn)return;let e=()=>void $(`/projects/${H.id}/git`).then(e=>wt({projectId:H.id,status:e})).catch(()=>void 0);e();let t=setInterval(e,2e4);return()=>clearInterval(t)},[H?.id,H?.path,Dn,An]),(0,S.useEffect)(()=>ce(null),[H?.id,H?.path]),(0,S.useEffect)(()=>{if(!H)return;let e=!0,t=()=>void $(`/projects/${H.id}/skills`).then(t=>{if(!e)return;let n=Array.isArray(t.skills)?t.skills:[];z({projectId:H.id,list:n}),ce(e=>e&&n.find(t=>t.id===e.id)||null)},()=>void 0);return t(),window.addEventListener(`focus`,t),()=>{e=!1,window.removeEventListener(`focus`,t)}},[H?.id,H?.path,B]);let jn=St.projectId===H?.id?St.status:null,Mn=le.projectId===H?.id?le.list:[],Nn=(e,t)=>{wt({projectId:e,status:t}),_t(n=>n.projectId===e&&n.data?{...n,data:{...n.data,git:t}}:n)},Pn=gt.projectId===H?.id?gt:{data:null,error:``},Fn=Pn.data?.annotations||[],In=ue(H?.id||``,Fn),Ln=pe(H?.id||``),Rn=Ln.forNotes(In.selected),zn=!ae.trim()&&!se&&m(In.selected,Rn).length>0,Bn=e=>{++vt.current,_t(t=>t.projectId===H?.id&&t.data?{...t,data:{...t.data,annotations:e(t.data.annotations||[])}}:t)},Vn={selection:In,instructions:Ln,group:st,setGroup:ct,async add(e,t,n,r,i,a){if(!H||!Pn.data?.build.key)throw Error(R(`Wait for the PDF to compile.`));dt(e=>e+1);try{let o=await $(`/projects/${H.id}/annotations`,{key:Pn.data.build.key,page:e,rect:t,...n.length?{rects:n,quote:r}:{},comment:i,...a?{group:a}:{}});Bn(e=>[...e,o]),ot(o.id),a?ft.current.push({kind:`add`,note:o}):(nt(!1),Fe||et(`task`))}finally{dt(e=>e-1)}},async edit(e,t){let n=await $(`/projects/${e.projectId}/annotations/${e.id}`,{comment:t});Bn(t=>t.map(t=>t.id===e.id?n:t))},async remove(e){await $(`/projects/${e.projectId}/annotations/${e.id}/delete`,{}),Bn(t=>t.filter(t=>t.id!==e.id)),ft.current.push({kind:`remove`,note:e})},async restore(e){let t=await $(`/projects/${e.projectId}/annotations/${e.id}/restore`,{});Bn(()=>t.annotations),ot(e.id)},onEditing:ht,sending:_e};ut(()=>{let e=ft.current.at(-1);if(!Dn||!e)return!1;if(_e||lt||mt||pt.current)return!0;pt.current=!0,O(``);let{note:t}=e;return(async()=>{try{e.kind===`add`?(await $(`/projects/${t.projectId}/annotations/${t.id}/delete`,{}),Bn(e=>e.filter(e=>e.id!==t.id))):(await Vn.restore(t),requestAnimationFrame(()=>document.querySelector(`[data-note="${t.id}"] .note-edit-trigger`)?.focus())),ft.current=ft.current.filter(t=>t!==e)}catch(e){Ft(e)}finally{pt.current=!1}})(),!0});let Hn=e?.tasks.filter(e=>e.status===`waiting_input`).length||0;(0,S.useEffect)(()=>{document.title=(Hn?`(${Hn}) `:``)+(V?`${V.title} · Papilot`:Dn&&H?`${H.name} · Papilot`:`Papilot`)},[Hn,V?.title,Dn,H?.name]);let Un=!!(V&&e?.requests.some(e=>e.taskId===V.id)),Wn=V?.review?.counts?.pending||0,Gn=!!(V&&cm.includes(V.status)),Kn=!!(V&&(om(V)||Gn&&V.review?.round===null)),qn=Kn?`conversation`:je,Jn=Kn?`conversation`:Le,Yn=Fe?Jn===`conversation`:qn!==`review`,Xn=()=>{V&&hn(`/tasks/`+V.id+`/interrupt`)},W=Fe?Jn===`conversation`:qn===`conversation`,Zn=V?Nm(V,jn):[],Qn=Zn.length>0||V?.delivery?.pending,G=V?JSON.stringify([V.id,V.deferred,V.review?.round,V.review?.counts,Zn,V.delivery?.accepted,V.committed?.accepted,V.deferred?V.name:jn?.branch]):``;Qn&&!I.current.has(G)&&I.current.set(G,new sp);let $n=V&&(Qn?(0,C.jsx)(op,{draft:I.current.get(G),branch:V.deferred?`papilot/${V.name}`:jn?.branch??null,isolated:!!V.deferred,remote:!V.deferred&&!!jn?.remote,agent:am(V),disabled:_n,apply:V.deferred&&V.delivery?.mode!==`branch`?async()=>{let e=await $(`/tasks/${V.id}/apply`,{});return e.git&&Nn(V.projectId,e.git),await Lt(!0),R(`Applied to working directory`)}:void 0,generate:V.delivery?.mode===`workspace`?void 0:e=>$(V.deferred?`/tasks/${V.id}/commit-message`:`/projects/${V.projectId}/git/message`,{paths:Zn,agent:V.agent||`codex`,fresh:e},void 0,13e4).then(e=>e.message),commit:async(e,t)=>{let n=await $(`/tasks/${V.id}/commit`,{message:e,push:t},void 0,13e4);Nn(V.projectId,n.git);let r=t&&!n.pushError?R(`Committed {hash} and pushed.`,{hash:n.commit}):R(`Committed {hash}.`,{hash:n.commit});return L(e=>({...e,[V.id]:r})),n.pushError&&Ft(n.pushError),await Lt(!0),r}},G):V.deferred&&V.delivery?(0,C.jsx)(`span`,{className:`commit-state`,children:V.delivery.mode===`workspace`?R(`Applied to working directory`):R(`Committed {hash} to {branch}`,{hash:V.delivery.commit?.slice(0,7)||``,branch:V.delivery.branch||``})}):ee[V.id]?(0,C.jsx)(`span`,{className:`commit-state`,children:ee[V.id]}):null),er=e=>V&&(0,C.jsx)(Pm,{card:e,task:V,composer:_.current.get(V.id),refresh:()=>void Lt(!0),reportError:Ft,onSent:()=>{Nt.current===V.id&&(Re(`conversation`),Me(e=>e===`review`?`split`:e))}},`review-feedback:`+V.id),tr=(Pe||!ke)&&(0,C.jsxs)(`button`,{className:`icon-button sidebar-toggle`,"aria-label":R(`Show task list`),title:R(`Show task list`),"aria-expanded":bn,"aria-controls":`task-sidebar`,onClick:()=>Pe?Te(!0):Ae(!0),children:[(0,C.jsx)(T,{name:Pe?`menu`:`sidebar`,size:20}),xe&&!bn&&(0,C.jsx)(`span`,{className:`task-added-dot`,"aria-hidden":`true`},xe.id)]});function nr(e){if(e===(Fe?Le:je)&&!ze.current)return;ze.current?.skipTransition(),ze.current=null;let t=()=>{(0,Se.flushSync)(()=>{Fe||Me(e),e!==`split`&&Re(e)}),document.querySelector(`.workspace-view-selector [aria-pressed="true"]`)?.focus({preventScroll:!0})};if(!document.startViewTransition||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches){document.documentElement.classList.remove(`switching-workspace`),t();return}document.documentElement.classList.add(`switching-workspace`);let n=document.startViewTransition(()=>{ze.current===n&&t()});ze.current=n;let r=()=>{ze.current===n&&(ze.current=null,document.documentElement.classList.remove(`switching-workspace`))};n.finished.then(r,r)}let rr=V&&(0,C.jsx)(`div`,{className:`task-state-actions`,children:V.status===`deleting`?(0,C.jsx)(`button`,{className:`button secondary compact`,onClick:()=>N(V),children:R(`Retry deletion`)}):V.status===`uncertain`?(0,C.jsxs)(`button`,{className:`button secondary compact`,disabled:_n,"aria-busy":_n,onClick:()=>void hn(`/tasks/`+V.id+`/reconcile`),children:[(0,C.jsx)(T,{name:`refresh`,size:14}),R(`Check status`)]}):Gn&&!Yn?(0,C.jsxs)(`button`,{className:`button secondary compact`,"aria-label":R(`Pause task`),title:R(`Pause {agent}`,{agent:am(V)}),disabled:_n,"aria-busy":_n,onClick:Xn,children:[(0,C.jsx)(T,{name:`pause`,size:14}),(0,C.jsx)(`span`,{className:`button-label`,children:R(`Pause`)})]}):V.error?(0,C.jsx)(`button`,{className:`button secondary compact`,onClick:()=>{Re(`conversation`),Me(`conversation`)},children:R(`View details`)}):null}),ir=V&&(0,C.jsx)(`div`,{className:`view-selector workspace-view-selector`+(Kn?` single-view`:``),role:`group`,"aria-label":R(`Workspace view`),children:Kn?(0,C.jsxs)(`button`,{type:`button`,"aria-label":R(Un?`Chat (reply needed)`:`Chat`),title:om(V)?R(`This conversation has no manuscript changes.`):R(`Chat only`),"aria-pressed":`true`,children:[(0,C.jsx)(T,{name:`chat`,size:16}),(0,C.jsx)(`span`,{children:R(`Chat`)}),Un&&(0,C.jsx)(`i`,{className:`attention-dot`,"aria-hidden":`true`})]}):Fe?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`button`,{"aria-label":Wn?R(`Review, {n} to decide`,{n:Wn}):R(`Review`),"aria-pressed":Le===`review`,onClick:()=>nr(`review`),children:[(0,C.jsx)(T,{name:`paper`,size:16}),(0,C.jsx)(`span`,{children:R(`Review`)}),Wn>0&&(0,C.jsx)(`b`,{className:`view-count`,"aria-hidden":`true`,children:Wn})]}),(0,C.jsxs)(`button`,{"aria-label":R(Un?`Chat (reply needed)`:`Chat`),"aria-pressed":Le===`conversation`,onClick:()=>nr(`conversation`),children:[(0,C.jsx)(T,{name:`chat`,size:16}),(0,C.jsx)(`span`,{children:R(`Chat`)}),Un&&(0,C.jsx)(`i`,{className:`attention-dot`,"aria-hidden":`true`})]})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`button`,{"aria-label":R(`Review`),title:R(`PDF review only`),"aria-pressed":je===`review`,onClick:()=>nr(`review`),children:[(0,C.jsx)(T,{name:`paper`,size:16}),(0,C.jsx)(`span`,{children:R(`Review`)})]}),(0,C.jsxs)(`button`,{"aria-label":R(`Split`),title:R(`Review and chat side by side`),"aria-pressed":je===`split`,onClick:()=>nr(`split`),children:[(0,C.jsx)(T,{name:`split`,size:16}),(0,C.jsx)(`span`,{children:R(`Split`)})]}),(0,C.jsxs)(`button`,{"aria-label":R(Un?`Chat (reply needed)`:`Chat`),title:R(`Chat only`),"aria-pressed":je===`conversation`,onClick:()=>nr(`conversation`),children:[(0,C.jsx)(T,{name:`chat`,size:16}),(0,C.jsx)(`span`,{children:R(`Chat`)}),Un&&(0,C.jsx)(`i`,{className:`attention-dot`,"aria-hidden":`true`})]})]})}),ar=V&&(0,C.jsxs)(C.Fragment,{children:[rr,ir]}),or=V&&Rt?(0,C.jsx)(`a`,{className:`icon-button review-open`,href:Bt(V),target:`_blank`,rel:`noreferrer`,"aria-label":R(`Open review in new tab`),title:R(`Open review in new tab`),children:(0,C.jsx)(T,{name:`external`,size:16})}):null,sr=V&&Rt?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`a`,{className:`icon-button full-pdf-link`,href:Rt,target:`_blank`,rel:`noreferrer`,"aria-label":R(`Full PDF`),title:R(`Open the full PDF`),children:(0,C.jsx)(T,{name:`pdf`,size:16})}),(0,C.jsx)(Yt,{className:`review-rebuild`,label:R(`Regenerate PDF comparison`),status:V.status===`building`?`building`:V.review?.job?.status===`failed`||V.review?.state===`build_failed`?`failed`:`ready`,disabled:[`running`,`waiting_input`,`queued`,`building`,`uncertain`,`deleting`].includes(V.status)||_n,onCompile:()=>hn(`/tasks/`+V.id+`/publish`)},V.id)]}):null,cr=H&&Pn.data?.build.key&&(0,C.jsx)(`a`,{className:`icon-button`,"aria-label":R(`Open PDF`),title:R(`Open PDF`),href:`/api/projects/${H.id}/manuscript.pdf?key=${Pn.data.build.key}`,target:`_blank`,rel:`noreferrer`,children:(0,C.jsx)(T,{name:`external`,size:16})}),lr=H&&(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(Yt,{label:R(`Recompile PDF`),status:bt.has(H.id)?`building`:Pn.error?`unknown`:Pn.data?.build.status||`unknown`,disabled:!Pn.data&&!Pn.error,onCompile:()=>On(H.id,!0)},H.id)}),ur=Dn&&H&&(0,C.jsxs)(C.Fragment,{children:[lr,(0,C.jsxs)(`div`,{className:`view-selector`,role:`group`,"aria-label":R(`Manuscript view`),children:[(0,C.jsxs)(`button`,{"aria-label":`PDF`,"aria-pressed":$e===`pdf`,onClick:()=>et(`pdf`),children:[(0,C.jsx)(T,{name:`pdf`,size:16}),(0,C.jsx)(`span`,{children:`PDF`})]}),(0,C.jsxs)(`button`,{"aria-label":R(`New task`),"aria-pressed":$e===`task`,onClick:()=>{et(`task`),nt(!1)},children:[(0,C.jsx)(T,{name:`compose`,size:16}),(0,C.jsx)(`span`,{children:R(`New task`)}),Fn.length>0&&(0,C.jsx)(`b`,{className:`view-count`,"aria-hidden":`true`,children:Fn.length})]}),(0,C.jsxs)(`button`,{"aria-label":R(`Contents`),"aria-pressed":$e===`contents`,onClick:()=>{et(`contents`),nt(!1)},children:[(0,C.jsx)(T,{name:`list`,size:16}),(0,C.jsx)(`span`,{children:R(`Contents`)})]}),(0,C.jsxs)(`button`,{"aria-label":jn?.files?.length?R(`Git, {n} changed`,{n:jn.files.length}):`Git`,"aria-pressed":$e===`git`,onClick:()=>{et(`git`),nt(!1)},children:[(0,C.jsx)(T,{name:`diff`,size:16}),(0,C.jsx)(`span`,{children:`Git`}),jn?.files?.length?(0,C.jsx)(`b`,{className:`view-count`,"aria-hidden":`true`,children:jn.files.length}):null]})]}),cr]}),dr=e=>(0,C.jsx)(`section`,{className:`new-task-panel`+(Fn.length?` has-notes`:``),"aria-label":R(`New task`),children:(0,C.jsxs)(`div`,{className:`new-task-start`,children:[!Fn.length&&(0,C.jsxs)(`div`,{className:`new-task-welcome`,children:[(0,C.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20fill='none'%3e%3crect%20x='18'%20y='48'%20width='14'%20height='10'%20fill='%23F0F4F8'%20stroke='%23000000'%20stroke-width='2'/%3e%3crect%20x='32'%20y='48'%20width='14'%20height='10'%20fill='%23C6D5E5'%20stroke='%23000000'%20stroke-width='2'/%3e%3cpath%20d='M32%206L12%2034L18%2048H32V6Z'%20fill='%23FFFFFF'/%3e%3cpath%20d='M32%206L52%2034L46%2048H32V6Z'%20fill='%23356AA0'/%3e%3cpath%20d='M32%206L52%2034L46%2048H18L12%2034L32%206Z'%20stroke='%23000000'%20stroke-width='2'%20stroke-linejoin='miter'%20stroke-miterlimit='2'/%3e%3cpath%20d='M32%206V20'%20stroke='%23000000'%20stroke-width='2'/%3e%3cpath%20d='M32%2020Q35%2031%2046%2034Q35%2037%2032%2048Q29%2037%2018%2034Q29%2031%2032%2020Z'%20fill='%23FFFFFF'%20stroke='%23000000'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e`,alt:``}),(0,C.jsx)(`h2`,{children:R(`What are we revising next?`)})]}),e,(0,C.jsx)(hm,{attachments:U.draft,upload:(e,t)=>tm(H.id,e,t),imageHint:fe===`antigravity`&&U.files.some(e=>e.mime.startsWith(`image/`)),autoFocus:!0,inputRef:ie,label:R(`Describe the revision`),value:ae,onChange:oe,readOnly:_e,onSubmit:()=>void mn(),placeholder:In.selected.length?R(`Add overall instructions (optional)`):R(`Describe the revision`),skills:Mn,skill:se,onSkill:ce,footer:e=>(0,C.jsxs)(`div`,{className:`composer-options`,children:[(0,C.jsx)(He,{onAttach:e,skills:Mn,selected:se,disabled:_e,onPick:e=>{ce(e),ie.current?.focus()}}),pn(_e)]}),action:(0,C.jsx)(`button`,{className:`send-button`,type:`submit`,"aria-label":R(`Start task`),title:R(zn?`Add instructions to the selected color groups above.`:`Start task (Enter)`),disabled:_e||U.blocked||lt>0||mt||zn||!ae.trim()&&!se&&!U.files.length&&!In.selected.some(e=>e.comment.trim())&&!Object.keys(Rn).length,"aria-busy":_e,children:_e?(0,C.jsx)(`span`,{className:`spinner light`}):(0,C.jsx)(T,{name:`arrowUp`,size:18})})}),ye&&(0,C.jsx)(`p`,{className:`inline-error`,role:`alert`,children:ye}),tn[fe]?.usage&&(0,C.jsx)(Xp,{agent:im[fe],usage:tn[fe].usage})]})});return(0,C.jsx)(Sm.Provider,{value:zt||null,children:(0,C.jsx)(Ct,{task:V,items:V?s.taskId===V.id?s.items:g.current.get(V.id)||[]:[],read:e=>$(`/tasks/${e}/note-results`),openReview:()=>{Re(`review`),Me(e=>e===`conversation`?`split`:e)},openChat:()=>{Re(`conversation`),Me(e=>e===`review`?`split`:e)},children:(0,C.jsxs)(`div`,{className:`app-shell`+(ke?``:` sidebar-collapsed`),children:[(0,C.jsxs)(`aside`,{ref:j,role:Pe&&we?`dialog`:void 0,"aria-modal":Pe&&we?!0:void 0,onKeyDown:e=>{Pe&&we&&!P&&!Ze&&(e.key===`Escape`?(e.preventDefault(),Te(!1)):Wt(e))},id:`task-sidebar`,className:`sidebar `+(we?`is-open`:``),"aria-label":R(`Papers and tasks`),children:[(0,C.jsxs)(`div`,{className:`sidebar-header`,children:[e?.projects.length&&H?(0,C.jsxs)(Ne,{label:R(`Paper: {name}`,{name:H.name}),className:`project-switcher`,menuClassName:`paper-menu`,align:`start`,actions:[...e.projects.map(e=>({id:e.id,label:e.name,detail:Fm(e.path),title:e.path,checked:e.id===H.id,select:e.id===H.id?void 0:()=>{o(e.id),i(``)},edit:{label:R(`Edit {name}`,{name:e.name}),select:()=>Qe(e)}})),...Vt?[{label:R(`Add paper…`),icon:`plus`,divider:!0,select:()=>en()}]:[]],children:[(0,C.jsx)(`span`,{className:`project-switcher-name`,children:H.name}),(0,C.jsx)(T,{name:`chevronDown`,size:13})]}):Vt&&(0,C.jsxs)(`button`,{className:`add-project`,disabled:!e,onClick:()=>en(),children:[(0,C.jsx)(T,{name:`plus`,size:16}),R(`Add paper`)]}),(0,C.jsx)(`button`,{className:`icon-button`,"aria-label":R(`Hide task list`),title:R(`Hide task list`),onClick:Cn,children:(0,C.jsx)(T,{name:Pe?`close`:`sidebar`,size:18})})]}),(0,C.jsx)(`div`,{className:`sidebar-actions`,children:H&&(0,C.jsxs)(`button`,{className:`nav-link manuscript-link`+(Dn?` active`:``),"aria-current":Dn?`page`:void 0,onClick:()=>{i(``),Fe&&et(`pdf`),Te(!1)},children:[(0,C.jsx)(T,{name:`pdf`,size:16}),(0,C.jsx)(`span`,{className:`nav-label`,children:R(`Manuscript`)}),Im(jn)&&(0,C.jsx)(`span`,{className:`nav-meta`,title:R(`Git status of the manuscript`),children:Im(jn)})]})}),(0,C.jsxs)(`div`,{className:`task-list-tools`,role:`group`,"aria-label":R(qe?`Archived tasks`:`Tasks`),children:[(0,C.jsxs)(`div`,{className:`task-search`,children:[(0,C.jsx)(T,{name:`search`,size:14}),(0,C.jsx)(`input`,{type:`search`,"aria-label":R(`Search tasks`),placeholder:R(qe?`Search archived tasks…`:`Search tasks…`),title:R(`Search task titles and instructions`),value:Ue,onChange:e=>Ke(e.target.value),onKeyDown:e=>{e.key===`Escape`&&Ue&&(e.preventDefault(),e.stopPropagation(),Ke(``))}}),Ue&&(0,C.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":R(`Clear task search`),onClick:()=>{Ke(``),document.querySelector(`.task-search input`)?.focus()},children:(0,C.jsx)(T,{name:`close`,size:13})})]}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button archive-toggle`,"aria-pressed":qe,"aria-label":R(qe?`Show current tasks`:`Show archived tasks`),title:R(qe?`Show current tasks`:`Show archived tasks`),onClick:()=>Je(e=>!e),children:(0,C.jsx)(T,{name:`archive`,size:15})})]}),(0,C.jsx)(`nav`,{className:`task-list`,"aria-label":R(`Task list`),children:Zt.length?[...Zt].reverse().map(e=>(0,C.jsxs)(`div`,{"data-task":e.id,className:`task-row `+(e.id===r?`active`:``)+(e.id===xe?.id?` task-added`:``),children:[Be===e.id?(0,C.jsx)(`form`,{className:`task-rename`,onSubmit:t=>{t.preventDefault(),Ye.current=e.id,t.currentTarget.querySelector(`input`)?.blur()},children:(0,C.jsx)(`input`,{name:`title`,"aria-label":R(`Rename {name}`,{name:e.title}),defaultValue:e.title,maxLength:120,autoFocus:!0,onFocus:e=>e.currentTarget.select(),onBlur:t=>void wn(e,t.currentTarget.value),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),Ye.current=e.id,t.currentTarget.value=e.title,t.currentTarget.blur())}})}):(0,C.jsxs)(`button`,{"aria-current":e.id===r?`page`:void 0,className:`task-link `+(e.id===r?`active`:``),onClick:()=>{i(e.id),Te(!1)},onDoubleClick:()=>{e.status!==`deleting`&&Ve(e.id)},children:[(0,C.jsx)(`span`,{className:`task-title`,title:e.title,children:e.title}),(0,C.jsxs)(`span`,{className:`task-meta`,children:[(0,C.jsx)(lm,{task:e}),(0,C.jsx)(`span`,{className:`task-time`,children:dm(e.updatedAt)})]})]}),(0,C.jsxs)(`div`,{className:`task-row-actions`,children:[e.review?.counts?.pending?(0,C.jsx)(`span`,{className:`task-badge`,title:re(e.review.counts.pending,`{n} change to decide`,`{n} changes to decide`),children:e.review.counts.pending}):null,(0,C.jsx)(Ne,{label:R(`Task actions for {title}`,{title:e.title}),actions:[...e.status===`deleting`?[]:[{label:R(`Rename…`),icon:`pencil`,select:()=>Ve(e.id)}],...e.status===`deleting`?[]:[{label:e.titleGeneration===`pending`?R(`Generating task title…`):e.titleGeneration===`failed`?R(`Retry title generation`):R(`Generate task title`),icon:`spark`,disabled:e.titleGeneration===`pending`||De.has(`/tasks/`+e.id),select:()=>void hn(`/tasks/`+e.id+`/title`)}],...e.status===`deleting`?[]:[{label:e.archivedAt?R(`Restore task`):R(`Archive task`),icon:e.archivedAt?`restore`:`archive`,disabled:De.has(`/tasks/`+e.id),select:()=>void yn(e)}],...cm.includes(e.status)?[{label:R(`Pause task`),icon:`pause`,disabled:De.has(`/tasks/`+e.id),select:()=>void hn(`/tasks/`+e.id+`/interrupt`)}]:[],...e.status===`uncertain`?[{label:R(`Check status`),icon:`refresh`,disabled:De.has(`/tasks/`+e.id),select:()=>void hn(`/tasks/`+e.id+`/reconcile`)}]:[],{label:e.status===`deleting`?R(`Retry deletion…`):R(`Delete task…`),icon:`trash`,danger:!0,select:()=>N(e)}]})]})]},e.id)):(0,C.jsx)(`div`,{className:`task-list-empty`,role:`status`,children:Xt.length?R(`No matching tasks`):R(qe?`No archived tasks`:`No tasks yet`)})}),(0,C.jsxs)(`div`,{className:`sidebar-footer`,children:[(0,C.jsxs)(`div`,{className:`sidebar-status`,children:[e&&(!x||Qt>0)&&(0,C.jsxs)(`div`,{className:`host-status`+(x?``:` reconnecting`),role:`status`,title:R(x?`Connected`:`Reconnecting`),children:[(0,C.jsx)(`span`,{className:`connection-dot`+(x?` connected`:``),"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`host-state`,children:x?re(Qt,`{n} active task`,`{n} active tasks`):R(`Reconnecting`)})]}),e&&Vt&&(0,C.jsx)(qt,{api:$,version:e.version})]}),(0,C.jsxs)(`a`,{href:`/`,className:`brand`,"aria-label":`Papilot`,onClick:e=>{e.preventDefault(),i(``),Fe&&et(`pdf`),Te(!1)},children:[(0,C.jsx)(`img`,{className:`brand-mark`,src:Sn,alt:``}),(0,C.jsx)(`span`,{children:`Papilot`}),e&&(0,C.jsxs)(`span`,{className:`brand-version`,title:R(`Papilot {version}`,{version:e.version}),children:[`v`,e.version]})]}),(0,C.jsx)(`button`,{type:`button`,className:`icon-button settings-link`,"aria-label":R(`Settings`),title:R(`Settings`),"aria-haspopup":`dialog`,onClick:()=>At(`general`),children:(0,C.jsx)(T,{name:`settings`,size:18})})]})]}),we&&Pe&&(0,C.jsx)(`button`,{tabIndex:-1,className:`sidebar-scrim`,"aria-label":R(`Close task list`),onClick:()=>Te(!1)}),(0,C.jsxs)(`main`,{className:`main`,inert:Pe&&we,children:[(0,C.jsx)(`h1`,{className:`sr-only`,children:V?V.title:Dn?R(`Manuscript`):`Papilot`}),(0,C.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-atomic":`true`,children:xe?R(`Task added: {title}`,{title:xe.title}):``}),(Fe||!V&&!Dn)&&(tr||V||Dn)&&(0,C.jsxs)(`div`,{className:`workspace-navigation`,children:[tr,ar,ur,or]}),e&&!x&&(0,C.jsxs)(`div`,{className:`connection-banner`,role:`status`,children:[(0,C.jsx)(T,{name:`alert`,size:15}),(0,C.jsx)(`span`,{children:R(`Connection lost. Showing the last update; your draft is kept.`)}),(0,C.jsx)(`button`,{onClick:()=>void Lt(!0),children:R(`Retry connection`)})]}),V?(0,C.jsxs)(`div`,{className:`task-grid layout-${qn} show-${Jn}`,style:Tt?{"--chat-width":`${Tt}px`}:void 0,children:[!Fe&&qn===`split`&&(0,C.jsx)(`div`,{className:`panel-resizer`,role:`separator`,"aria-orientation":`vertical`,"aria-label":R(`Resize chat panel`),"aria-valuenow":Tt||void 0,"aria-valuemin":300,tabIndex:0,title:R(`Drag to resize · Double-click to reset`),onPointerDown:Tn,onDoubleClick:()=>Et(0),onKeyDown:En}),(0,C.jsxs)(`section`,{id:`review-panel`,className:`review-panel`,"aria-label":R(`PDF review`),children:[!Fe&&!W&&(!V.review?.round||V.status===`deleting`)&&(tr||!Yn)&&(0,C.jsxs)(`div`,{className:`review-placeholder-toolbar`,children:[tr,!Yn&&ir,(0,C.jsx)(`div`,{className:`panel-tools`,children:!Yn&&rr})]}),V.status===`failed`&&V.review?.job?.status===`failed`&&(0,C.jsxs)(`div`,{className:`review-build-error`,role:`status`,children:[(0,C.jsx)(T,{name:`alert`,size:15}),(0,C.jsx)(`span`,{children:R(`Could not generate the PDF comparison.`)}),(0,C.jsx)(`button`,{className:`button secondary compact`,disabled:_n,onClick:()=>void hn(`/tasks/`+V.id+`/publish`),children:R(`Retry build`)})]}),V.status===`deleting`?(0,C.jsxs)(`div`,{className:`review-placeholder`,children:[(0,C.jsx)(`div`,{className:`placeholder-icon`,children:(0,C.jsx)(T,{name:`trash`,size:22})}),(0,C.jsx)(`h2`,{children:R(`Deletion is in progress`)}),(0,C.jsx)(`p`,{children:R(`This task is reserved until its worktree cleanup is confirmed. Use Retry deletion if the connection was interrupted.`)})]}):V.review?.round?(0,C.jsx)(Ut,{task:V,lead:!Fe&&!W&&(tr||!Yn)?(0,C.jsxs)(C.Fragment,{children:[tr,!Yn&&ir]}):null,tools:(0,C.jsxs)(C.Fragment,{children:[sr,!Fe&&!Yn&&(0,C.jsxs)(C.Fragment,{children:[rr,or]})]}),completion:W?null:$n,onSendNotes:async e=>{await $(`/tasks/`+V.id+`/messages`,e),Lt(!0)}},V.id):(0,C.jsx)(Wm,{task:V,busy:_n,onBuild:()=>void hn(`/tasks/`+V.id+`/publish`)}),!W&&er(!1)]}),(0,C.jsx)(Mm,{task:V,lead:!Fe&&W?tr:null,tools:!Fe&&Yn?(0,C.jsxs)(C.Fragment,{children:[ar,or]}):null,connection:(0,C.jsx)(Up,{name:am(V),runtime:tn[V.agent||`codex`],reconnecting:De.has(`/reconnect`),onReconnect:()=>void hn(`/reconnect`)}),models:tn[V.agent||`codex`]?.models||[],composer:_.current.get(V.id),answerDrafts:v.current,items:s.taskId===V.id?s.items:g.current.get(V.id)||[],loading:s.taskId===V.id?l:!g.current.has(V.id),loadError:f.taskId===V.id?f.message:``,retry:()=>void It(V.id),requests:e?.requests.filter(e=>e.taskId===V.id)||[],refresh:()=>void Lt(!0),reportError:Ft,pause:Xn,pausing:_n,skills:Mn,feedback:W?(0,C.jsxs)(C.Fragment,{children:[er(!0),$n&&(0,C.jsx)(`div`,{className:`review-feedback card commit-card task-delivery`,children:$n})]}):null,openReview:W?()=>{Re(`review`),Me(e=>e===`conversation`?`split`:e)}:void 0},V.id)]}):Dn&&H?(0,C.jsx)(Km,{tasks:e?.tasks.filter(e=>e.projectId===H.id)||[],onOpenTask:e=>{i(e),Te(!1)},navigation:Fe?null:tr,project:H,data:Pn.data,error:Pn.error,view:$e,setView:et,region:tt,setRegion:nt,active:at,setActive:ot,actions:Vn,newTask:dr,tools:Fe?null:lr,openPdf:Fe?null:cr,onGit:e=>Nn(H.id,e),writer:{agent:ln.agent,model:ln.model},reportError:Ft},H.id+H.path):e?Vt?(0,C.jsx)(`div`,{className:`home`,children:(0,C.jsxs)(`div`,{className:`home-inner`,children:[(0,C.jsx)(`img`,{className:`home-logo`,src:Sn,alt:``}),(0,C.jsx)(`h1`,{children:R(`Add your first paper`)}),(0,C.jsxs)(`button`,{className:`button primary`,onClick:()=>en(),children:[(0,C.jsx)(T,{name:`plus`,size:16}),R(`Add paper`)]})]})}):(0,C.jsx)(`div`,{className:`home`,children:(0,C.jsxs)(`div`,{className:`home-inner`,children:[(0,C.jsx)(`img`,{className:`home-logo`,src:Sn,alt:``}),(0,C.jsx)(`h1`,{children:R(`No papers yet`)}),(0,C.jsx)(`p`,{className:`home-copy`,children:R(`No papers have been shared with you yet. Papers appear here as soon as {name} shares them.`,{name:zt?.owner||``})})]})}):(0,C.jsx)(`div`,{className:`home`,children:(0,C.jsxs)(`div`,{className:`home-inner`,children:[(0,C.jsx)(`div`,{className:`home-mark`,children:(0,C.jsx)(`span`,{className:`spinner`})}),(0,C.jsx)(`h1`,{children:R(`Opening your workspace`)}),(0,C.jsx)(`p`,{className:`home-copy`,role:`status`,children:k||R(`Connecting to your papers and tasks…`)}),k&&(0,C.jsx)(`button`,{className:`button secondary`,onClick:()=>void Lt(!0),children:R(`Retry connection`)})]})})]}),E&&!P&&(0,C.jsxs)(`div`,{role:`alert`,className:`toast`,children:[(0,C.jsx)(T,{name:`alert`,size:16}),(0,C.jsx)(`span`,{children:E}),(0,C.jsx)(`button`,{className:`icon-button`,"aria-label":R(`Dismiss error`),onClick:()=>O(``),children:(0,C.jsx)(T,{name:`close`,size:14})})]}),kt&&(0,C.jsx)(ip,{initialPage:kt,theme:Dt.theme,onTheme:Dt.setTheme,onClose:()=>At(!1),onPeople:Vt?()=>Mt(!0):void 0,onSignOut:zt?.listener===`account`?()=>{At(!1),Ht()}:void 0,accountName:zt?.name,diagnostics:Vt?{online:x,runtimes:tn,project:H,check:nm}:void 0,skills:Vt?{project:H,api:$,onChanged:()=>de(e=>e+1)}:void 0}),jt&&(0,C.jsx)(pp,{api:$,projects:e?.projects||[],ago:fm,onClose:()=>Mt(!1)}),M&&(0,C.jsx)(Gt,{task:e?.tasks.find(e=>e.id===M.id)||M,submit:()=>$(`/tasks/`+M.id+`/delete`,{confirm:!0}),onClose:()=>N(null),onDeleted:()=>xn(M.id),refresh:()=>void Lt(!0)}),Ze&&(0,C.jsx)(Jt,{paper:Ze,canManage:Vt,onClose:()=>Qe(null),save:async e=>{let t=Ze,n=Vt&&e.path!==t.path;await $(`/projects/${t.id}/${n?`path`:`rename`}`,n?e:{name:e.name}),n&&(++vt.current,_t({projectId:``,data:null,error:``}),wt({projectId:``,status:null})),await Lt(!0),n&&H?.id===t.id&&Dn&&await On(t.id)},remove:async()=>{let e=Ze;await $(`/projects/${e.id}/remove`,{}),V?.projectId===e.id&&i(``),t(t=>t&&{...t,projects:t.projects.filter(t=>t.id!==e.id),tasks:t.tasks.filter(t=>t.projectId!==e.id)}),await Lt(!0)}},Ze.id),P&&(0,C.jsx)($t,{api:$,agent:fe,canRepair:Object.values(tn).some(e=>e?.connected&&e.authenticated),onClose:()=>F(null),onDone:async e=>{o(e.id),i(``),F(null),Te(!1),await Lt(!0)}})]})})})}function Jm(){let e=zp(),[t,n]=(0,S.useState)(location.pathname===`/invite`),r=()=>{n(!1),Lp(!1)};return t?(0,C.jsx)(Pp,{api:$,onDone:r}):e?(0,C.jsx)(Np,{api:$,onSignedIn:r}):(0,C.jsx)(qm,{})}(0,Ce.createRoot)(document.getElementById(`root`)).render((0,C.jsx)(S.StrictMode,{children:(0,C.jsx)(Jm,{})}));export{D as C,y as E,R as S,x as T,ye as _,K as a,ie as b,Cr as c,In as d,Fn as f,Ke as g,ot as h,J as i,yr as l,lt as m,vc as n,wr as o,rn as p,yc as r,Sr as s,Eu as t,qn as u,oe as v,T as w,ae as x,se as y};
|